@wjarka/cezarion 0.14.8-pr540.823 → 0.14.9-dev.1004
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 +56 -3
- package/dist/automations/scheduler.d.ts +6 -0
- package/dist/automations/scheduler.js +45 -17
- package/dist/automations/scheduler.js.map +1 -1
- package/dist/automations/store.d.ts +12 -4
- package/dist/automations/store.js +199 -22
- package/dist/automations/store.js.map +1 -1
- package/dist/automations/types.d.ts +2 -0
- package/dist/automations/types.js +1 -0
- package/dist/automations/types.js.map +1 -1
- package/dist/contract/automations.d.ts +6 -0
- package/dist/contract/delegation.d.ts +29 -0
- package/dist/contract/discovery.d.ts +134 -0
- package/dist/contract/index.d.ts +1 -0
- package/dist/contract/index.js +1520 -1447
- package/dist/contract/projects.d.ts +40 -0
- package/dist/contract/runs.d.ts +43 -0
- package/dist/contract/skills.d.ts +5 -0
- package/dist/core/claude-cli-runner.js +1 -1
- package/dist/core/claude-cli-runner.js.map +1 -1
- package/dist/core/cursor-acp-runner.d.ts +2 -0
- package/dist/core/cursor-acp-runner.js +159 -26
- package/dist/core/cursor-acp-runner.js.map +1 -1
- package/dist/core/cursor-provider-error.d.ts +3 -0
- package/dist/core/cursor-provider-error.js +14 -1
- package/dist/core/cursor-provider-error.js.map +1 -1
- package/dist/core/opencode-server-runner.js +12 -5
- package/dist/core/opencode-server-runner.js.map +1 -1
- package/dist/core/pi-runner.js +17 -4
- package/dist/core/pi-runner.js.map +1 -1
- package/dist/core/provider-auth.d.ts +99 -1
- package/dist/core/provider-auth.js +203 -2
- package/dist/core/provider-auth.js.map +1 -1
- package/dist/delegation/cli.d.ts +1 -0
- package/dist/delegation/cli.js +1 -1
- package/dist/delegation/cli.js.map +1 -1
- package/dist/delegation/policy.d.ts +3 -2
- package/dist/delegation/policy.js +3 -1
- package/dist/delegation/policy.js.map +1 -1
- package/dist/delegation/process-liveness.d.ts +66 -0
- package/dist/delegation/process-liveness.js +215 -0
- package/dist/delegation/process-liveness.js.map +1 -0
- package/dist/delegation/provision.d.ts +1 -1
- package/dist/delegation/provision.js +5 -2
- package/dist/delegation/provision.js.map +1 -1
- package/dist/delegation/results.js +10 -6
- package/dist/delegation/results.js.map +1 -1
- package/dist/delegation/routes.d.ts +101 -54
- package/dist/delegation/routes.js +3 -2
- package/dist/delegation/routes.js.map +1 -1
- package/dist/delegation/service.d.ts +8 -1
- package/dist/delegation/service.js +56 -7
- package/dist/delegation/service.js.map +1 -1
- package/dist/delegation/transport.d.ts +40 -4
- package/dist/discovery/catalog.d.ts +14 -0
- package/dist/discovery/catalog.js +31 -0
- package/dist/discovery/catalog.js.map +1 -0
- package/dist/discovery/cli.d.ts +8 -0
- package/dist/discovery/cli.js +104 -0
- package/dist/discovery/cli.js.map +1 -0
- package/dist/git-worktree.d.ts +3 -1
- package/dist/git-worktree.js +26 -4
- package/dist/git-worktree.js.map +1 -1
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -1
- package/dist/runs/agent-tmpdir.d.ts +2 -0
- package/dist/runs/agent-tmpdir.js +5 -2
- package/dist/runs/agent-tmpdir.js.map +1 -1
- package/dist/runs/retention.d.ts +7 -2
- package/dist/runs/retention.js +39 -7
- package/dist/runs/retention.js.map +1 -1
- package/dist/runs/store.d.ts +22 -0
- package/dist/runs/store.js +82 -1
- package/dist/runs/store.js.map +1 -1
- package/dist/runs/webhook.d.ts +125 -0
- package/dist/runs/webhook.js +256 -0
- package/dist/runs/webhook.js.map +1 -0
- package/dist/server/provider-auth-runtime.d.ts +30 -4
- package/dist/server/provider-auth-runtime.js +71 -6
- package/dist/server/provider-auth-runtime.js.map +1 -1
- package/dist/server/server.d.ts +3673 -2420
- package/dist/server/server.js +139 -11
- package/dist/server/server.js.map +1 -1
- package/dist/server-install/platforms/ubuntu-vps.d.ts +5 -1
- package/dist/server-install/platforms/ubuntu-vps.js +160 -18
- package/dist/server-install/platforms/ubuntu-vps.js.map +1 -1
- package/dist/server-install/steps.d.ts +4 -2
- package/dist/server-install/steps.js +5 -4
- package/dist/server-install/steps.js.map +1 -1
- package/dist/skills-remote.d.ts +30 -5
- package/dist/skills-remote.js +122 -32
- package/dist/skills-remote.js.map +1 -1
- package/dist/skills.js +15 -6
- package/dist/skills.js.map +1 -1
- package/dist/task-cli/cli.js +124 -7
- package/dist/task-cli/cli.js.map +1 -1
- package/dist/task-cli/discovery.js +6 -5
- package/dist/task-cli/discovery.js.map +1 -1
- package/dist/task-cli/http.d.ts +3 -0
- package/dist/task-cli/http.js.map +1 -1
- package/dist/task-cli/watch.d.ts +19 -0
- package/dist/task-cli/watch.js +35 -2
- package/dist/task-cli/watch.js.map +1 -1
- package/dist/workflows/run.d.ts +67 -2
- package/dist/workflows/run.js +325 -27
- package/dist/workflows/run.js.map +1 -1
- package/dist/workspace/agent-profiles.d.ts +22 -0
- package/dist/workspace/agent-profiles.js +15 -0
- package/dist/workspace/agent-profiles.js.map +1 -1
- package/dist/workspace/config.d.ts +9 -0
- package/dist/workspace/config.js +13 -1
- package/dist/workspace/config.js.map +1 -1
- package/dist/workspace/projects.d.ts +24 -1
- package/dist/workspace/projects.js +14 -1
- package/dist/workspace/projects.js.map +1 -1
- package/package.json +5 -5
- package/scripts/mock-claude.mjs +26 -0
- package/scripts/mock-codex-app-server.mjs +26 -0
- package/scripts/mock-cursor-acp.mjs +51 -3
- package/scripts/mock-cursor-hang-stdin-late.mjs +35 -0
- package/scripts/mock-cursor-hang-stdin.mjs +30 -0
- package/scripts/mock-opencode-serve.mjs +33 -0
- package/scripts/mock-pi-rpc.mjs +22 -4
- package/web/dist/assets/agent-accounts-CerclGiO.js +1 -0
- package/web/dist/assets/centered-state-DH8qtCz-.js +43 -0
- package/web/dist/assets/{collapsible-Bb2y0asn.js → collapsible-De2G0xqQ.js} +1 -1
- package/web/dist/assets/{commit-list-DpxX-bA4.js → commit-list-CQubP1iS.js} +1 -1
- package/web/dist/assets/compare-variants-C_NijJvg.js +1 -0
- package/web/dist/assets/{diff-rDeblLVZ2.js → diff-8M5HlDxq2.js} +2 -2
- package/web/dist/assets/{diff-controls-frbAqBK1.js → diff-controls-B6ok0TtQ.js} +1 -1
- package/web/dist/assets/{diff-stat-Cn7rzy1H.js → diff-stat-D1AODN2a.js} +1 -1
- package/web/dist/assets/{diff-view-D6N_QzSq.js → diff-view-Bs5Gh7UF.js} +2 -2
- package/web/dist/assets/{dropdown-menu-Bwvi4Ono.js → dropdown-menu-7KGQMoFj.js} +1 -1
- package/web/dist/assets/{git-toolbar-5TyOh819.js → git-toolbar-DqbapMXr.js} +1 -1
- package/web/dist/assets/github-lMHiuYSx.js +1 -0
- package/web/dist/assets/{image-preview-B618kDBH.js → image-preview-jzHoEyLM.js} +1 -1
- package/web/dist/assets/index-D4OJTArJ.js +7 -0
- package/web/dist/assets/index-D5NkwqY7.css +1 -0
- package/web/dist/assets/{markdown-BnjmXdz2.js → markdown-DvbymqXz.js} +1 -1
- package/web/dist/assets/pill-BL6ugwXo.js +1 -0
- package/web/dist/assets/{project-router-BSpCQc8A.js → project-router-ChC5Rb-Y.js} +1 -1
- package/web/dist/assets/{prompt-templates-BsHnTixc.js → prompt-templates-j8qlK7c-.js} +3 -3
- package/web/dist/assets/repo-git-BbPAgkqb.js +1 -0
- package/web/dist/assets/{run-diff-CFeYdPGE.js → run-diff-BuATgZpx.js} +2 -2
- package/web/dist/assets/run-header-DuAWswYM.js +1 -0
- package/web/dist/assets/skills-DiC2XrU1.js +1 -0
- package/web/dist/assets/{tab-link-BXDesc8g.js → tab-link-BmGKj9Rt.js} +1 -1
- package/web/dist/assets/{task-changes-DfF08cUG.js → task-changes-CP9kPnsy.js} +1 -1
- package/web/dist/assets/{task-commits-BMmpYP5e.js → task-commits-D6NfTw5r.js} +1 -1
- package/web/dist/assets/{task-files-D_dKDdRK.js → task-files-W-b_gtcb.js} +2 -2
- package/web/dist/assets/task-thread-Bw_nQuTx.css +1 -0
- package/web/dist/assets/task-thread-Q7Nj33DH.js +9 -0
- package/web/dist/assets/{textarea-COQtp9cB.js → textarea-ByZ-txS7.js} +1 -1
- package/web/dist/assets/thread-loading-DHT9p5o5.js +1 -0
- package/web/dist/assets/{token-metrics-CFWQYcgY.js → token-metrics-k4XoovDS.js} +1 -1
- package/web/dist/assets/{utils-DKheTxGD.js → utils-BTFBhZ55.js} +1 -1
- package/web/dist/assets/workflows-DqQszPHJ.js +11 -0
- package/web/dist/assets/{zoomable-image-YW3Qdrr_.js → zoomable-image-Ba6y6Wyl.js} +1 -1
- package/web/dist/index.html +14 -14
- package/web/dist/assets/agent-accounts-B7aDlJ4I.js +0 -1
- package/web/dist/assets/centered-state-wm14n-hB.js +0 -43
- package/web/dist/assets/compare-variants-DbPcvMtU.js +0 -1
- package/web/dist/assets/github-Dyo38xkh.js +0 -1
- package/web/dist/assets/ibm-plex-mono-regular-BF3vfe7_.ttf +0 -0
- package/web/dist/assets/index-dgQfUHKO.css +0 -1
- package/web/dist/assets/index-yCn9jZqm.js +0 -7
- package/web/dist/assets/pill-DqEXer06.js +0 -1
- package/web/dist/assets/repo-git-Cw1UOtWI.js +0 -1
- package/web/dist/assets/run-header-G5PQQyme.js +0 -1
- package/web/dist/assets/skills-DMvpMI_E.js +0 -1
- package/web/dist/assets/task-thread-BL7keYuU.js +0 -9
- package/web/dist/assets/task-thread-BQFdz1dJ.css +0 -1
- package/web/dist/assets/thread-loading-B7mgkPaL.js +0 -1
- package/web/dist/assets/workflows-DLCH6MDH.js +0 -11
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";
|
|
@@ -87,8 +87,11 @@ var requestWaitRequestSchema = z2.object({
|
|
|
87
87
|
timeoutSeconds: z2.number().int().min(1).max(1800).default(600)
|
|
88
88
|
}).strict().refine((value) => value.mode !== "one" || value.requestIds.length === 1, { message: "one requires exactly one request" });
|
|
89
89
|
|
|
90
|
-
// ../contract/src/
|
|
91
|
-
import { z as
|
|
90
|
+
// ../contract/src/discovery.ts
|
|
91
|
+
import { z as z7 } from "zod";
|
|
92
|
+
|
|
93
|
+
// ../contract/src/workspace.ts
|
|
94
|
+
import { z as z6 } from "zod";
|
|
92
95
|
|
|
93
96
|
// ../contract/src/effort.ts
|
|
94
97
|
import { z as z3 } from "zod";
|
|
@@ -102,163 +105,599 @@ function parseEffort(value) {
|
|
|
102
105
|
return parsed.success ? parsed.data : void 0;
|
|
103
106
|
}
|
|
104
107
|
|
|
108
|
+
// ../contract/src/health.ts
|
|
109
|
+
import { z as z5 } from "zod";
|
|
110
|
+
|
|
111
|
+
// ../contract/src/application-update.ts
|
|
112
|
+
import { z as z4 } from "zod";
|
|
113
|
+
var applicationUpdateStateSchema = z4.object({
|
|
114
|
+
status: z4.enum(["idle", "preparing", "ready", "restarting", "error"]),
|
|
115
|
+
supported: z4.boolean(),
|
|
116
|
+
targetVersion: z4.string().optional(),
|
|
117
|
+
message: z4.string().optional()
|
|
118
|
+
});
|
|
119
|
+
var applicationUpdateInputSchema = z4.record(z4.string(), z4.never());
|
|
120
|
+
var applicationUpdateResponseSchema = z4.object({ state: applicationUpdateStateSchema });
|
|
121
|
+
|
|
122
|
+
// ../contract/src/health.ts
|
|
123
|
+
var runnerSchema = z5.enum(["claude", "codex", "opencode", "pi", "cursor"]);
|
|
124
|
+
var repoInfoSchema = z5.object({
|
|
125
|
+
root: z5.string(),
|
|
126
|
+
branch: z5.string(),
|
|
127
|
+
remote: z5.string().optional()
|
|
128
|
+
});
|
|
129
|
+
var backendCheckSchema = z5.object({
|
|
130
|
+
name: z5.enum(["claude", "codex", "opencode", "pi", "cursor", "gh", "git"]),
|
|
131
|
+
available: z5.boolean(),
|
|
132
|
+
version: z5.string().optional(),
|
|
133
|
+
hint: z5.string().optional()
|
|
134
|
+
});
|
|
135
|
+
var forgeInfoSchema = z5.object({
|
|
136
|
+
kind: z5.literal("github"),
|
|
137
|
+
/**
|
|
138
|
+
* Whether the forge is reachable — **absent until the availability probe has warmed**.
|
|
139
|
+
*
|
|
140
|
+
* Health must never pay a `gh` shell-out, so it serves whatever the cache holds. Absent means
|
|
141
|
+
* "not determined yet", which is not the same as `false`, and the cockpit renders the two
|
|
142
|
+
* differently. Declaring it required is what made an earlier hand-written mirror wrong.
|
|
143
|
+
*/
|
|
144
|
+
available: z5.boolean().optional(),
|
|
145
|
+
reason: z5.string().optional()
|
|
146
|
+
});
|
|
147
|
+
var capabilitiesSchema = z5.object({
|
|
148
|
+
localHandoff: z5.boolean(),
|
|
149
|
+
followups: z5.boolean(),
|
|
150
|
+
singleProject: z5.boolean(),
|
|
151
|
+
/**
|
|
152
|
+
* `true` means `CEZ_AUTOMATIONS=1` opted this server into GitHub automations (#801). Off — the
|
|
153
|
+
* default — the whole feature is absent: no `Automations` nav item anywhere it is rendered, the
|
|
154
|
+
* `/api/v1/…/automations*` family answers `409`, and the workspace scheduler never polls GitHub.
|
|
155
|
+
*
|
|
156
|
+
* REQUIRED for the same reason as `tokenMetrics` below: this server always sends it.
|
|
157
|
+
*/
|
|
158
|
+
automations: z5.boolean(),
|
|
159
|
+
/**
|
|
160
|
+
* `false` means `CEZ_HIDE_TOKEN_METRICS=1` asks the browser to omit token counts and monetary
|
|
161
|
+
* cost (#481). The telemetry itself still rides in run/event payloads — this is presentation
|
|
162
|
+
* only.
|
|
163
|
+
*
|
|
164
|
+
* REQUIRED, because this server always sends it (`capabilities.ts` computes it from the env on
|
|
165
|
+
* every read) and this contract describes THIS server's wire. The DTO it replaces declared it
|
|
166
|
+
* optional so a newer cockpit could read an OLDER server, which is version skew a contract
|
|
167
|
+
* versioned in lockstep with the server cannot model. That tolerance lives where it belongs, in
|
|
168
|
+
* `web/src/lib/token-metrics.ts`, whose `!== false` read still treats an absent field as
|
|
169
|
+
* visible.
|
|
170
|
+
*/
|
|
171
|
+
tokenMetrics: z5.boolean(),
|
|
172
|
+
/** Current token-count presentation policy. Required on current servers;
|
|
173
|
+
* older payload tolerance belongs in the browser resolver. */
|
|
174
|
+
tokenUsageMetrics: z5.boolean(),
|
|
175
|
+
/** Current backend-reported-cost presentation policy. */
|
|
176
|
+
costMetrics: z5.boolean()
|
|
177
|
+
});
|
|
178
|
+
var healthResponseSchema = z5.object({
|
|
179
|
+
version: z5.string(),
|
|
180
|
+
latestVersion: z5.string().optional(),
|
|
181
|
+
repoRoot: z5.string(),
|
|
182
|
+
repo: repoInfoSchema.nullable(),
|
|
183
|
+
checks: z5.array(backendCheckSchema),
|
|
184
|
+
defaultRunner: runnerSchema,
|
|
185
|
+
forge: forgeInfoSchema.nullable(),
|
|
186
|
+
capabilities: capabilitiesSchema,
|
|
187
|
+
// Always sent: `workspaceSummary()` returns both unconditionally, and an unreadable workspace
|
|
188
|
+
// degrades to `projects: []` rather than to an absent key. The hand-written DTO declared them
|
|
189
|
+
// optional, which was wider than the server has ever been.
|
|
190
|
+
projects: z5.array(z5.object({ id: z5.string(), name: z5.string() })),
|
|
191
|
+
bootProject: z5.string(),
|
|
192
|
+
applicationUpdate: applicationUpdateStateSchema.optional()
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
// ../contract/src/workspace.ts
|
|
196
|
+
var workspaceConfigResponseSchema = z6.object({
|
|
197
|
+
/** Root exposed by the Add-project directory browser — stored as written (`~` kept). */
|
|
198
|
+
browseRoot: z6.string(),
|
|
199
|
+
/** Checkout root for GUI-cloned projects — stored as written (`~` kept). */
|
|
200
|
+
projectsDir: z6.string(),
|
|
201
|
+
/** Stored override; `null` means inherit `CEZ_SKILLS_AUTO_UPDATE`, then true. */
|
|
202
|
+
skillsAutoUpdate: z6.boolean().nullable(),
|
|
203
|
+
effectiveSkillsAutoUpdate: z6.boolean(),
|
|
204
|
+
composerDefaults: z6.object({
|
|
205
|
+
autonomous: z6.boolean().nullable(),
|
|
206
|
+
worktree: z6.boolean().nullable(),
|
|
207
|
+
/** `'source-dependent'` when no `CEZ_AUTONOMOUS_DEFAULT` pins it either way. */
|
|
208
|
+
inheritedAutonomous: z6.union([z6.boolean(), z6.literal("source-dependent")]),
|
|
209
|
+
inheritedWorktree: z6.boolean()
|
|
210
|
+
}),
|
|
211
|
+
resources: z6.object({
|
|
212
|
+
maxParallel: z6.number(),
|
|
213
|
+
maxMonitoringSessions: z6.number(),
|
|
214
|
+
monitoringWakeIntervalMinutes: z6.number().nullable(),
|
|
215
|
+
/** Resume a run a provider usage limit stopped, once the limit resets. Default `true`. */
|
|
216
|
+
autoResumeOnUsageLimit: z6.boolean(),
|
|
217
|
+
memoryLimitMb: z6.number().nullable(),
|
|
218
|
+
worktreeRetentionDefault: z6.number()
|
|
219
|
+
}),
|
|
220
|
+
/**
|
|
221
|
+
* What a repo that has set none of its own runs (spec 2026-07-29-agent-profiles).
|
|
222
|
+
*
|
|
223
|
+
* Both keys are OPTIONAL on the wire, and that is load-bearing rather than lax: absent means
|
|
224
|
+
* "this machine has no opinion, the built-in default applies", and it has to stay distinguishable
|
|
225
|
+
* from a value someone chose or the fallback collapses into "always claude". Consulted only where
|
|
226
|
+
* the repo's own `.ai/cezar/config.json` is silent — a repo that chose is never overruled.
|
|
227
|
+
*/
|
|
228
|
+
agentDefaults: z6.object({
|
|
229
|
+
runner: runnerSchema.optional(),
|
|
230
|
+
models: z6.object({
|
|
231
|
+
claude: z6.string().optional(),
|
|
232
|
+
codex: z6.string().optional(),
|
|
233
|
+
opencode: z6.string().optional(),
|
|
234
|
+
pi: z6.string().optional(),
|
|
235
|
+
cursor: z6.string().optional()
|
|
236
|
+
}).optional()
|
|
237
|
+
})
|
|
238
|
+
});
|
|
239
|
+
var setWorkspaceConfigInputSchema = z6.object({
|
|
240
|
+
browseRoot: z6.string().trim().min(1).max(4096).optional(),
|
|
241
|
+
projectsDir: z6.string().trim().min(1).max(4096).optional(),
|
|
242
|
+
skillsAutoUpdate: z6.boolean().nullable().optional(),
|
|
243
|
+
composerDefaults: z6.object({
|
|
244
|
+
autonomous: z6.boolean().nullable().optional(),
|
|
245
|
+
worktree: z6.boolean().nullable().optional()
|
|
246
|
+
}).optional(),
|
|
247
|
+
/** Machine-wide agent defaults. `null` on a key CLEARS it back to "no opinion", which a bare
|
|
248
|
+
* absent key cannot say in a partial patch. */
|
|
249
|
+
agentDefaults: z6.object({
|
|
250
|
+
runner: runnerSchema.nullable().optional(),
|
|
251
|
+
models: z6.object({
|
|
252
|
+
claude: z6.string().trim().min(1).max(200).nullable().optional(),
|
|
253
|
+
codex: z6.string().trim().min(1).max(200).nullable().optional(),
|
|
254
|
+
opencode: z6.string().trim().min(1).max(200).nullable().optional(),
|
|
255
|
+
pi: z6.string().trim().min(1).max(200).nullable().optional(),
|
|
256
|
+
cursor: z6.string().trim().min(1).max(200).nullable().optional()
|
|
257
|
+
}).optional()
|
|
258
|
+
}).optional(),
|
|
259
|
+
resources: z6.object({
|
|
260
|
+
maxParallel: z6.number().int().min(1).max(16).optional(),
|
|
261
|
+
maxMonitoringSessions: z6.number().int().min(0).max(16).optional(),
|
|
262
|
+
monitoringWakeIntervalMinutes: z6.number().int().min(1).max(60).nullable().optional(),
|
|
263
|
+
autoResumeOnUsageLimit: z6.boolean().optional(),
|
|
264
|
+
memoryLimitMb: z6.number().int().min(0).max(1048576).nullable().optional(),
|
|
265
|
+
worktreeRetentionDefault: z6.number().int().min(0).max(1e3).optional()
|
|
266
|
+
}).optional()
|
|
267
|
+
});
|
|
268
|
+
var appearanceSchema = z6.object({
|
|
269
|
+
accent: z6.enum(["cezarion", "lime", "violet"]).optional(),
|
|
270
|
+
density: z6.enum(["comfortable", "compact", "ultra"]).optional(),
|
|
271
|
+
width: z6.enum(["narrow", "wide"]).optional()
|
|
272
|
+
});
|
|
273
|
+
var taskTableUiStateSchema = z6.looseObject({
|
|
274
|
+
/** Explicit user choices only. Missing ids keep the registry-owned default. */
|
|
275
|
+
expandedColumns: z6.record(z6.string(), z6.boolean()).optional()
|
|
276
|
+
});
|
|
277
|
+
var uiStateSchema = z6.looseObject({
|
|
278
|
+
/** What the last started run used. `null` is a VALUE, not an absence: it records a run that
|
|
279
|
+
* chose neither a skill nor a workflow (the plain built-in `quick-task`), which the composer
|
|
280
|
+
* can now express since the source picker grew an empty state. Absent still means "no
|
|
281
|
+
* run has been recorded here" — a cockpit reading either one selects nothing. */
|
|
282
|
+
lastTask: z6.object({ source: z6.enum(["workflow", "skill"]), ref: z6.string() }).nullable().optional(),
|
|
283
|
+
/** Most-recently-run sources, newest first (deduped, capped). Feeds the composer picker's
|
|
284
|
+
* recency sort. */
|
|
285
|
+
recentSources: z6.array(z6.object({ source: z6.enum(["workflow", "skill"]), ref: z6.string() })).optional(),
|
|
286
|
+
/** The last worktree choice for a single-skill run. Absent → the default (isolated worktree). */
|
|
287
|
+
lastWorktree: z6.boolean().optional(),
|
|
288
|
+
/** The last autonomous choice — remembered like `lastWorktree`. Absent → off. */
|
|
289
|
+
lastAutonomous: z6.boolean().optional(),
|
|
290
|
+
/** Whether new runs should ask agents to append follow-up work. Absent → on. */
|
|
291
|
+
lastGenerateFollowups: z6.boolean().optional(),
|
|
292
|
+
/** Skill selection frequency (#408): name → times chosen, across BOTH composers. */
|
|
293
|
+
skillUsage: z6.record(z6.string(), z6.number()).optional(),
|
|
294
|
+
runsView: z6.enum(["list", "table"]).optional(),
|
|
295
|
+
/** The GitHub tab's last-selected sub-tab (#417). Absent → issues. */
|
|
296
|
+
githubView: z6.enum(["issues", "prs"]).optional(),
|
|
297
|
+
/** Settings → Appearance. The theme itself stays in localStorage (`cez-theme`) — it must
|
|
298
|
+
* pre-paint, and it is per-browser by design. */
|
|
299
|
+
appearance: appearanceSchema.optional(),
|
|
300
|
+
/** Follow-up prompt templates (#413). Absent → the built-in defaults; present (even `[]`) is
|
|
301
|
+
* the user's own edited list. `skills` are the skill names the template auto-applies for. */
|
|
302
|
+
promptTemplates: z6.array(
|
|
303
|
+
z6.object({
|
|
304
|
+
id: z6.string(),
|
|
305
|
+
label: z6.string(),
|
|
306
|
+
text: z6.string(),
|
|
307
|
+
skills: z6.array(z6.string()).optional()
|
|
308
|
+
})
|
|
309
|
+
).optional(),
|
|
310
|
+
/** The open-mercato/skills promo banner (#391), dismissed for good. Legacy — the banner is
|
|
311
|
+
* gone, replaced by `WorkspaceUiState.importedSkills`; retained so old files round-trip. */
|
|
312
|
+
dismissedSkillsBanner: z6.boolean().optional()
|
|
313
|
+
});
|
|
314
|
+
var workspaceLastLocationSchema = z6.strictObject({
|
|
315
|
+
projectId: z6.string().min(1).max(64),
|
|
316
|
+
pathname: z6.string().min(1).max(2048).startsWith("/p/"),
|
|
317
|
+
search: z6.string().max(4096).startsWith("?").optional(),
|
|
318
|
+
hash: z6.string().max(2048).startsWith("#").optional()
|
|
319
|
+
});
|
|
320
|
+
var workspaceUiStateSchema = z6.looseObject({
|
|
321
|
+
/** LEGACY — the sidebar's per-project collapse map (step 3.3). Still accepted and still
|
|
322
|
+
* round-tripped so an older cockpit sharing this home keeps working, but the current cockpit
|
|
323
|
+
* neither reads nor writes it: which groups are shut describes the WINDOW, not the workspace,
|
|
324
|
+
* so it lives in that browser's localStorage (`packages/web/src/lib/sidebar-collapse.ts`).
|
|
325
|
+
* One shared answer meant a phone collapsing a group collapsed it on the desktop too. */
|
|
326
|
+
sidebar: z6.looseObject({ collapsed: z6.record(z6.string(), z6.boolean()).optional() }).optional(),
|
|
327
|
+
/** Dismissed runtime-auth incident IDs, keyed by provider. An ID is only dismissed until the
|
|
328
|
+
* provider reports a different incident, so this stays workspace-global with the browser
|
|
329
|
+
* rather than one project checkout. */
|
|
330
|
+
dismissedProviderAuthFailures: z6.object({
|
|
331
|
+
claude: z6.string().optional(),
|
|
332
|
+
codex: z6.string().optional(),
|
|
333
|
+
opencode: z6.string().optional(),
|
|
334
|
+
pi: z6.string().optional(),
|
|
335
|
+
cursor: z6.string().optional()
|
|
336
|
+
}).optional(),
|
|
337
|
+
/** Settings → Appearance, GLOBAL since step 3.5: accent + density describe the person at the
|
|
338
|
+
* keyboard, not a repo. */
|
|
339
|
+
appearance: appearanceSchema.optional(),
|
|
340
|
+
/** Settings → Notifications, GLOBAL since step 3.5 — one answer for the whole workspace, since
|
|
341
|
+
* the delivering browser is one browser whichever project you are looking at. */
|
|
342
|
+
notifications: z6.looseObject({ enabled: z6.boolean().optional() }).optional(),
|
|
343
|
+
/** Desktop Tasks-table density, shared across every project in this workspace. */
|
|
344
|
+
taskTable: taskTableUiStateSchema.optional(),
|
|
345
|
+
/** LEGACY, exactly like `sidebar` above — the last settled project-scoped page, restored when
|
|
346
|
+
* entering at the exact bare root. The shape is unchanged and still accepted, but the current
|
|
347
|
+
* cockpit keeps it in localStorage (`packages/web/src/lib/last-location.ts`): stored here, the
|
|
348
|
+
* last client to navigate decided where every OTHER client's next launch landed. */
|
|
349
|
+
lastLocation: workspaceLastLocationSchema.optional(),
|
|
350
|
+
/** The user's curated selection of default (vendor) skills. Tri-state: ABSENT means "not
|
|
351
|
+
* curated", so every default skill shows; a PRESENT array (even `[]`) means only those names
|
|
352
|
+
* show from that repo. */
|
|
353
|
+
importedSkills: z6.array(z6.string()).optional()
|
|
354
|
+
});
|
|
355
|
+
var WORKSPACE_UI_STATE_MAX_KEYS = 200;
|
|
356
|
+
var TASK_TABLE_MAX_COLUMNS = 50;
|
|
357
|
+
var setWorkspaceUiStateInputSchema = z6.looseObject({
|
|
358
|
+
...workspaceUiStateSchema.shape,
|
|
359
|
+
sidebar: z6.looseObject({
|
|
360
|
+
collapsed: z6.record(z6.string().min(1).max(64), z6.boolean()).refine((map) => Object.keys(map).length <= WORKSPACE_UI_STATE_MAX_KEYS, {
|
|
361
|
+
message: `sidebar.collapsed must have at most ${WORKSPACE_UI_STATE_MAX_KEYS} entries`
|
|
362
|
+
}).optional()
|
|
363
|
+
}).optional(),
|
|
364
|
+
dismissedProviderAuthFailures: z6.strictObject({
|
|
365
|
+
claude: z6.string().min(1).max(128).optional(),
|
|
366
|
+
codex: z6.string().min(1).max(128).optional(),
|
|
367
|
+
opencode: z6.string().min(1).max(128).optional(),
|
|
368
|
+
pi: z6.string().min(1).max(128).optional(),
|
|
369
|
+
cursor: z6.string().min(1).max(128).optional()
|
|
370
|
+
}).optional(),
|
|
371
|
+
importedSkills: z6.array(z6.string().min(1).max(200)).max(WORKSPACE_UI_STATE_MAX_KEYS).optional(),
|
|
372
|
+
taskTable: taskTableUiStateSchema.extend({
|
|
373
|
+
expandedColumns: z6.record(z6.string().min(1).max(64), z6.boolean()).refine((map) => Object.keys(map).length <= TASK_TABLE_MAX_COLUMNS, {
|
|
374
|
+
message: `taskTable.expandedColumns must have at most ${TASK_TABLE_MAX_COLUMNS} entries`
|
|
375
|
+
}).optional()
|
|
376
|
+
}).optional()
|
|
377
|
+
}).superRefine((data, ctx) => {
|
|
378
|
+
if (Object.keys(data).length > WORKSPACE_UI_STATE_MAX_KEYS) {
|
|
379
|
+
ctx.addIssue({
|
|
380
|
+
code: "custom",
|
|
381
|
+
message: `ui-state has too many keys (max ${WORKSPACE_UI_STATE_MAX_KEYS})`
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
});
|
|
385
|
+
var runnerModelsSchema = z6.object({
|
|
386
|
+
claude: z6.string().optional(),
|
|
387
|
+
codex: z6.string().optional(),
|
|
388
|
+
opencode: z6.string().optional(),
|
|
389
|
+
pi: z6.string().optional(),
|
|
390
|
+
cursor: z6.string().optional()
|
|
391
|
+
});
|
|
392
|
+
var configResponseSchema = z6.object({
|
|
393
|
+
baseBranch: z6.string().nullable(),
|
|
394
|
+
defaultRunner: runnerSchema,
|
|
395
|
+
systemPrompt: z6.string().nullable(),
|
|
396
|
+
defaultModels: runnerModelsSchema,
|
|
397
|
+
/** True when native coding-agent settings are authoritative and model picks are read-only. */
|
|
398
|
+
modelsLocked: z6.boolean(),
|
|
399
|
+
/** How many tasks run at once (1–16). */
|
|
400
|
+
maxParallel: z6.number(),
|
|
401
|
+
/** Per-task memory ceiling in MiB (whole process tree); null = no limit. */
|
|
402
|
+
memoryLimitMb: z6.number().nullable(),
|
|
403
|
+
/** Keep the last N finished worktrees on disk (#483); 0 = unlimited. Older ones are reclaimed
|
|
404
|
+
* (directory only — branch kept, so work is recoverable). */
|
|
405
|
+
worktreeRetention: z6.number(),
|
|
406
|
+
/** Live title updates: null = no config key, the `CEZ_TITLE_UPDATES` env default (ON) decides. */
|
|
407
|
+
liveTitleUpdates: z6.boolean().nullable(),
|
|
408
|
+
/** Optional review gate (#489): null = no config key, the `CEZ_REVIEW_GATE` env default (OFF)
|
|
409
|
+
* decides. */
|
|
410
|
+
reviewGate: z6.boolean().nullable()
|
|
411
|
+
});
|
|
412
|
+
var setConfigResponseSchema = configResponseSchema;
|
|
413
|
+
var setConfigInputSchema = z6.object({
|
|
414
|
+
baseBranch: z6.string().trim().min(1).max(200).nullable().optional(),
|
|
415
|
+
defaultRunner: runnerSchema.optional(),
|
|
416
|
+
systemPrompt: z6.string().trim().max(2e4).nullable().optional(),
|
|
417
|
+
defaultModels: z6.object({
|
|
418
|
+
claude: z6.string().trim().max(200).nullable().optional(),
|
|
419
|
+
codex: z6.string().trim().max(200).nullable().optional(),
|
|
420
|
+
opencode: z6.string().trim().max(200).nullable().optional(),
|
|
421
|
+
pi: z6.string().trim().max(200).nullable().optional(),
|
|
422
|
+
cursor: z6.string().trim().max(200).nullable().optional()
|
|
423
|
+
}).optional(),
|
|
424
|
+
maxParallel: z6.number().int().min(1).max(16).optional(),
|
|
425
|
+
/** null or 0 clears the ceiling back to "no limit". */
|
|
426
|
+
memoryLimitMb: z6.number().int().min(0).max(1048576).nullable().optional(),
|
|
427
|
+
/** Keep last N finished worktrees (#483); 0 = unlimited, null clears back to the default (10). */
|
|
428
|
+
worktreeRetention: z6.number().int().min(0).max(1e3).nullable().optional(),
|
|
429
|
+
/** null clears the key back to the env-default behavior. */
|
|
430
|
+
liveTitleUpdates: z6.boolean().nullable().optional(),
|
|
431
|
+
/** null clears the key back to the env-default behavior (OFF). */
|
|
432
|
+
reviewGate: z6.boolean().nullable().optional()
|
|
433
|
+
});
|
|
434
|
+
var skillsUpdateStatusSchema = z6.enum([
|
|
435
|
+
"idle",
|
|
436
|
+
"checking",
|
|
437
|
+
"available",
|
|
438
|
+
"updating",
|
|
439
|
+
"current",
|
|
440
|
+
"unavailable",
|
|
441
|
+
"error"
|
|
442
|
+
]);
|
|
443
|
+
var skillsUpdateScopeStateSchema = z6.object({
|
|
444
|
+
scope: z6.enum(["project", "global"]),
|
|
445
|
+
status: skillsUpdateStatusSchema,
|
|
446
|
+
available: z6.boolean(),
|
|
447
|
+
skills: z6.array(z6.string()),
|
|
448
|
+
checkedAt: z6.string().nullable(),
|
|
449
|
+
updatedAt: z6.string().nullable(),
|
|
450
|
+
reason: z6.string().optional()
|
|
451
|
+
});
|
|
452
|
+
var skillsUpdateStateSchema = z6.object({
|
|
453
|
+
status: skillsUpdateStatusSchema,
|
|
454
|
+
available: z6.boolean(),
|
|
455
|
+
autoUpdateEnabled: z6.boolean(),
|
|
456
|
+
inherited: z6.boolean(),
|
|
457
|
+
checkedAt: z6.string().nullable(),
|
|
458
|
+
updatedAt: z6.string().nullable(),
|
|
459
|
+
scopes: z6.array(skillsUpdateScopeStateSchema),
|
|
460
|
+
needsUpgradeNotes: z6.boolean()
|
|
461
|
+
});
|
|
462
|
+
var providerIdSchema = runnerSchema;
|
|
463
|
+
var providerConnectionStateSchema = z6.enum([
|
|
464
|
+
"connected",
|
|
465
|
+
"disconnected",
|
|
466
|
+
"not-installed",
|
|
467
|
+
"unknown"
|
|
468
|
+
]);
|
|
469
|
+
var providerStatusSchema = z6.object({
|
|
470
|
+
provider: providerIdSchema,
|
|
471
|
+
status: providerConnectionStateSchema,
|
|
472
|
+
enabled: z6.boolean().optional(),
|
|
473
|
+
hint: z6.string().optional(),
|
|
474
|
+
authFailureId: z6.string().optional(),
|
|
475
|
+
/** Which agent account this row describes (spec 2026-07-29-agent-profiles). ABSENT on
|
|
476
|
+
* `GET /api/v1/providers/status`, which deliberately keeps answering exactly one row per
|
|
477
|
+
* provider — the discovered default — so an older client sees no change at all. Per-account
|
|
478
|
+
* rows are carried by `GET /api/v1/workspace/agent-profiles` instead. */
|
|
479
|
+
profileId: z6.string().optional()
|
|
480
|
+
});
|
|
481
|
+
var providerStatusResponseSchema = z6.object({
|
|
482
|
+
providers: z6.array(providerStatusSchema)
|
|
483
|
+
});
|
|
484
|
+
var providerConnectResponseSchema = z6.discriminatedUnion("opened", [
|
|
485
|
+
z6.object({ opened: z6.literal(true), command: z6.string() }),
|
|
486
|
+
z6.object({ opened: z6.literal(false), connected: z6.literal(true), command: z6.string() })
|
|
487
|
+
]);
|
|
488
|
+
var modelDiscoveryRunnerSchema = z6.enum(["claude", "codex", "opencode", "pi", "cursor"]);
|
|
489
|
+
var MODEL_DISCOVERY_RUNNERS = modelDiscoveryRunnerSchema.options;
|
|
490
|
+
function runnerDiscoversModels(runner) {
|
|
491
|
+
return MODEL_DISCOVERY_RUNNERS.includes(runner);
|
|
492
|
+
}
|
|
493
|
+
var runnerModelOptionSchema = z6.object({
|
|
494
|
+
id: z6.string(),
|
|
495
|
+
label: z6.string(),
|
|
496
|
+
description: z6.string(),
|
|
497
|
+
effortLevels: z6.array(effortLevelSchema).optional()
|
|
498
|
+
});
|
|
499
|
+
var runnerModelCatalogResponseSchema = z6.object({
|
|
500
|
+
runner: runnerSchema,
|
|
501
|
+
models: z6.array(runnerModelOptionSchema),
|
|
502
|
+
source: z6.enum(["live", "cache", "unavailable"]),
|
|
503
|
+
stale: z6.boolean(),
|
|
504
|
+
reason: z6.string().optional()
|
|
505
|
+
});
|
|
506
|
+
var openTargetSchema = z6.object({
|
|
507
|
+
id: z6.string(),
|
|
508
|
+
label: z6.string(),
|
|
509
|
+
/** A stable icon key (#361) the UI maps to a concrete icon. Optional: an older server omitting
|
|
510
|
+
* it just renders the generic fallback icon. */
|
|
511
|
+
icon: z6.string().optional()
|
|
512
|
+
});
|
|
513
|
+
var openTargetsResponseSchema = z6.object({
|
|
514
|
+
targets: z6.array(openTargetSchema)
|
|
515
|
+
});
|
|
516
|
+
var openProjectInSchema = z6.object({
|
|
517
|
+
// A short bound (#429): matched against a downstream allowlist, so an app id is never long.
|
|
518
|
+
target: z6.string().trim().min(1, "target required").max(200)
|
|
519
|
+
});
|
|
520
|
+
var openProjectInResponseSchema = z6.object({
|
|
521
|
+
opened: z6.literal(true),
|
|
522
|
+
path: z6.string()
|
|
523
|
+
});
|
|
524
|
+
|
|
525
|
+
// ../contract/src/discovery.ts
|
|
526
|
+
var discoveryRequestSchema = z7.discriminatedUnion("kind", [
|
|
527
|
+
z7.object({ kind: z7.literal("runners") }).strict(),
|
|
528
|
+
z7.object({ kind: z7.literal("models"), runner: modelDiscoveryRunnerSchema }).strict()
|
|
529
|
+
]);
|
|
530
|
+
var discoveredRunnerSchema = providerStatusSchema.omit({ provider: true, profileId: true }).extend({ runner: modelDiscoveryRunnerSchema });
|
|
531
|
+
var discoveredRunnersSchema = z7.object({
|
|
532
|
+
scope: z7.literal("host-default-account"),
|
|
533
|
+
runners: z7.array(discoveredRunnerSchema)
|
|
534
|
+
});
|
|
535
|
+
var discoveryResponseSchema = z7.union([discoveredRunnersSchema, runnerModelCatalogResponseSchema]);
|
|
536
|
+
var modelChoicesSchema = z7.object({
|
|
537
|
+
runner: modelDiscoveryRunnerSchema,
|
|
538
|
+
requestedModel: z7.string(),
|
|
539
|
+
availableModels: z7.array(runnerModelOptionSchema),
|
|
540
|
+
otherRunners: z7.array(modelDiscoveryRunnerSchema)
|
|
541
|
+
});
|
|
542
|
+
|
|
105
543
|
// ../contract/src/delegation.ts
|
|
106
|
-
|
|
107
|
-
var
|
|
108
|
-
var
|
|
109
|
-
var
|
|
110
|
-
var
|
|
111
|
-
var
|
|
112
|
-
var
|
|
113
|
-
var
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
544
|
+
import { z as z8 } from "zod";
|
|
545
|
+
var workerOperationSchema = z8.enum(["spawn", "inspect", "steer", "stop", "destroy", "diff", "wait"]);
|
|
546
|
+
var commitShaSchema = z8.string().regex(/^(?:[0-9a-f]{40}|[0-9a-f]{64})$/);
|
|
547
|
+
var requestHashSchema = z8.string().regex(/^[0-9a-f]{64}$/);
|
|
548
|
+
var workerIdsSchema = z8.array(z8.uuid()).min(1).max(32).refine((ids) => new Set(ids).size === ids.length);
|
|
549
|
+
var permissionsSchema = z8.array(workerOperationSchema).max(7).refine((operations) => new Set(operations).size === operations.length);
|
|
550
|
+
var remainingSchema = z8.array(z8.enum(["process", "worktree", "branch"])).max(3).refine((resources) => new Set(resources).size === resources.length);
|
|
551
|
+
var errorSchema = z8.string().max(2e3);
|
|
552
|
+
var workerWorkspaceSchema = z8.object({
|
|
553
|
+
ownerRunId: z8.uuid(),
|
|
554
|
+
resourceId: z8.uuid(),
|
|
555
|
+
kind: z8.literal("owned-isolated"),
|
|
117
556
|
/** Canonical creation path and original branch, never inferred from execution cwd. */
|
|
118
|
-
path:
|
|
119
|
-
branch:
|
|
557
|
+
path: z8.string().min(1),
|
|
558
|
+
branch: z8.string().min(1),
|
|
120
559
|
baselineSha: commitShaSchema
|
|
121
560
|
}).strict();
|
|
122
|
-
var workerOutcomeSchema =
|
|
123
|
-
workerId:
|
|
124
|
-
status:
|
|
125
|
-
observedAt:
|
|
126
|
-
summary:
|
|
127
|
-
revision:
|
|
561
|
+
var workerOutcomeSchema = z8.object({
|
|
562
|
+
workerId: z8.uuid(),
|
|
563
|
+
status: z8.enum(["review", "done", "failed", "cancelled"]),
|
|
564
|
+
observedAt: z8.iso.datetime(),
|
|
565
|
+
summary: z8.string().max(4e3).optional(),
|
|
566
|
+
revision: z8.number().int().nonnegative().optional()
|
|
128
567
|
}).strict();
|
|
129
|
-
var workerWaitModeSchema =
|
|
130
|
-
var workerWaitSchema =
|
|
131
|
-
id:
|
|
132
|
-
workerIds:
|
|
133
|
-
requestIds:
|
|
134
|
-
requestOutcomes:
|
|
135
|
-
deadline:
|
|
568
|
+
var workerWaitModeSchema = z8.enum(["one", "any", "all"]);
|
|
569
|
+
var workerWaitSchema = z8.object({
|
|
570
|
+
id: z8.uuid(),
|
|
571
|
+
workerIds: z8.array(z8.uuid()).max(32).refine((ids) => new Set(ids).size === ids.length),
|
|
572
|
+
requestIds: z8.array(z8.uuid()).min(1).max(32).optional(),
|
|
573
|
+
requestOutcomes: z8.array(requestOutcomeSchema).max(32).optional(),
|
|
574
|
+
deadline: z8.iso.datetime(),
|
|
136
575
|
mode: workerWaitModeSchema.optional(),
|
|
137
|
-
revisions:
|
|
138
|
-
reason:
|
|
139
|
-
phase:
|
|
140
|
-
outcomes:
|
|
141
|
-
wakeId:
|
|
576
|
+
revisions: z8.array(z8.object({ workerId: z8.uuid(), revision: z8.number().int().nonnegative() }).strict()).max(32).optional(),
|
|
577
|
+
reason: z8.enum(["outcome", "timeout", "cancelled", "message"]).optional(),
|
|
578
|
+
phase: z8.enum(["registered", "parked", "wake-pending"]),
|
|
579
|
+
outcomes: z8.array(workerOutcomeSchema).max(32),
|
|
580
|
+
wakeId: z8.uuid().optional()
|
|
142
581
|
}).strict();
|
|
143
|
-
var workerDestroySchema =
|
|
144
|
-
requestedAt:
|
|
145
|
-
phase:
|
|
582
|
+
var workerDestroySchema = z8.object({
|
|
583
|
+
requestedAt: z8.iso.datetime(),
|
|
584
|
+
phase: z8.enum(["requested", "terminating", "cleaning", "complete", "incomplete"]),
|
|
146
585
|
remaining: remainingSchema,
|
|
147
586
|
error: errorSchema.optional()
|
|
148
587
|
}).strict();
|
|
149
|
-
var workerCreationReceiptSchema =
|
|
150
|
-
requestId:
|
|
151
|
-
workerId:
|
|
588
|
+
var workerCreationReceiptSchema = z8.object({
|
|
589
|
+
requestId: z8.uuid(),
|
|
590
|
+
workerId: z8.uuid(),
|
|
152
591
|
/** Hash of the original normalized spawn request, NOT the resolved commit or inherited settings. */
|
|
153
592
|
requestHash: requestHashSchema,
|
|
154
|
-
deletion:
|
|
593
|
+
deletion: z8.object({ phase: z8.enum(["pending", "complete"]), revision: z8.number().int().nonnegative(), resourceId: z8.uuid(), generation: z8.uuid() }).strict().optional()
|
|
155
594
|
}).strict();
|
|
156
|
-
var workerBackendSchema =
|
|
157
|
-
var relativeInputPath =
|
|
158
|
-
var workerContextReferenceSchema =
|
|
159
|
-
|
|
160
|
-
|
|
595
|
+
var workerBackendSchema = z8.enum(["claude", "codex", "opencode", "pi", "cursor"]);
|
|
596
|
+
var relativeInputPath = z8.string().min(1).max(4096).refine((path) => !/[\\\u0000-\u001f\u007f:]/.test(path) && !path.startsWith("/") && path.split("/").every((part) => part !== "" && part !== "." && part !== ".."));
|
|
597
|
+
var workerContextReferenceSchema = z8.discriminatedUnion("kind", [
|
|
598
|
+
z8.object({ kind: z8.literal("baseline-file"), path: relativeInputPath }).strict(),
|
|
599
|
+
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()
|
|
161
600
|
]);
|
|
162
|
-
var workerContextSchema =
|
|
163
|
-
text:
|
|
164
|
-
artifacts:
|
|
601
|
+
var workerContextSchema = z8.object({
|
|
602
|
+
text: z8.string().max(1e5).optional(),
|
|
603
|
+
artifacts: z8.array(workerContextReferenceSchema).max(32).optional()
|
|
165
604
|
}).strict();
|
|
166
|
-
var workerInputSchema =
|
|
605
|
+
var workerInputSchema = z8.object({
|
|
167
606
|
source: workerContextReferenceSchema,
|
|
168
|
-
path:
|
|
607
|
+
path: z8.string().min(1).max(8192),
|
|
169
608
|
/** Parent attachment: SHA-256 of copied bytes. Baseline file: SHA-256 of the pinned Git blob ID
|
|
170
609
|
* (the lowercase hexadecimal ID as UTF-8 text), not of file contents. Interpret by source.kind. */
|
|
171
610
|
sha256: requestHashSchema,
|
|
172
|
-
bytes:
|
|
611
|
+
bytes: z8.number().int().min(0).max(Number.MAX_SAFE_INTEGER)
|
|
173
612
|
}).strict();
|
|
174
|
-
var workerInputRecipeSchema =
|
|
175
|
-
text:
|
|
176
|
-
inputs:
|
|
613
|
+
var workerInputRecipeSchema = z8.object({
|
|
614
|
+
text: z8.string().max(1e5).optional(),
|
|
615
|
+
inputs: z8.array(workerInputSchema).max(32)
|
|
177
616
|
}).strict();
|
|
178
|
-
var unavailableEvidenceSchema =
|
|
179
|
-
var deletedEvidenceSchema =
|
|
180
|
-
var executionOutcomeSchema =
|
|
181
|
-
var workerArtifactSchema =
|
|
182
|
-
|
|
183
|
-
unavailableEvidenceSchema.extend({ id:
|
|
184
|
-
deletedEvidenceSchema.extend({ id:
|
|
617
|
+
var unavailableEvidenceSchema = z8.object({ state: z8.literal("unavailable"), reason: z8.enum(["no-assistant-output", "missing", "unreadable", "unverified"]), detail: errorSchema.optional() }).strict();
|
|
618
|
+
var deletedEvidenceSchema = z8.object({ state: z8.literal("deleted"), reason: z8.literal("missing") }).strict();
|
|
619
|
+
var executionOutcomeSchema = z8.enum(["running", "review-ready", "completed", "failed", "cancelled"]);
|
|
620
|
+
var workerArtifactSchema = z8.discriminatedUnion("state", [
|
|
621
|
+
z8.object({ state: z8.literal("available"), id: z8.string().max(255), path: z8.string().max(8192) }).strict(),
|
|
622
|
+
unavailableEvidenceSchema.extend({ id: z8.string().max(255), path: z8.string().max(8192) }),
|
|
623
|
+
deletedEvidenceSchema.extend({ id: z8.string().max(255), path: z8.string().max(8192) })
|
|
185
624
|
]);
|
|
186
|
-
var workerCollectedResultSchema =
|
|
187
|
-
workerId:
|
|
188
|
-
parentRunId:
|
|
189
|
-
revision:
|
|
190
|
-
observedAt:
|
|
191
|
-
status:
|
|
192
|
-
outcome:
|
|
625
|
+
var workerCollectedResultSchema = z8.object({
|
|
626
|
+
workerId: z8.uuid(),
|
|
627
|
+
parentRunId: z8.uuid(),
|
|
628
|
+
revision: z8.number().int().nonnegative(),
|
|
629
|
+
observedAt: z8.iso.datetime(),
|
|
630
|
+
status: z8.enum(["queued", "running", "waiting", "review", "done", "failed", "cancelled"]),
|
|
631
|
+
outcome: z8.enum(["running", "review-ready", "completed", "failed", "cancelled", "destroyed"]),
|
|
193
632
|
lastExecutionOutcome: executionOutcomeSchema,
|
|
194
|
-
partial:
|
|
195
|
-
settled:
|
|
633
|
+
partial: z8.boolean(),
|
|
634
|
+
settled: z8.boolean(),
|
|
196
635
|
error: errorSchema.optional(),
|
|
197
636
|
backend: workerBackendSchema.optional(),
|
|
198
|
-
model:
|
|
637
|
+
model: z8.string().max(512).optional(),
|
|
199
638
|
baselineSha: commitShaSchema,
|
|
200
|
-
workspace: workerWorkspaceSchema.extend({ state:
|
|
201
|
-
cleanup:
|
|
202
|
-
summary:
|
|
203
|
-
|
|
639
|
+
workspace: workerWorkspaceSchema.extend({ state: z8.enum(["available", "unavailable", "deleted"]).optional() }),
|
|
640
|
+
cleanup: z8.enum(["retained", "requested", "terminating", "cleaning", "complete", "incomplete"]),
|
|
641
|
+
summary: z8.discriminatedUnion("state", [
|
|
642
|
+
z8.object({ state: z8.literal("available"), text: z8.string().min(1).max(4e3), source: z8.literal("assistant"), seq: z8.number().int().nonnegative(), truncated: z8.boolean() }).strict(),
|
|
204
643
|
unavailableEvidenceSchema,
|
|
205
644
|
deletedEvidenceSchema
|
|
206
645
|
]),
|
|
207
|
-
head:
|
|
208
|
-
|
|
646
|
+
head: z8.discriminatedUnion("state", [
|
|
647
|
+
z8.object({ state: z8.literal("available"), sha: commitShaSchema }).strict(),
|
|
209
648
|
unavailableEvidenceSchema.extend({ sha: commitShaSchema.optional() }),
|
|
210
649
|
deletedEvidenceSchema.extend({ sha: commitShaSchema.optional() })
|
|
211
650
|
]),
|
|
212
|
-
diff:
|
|
651
|
+
diff: z8.discriminatedUnion("state", [
|
|
213
652
|
// path addresses a workerResultFileSchema JSON document; its diffSnapshot field contains the patch.
|
|
214
|
-
|
|
653
|
+
z8.object({ state: z8.literal("available"), snapshotId: z8.uuid(), path: z8.string().min(1).max(8192), truncated: z8.boolean() }).strict(),
|
|
215
654
|
unavailableEvidenceSchema,
|
|
216
655
|
deletedEvidenceSchema
|
|
217
656
|
]),
|
|
218
|
-
artifacts:
|
|
219
|
-
|
|
657
|
+
artifacts: z8.discriminatedUnion("state", [
|
|
658
|
+
z8.object({ state: z8.literal("available"), items: z8.array(workerArtifactSchema).max(32), truncated: z8.boolean() }).strict(),
|
|
220
659
|
unavailableEvidenceSchema,
|
|
221
660
|
deletedEvidenceSchema
|
|
222
661
|
])
|
|
223
662
|
}).strict();
|
|
224
|
-
var workerResultFileSchema =
|
|
225
|
-
var workerResultReferenceSchema =
|
|
226
|
-
workerId:
|
|
227
|
-
revision:
|
|
228
|
-
snapshotId:
|
|
229
|
-
observedAt:
|
|
663
|
+
var workerResultFileSchema = z8.object({ result: workerCollectedResultSchema, diffSnapshot: z8.string().max(4e5).optional() }).strict();
|
|
664
|
+
var workerResultReferenceSchema = z8.object({
|
|
665
|
+
workerId: z8.uuid(),
|
|
666
|
+
revision: z8.number().int().nonnegative(),
|
|
667
|
+
snapshotId: z8.uuid(),
|
|
668
|
+
observedAt: z8.iso.datetime(),
|
|
230
669
|
lastExecutionOutcome: executionOutcomeSchema,
|
|
231
|
-
previous:
|
|
670
|
+
previous: z8.object({ revision: z8.number().int().nonnegative(), observedAt: z8.iso.datetime(), lastExecutionOutcome: executionOutcomeSchema }).strict().optional()
|
|
232
671
|
}).strict();
|
|
233
|
-
var delegationStateSchema =
|
|
234
|
-
|
|
235
|
-
role:
|
|
672
|
+
var delegationStateSchema = z8.discriminatedUnion("role", [
|
|
673
|
+
z8.object({
|
|
674
|
+
role: z8.literal("root"),
|
|
236
675
|
conversation: conversationStateSchema.optional(),
|
|
237
676
|
permissions: permissionsSchema,
|
|
238
|
-
receipts:
|
|
677
|
+
receipts: z8.array(workerCreationReceiptSchema).max(32).refine((receipts) => new Set(receipts.map((receipt) => receipt.requestId)).size === receipts.length && new Set(receipts.map((receipt) => receipt.workerId)).size === receipts.length),
|
|
239
678
|
wait: workerWaitSchema.optional(),
|
|
240
679
|
lastWait: workerWaitSchema.optional(),
|
|
241
|
-
results:
|
|
242
|
-
finishRequestedAt:
|
|
243
|
-
historyDeletion:
|
|
244
|
-
completion:
|
|
680
|
+
results: z8.array(workerResultReferenceSchema).max(32).refine((results) => new Set(results.map((result) => result.workerId)).size === results.length).optional(),
|
|
681
|
+
finishRequestedAt: z8.iso.datetime().optional(),
|
|
682
|
+
historyDeletion: z8.literal("pending").optional(),
|
|
683
|
+
completion: z8.object({ phase: z8.enum(["waiting", "attention"]), waitId: z8.uuid().optional() }).strict().optional()
|
|
245
684
|
}).strict(),
|
|
246
|
-
|
|
247
|
-
role:
|
|
685
|
+
z8.object({
|
|
686
|
+
role: z8.literal("worker"),
|
|
248
687
|
wait: workerWaitSchema.optional(),
|
|
249
688
|
lastWait: workerWaitSchema.optional(),
|
|
250
689
|
permissions: permissionsSchema,
|
|
251
|
-
parentRunId:
|
|
690
|
+
parentRunId: z8.uuid(),
|
|
252
691
|
workspace: workerWorkspaceSchema,
|
|
253
692
|
destroy: workerDestroySchema.optional(),
|
|
254
693
|
context: workerInputRecipeSchema.optional(),
|
|
255
|
-
executionRevision:
|
|
256
|
-
executionStartSeq:
|
|
694
|
+
executionRevision: z8.number().int().nonnegative().optional(),
|
|
695
|
+
executionStartSeq: z8.number().int().nonnegative().optional()
|
|
257
696
|
}).strict(),
|
|
258
697
|
// A persisted quarantine is distinct from absent legacy metadata and grants no authority.
|
|
259
|
-
|
|
698
|
+
z8.object({ role: z8.literal("invalid") }).strict()
|
|
260
699
|
]);
|
|
261
|
-
var runDelegationSummarySchema =
|
|
700
|
+
var runDelegationSummarySchema = z8.discriminatedUnion("role", [
|
|
262
701
|
delegationStateSchema.options[0].pick({ role: true }).strip().extend({
|
|
263
702
|
wait: workerWaitSchema.pick({ phase: true, requestIds: true }).strip().optional()
|
|
264
703
|
}),
|
|
@@ -267,89 +706,89 @@ var runDelegationSummarySchema = z4.discriminatedUnion("role", [
|
|
|
267
706
|
}),
|
|
268
707
|
delegationStateSchema.options[2].strip()
|
|
269
708
|
]);
|
|
270
|
-
var workerSpawnRequestSchema =
|
|
271
|
-
task:
|
|
272
|
-
baseline:
|
|
273
|
-
requestId:
|
|
709
|
+
var workerSpawnRequestSchema = z8.object({
|
|
710
|
+
task: z8.string().min(1).max(1e5),
|
|
711
|
+
baseline: z8.string().min(1).max(1024),
|
|
712
|
+
requestId: z8.uuid(),
|
|
274
713
|
context: workerContextSchema.optional(),
|
|
275
714
|
backend: workerBackendSchema.optional(),
|
|
276
|
-
model:
|
|
715
|
+
model: z8.string().trim().min(1).max(512).optional(),
|
|
277
716
|
effort: effortFieldSchema,
|
|
278
717
|
/** Catalog workflow name (built-in quick-task or `.ai/cezar/workflows/*.yaml`, #451). Absent means quick-task. */
|
|
279
|
-
workflow:
|
|
718
|
+
workflow: z8.string().trim().min(1).max(200).optional()
|
|
280
719
|
}).strict().refine((request) => request.task.length + (request.context?.text?.length ?? 0) <= 1e5, { message: "Combined task and context exceed 100000 characters" });
|
|
281
|
-
var workerSteerRequestSchema =
|
|
282
|
-
text:
|
|
720
|
+
var workerSteerRequestSchema = z8.object({
|
|
721
|
+
text: z8.string().max(1e5).refine((text) => text.trim().length > 0)
|
|
283
722
|
}).strict();
|
|
284
|
-
var workerWaitRequestSchema =
|
|
723
|
+
var workerWaitRequestSchema = z8.object({
|
|
285
724
|
workerIds: workerIdsSchema,
|
|
286
|
-
timeoutSeconds:
|
|
725
|
+
timeoutSeconds: z8.number().int().min(1).max(1800).default(600),
|
|
287
726
|
mode: workerWaitModeSchema.optional()
|
|
288
727
|
}).strict().refine((request) => request.mode !== "one" || request.workerIds.length === 1, { message: "one mode requires exactly one worker" });
|
|
289
|
-
var inboxClaimSchema =
|
|
290
|
-
receiptId:
|
|
291
|
-
generation:
|
|
292
|
-
expiresAt:
|
|
293
|
-
acknowledgedAt:
|
|
728
|
+
var inboxClaimSchema = z8.object({
|
|
729
|
+
receiptId: z8.uuid(),
|
|
730
|
+
generation: z8.uuid(),
|
|
731
|
+
expiresAt: z8.iso.datetime(),
|
|
732
|
+
acknowledgedAt: z8.iso.datetime().optional(),
|
|
294
733
|
/** Optional on read for receipts persisted before member manifests existed. */
|
|
295
|
-
memberIds:
|
|
734
|
+
memberIds: z8.array(z8.uuid()).min(1).max(32).refine((ids) => new Set(ids).size === ids.length).optional()
|
|
296
735
|
}).strict();
|
|
297
|
-
var agentInputSchema =
|
|
736
|
+
var agentInputSchema = z8.object({
|
|
298
737
|
conversation: conversationAttributionSchema.optional(),
|
|
299
|
-
id:
|
|
300
|
-
source:
|
|
301
|
-
parentRunId:
|
|
302
|
-
text:
|
|
303
|
-
createdAt:
|
|
304
|
-
deliveredAt:
|
|
738
|
+
id: z8.uuid(),
|
|
739
|
+
source: z8.enum(["agent", "lifecycle"]),
|
|
740
|
+
parentRunId: z8.uuid(),
|
|
741
|
+
text: z8.string().min(1).max(1e5),
|
|
742
|
+
createdAt: z8.iso.datetime(),
|
|
743
|
+
deliveredAt: z8.iso.datetime().optional(),
|
|
305
744
|
/** The model received it, when the harness can show that (#505). Absent on
|
|
306
745
|
* unobservable backends and on records written before #505. */
|
|
307
|
-
consumedAt:
|
|
746
|
+
consumedAt: z8.iso.datetime().optional(),
|
|
308
747
|
/** Accepted by a harness that reports reading, and not read yet. A restart replays
|
|
309
748
|
* such input; records written before #505 never carry it, so nothing historical replays. */
|
|
310
|
-
awaitingRead:
|
|
749
|
+
awaitingRead: z8.literal(true).optional(),
|
|
311
750
|
inboxClaim: inboxClaimSchema.optional()
|
|
312
751
|
}).strict();
|
|
313
|
-
var workerInspectionSchema =
|
|
314
|
-
workerId:
|
|
315
|
-
parentRunId:
|
|
316
|
-
status:
|
|
317
|
-
currentStepId:
|
|
318
|
-
activity:
|
|
752
|
+
var workerInspectionSchema = z8.object({
|
|
753
|
+
workerId: z8.uuid(),
|
|
754
|
+
parentRunId: z8.uuid(),
|
|
755
|
+
status: z8.enum(["queued", "running", "waiting", ...workerOutcomeSchema.shape.status.options]),
|
|
756
|
+
currentStepId: z8.string().optional(),
|
|
757
|
+
activity: z8.enum(["monitoring"]).optional(),
|
|
319
758
|
workspace: workerWorkspaceSchema,
|
|
320
759
|
backend: workerBackendSchema.optional(),
|
|
321
|
-
model:
|
|
322
|
-
inputs:
|
|
760
|
+
model: z8.string().max(512).optional(),
|
|
761
|
+
inputs: z8.array(workerInputSchema).max(32).optional(),
|
|
323
762
|
wait: workerWaitSchema.optional(),
|
|
324
763
|
destroy: workerDestroySchema.optional(),
|
|
325
764
|
outcome: workerOutcomeSchema.optional()
|
|
326
765
|
});
|
|
327
|
-
var workerDiffSchema =
|
|
328
|
-
workerId:
|
|
766
|
+
var workerDiffSchema = z8.object({
|
|
767
|
+
workerId: z8.uuid(),
|
|
329
768
|
baselineSha: commitShaSchema,
|
|
330
|
-
diff:
|
|
331
|
-
truncated:
|
|
332
|
-
});
|
|
333
|
-
var workerStopResultSchema =
|
|
334
|
-
workerId:
|
|
335
|
-
state:
|
|
336
|
-
});
|
|
337
|
-
var workerDestroyResultSchema =
|
|
338
|
-
workerId:
|
|
339
|
-
state:
|
|
340
|
-
deleted:
|
|
341
|
-
|
|
342
|
-
|
|
769
|
+
diff: z8.string().max(4e5),
|
|
770
|
+
truncated: z8.boolean()
|
|
771
|
+
});
|
|
772
|
+
var workerStopResultSchema = z8.object({
|
|
773
|
+
workerId: z8.uuid(),
|
|
774
|
+
state: z8.enum(["stopping", "terminated"])
|
|
775
|
+
});
|
|
776
|
+
var workerDestroyResultSchema = z8.object({
|
|
777
|
+
workerId: z8.uuid(),
|
|
778
|
+
state: z8.enum(["complete", "incomplete"]),
|
|
779
|
+
deleted: z8.array(z8.discriminatedUnion("kind", [
|
|
780
|
+
z8.object({ kind: z8.literal("worktree"), path: z8.string().max(8192) }).strict(),
|
|
781
|
+
z8.object({ kind: z8.literal("branch"), ref: z8.string().max(1024) }).strict()
|
|
343
782
|
])).max(2).optional(),
|
|
344
783
|
remaining: remainingSchema,
|
|
345
784
|
error: errorSchema.optional()
|
|
346
785
|
});
|
|
347
|
-
var runRelationshipsSchema =
|
|
348
|
-
parentRunId:
|
|
349
|
-
workers:
|
|
786
|
+
var runRelationshipsSchema = z8.object({
|
|
787
|
+
parentRunId: z8.uuid().optional(),
|
|
788
|
+
workers: z8.array(workerInspectionSchema).max(32)
|
|
350
789
|
});
|
|
351
|
-
var delegationErrorResponseSchema =
|
|
352
|
-
code:
|
|
790
|
+
var delegationErrorResponseSchema = z8.object({
|
|
791
|
+
code: z8.enum([
|
|
353
792
|
"unavailable_transport",
|
|
354
793
|
"unauthenticated",
|
|
355
794
|
"denied_scope",
|
|
@@ -360,88 +799,89 @@ var delegationErrorResponseSchema = z4.object({
|
|
|
360
799
|
"unavailable_diff",
|
|
361
800
|
"incomplete_cleanup"
|
|
362
801
|
]),
|
|
363
|
-
error: errorSchema
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
var
|
|
367
|
-
var
|
|
368
|
-
var
|
|
369
|
-
var
|
|
370
|
-
var
|
|
371
|
-
var
|
|
802
|
+
error: errorSchema,
|
|
803
|
+
modelChoices: modelChoicesSchema.optional()
|
|
804
|
+
});
|
|
805
|
+
var workerParamsSchema = z8.object({ workerId: z8.uuid() }).strict();
|
|
806
|
+
var workerSpawnResultSchema = z8.object({ workerId: z8.uuid(), baselineSha: commitShaSchema }).strict();
|
|
807
|
+
var workerSteerResultSchema = z8.object({ workerId: z8.uuid(), state: z8.enum(["queued", "delivered"]) }).strict();
|
|
808
|
+
var workerWaitResultSchema = z8.object({ wait: workerWaitSchema, instruction: z8.string().min(1).max(1e3) }).strict();
|
|
809
|
+
var workerEmptyRequestSchema = z8.object({}).strict();
|
|
810
|
+
var workerCancelWaitRequestSchema = z8.object({ waitId: z8.uuid() }).strict();
|
|
811
|
+
var workerCancelWaitResultSchema = z8.object({ wait: workerWaitSchema }).strict();
|
|
372
812
|
|
|
373
813
|
// ../contract/src/events.ts
|
|
374
|
-
var runEventSchema =
|
|
375
|
-
seq:
|
|
376
|
-
ts:
|
|
377
|
-
stepId:
|
|
378
|
-
type:
|
|
379
|
-
});
|
|
380
|
-
var conversationMessageEventSchema = runEventSchema.extend({ type:
|
|
381
|
-
var requestOutcomeEventSchema = runEventSchema.extend({ type:
|
|
814
|
+
var runEventSchema = z9.looseObject({
|
|
815
|
+
seq: z9.number(),
|
|
816
|
+
ts: z9.string(),
|
|
817
|
+
stepId: z9.string().optional(),
|
|
818
|
+
type: z9.string()
|
|
819
|
+
});
|
|
820
|
+
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() });
|
|
821
|
+
var requestOutcomeEventSchema = runEventSchema.extend({ type: z9.literal("request-outcome"), outcome: requestOutcomeSchema });
|
|
382
822
|
var agentInputEventSchema = runEventSchema.extend({
|
|
383
|
-
type:
|
|
823
|
+
type: z9.literal("agent-input"),
|
|
384
824
|
input: agentInputSchema
|
|
385
825
|
});
|
|
386
826
|
var humanInputDeliveredEventSchema = runEventSchema.extend({
|
|
387
|
-
type:
|
|
388
|
-
askSeq:
|
|
827
|
+
type: z9.literal("human-input-delivered"),
|
|
828
|
+
askSeq: z9.number().int().nonnegative(),
|
|
389
829
|
/** Who answered: absent (records before #505) or `human` is a person; `parent` is the
|
|
390
830
|
* owning parent's reply to a routed worker question. */
|
|
391
|
-
source:
|
|
831
|
+
source: z9.enum(["human", "parent"]).optional()
|
|
392
832
|
});
|
|
393
833
|
var workerQuestionRoutedEventSchema = runEventSchema.extend({
|
|
394
|
-
type:
|
|
395
|
-
askSeq:
|
|
396
|
-
messageId:
|
|
397
|
-
parentRunId:
|
|
834
|
+
type: z9.literal("worker-question-routed"),
|
|
835
|
+
askSeq: z9.number().int().nonnegative(),
|
|
836
|
+
messageId: z9.uuid(),
|
|
837
|
+
parentRunId: z9.uuid()
|
|
398
838
|
});
|
|
399
839
|
var workerQuestionFallbackEventSchema = runEventSchema.extend({
|
|
400
|
-
type:
|
|
401
|
-
askSeq:
|
|
402
|
-
reason:
|
|
840
|
+
type: z9.literal("worker-question-fallback"),
|
|
841
|
+
askSeq: z9.number().int().nonnegative(),
|
|
842
|
+
reason: z9.string().min(1).max(200)
|
|
403
843
|
});
|
|
404
844
|
var workerOutcomeEventSchema = runEventSchema.extend({
|
|
405
|
-
type:
|
|
845
|
+
type: z9.literal("worker-outcome"),
|
|
406
846
|
outcome: workerOutcomeSchema
|
|
407
847
|
});
|
|
408
848
|
var RUN_HISTORY_PAGE_ITEMS = 100;
|
|
409
|
-
var runIdParamSchema =
|
|
410
|
-
id:
|
|
849
|
+
var runIdParamSchema = z9.object({
|
|
850
|
+
id: z9.string().min(1).max(128).regex(/^[A-Za-z0-9._-]+$/)
|
|
411
851
|
});
|
|
412
|
-
var runHistoryCursorSchema =
|
|
413
|
-
var runHistoryQuerySchema =
|
|
852
|
+
var runHistoryCursorSchema = z9.string().min(1).max(2048);
|
|
853
|
+
var runHistoryQuerySchema = z9.object({
|
|
414
854
|
cursor: runHistoryCursorSchema.optional()
|
|
415
855
|
});
|
|
416
|
-
var runEventsQuerySchema =
|
|
856
|
+
var runEventsQuerySchema = z9.object({
|
|
417
857
|
cursor: runHistoryCursorSchema.optional(),
|
|
418
|
-
afterSeq:
|
|
419
|
-
});
|
|
420
|
-
var runHistoryEventSchema =
|
|
421
|
-
seq:
|
|
422
|
-
ts:
|
|
423
|
-
stepId:
|
|
424
|
-
type:
|
|
425
|
-
}).catchall(
|
|
426
|
-
var runHistoryPageSchema =
|
|
427
|
-
events:
|
|
428
|
-
itemCount:
|
|
858
|
+
afterSeq: z9.coerce.number().int().nonnegative().optional()
|
|
859
|
+
});
|
|
860
|
+
var runHistoryEventSchema = z9.object({
|
|
861
|
+
seq: z9.number(),
|
|
862
|
+
ts: z9.string(),
|
|
863
|
+
stepId: z9.string().optional(),
|
|
864
|
+
type: z9.string()
|
|
865
|
+
}).catchall(z9.any());
|
|
866
|
+
var runHistoryPageSchema = z9.object({
|
|
867
|
+
events: z9.array(runHistoryEventSchema),
|
|
868
|
+
itemCount: z9.number().int().min(0).max(RUN_HISTORY_PAGE_ITEMS),
|
|
429
869
|
olderCursor: runHistoryCursorSchema.optional(),
|
|
430
870
|
newerCursor: runHistoryCursorSchema.optional(),
|
|
431
871
|
liveCursor: runHistoryCursorSchema,
|
|
432
|
-
asOfSeq:
|
|
433
|
-
hasOlder:
|
|
872
|
+
asOfSeq: z9.number().int().nonnegative(),
|
|
873
|
+
hasOlder: z9.boolean()
|
|
434
874
|
});
|
|
435
|
-
var runHistoryContextSchema =
|
|
436
|
-
contextEvents:
|
|
437
|
-
asOfSeq:
|
|
875
|
+
var runHistoryContextSchema = z9.object({
|
|
876
|
+
contextEvents: z9.array(runHistoryEventSchema),
|
|
877
|
+
asOfSeq: z9.number().int().nonnegative()
|
|
438
878
|
});
|
|
439
|
-
var checkoutProgressEventSchema =
|
|
440
|
-
checkoutId:
|
|
441
|
-
name:
|
|
442
|
-
phase:
|
|
443
|
-
line:
|
|
444
|
-
error:
|
|
879
|
+
var checkoutProgressEventSchema = z9.object({
|
|
880
|
+
checkoutId: z9.string().optional(),
|
|
881
|
+
name: z9.string(),
|
|
882
|
+
phase: z9.enum(["cloning", "done", "error"]),
|
|
883
|
+
line: z9.string().optional(),
|
|
884
|
+
error: z9.string().optional()
|
|
445
885
|
});
|
|
446
886
|
|
|
447
887
|
// ../contract/src/ask.ts
|
|
@@ -459,116 +899,29 @@ function pendingHumanAsk(events) {
|
|
|
459
899
|
return pending;
|
|
460
900
|
}
|
|
461
901
|
|
|
462
|
-
// ../contract/src/health.ts
|
|
463
|
-
import { z as z7 } from "zod";
|
|
464
|
-
|
|
465
|
-
// ../contract/src/application-update.ts
|
|
466
|
-
import { z as z6 } from "zod";
|
|
467
|
-
var applicationUpdateStateSchema = z6.object({
|
|
468
|
-
status: z6.enum(["idle", "preparing", "ready", "restarting", "error"]),
|
|
469
|
-
supported: z6.boolean(),
|
|
470
|
-
targetVersion: z6.string().optional(),
|
|
471
|
-
message: z6.string().optional()
|
|
472
|
-
});
|
|
473
|
-
var applicationUpdateInputSchema = z6.record(z6.string(), z6.never());
|
|
474
|
-
var applicationUpdateResponseSchema = z6.object({ state: applicationUpdateStateSchema });
|
|
475
|
-
|
|
476
|
-
// ../contract/src/health.ts
|
|
477
|
-
var runnerSchema = z7.enum(["claude", "codex", "opencode", "pi", "cursor"]);
|
|
478
|
-
var repoInfoSchema = z7.object({
|
|
479
|
-
root: z7.string(),
|
|
480
|
-
branch: z7.string(),
|
|
481
|
-
remote: z7.string().optional()
|
|
482
|
-
});
|
|
483
|
-
var backendCheckSchema = z7.object({
|
|
484
|
-
name: z7.enum(["claude", "codex", "opencode", "pi", "cursor", "gh", "git"]),
|
|
485
|
-
available: z7.boolean(),
|
|
486
|
-
version: z7.string().optional(),
|
|
487
|
-
hint: z7.string().optional()
|
|
488
|
-
});
|
|
489
|
-
var forgeInfoSchema = z7.object({
|
|
490
|
-
kind: z7.literal("github"),
|
|
491
|
-
/**
|
|
492
|
-
* Whether the forge is reachable — **absent until the availability probe has warmed**.
|
|
493
|
-
*
|
|
494
|
-
* Health must never pay a `gh` shell-out, so it serves whatever the cache holds. Absent means
|
|
495
|
-
* "not determined yet", which is not the same as `false`, and the cockpit renders the two
|
|
496
|
-
* differently. Declaring it required is what made an earlier hand-written mirror wrong.
|
|
497
|
-
*/
|
|
498
|
-
available: z7.boolean().optional(),
|
|
499
|
-
reason: z7.string().optional()
|
|
500
|
-
});
|
|
501
|
-
var capabilitiesSchema = z7.object({
|
|
502
|
-
localHandoff: z7.boolean(),
|
|
503
|
-
followups: z7.boolean(),
|
|
504
|
-
singleProject: z7.boolean(),
|
|
505
|
-
/**
|
|
506
|
-
* `true` means `CEZ_AUTOMATIONS=1` opted this server into GitHub automations (#801). Off — the
|
|
507
|
-
* default — the whole feature is absent: no `Automations` nav item anywhere it is rendered, the
|
|
508
|
-
* `/api/v1/…/automations*` family answers `409`, and the workspace scheduler never polls GitHub.
|
|
509
|
-
*
|
|
510
|
-
* REQUIRED for the same reason as `tokenMetrics` below: this server always sends it.
|
|
511
|
-
*/
|
|
512
|
-
automations: z7.boolean(),
|
|
513
|
-
/**
|
|
514
|
-
* `false` means `CEZ_HIDE_TOKEN_METRICS=1` asks the browser to omit token counts and monetary
|
|
515
|
-
* cost (#481). The telemetry itself still rides in run/event payloads — this is presentation
|
|
516
|
-
* only.
|
|
517
|
-
*
|
|
518
|
-
* REQUIRED, because this server always sends it (`capabilities.ts` computes it from the env on
|
|
519
|
-
* every read) and this contract describes THIS server's wire. The DTO it replaces declared it
|
|
520
|
-
* optional so a newer cockpit could read an OLDER server, which is version skew a contract
|
|
521
|
-
* versioned in lockstep with the server cannot model. That tolerance lives where it belongs, in
|
|
522
|
-
* `web/src/lib/token-metrics.ts`, whose `!== false` read still treats an absent field as
|
|
523
|
-
* visible.
|
|
524
|
-
*/
|
|
525
|
-
tokenMetrics: z7.boolean(),
|
|
526
|
-
/** Current token-count presentation policy. Required on current servers;
|
|
527
|
-
* older payload tolerance belongs in the browser resolver. */
|
|
528
|
-
tokenUsageMetrics: z7.boolean(),
|
|
529
|
-
/** Current backend-reported-cost presentation policy. */
|
|
530
|
-
costMetrics: z7.boolean()
|
|
531
|
-
});
|
|
532
|
-
var healthResponseSchema = z7.object({
|
|
533
|
-
version: z7.string(),
|
|
534
|
-
latestVersion: z7.string().optional(),
|
|
535
|
-
repoRoot: z7.string(),
|
|
536
|
-
repo: repoInfoSchema.nullable(),
|
|
537
|
-
checks: z7.array(backendCheckSchema),
|
|
538
|
-
defaultRunner: runnerSchema,
|
|
539
|
-
forge: forgeInfoSchema.nullable(),
|
|
540
|
-
capabilities: capabilitiesSchema,
|
|
541
|
-
// Always sent: `workspaceSummary()` returns both unconditionally, and an unreadable workspace
|
|
542
|
-
// degrades to `projects: []` rather than to an absent key. The hand-written DTO declared them
|
|
543
|
-
// optional, which was wider than the server has ever been.
|
|
544
|
-
projects: z7.array(z7.object({ id: z7.string(), name: z7.string() })),
|
|
545
|
-
bootProject: z7.string(),
|
|
546
|
-
applicationUpdate: applicationUpdateStateSchema.optional()
|
|
547
|
-
});
|
|
548
|
-
|
|
549
902
|
// ../contract/src/ci-wait.ts
|
|
550
|
-
import { z as
|
|
903
|
+
import { z as z10 } from "zod";
|
|
551
904
|
var CI_WAIT_LIMITATION = "Passing reported checks does not prove that every expected workflow has appeared or that the PR is merge-ready. This observation is not merge approval.";
|
|
552
905
|
var CI_WAIT_RECEIPT_INSTRUCTION = "End your turn to wait for CI; no marker is needed. " + CI_WAIT_LIMITATION;
|
|
553
906
|
var prPattern = /^https:\/\/([a-zA-Z0-9](?:[a-zA-Z0-9.-]*[a-zA-Z0-9])?)\/([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_.-]+)\/pull\/([1-9][0-9]*)$/;
|
|
554
|
-
var ciPrUrlSchema =
|
|
907
|
+
var ciPrUrlSchema = z10.string().max(2048).regex(prPattern).refine((value) => {
|
|
555
908
|
const match = prPattern.exec(value);
|
|
556
909
|
return !!match && Number.isSafeInteger(Number(match[4])) && match[3] !== "." && match[3] !== "..";
|
|
557
910
|
}, "Expected an HTTPS GitHub PR URL with a positive integer PR number");
|
|
558
|
-
var ciWaitRequestSchema =
|
|
911
|
+
var ciWaitRequestSchema = z10.object({
|
|
559
912
|
pr: ciPrUrlSchema,
|
|
560
|
-
timeout_seconds:
|
|
913
|
+
timeout_seconds: z10.number().int().min(1).max(7200).default(1800)
|
|
561
914
|
}).strict();
|
|
562
|
-
var sha =
|
|
563
|
-
var ciPrIdentitySchema =
|
|
915
|
+
var sha = z10.string().regex(/^[0-9a-f]{40}$/i);
|
|
916
|
+
var ciPrIdentitySchema = z10.object({
|
|
564
917
|
prUrl: ciPrUrlSchema,
|
|
565
|
-
repository:
|
|
566
|
-
prNumber:
|
|
918
|
+
repository: z10.string().max(2048).regex(/^[a-zA-Z0-9_-]+\/[a-zA-Z0-9_.-]+$/),
|
|
919
|
+
prNumber: z10.number().int().positive().max(Number.MAX_SAFE_INTEGER),
|
|
567
920
|
headSha: sha
|
|
568
921
|
}).strict();
|
|
569
|
-
var ciWaitOutcomeSchema =
|
|
570
|
-
var ciWaitErrorCodeSchema =
|
|
571
|
-
var ciWaitErrorSchema =
|
|
922
|
+
var ciWaitOutcomeSchema = z10.enum(["passed", "failed", "cancelled", "skipped", "no_checks", "head_changed", "deadline", "error"]);
|
|
923
|
+
var ciWaitErrorCodeSchema = z10.enum(["invalid_request", "unsupported_host", "gh_missing", "authentication", "inaccessible_pr", "malformed_data", "output_limit", "query_timeout", "command_failed", "wait_conflict", "capacity", "unavailable", "unauthorized", "persistence"]);
|
|
924
|
+
var ciWaitErrorSchema = z10.object({ code: ciWaitErrorCodeSchema, message: z10.string().max(4096) }).strict();
|
|
572
925
|
function utf8Bytes(value) {
|
|
573
926
|
let bytes = 0;
|
|
574
927
|
for (const char of value) {
|
|
@@ -577,113 +930,113 @@ function utf8Bytes(value) {
|
|
|
577
930
|
}
|
|
578
931
|
return bytes;
|
|
579
932
|
}
|
|
580
|
-
var ciWaitResultSchema =
|
|
933
|
+
var ciWaitResultSchema = z10.object({
|
|
581
934
|
outcome: ciWaitOutcomeSchema,
|
|
582
935
|
headSha: sha,
|
|
583
936
|
observedHeadSha: sha.optional(),
|
|
584
|
-
observedAt:
|
|
585
|
-
checks:
|
|
586
|
-
totalChecks:
|
|
587
|
-
truncated:
|
|
588
|
-
diagnostic:
|
|
937
|
+
observedAt: z10.iso.datetime(),
|
|
938
|
+
checks: z10.array(z10.object({ name: z10.string().max(256), state: z10.string().max(256), link: z10.string().max(2048) }).strict()).max(100),
|
|
939
|
+
totalChecks: z10.number().int().nonnegative(),
|
|
940
|
+
truncated: z10.boolean(),
|
|
941
|
+
diagnostic: z10.string().max(4096).refine((value) => utf8Bytes(value) <= 4096).optional()
|
|
589
942
|
}).strict().refine((value) => utf8Bytes(JSON.stringify(value)) <= 32 * 1024, "CI result exceeds 32 KiB");
|
|
590
943
|
var ciWaitSchema = ciPrIdentitySchema.extend({
|
|
591
|
-
id:
|
|
592
|
-
generation:
|
|
593
|
-
turnId:
|
|
594
|
-
timeoutSeconds:
|
|
595
|
-
registeredAt:
|
|
596
|
-
deadline:
|
|
597
|
-
phase:
|
|
944
|
+
id: z10.uuid(),
|
|
945
|
+
generation: z10.string().min(1).max(256),
|
|
946
|
+
turnId: z10.string().min(1).max(256),
|
|
947
|
+
timeoutSeconds: z10.number().int().min(1).max(7200),
|
|
948
|
+
registeredAt: z10.iso.datetime(),
|
|
949
|
+
deadline: z10.iso.datetime(),
|
|
950
|
+
phase: z10.enum(["registered", "parked", "wake-pending", "delivered", "withdrawn"]),
|
|
598
951
|
result: ciWaitResultSchema.optional(),
|
|
599
|
-
wakeId:
|
|
600
|
-
deliveredAt:
|
|
952
|
+
wakeId: z10.string().min(1).max(256).optional(),
|
|
953
|
+
deliveredAt: z10.iso.datetime().optional()
|
|
601
954
|
}).strict();
|
|
602
955
|
var ciWaitReceiptSchema = ciPrIdentitySchema.extend({
|
|
603
|
-
waitId:
|
|
604
|
-
registeredAt:
|
|
605
|
-
deadline:
|
|
956
|
+
waitId: z10.uuid(),
|
|
957
|
+
registeredAt: z10.iso.datetime(),
|
|
958
|
+
deadline: z10.iso.datetime(),
|
|
606
959
|
phase: ciWaitSchema.shape.phase
|
|
607
960
|
}).strict();
|
|
608
961
|
|
|
609
962
|
// ../contract/src/runs.ts
|
|
610
|
-
import { z as
|
|
963
|
+
import { z as z13 } from "zod";
|
|
611
964
|
|
|
612
965
|
// ../contract/src/github.ts
|
|
613
|
-
import { z as
|
|
614
|
-
var checksGlyphSchema =
|
|
615
|
-
var githubItemSchema =
|
|
616
|
-
kind:
|
|
617
|
-
number:
|
|
618
|
-
title:
|
|
619
|
-
author:
|
|
620
|
-
createdAt:
|
|
621
|
-
labels:
|
|
622
|
-
body:
|
|
623
|
-
url:
|
|
624
|
-
comments:
|
|
966
|
+
import { z as z11 } from "zod";
|
|
967
|
+
var checksGlyphSchema = z11.enum(["passing", "failing", "pending"]).nullable();
|
|
968
|
+
var githubItemSchema = z11.object({
|
|
969
|
+
kind: z11.enum(["issue", "pr"]),
|
|
970
|
+
number: z11.number(),
|
|
971
|
+
title: z11.string(),
|
|
972
|
+
author: z11.string(),
|
|
973
|
+
createdAt: z11.string(),
|
|
974
|
+
labels: z11.array(z11.string()),
|
|
975
|
+
body: z11.string(),
|
|
976
|
+
url: z11.string(),
|
|
977
|
+
comments: z11.number(),
|
|
625
978
|
/** Issues only; absent on older servers. */
|
|
626
|
-
assignees:
|
|
627
|
-
projectIds:
|
|
979
|
+
assignees: z11.array(z11.string()).optional(),
|
|
980
|
+
projectIds: z11.array(z11.string()).optional(),
|
|
628
981
|
/** PRs only. */
|
|
629
|
-
isDraft:
|
|
630
|
-
additions:
|
|
631
|
-
deletions:
|
|
982
|
+
isDraft: z11.boolean().optional(),
|
|
983
|
+
additions: z11.number().optional(),
|
|
984
|
+
deletions: z11.number().optional(),
|
|
632
985
|
checks: checksGlyphSchema.optional()
|
|
633
986
|
});
|
|
634
|
-
var githubProjectSchema =
|
|
635
|
-
id:
|
|
636
|
-
title:
|
|
637
|
-
url:
|
|
987
|
+
var githubProjectSchema = z11.object({
|
|
988
|
+
id: z11.string(),
|
|
989
|
+
title: z11.string(),
|
|
990
|
+
url: z11.string()
|
|
638
991
|
});
|
|
639
|
-
var githubDataSchema =
|
|
640
|
-
available:
|
|
992
|
+
var githubDataSchema = z11.object({
|
|
993
|
+
available: z11.boolean(),
|
|
641
994
|
/** Why it is unavailable (`gh` missing, no remote, offline…). Never an error — a hint. */
|
|
642
|
-
reason:
|
|
995
|
+
reason: z11.string().optional(),
|
|
643
996
|
/** owner/name, when known. */
|
|
644
|
-
repo:
|
|
645
|
-
syncedAt:
|
|
646
|
-
issues:
|
|
647
|
-
prs:
|
|
997
|
+
repo: z11.string().optional(),
|
|
998
|
+
syncedAt: z11.string().optional(),
|
|
999
|
+
issues: z11.array(githubItemSchema),
|
|
1000
|
+
prs: z11.array(githubItemSchema),
|
|
648
1001
|
/** Repo-wide label name → 6-hex color (no `#`); lets chips tint like GitHub. Additive. */
|
|
649
|
-
labelColors:
|
|
650
|
-
viewerLogin:
|
|
1002
|
+
labelColors: z11.record(z11.string(), z11.string()).optional(),
|
|
1003
|
+
viewerLogin: z11.string().optional(),
|
|
651
1004
|
/** Repository-linked Projects v2. Absent when lookup is unavailable; [] means none. */
|
|
652
|
-
projects:
|
|
653
|
-
projectsReason:
|
|
1005
|
+
projects: z11.array(githubProjectSchema).optional(),
|
|
1006
|
+
projectsReason: z11.string().optional()
|
|
654
1007
|
});
|
|
655
|
-
var githubChecksDataSchema =
|
|
656
|
-
|
|
657
|
-
available:
|
|
658
|
-
checks:
|
|
1008
|
+
var githubChecksDataSchema = z11.discriminatedUnion("available", [
|
|
1009
|
+
z11.object({
|
|
1010
|
+
available: z11.literal(true),
|
|
1011
|
+
checks: z11.record(z11.number(), checksGlyphSchema)
|
|
659
1012
|
}),
|
|
660
|
-
|
|
661
|
-
available:
|
|
662
|
-
reason:
|
|
1013
|
+
z11.object({
|
|
1014
|
+
available: z11.literal(false),
|
|
1015
|
+
reason: z11.string()
|
|
663
1016
|
})
|
|
664
1017
|
]);
|
|
665
1018
|
var GITHUB_SEARCH_MAX = 50;
|
|
666
|
-
var githubSearchQuerySchema =
|
|
667
|
-
kind:
|
|
668
|
-
q:
|
|
669
|
-
limit:
|
|
1019
|
+
var githubSearchQuerySchema = z11.object({
|
|
1020
|
+
kind: z11.enum(["issue", "pr"]),
|
|
1021
|
+
q: z11.string().trim().min(1).max(256),
|
|
1022
|
+
limit: z11.coerce.number().int().positive().max(GITHUB_SEARCH_MAX).optional()
|
|
670
1023
|
});
|
|
671
|
-
var githubSearchDataSchema =
|
|
672
|
-
available:
|
|
1024
|
+
var githubSearchDataSchema = z11.object({
|
|
1025
|
+
available: z11.boolean(),
|
|
673
1026
|
/** Membership is unknown when lookup fails; never substitute empty projectIds. */
|
|
674
|
-
projectsReason:
|
|
1027
|
+
projectsReason: z11.string().optional(),
|
|
675
1028
|
/** Why it could not search (`gh` missing, no remote, rate-limited…). A hint, never an error. */
|
|
676
|
-
reason:
|
|
1029
|
+
reason: z11.string().optional(),
|
|
677
1030
|
/** The same rows the list ships. `checks` is always `null` here — hydrated lazily through
|
|
678
1031
|
* `/github/checks`, exactly as list rows have been since #664. */
|
|
679
|
-
items:
|
|
1032
|
+
items: z11.array(githubItemSchema),
|
|
680
1033
|
/** The hit list filled the server's cap; there may be more matches on the forge. */
|
|
681
|
-
truncated:
|
|
1034
|
+
truncated: z11.boolean().optional(),
|
|
682
1035
|
/** Label name → 6-hex color for the labels these hits carry. A closed item often wears labels
|
|
683
1036
|
* no open one does, which the repo-wide map from the list call would not cover. Additive. */
|
|
684
|
-
labelColors:
|
|
1037
|
+
labelColors: z11.record(z11.string(), z11.string()).optional()
|
|
685
1038
|
});
|
|
686
|
-
var referenceStatusSchema =
|
|
1039
|
+
var referenceStatusSchema = z11.enum([
|
|
687
1040
|
"draft",
|
|
688
1041
|
"review-required",
|
|
689
1042
|
"changes-requested",
|
|
@@ -696,13 +1049,13 @@ var referenceStatusSchema = z9.enum([
|
|
|
696
1049
|
"completed",
|
|
697
1050
|
"not-planned"
|
|
698
1051
|
]);
|
|
699
|
-
var recheckAfterMsSchema =
|
|
1052
|
+
var recheckAfterMsSchema = z11.number().nullable();
|
|
700
1053
|
var REFERENCE_STATUS_MAX = 100;
|
|
701
|
-
var githubRefStatusDataSchema =
|
|
702
|
-
|
|
703
|
-
available:
|
|
704
|
-
prs:
|
|
705
|
-
issues:
|
|
1054
|
+
var githubRefStatusDataSchema = z11.discriminatedUnion("available", [
|
|
1055
|
+
z11.object({
|
|
1056
|
+
available: z11.literal(true),
|
|
1057
|
+
prs: z11.record(z11.number(), referenceStatusSchema),
|
|
1058
|
+
issues: z11.record(z11.number(), referenceStatusSchema),
|
|
706
1059
|
/**
|
|
707
1060
|
* The pull request numbers that do NOT merge cleanly into their base right now.
|
|
708
1061
|
*
|
|
@@ -722,28 +1075,28 @@ var githubRefStatusDataSchema = z9.discriminatedUnion("available", [
|
|
|
722
1075
|
* ever named — GitHub reports `UNKNOWN` for merged and closed ones, and `UNKNOWN` (which is
|
|
723
1076
|
* also what it answers while it is still computing) is never listed.
|
|
724
1077
|
*/
|
|
725
|
-
conflicts:
|
|
1078
|
+
conflicts: z11.array(z11.number()).optional(),
|
|
726
1079
|
recheckAfterMs: recheckAfterMsSchema
|
|
727
1080
|
}),
|
|
728
|
-
|
|
729
|
-
available:
|
|
730
|
-
reason:
|
|
1081
|
+
z11.object({
|
|
1082
|
+
available: z11.literal(false),
|
|
1083
|
+
reason: z11.string(),
|
|
731
1084
|
recheckAfterMs: recheckAfterMsSchema
|
|
732
1085
|
})
|
|
733
1086
|
]);
|
|
734
|
-
var githubCommentSchema =
|
|
735
|
-
id:
|
|
1087
|
+
var githubCommentSchema = z11.object({
|
|
1088
|
+
id: z11.number(),
|
|
736
1089
|
/** Author login, `'?'` fallback when gh omits the user. */
|
|
737
|
-
author:
|
|
738
|
-
avatarUrl:
|
|
739
|
-
createdAt:
|
|
740
|
-
body:
|
|
741
|
-
kind:
|
|
1090
|
+
author: z11.string(),
|
|
1091
|
+
avatarUrl: z11.string().optional(),
|
|
1092
|
+
createdAt: z11.string(),
|
|
1093
|
+
body: z11.string(),
|
|
1094
|
+
kind: z11.enum(["comment", "review"]),
|
|
742
1095
|
/** Reviews only — drives the state chip. */
|
|
743
|
-
reviewState:
|
|
744
|
-
url:
|
|
1096
|
+
reviewState: z11.enum(["approved", "changes_requested", "commented", "dismissed"]).optional(),
|
|
1097
|
+
url: z11.string()
|
|
745
1098
|
});
|
|
746
|
-
var githubTimelineEventKindSchema =
|
|
1099
|
+
var githubTimelineEventKindSchema = z11.enum([
|
|
747
1100
|
"committed",
|
|
748
1101
|
"labeled",
|
|
749
1102
|
"unlabeled",
|
|
@@ -756,134 +1109,134 @@ var githubTimelineEventKindSchema = z9.enum([
|
|
|
756
1109
|
"cross-referenced",
|
|
757
1110
|
"renamed"
|
|
758
1111
|
]);
|
|
759
|
-
var githubTimelineEventSchema =
|
|
760
|
-
id:
|
|
1112
|
+
var githubTimelineEventSchema = z11.object({
|
|
1113
|
+
id: z11.string(),
|
|
761
1114
|
kind: githubTimelineEventKindSchema,
|
|
762
1115
|
/** Login — or the git author name for `committed`, which carries no GitHub actor. */
|
|
763
|
-
actor:
|
|
1116
|
+
actor: z11.string(),
|
|
764
1117
|
/** Absent for `committed`. */
|
|
765
|
-
avatarUrl:
|
|
766
|
-
createdAt:
|
|
767
|
-
url:
|
|
1118
|
+
avatarUrl: z11.string().optional(),
|
|
1119
|
+
createdAt: z11.string(),
|
|
1120
|
+
url: z11.string().optional(),
|
|
768
1121
|
/** `committed` — full 40-char SHA. */
|
|
769
|
-
sha:
|
|
1122
|
+
sha: z11.string().optional(),
|
|
770
1123
|
/** `committed` — first line, capped at 120 chars. */
|
|
771
|
-
message:
|
|
1124
|
+
message: z11.string().optional(),
|
|
772
1125
|
/** `committed` — **absent** (lookup failed/skipped) and **`null`** (no CI configured) both
|
|
773
1126
|
* render no glyph, but stay distinct values. */
|
|
774
1127
|
checks: checksGlyphSchema.optional(),
|
|
775
|
-
label:
|
|
1128
|
+
label: z11.object({ name: z11.string(), color: z11.string().optional() }).optional(),
|
|
776
1129
|
/** `assigned`/`unassigned` login, or the new title for `renamed`. */
|
|
777
|
-
subject:
|
|
778
|
-
refNumber:
|
|
779
|
-
refTitle:
|
|
780
|
-
refIsPr:
|
|
781
|
-
});
|
|
782
|
-
var githubCommentsDataSchema =
|
|
783
|
-
available:
|
|
784
|
-
reason:
|
|
1130
|
+
subject: z11.string().optional(),
|
|
1131
|
+
refNumber: z11.number().optional(),
|
|
1132
|
+
refTitle: z11.string().optional(),
|
|
1133
|
+
refIsPr: z11.boolean().optional()
|
|
1134
|
+
});
|
|
1135
|
+
var githubCommentsDataSchema = z11.object({
|
|
1136
|
+
available: z11.boolean(),
|
|
1137
|
+
reason: z11.string().optional(),
|
|
785
1138
|
/** Chronological, oldest first. */
|
|
786
|
-
comments:
|
|
1139
|
+
comments: z11.array(githubCommentSchema),
|
|
787
1140
|
/** True when either stream hit its cap, or the timeline fetch stopped short. */
|
|
788
|
-
truncated:
|
|
1141
|
+
truncated: z11.boolean().optional(),
|
|
789
1142
|
/** Timeline events (#525) — additive; absent when the server degraded to the legacy
|
|
790
1143
|
* comments-only fetch. Capped independently of `comments`. */
|
|
791
|
-
events:
|
|
1144
|
+
events: z11.array(githubTimelineEventSchema).optional()
|
|
792
1145
|
});
|
|
793
|
-
var githubMergeMethodSchema =
|
|
794
|
-
var githubPrCheckSchema =
|
|
795
|
-
name:
|
|
796
|
-
state:
|
|
797
|
-
required:
|
|
798
|
-
url:
|
|
799
|
-
});
|
|
800
|
-
var githubPrMergeStateSchema =
|
|
801
|
-
number:
|
|
802
|
-
title:
|
|
803
|
-
url:
|
|
804
|
-
state:
|
|
805
|
-
isDraft:
|
|
806
|
-
headRef:
|
|
807
|
-
baseRef:
|
|
808
|
-
headSha:
|
|
809
|
-
mergeable:
|
|
810
|
-
reviewDecision:
|
|
811
|
-
checks:
|
|
812
|
-
methods:
|
|
1146
|
+
var githubMergeMethodSchema = z11.enum(["merge", "squash", "rebase"]);
|
|
1147
|
+
var githubPrCheckSchema = z11.object({
|
|
1148
|
+
name: z11.string(),
|
|
1149
|
+
state: z11.enum(["passing", "failing", "pending", "unknown"]),
|
|
1150
|
+
required: z11.boolean().nullable(),
|
|
1151
|
+
url: z11.string().optional()
|
|
1152
|
+
});
|
|
1153
|
+
var githubPrMergeStateSchema = z11.object({
|
|
1154
|
+
number: z11.number(),
|
|
1155
|
+
title: z11.string(),
|
|
1156
|
+
url: z11.string(),
|
|
1157
|
+
state: z11.enum(["open", "closed", "merged"]),
|
|
1158
|
+
isDraft: z11.boolean(),
|
|
1159
|
+
headRef: z11.string(),
|
|
1160
|
+
baseRef: z11.string(),
|
|
1161
|
+
headSha: z11.string(),
|
|
1162
|
+
mergeable: z11.enum(["mergeable", "conflicting", "unknown"]),
|
|
1163
|
+
reviewDecision: z11.enum(["approved", "changes-requested", "review-required", "unknown"]),
|
|
1164
|
+
checks: z11.array(githubPrCheckSchema),
|
|
1165
|
+
methods: z11.array(githubMergeMethodSchema),
|
|
813
1166
|
defaultMethod: githubMergeMethodSchema.nullable(),
|
|
814
|
-
eligibility:
|
|
815
|
-
blockers:
|
|
816
|
-
canMerge:
|
|
817
|
-
canOverride:
|
|
818
|
-
});
|
|
819
|
-
var githubPrMergeStateResponseSchema =
|
|
820
|
-
|
|
821
|
-
|
|
1167
|
+
eligibility: z11.enum(["ready", "blocked", "pending", "unauthorized", "terminal", "unknown"]),
|
|
1168
|
+
blockers: z11.array(z11.object({ code: z11.string(), message: z11.string() })),
|
|
1169
|
+
canMerge: z11.boolean(),
|
|
1170
|
+
canOverride: z11.boolean()
|
|
1171
|
+
});
|
|
1172
|
+
var githubPrMergeStateResponseSchema = z11.discriminatedUnion("available", [
|
|
1173
|
+
z11.object({ available: z11.literal(true), mergeState: githubPrMergeStateSchema }),
|
|
1174
|
+
z11.object({ available: z11.literal(false), reason: z11.string() })
|
|
822
1175
|
]);
|
|
823
|
-
var githubMergeResponseSchema =
|
|
824
|
-
merged:
|
|
825
|
-
number:
|
|
826
|
-
url:
|
|
1176
|
+
var githubMergeResponseSchema = z11.object({
|
|
1177
|
+
merged: z11.literal(true),
|
|
1178
|
+
number: z11.number(),
|
|
1179
|
+
url: z11.string(),
|
|
827
1180
|
method: githubMergeMethodSchema,
|
|
828
|
-
mergeCommitSha:
|
|
829
|
-
});
|
|
830
|
-
var githubPrChangeSchema =
|
|
831
|
-
path:
|
|
832
|
-
previousPath:
|
|
833
|
-
status:
|
|
834
|
-
additions:
|
|
835
|
-
deletions:
|
|
836
|
-
patch:
|
|
837
|
-
patchUnavailableReason:
|
|
838
|
-
truncated:
|
|
839
|
-
});
|
|
840
|
-
var githubPrChangesDataSchema =
|
|
841
|
-
|
|
842
|
-
available:
|
|
843
|
-
number:
|
|
844
|
-
headSha:
|
|
845
|
-
files:
|
|
846
|
-
additions:
|
|
847
|
-
deletions:
|
|
848
|
-
truncated:
|
|
1181
|
+
mergeCommitSha: z11.string().optional()
|
|
1182
|
+
});
|
|
1183
|
+
var githubPrChangeSchema = z11.object({
|
|
1184
|
+
path: z11.string(),
|
|
1185
|
+
previousPath: z11.string().optional(),
|
|
1186
|
+
status: z11.enum(["added", "modified", "removed", "renamed", "copied", "changed"]),
|
|
1187
|
+
additions: z11.number(),
|
|
1188
|
+
deletions: z11.number(),
|
|
1189
|
+
patch: z11.string().optional(),
|
|
1190
|
+
patchUnavailableReason: z11.enum(["binary", "too-large", "not-provided"]).optional(),
|
|
1191
|
+
truncated: z11.boolean().optional()
|
|
1192
|
+
});
|
|
1193
|
+
var githubPrChangesDataSchema = z11.discriminatedUnion("available", [
|
|
1194
|
+
z11.object({
|
|
1195
|
+
available: z11.literal(true),
|
|
1196
|
+
number: z11.number(),
|
|
1197
|
+
headSha: z11.string(),
|
|
1198
|
+
files: z11.array(githubPrChangeSchema),
|
|
1199
|
+
additions: z11.number(),
|
|
1200
|
+
deletions: z11.number(),
|
|
1201
|
+
truncated: z11.boolean(),
|
|
849
1202
|
/** Present when the payload is complete but partial in some other way (a capped patch). */
|
|
850
|
-
reason:
|
|
1203
|
+
reason: z11.string().optional()
|
|
851
1204
|
}),
|
|
852
|
-
|
|
1205
|
+
z11.object({ available: z11.literal(false), reason: z11.string() })
|
|
853
1206
|
]);
|
|
854
1207
|
|
|
855
1208
|
// ../contract/src/workflows.ts
|
|
856
|
-
import { z as
|
|
857
|
-
var workflowStepDefSchema =
|
|
858
|
-
id:
|
|
859
|
-
name:
|
|
1209
|
+
import { z as z12 } from "zod";
|
|
1210
|
+
var workflowStepDefSchema = z12.object({
|
|
1211
|
+
id: z12.string().min(1),
|
|
1212
|
+
name: z12.string().optional(),
|
|
860
1213
|
// agent step
|
|
861
|
-
prompt:
|
|
862
|
-
skill:
|
|
863
|
-
model:
|
|
864
|
-
effort:
|
|
1214
|
+
prompt: z12.string().optional(),
|
|
1215
|
+
skill: z12.string().optional(),
|
|
1216
|
+
model: z12.string().optional(),
|
|
1217
|
+
effort: z12.string().max(32).optional(),
|
|
865
1218
|
/** Per-step agent backend override (falls back to the task / config default). */
|
|
866
1219
|
runner: runnerSchema.optional(),
|
|
867
1220
|
/** Agent account id for this step (spec 2026-07-29-agent-profiles); resolved per step for owned workers (#452). */
|
|
868
|
-
agentProfile:
|
|
869
|
-
allowedTools:
|
|
870
|
-
bashAllowlist:
|
|
1221
|
+
agentProfile: z12.string().min(1).max(64).optional(),
|
|
1222
|
+
allowedTools: z12.array(z12.string()).optional(),
|
|
1223
|
+
bashAllowlist: z12.array(z12.string()).optional(),
|
|
871
1224
|
// check step
|
|
872
|
-
command:
|
|
873
|
-
onFail:
|
|
874
|
-
retry:
|
|
875
|
-
max:
|
|
1225
|
+
command: z12.string().optional(),
|
|
1226
|
+
onFail: z12.object({
|
|
1227
|
+
retry: z12.string().min(1),
|
|
1228
|
+
max: z12.number().int().positive().default(2)
|
|
876
1229
|
}).optional()
|
|
877
1230
|
}).refine((s) => Boolean(s.command) !== Boolean(s.prompt ?? s.skill), {
|
|
878
1231
|
message: "a step is either an agent step (prompt/skill) or a check step (command), not both"
|
|
879
1232
|
});
|
|
880
|
-
var workflowDefSchema =
|
|
881
|
-
name:
|
|
882
|
-
description:
|
|
883
|
-
steps:
|
|
884
|
-
source:
|
|
1233
|
+
var workflowDefSchema = z12.object({
|
|
1234
|
+
name: z12.string(),
|
|
1235
|
+
description: z12.string().optional(),
|
|
1236
|
+
steps: z12.array(workflowStepDefSchema),
|
|
1237
|
+
source: z12.enum(["built-in", "file"]),
|
|
885
1238
|
/** Absent on built-ins — which is exactly what makes them undeletable. */
|
|
886
|
-
path:
|
|
1239
|
+
path: z12.string().optional()
|
|
887
1240
|
});
|
|
888
1241
|
function providersRequiredByWorkflow(workflow, fallback) {
|
|
889
1242
|
const required = /* @__PURE__ */ new Set();
|
|
@@ -892,46 +1245,46 @@ function providersRequiredByWorkflow(workflow, fallback) {
|
|
|
892
1245
|
}
|
|
893
1246
|
return runnerSchema.options.filter((provider) => required.has(provider));
|
|
894
1247
|
}
|
|
895
|
-
var workflowLoadIssueSchema =
|
|
896
|
-
path:
|
|
897
|
-
message:
|
|
898
|
-
});
|
|
899
|
-
var workflowsResponseSchema =
|
|
900
|
-
workflows:
|
|
901
|
-
issues:
|
|
902
|
-
});
|
|
903
|
-
var saveWorkflowInputSchema =
|
|
904
|
-
name:
|
|
905
|
-
description:
|
|
906
|
-
steps:
|
|
907
|
-
skills:
|
|
908
|
-
overwrite:
|
|
1248
|
+
var workflowLoadIssueSchema = z12.object({
|
|
1249
|
+
path: z12.string(),
|
|
1250
|
+
message: z12.string()
|
|
1251
|
+
});
|
|
1252
|
+
var workflowsResponseSchema = z12.object({
|
|
1253
|
+
workflows: z12.array(workflowDefSchema),
|
|
1254
|
+
issues: z12.array(workflowLoadIssueSchema)
|
|
1255
|
+
});
|
|
1256
|
+
var saveWorkflowInputSchema = z12.object({
|
|
1257
|
+
name: z12.string().trim().min(1).max(80),
|
|
1258
|
+
description: z12.string().max(2e3, "must be at most 2000 characters").optional(),
|
|
1259
|
+
steps: z12.array(workflowStepDefSchema).min(1).max(8).optional(),
|
|
1260
|
+
skills: z12.array(z12.string().trim().min(1)).min(1).max(8).optional(),
|
|
1261
|
+
overwrite: z12.boolean().optional()
|
|
909
1262
|
}).refine((b) => Boolean(b.steps) !== Boolean(b.skills), {
|
|
910
1263
|
message: 'provide either "steps" or "skills", not both'
|
|
911
1264
|
});
|
|
912
|
-
var saveWorkflowResponseSchema =
|
|
913
|
-
path:
|
|
914
|
-
name:
|
|
1265
|
+
var saveWorkflowResponseSchema = z12.object({
|
|
1266
|
+
path: z12.string(),
|
|
1267
|
+
name: z12.string()
|
|
915
1268
|
});
|
|
916
|
-
var parsedWorkflowSchema =
|
|
917
|
-
name:
|
|
918
|
-
description:
|
|
919
|
-
steps:
|
|
1269
|
+
var parsedWorkflowSchema = z12.object({
|
|
1270
|
+
name: z12.string(),
|
|
1271
|
+
description: z12.string().optional(),
|
|
1272
|
+
steps: z12.array(workflowStepDefSchema)
|
|
920
1273
|
});
|
|
921
|
-
var deleteWorkflowResponseSchema =
|
|
922
|
-
ok:
|
|
923
|
-
path:
|
|
1274
|
+
var deleteWorkflowResponseSchema = z12.object({
|
|
1275
|
+
ok: z12.literal(true),
|
|
1276
|
+
path: z12.string()
|
|
924
1277
|
});
|
|
925
|
-
var planResponseSchema =
|
|
1278
|
+
var planResponseSchema = z12.object({
|
|
926
1279
|
/** The kebab-case workflow title the planner proposed. Absent on the degraded fallback. */
|
|
927
|
-
name:
|
|
928
|
-
steps:
|
|
929
|
-
rationale:
|
|
930
|
-
fallback:
|
|
1280
|
+
name: z12.string().optional(),
|
|
1281
|
+
steps: z12.array(workflowStepDefSchema),
|
|
1282
|
+
rationale: z12.string(),
|
|
1283
|
+
fallback: z12.boolean()
|
|
931
1284
|
});
|
|
932
1285
|
|
|
933
1286
|
// ../contract/src/runs.ts
|
|
934
|
-
var runStatusSchema =
|
|
1287
|
+
var runStatusSchema = z13.enum([
|
|
935
1288
|
"queued",
|
|
936
1289
|
"running",
|
|
937
1290
|
"waiting",
|
|
@@ -940,8 +1293,8 @@ var runStatusSchema = z11.enum([
|
|
|
940
1293
|
"failed",
|
|
941
1294
|
"cancelled"
|
|
942
1295
|
]);
|
|
943
|
-
var runActivitySchema =
|
|
944
|
-
var stepStatusSchema =
|
|
1296
|
+
var runActivitySchema = z13.enum(["monitoring"]);
|
|
1297
|
+
var stepStatusSchema = z13.enum([
|
|
945
1298
|
"pending",
|
|
946
1299
|
"running",
|
|
947
1300
|
"waiting",
|
|
@@ -951,16 +1304,16 @@ var stepStatusSchema = z11.enum([
|
|
|
951
1304
|
"cancelled",
|
|
952
1305
|
"skipped"
|
|
953
1306
|
]);
|
|
954
|
-
var usageCounterSchema =
|
|
955
|
-
var stepStateSchema =
|
|
956
|
-
id:
|
|
957
|
-
name:
|
|
958
|
-
kind:
|
|
1307
|
+
var usageCounterSchema = z13.number().finite().nonnegative();
|
|
1308
|
+
var stepStateSchema = z13.object({
|
|
1309
|
+
id: z13.string(),
|
|
1310
|
+
name: z13.string(),
|
|
1311
|
+
kind: z13.enum(["agent", "check"]),
|
|
959
1312
|
status: stepStatusSchema,
|
|
960
|
-
iterations:
|
|
1313
|
+
iterations: z13.number(),
|
|
961
1314
|
/** Durable count of onFail retry loops consumed by this check. */
|
|
962
|
-
retriesUsed:
|
|
963
|
-
tokensUsed:
|
|
1315
|
+
retriesUsed: z13.number().int().nonnegative().optional(),
|
|
1316
|
+
tokensUsed: z13.number(),
|
|
964
1317
|
inputTokens: usageCounterSchema.optional(),
|
|
965
1318
|
outputTokens: usageCounterSchema.optional(),
|
|
966
1319
|
usageInvocationsStarted: usageCounterSchema.optional(),
|
|
@@ -968,99 +1321,103 @@ var stepStateSchema = z11.object({
|
|
|
968
1321
|
usageTurnsStarted: usageCounterSchema.optional(),
|
|
969
1322
|
usageTurnsRecorded: usageCounterSchema.optional(),
|
|
970
1323
|
usageInvocationEpoch: usageCounterSchema.optional(),
|
|
971
|
-
startedAt:
|
|
972
|
-
finishedAt:
|
|
973
|
-
error:
|
|
1324
|
+
startedAt: z13.string().optional(),
|
|
1325
|
+
finishedAt: z13.string().optional(),
|
|
1326
|
+
error: z13.string().optional(),
|
|
974
1327
|
/** Latest agent session id — `claude --resume <id>` and friends. */
|
|
975
|
-
sessionId:
|
|
1328
|
+
sessionId: z13.string().optional(),
|
|
976
1329
|
/** Backend that owns `sessionId`; absent on records written before backend affinity. */
|
|
977
1330
|
backend: runnerSchema.optional(),
|
|
978
1331
|
/** Agent account (spec 2026-07-29-agent-profiles) that owns `sessionId` — `default`, or a
|
|
979
1332
|
* stored profile id. The two are a PAIR: a session id only resolves inside the config dir
|
|
980
1333
|
* that created it, so resume and Continue read this rather than the project's current
|
|
981
1334
|
* selection. Absent on records written before accounts existed. */
|
|
982
|
-
profileId:
|
|
983
|
-
costUsd:
|
|
1335
|
+
profileId: z13.string().optional(),
|
|
1336
|
+
costUsd: z13.number().optional(),
|
|
984
1337
|
/** Explicit provenance for engine-generated continuation steps. */
|
|
985
|
-
synthetic:
|
|
1338
|
+
synthetic: z13.literal("continuation").optional()
|
|
986
1339
|
});
|
|
987
|
-
var diffStatSchema =
|
|
988
|
-
adds:
|
|
989
|
-
dels:
|
|
990
|
-
files:
|
|
1340
|
+
var diffStatSchema = z13.object({
|
|
1341
|
+
adds: z13.number(),
|
|
1342
|
+
dels: z13.number(),
|
|
1343
|
+
files: z13.number(),
|
|
991
1344
|
/** Additive since #751, and present ONLY when true: the numbers were measured against a
|
|
992
1345
|
* branch the agent checked out into the task's worktree, as the run found it, because the
|
|
993
1346
|
* worktree's HEAD had been repointed off the task's own branch (every review/QA run does
|
|
994
1347
|
* this) and the merge-base anchor would otherwise have reported that branch's entire diff
|
|
995
1348
|
* as this task's. Absent on every normal run and on every record written before #751 — a
|
|
996
1349
|
* consumer that ignores it sees exactly the old shape. */
|
|
997
|
-
repointed:
|
|
1350
|
+
repointed: z13.boolean().optional()
|
|
998
1351
|
});
|
|
999
|
-
var queuedMessageSchema =
|
|
1000
|
-
id:
|
|
1001
|
-
text:
|
|
1352
|
+
var queuedMessageSchema = z13.object({
|
|
1353
|
+
id: z13.string(),
|
|
1354
|
+
text: z13.string(),
|
|
1002
1355
|
/** `/api/v1/runs/:id/images/…` URLs — attachments are persisted, never inlined. Images and
|
|
1003
1356
|
* files share this one list; read `isImageAttachmentName` on the file name to tell them apart. */
|
|
1004
|
-
images:
|
|
1005
|
-
createdAt:
|
|
1357
|
+
images: z13.array(z13.string()).optional(),
|
|
1358
|
+
createdAt: z13.string()
|
|
1006
1359
|
});
|
|
1007
1360
|
var continuationMessageSchema = queuedMessageSchema.extend({
|
|
1008
|
-
origin:
|
|
1361
|
+
origin: z13.enum(["human", "lifecycle"]).optional(),
|
|
1009
1362
|
/** An attributed parent message used as the opening prompt, never a human answer. */
|
|
1010
|
-
agentInputId:
|
|
1363
|
+
agentInputId: z13.uuid().optional()
|
|
1011
1364
|
});
|
|
1012
|
-
var processUsageSchema =
|
|
1365
|
+
var processUsageSchema = z13.object({
|
|
1013
1366
|
/** Sum of `%cpu` across the tree — can exceed 100 on multi-core work. */
|
|
1014
|
-
cpuPct:
|
|
1015
|
-
rssBytes:
|
|
1016
|
-
procCount:
|
|
1367
|
+
cpuPct: z13.number(),
|
|
1368
|
+
rssBytes: z13.number(),
|
|
1369
|
+
procCount: z13.number()
|
|
1017
1370
|
});
|
|
1018
|
-
var
|
|
1019
|
-
|
|
1020
|
-
|
|
1371
|
+
var runWebhookOutcomeSchema = z13.object({
|
|
1372
|
+
lastDeliveredAt: z13.string().optional(),
|
|
1373
|
+
lastError: z13.string().max(512).optional()
|
|
1374
|
+
});
|
|
1375
|
+
var runRecordSchema = z13.object({
|
|
1376
|
+
id: z13.string(),
|
|
1377
|
+
title: z13.string(),
|
|
1021
1378
|
/** Display title (#389): auto-derived from the first agent turn, or the user's inline edit
|
|
1022
1379
|
* (`PATCH /runs/:id` sets it together with `title`). Show `titleSummary ?? title`. */
|
|
1023
|
-
titleSummary:
|
|
1380
|
+
titleSummary: z13.string().optional(),
|
|
1024
1381
|
/** Refreshed on every turn-end; absent until the first turn ends (and on worktree-less runs). */
|
|
1025
1382
|
diffStat: diffStatSchema.optional(),
|
|
1026
|
-
workflow:
|
|
1027
|
-
task:
|
|
1383
|
+
workflow: z13.string(),
|
|
1384
|
+
task: z13.string(),
|
|
1028
1385
|
/** Prompt messages stacked onto the run while it waited for a free agent slot (#472). Folded
|
|
1029
1386
|
* into the prompt at dequeue — never delivered as their own turns. Absent on pre-#472 runs. */
|
|
1030
|
-
queuedMessages:
|
|
1387
|
+
queuedMessages: z13.array(queuedMessageSchema).optional(),
|
|
1031
1388
|
/** Stop was accepted; execution termination is still pending. */
|
|
1032
|
-
stopping:
|
|
1389
|
+
stopping: z13.boolean().optional(),
|
|
1033
1390
|
/** Opening Continue message, retained until its first completed turn for crash recovery. */
|
|
1034
1391
|
continuationMessage: continuationMessageSchema.optional(),
|
|
1035
1392
|
/** The last turn carried a malformed explicit structured question. */
|
|
1036
|
-
invalidAsk:
|
|
1393
|
+
invalidAsk: z13.boolean().optional(),
|
|
1037
1394
|
/** Owned-run authority; absence is legacy, invalid is explicitly quarantined. */
|
|
1038
1395
|
delegation: delegationStateSchema.optional(),
|
|
1039
1396
|
/** Durable non-human input, kept separate from human prompt/answer queues. */
|
|
1040
|
-
agentInputs:
|
|
1397
|
+
agentInputs: z13.array(agentInputSchema).optional(),
|
|
1041
1398
|
ciWait: ciWaitSchema.optional(),
|
|
1042
1399
|
lastCiWait: ciWaitSchema.optional(),
|
|
1043
1400
|
/** Retained recovery observation when previous CI metadata cannot be trusted. */
|
|
1044
|
-
lastCiWaitError:
|
|
1401
|
+
lastCiWaitError: z13.string().max(256).optional(),
|
|
1045
1402
|
/** URLs of images and document attachments on the initial task prompt; branch on isImageAttachmentName. */
|
|
1046
|
-
taskImages:
|
|
1047
|
-
model:
|
|
1403
|
+
taskImages: z13.array(z13.string()).optional(),
|
|
1404
|
+
model: z13.string().optional(),
|
|
1048
1405
|
/** Reasoning-effort pin (#45). Canonical `low`/`medium`/`high`/`xhigh`/`max`.
|
|
1049
1406
|
* Absent = harness default. Additive: pre-#45 records omit it and still parse. */
|
|
1050
|
-
effort:
|
|
1407
|
+
effort: z13.string().max(32).optional(),
|
|
1051
1408
|
/** Normalized provider/model identity used for attribution and reproducible replay. */
|
|
1052
|
-
modelIdentity:
|
|
1409
|
+
modelIdentity: z13.string().optional(),
|
|
1053
1410
|
runner: runnerSchema.optional(),
|
|
1054
1411
|
/** The composer's per-task agent account (spec 2026-07-29-agent-profiles), applying to steps
|
|
1055
1412
|
* on `runner`. Absent = the run follows the project's own selection. */
|
|
1056
|
-
agentProfile:
|
|
1413
|
+
agentProfile: z13.string().optional(),
|
|
1057
1414
|
/** Echo of the extra system prompt the run used (POST override or config default). */
|
|
1058
|
-
systemPrompt:
|
|
1415
|
+
systemPrompt: z13.string().optional(),
|
|
1059
1416
|
/** false when the run deliberately disabled follow-up todo generation. Absent means enabled. */
|
|
1060
|
-
generateFollowups:
|
|
1417
|
+
generateFollowups: z13.boolean().optional(),
|
|
1061
1418
|
/** Autonomous mode (#autonomous): the run never parks at `waiting` or the terminal `review`
|
|
1062
1419
|
* gate. Absent = falsy = not autonomous. */
|
|
1063
|
-
autonomous:
|
|
1420
|
+
autonomous: z13.boolean().optional(),
|
|
1064
1421
|
/**
|
|
1065
1422
|
* Provenance for a task a project GitHub automation launched (#694). Absent on every ordinary
|
|
1066
1423
|
* run, which is what makes it additive — the cockpit shows the "from automation" link only when
|
|
@@ -1070,101 +1427,107 @@ var runRecordSchema = z11.object({
|
|
|
1070
1427
|
* launching definition matched, recorded on the run for the audit trail, and `src/runs/store.ts`
|
|
1071
1428
|
* persists it as free text so an older cezar can still read a record written by a newer one.
|
|
1072
1429
|
*/
|
|
1073
|
-
automation:
|
|
1074
|
-
automationId:
|
|
1075
|
-
automationRevision:
|
|
1076
|
-
receiptId:
|
|
1077
|
-
event:
|
|
1078
|
-
githubUrl:
|
|
1430
|
+
automation: z13.object({
|
|
1431
|
+
automationId: z13.string(),
|
|
1432
|
+
automationRevision: z13.number(),
|
|
1433
|
+
receiptId: z13.string(),
|
|
1434
|
+
event: z13.string(),
|
|
1435
|
+
githubUrl: z13.string()
|
|
1079
1436
|
}).optional(),
|
|
1437
|
+
/** Task webhook opt-in (#589): the project's webhook receives this run's status changes.
|
|
1438
|
+
* Absent = off. Changes after start through `POST /runs/:id/notify`, which is why it is not
|
|
1439
|
+
* part of the idempotent-start hash. */
|
|
1440
|
+
notify: z13.boolean().optional(),
|
|
1441
|
+
/** The last webhook delivery's outcome (#589). Absent until a delivery was attempted. */
|
|
1442
|
+
webhook: runWebhookOutcomeSchema.optional(),
|
|
1080
1443
|
status: runStatusSchema,
|
|
1081
1444
|
/** `monitoring` while `status === 'running'` and the agent is working on downstream work.
|
|
1082
1445
|
* Absent on old runs; cleared on resume/end. */
|
|
1083
1446
|
activity: runActivitySchema.optional(),
|
|
1084
1447
|
/** Derived from valid human questions and matching delivery receipts in durable history.
|
|
1085
1448
|
* List attention only; never authorization to deliver an answer or wake a worker. */
|
|
1086
|
-
hasPendingHumanAsk:
|
|
1449
|
+
hasPendingHumanAsk: z13.boolean().optional(),
|
|
1087
1450
|
/** Exact ISO-8601 deadline for the next automatic monitoring check. */
|
|
1088
|
-
monitoringWakeAt:
|
|
1451
|
+
monitoringWakeAt: z13.string().optional(),
|
|
1089
1452
|
/** The current live monitoring epoch exhausted its 40 automatic checks. */
|
|
1090
|
-
monitoringWakeCapReached:
|
|
1453
|
+
monitoringWakeCapReached: z13.boolean().optional(),
|
|
1091
1454
|
/** Exact ISO-8601 instant this run resumes itself after a provider usage limit stopped it
|
|
1092
1455
|
* (spec 2026-08-03-auto-resume-after-usage-limit). Present only on a `failed` run with a
|
|
1093
1456
|
* pending automatic resume — its absence is what "no resume is scheduled" looks like. */
|
|
1094
|
-
autoResumeAt:
|
|
1457
|
+
autoResumeAt: z13.string().optional(),
|
|
1095
1458
|
/** Consecutive automatic resumes since the last human turn, against the safety cap. */
|
|
1096
|
-
autoResumeAttempts:
|
|
1097
|
-
createdAt:
|
|
1098
|
-
startedAt:
|
|
1099
|
-
finishedAt:
|
|
1100
|
-
tokensUsed:
|
|
1459
|
+
autoResumeAttempts: z13.number().optional(),
|
|
1460
|
+
createdAt: z13.string(),
|
|
1461
|
+
startedAt: z13.string().optional(),
|
|
1462
|
+
finishedAt: z13.string().optional(),
|
|
1463
|
+
tokensUsed: z13.number(),
|
|
1101
1464
|
inputTokens: usageCounterSchema.optional(),
|
|
1102
1465
|
outputTokens: usageCounterSchema.optional(),
|
|
1103
|
-
costUsd:
|
|
1104
|
-
pullRequestUrl:
|
|
1466
|
+
costUsd: z13.number().optional(),
|
|
1467
|
+
pullRequestUrl: z13.string().optional(),
|
|
1105
1468
|
/** The PR this task is ABOUT (#407) — auto-discovered from conversation references. Display
|
|
1106
1469
|
* tier only: `pullRequestUrl` (the PR this task CREATED) wins, and the action gates ignore it. */
|
|
1107
|
-
referencedPullRequestUrl:
|
|
1470
|
+
referencedPullRequestUrl: z13.string().optional(),
|
|
1108
1471
|
/** The PR/issue number this task is ABOUT (task auto-naming spec) — display tier only. */
|
|
1109
|
-
prNumber:
|
|
1110
|
-
issueNumber:
|
|
1472
|
+
prNumber: z13.number().optional(),
|
|
1473
|
+
issueNumber: z13.number().optional(),
|
|
1111
1474
|
/** Server-side provenance: referenced-issue discovery currently owns `issueNumber`. */
|
|
1112
|
-
referencedIssueNumberSeeded:
|
|
1475
|
+
referencedIssueNumberSeeded: z13.boolean().optional(),
|
|
1113
1476
|
/** 'user' = renamed via PATCH, never auto-overwritten; 'marker' = agent-declared via
|
|
1114
1477
|
* CEZ:TITLE (spec 2026-07-18-task-ref-markers); 'auto' = namer-owned. */
|
|
1115
|
-
titleOrigin:
|
|
1478
|
+
titleOrigin: z13.enum(["user", "auto", "marker"]).optional(),
|
|
1116
1479
|
/** References the agent declared via CEZ:PR/CEZ:ISSUE markers — authoritative over the namer
|
|
1117
1480
|
* for the matching kind. */
|
|
1118
|
-
markerRefs:
|
|
1481
|
+
markerRefs: z13.object({ pr: z13.number().optional(), issue: z13.number().optional() }).optional(),
|
|
1119
1482
|
/** The referenced tier's working set (distinct PR URLs spotted, capped server-side). */
|
|
1120
|
-
referencedPrCandidates:
|
|
1483
|
+
referencedPrCandidates: z13.array(z13.string()).optional(),
|
|
1121
1484
|
/** The issue this task is ABOUT (spec 2026-07-21-report-ref-discovery). Display-only. */
|
|
1122
|
-
referencedIssueUrl:
|
|
1485
|
+
referencedIssueUrl: z13.string().optional(),
|
|
1123
1486
|
/** The referenced-issue working set, persisted like `referencedPrCandidates`. Capped. */
|
|
1124
|
-
referencedIssueCandidates:
|
|
1487
|
+
referencedIssueCandidates: z13.array(z13.string()).optional(),
|
|
1125
1488
|
/** Explicit execution policy. `false` means the run intentionally uses the repo root;
|
|
1126
1489
|
* absent on older runs and for the default isolated-worktree mode. */
|
|
1127
|
-
worktree:
|
|
1490
|
+
worktree: z13.literal(false).optional(),
|
|
1128
1491
|
/** Absent for in-place runs and after an isolated worktree is removed. */
|
|
1129
|
-
worktreePath:
|
|
1130
|
-
branch:
|
|
1492
|
+
worktreePath: z13.string().optional(),
|
|
1493
|
+
branch: z13.string().optional(),
|
|
1131
1494
|
/** Stable baseline for session git views: a worktree's fork ref, or an in-place run's starting commit. */
|
|
1132
|
-
baseBranch:
|
|
1495
|
+
baseBranch: z13.string().optional(),
|
|
1133
1496
|
/** Set when count-based retention (#483) reclaimed the worktree DIRECTORY (the branch is
|
|
1134
1497
|
* kept): the dir is gone but recoverable. */
|
|
1135
|
-
worktreeReclaimedAt:
|
|
1498
|
+
worktreeReclaimedAt: z13.string().optional(),
|
|
1136
1499
|
/** Parallel variants (spec 010): runs sharing a groupId are one group. */
|
|
1137
|
-
groupId:
|
|
1500
|
+
groupId: z13.string().optional(),
|
|
1138
1501
|
/** Variant letter within the group — 'A' | 'B' | 'C'. */
|
|
1139
|
-
variant:
|
|
1502
|
+
variant: z13.string().optional(),
|
|
1140
1503
|
/** Idempotent start (#504): the caller's request id and the hash of the start payload it
|
|
1141
1504
|
* named (`src/runs/client-request.ts`). Absent on every run started without one. */
|
|
1142
|
-
clientRequestId:
|
|
1143
|
-
clientRequestHash:
|
|
1144
|
-
peakRssBytes:
|
|
1145
|
-
peakProcCount:
|
|
1146
|
-
archived:
|
|
1147
|
-
archivedAt:
|
|
1505
|
+
clientRequestId: z13.string().optional(),
|
|
1506
|
+
clientRequestHash: z13.string().optional(),
|
|
1507
|
+
peakRssBytes: z13.number().optional(),
|
|
1508
|
+
peakProcCount: z13.number().optional(),
|
|
1509
|
+
archived: z13.boolean(),
|
|
1510
|
+
archivedAt: z13.string().optional(),
|
|
1148
1511
|
/** Pinned to the top of this project's task list (#935) — the `Pinned` group above
|
|
1149
1512
|
* `Needs you`. Optional, unlike `archived`: absent IS "not pinned", which is what every
|
|
1150
1513
|
* record written before this carries, and the store never writes `false`. Archiving
|
|
1151
1514
|
* clears it, because archiving is how a user resigns from a task. */
|
|
1152
|
-
pinned:
|
|
1515
|
+
pinned: z13.boolean().optional(),
|
|
1153
1516
|
/** When the pin was set. Deliberately WRITE-ONLY today, like the `archivedAt` above it:
|
|
1154
1517
|
* ordering inside `Pinned` uses the ordinary status/recency rules, so nothing reads this
|
|
1155
1518
|
* yet. It is here because a field on a protected surface is far cheaper to add now than to
|
|
1156
1519
|
* add later — "pinned oldest first" and "unpin what you pinned a month ago" both need it,
|
|
1157
1520
|
* and neither can be reconstructed after the fact. */
|
|
1158
|
-
pinnedAt:
|
|
1521
|
+
pinnedAt: z13.string().optional(),
|
|
1159
1522
|
/** Read receipt (#unread-done-items): ISO time the cockpit last opened this run's
|
|
1160
1523
|
* thread. A finished (`done`/`failed`) run reads as *unread* until seen since it
|
|
1161
1524
|
* finished — see `isUnread()` in the cockpit's `lib/read-state.ts`. Absent on old
|
|
1162
1525
|
* runs, on any run not yet opened, and on one deliberately put back to unread via
|
|
1163
1526
|
* `POST /runs/:id/unread` (#775) — all three count as unread. */
|
|
1164
|
-
seenAt:
|
|
1165
|
-
currentStepId:
|
|
1166
|
-
error:
|
|
1167
|
-
steps:
|
|
1527
|
+
seenAt: z13.string().optional(),
|
|
1528
|
+
currentStepId: z13.string().optional(),
|
|
1529
|
+
error: z13.string().optional(),
|
|
1530
|
+
steps: z13.array(stepStateSchema),
|
|
1168
1531
|
/**
|
|
1169
1532
|
* The persisted workflow definition, so a `queued` run survives a restart — including the ad-hoc
|
|
1170
1533
|
* "(planned)" chains that exist nowhere else.
|
|
@@ -1182,48 +1545,48 @@ var runRecordSchema = z11.object({
|
|
|
1182
1545
|
var apiRunSchema = runRecordSchema.extend({
|
|
1183
1546
|
/** Read-only GET /runs/:id verdict: null permits Finish, a string explains refusal.
|
|
1184
1547
|
* Absent on lists, stored records and mutation responses; absence is not permission. */
|
|
1185
|
-
finishBlocked:
|
|
1548
|
+
finishBlocked: z13.string().nullable().optional(),
|
|
1186
1549
|
/** Server-resolved Cursor CLI command, including the configured executable. Never persisted. */
|
|
1187
|
-
cliResumeCommand:
|
|
1550
|
+
cliResumeCommand: z13.string().optional(),
|
|
1188
1551
|
usage: processUsageSchema.optional()
|
|
1189
1552
|
});
|
|
1190
|
-
var runIndexEntrySchema =
|
|
1553
|
+
var runIndexEntrySchema = z13.object({
|
|
1191
1554
|
/** The registered project this run belongs to. Joins against `GET /projects`. */
|
|
1192
|
-
projectId:
|
|
1193
|
-
id:
|
|
1194
|
-
title:
|
|
1195
|
-
titleSummary:
|
|
1196
|
-
titleOrigin:
|
|
1555
|
+
projectId: z13.string(),
|
|
1556
|
+
id: z13.string(),
|
|
1557
|
+
title: z13.string(),
|
|
1558
|
+
titleSummary: z13.string().optional(),
|
|
1559
|
+
titleOrigin: z13.enum(["user", "auto", "marker"]).optional(),
|
|
1197
1560
|
status: runStatusSchema,
|
|
1198
1561
|
activity: runActivitySchema.optional(),
|
|
1199
1562
|
hasPendingHumanAsk: runRecordSchema.shape.hasPendingHumanAsk,
|
|
1200
1563
|
/** Only the relationship role and wait phase used by list attention. */
|
|
1201
1564
|
delegation: runDelegationSummarySchema.optional(),
|
|
1202
|
-
createdAt:
|
|
1203
|
-
finishedAt:
|
|
1565
|
+
createdAt: z13.string(),
|
|
1566
|
+
finishedAt: z13.string().optional(),
|
|
1204
1567
|
/** With `status`/`finishedAt`/`archived`, the four inputs `isUnread` reads — what lets the
|
|
1205
1568
|
* palette lead with "finished while you weren't looking" across every project, not just the
|
|
1206
1569
|
* one you happen to be standing in. */
|
|
1207
|
-
seenAt:
|
|
1570
|
+
seenAt: z13.string().optional(),
|
|
1208
1571
|
/** Always present, like `RunRecord.archived`: absent would read as "not archived", and the
|
|
1209
1572
|
* unread rule treats archiving as a stronger "done with this" than reading. */
|
|
1210
|
-
archived:
|
|
1573
|
+
archived: z13.boolean(),
|
|
1211
1574
|
/** A run parked by a provider usage limit is `failed` on the record with a resume booked
|
|
1212
1575
|
* (spec 2026-08-03-auto-resume-after-usage-limit). Both `deriveAttention` and `isUnread` read
|
|
1213
1576
|
* it, so without it here a cross-project row would show a red "failed" dot and land in
|
|
1214
1577
|
* Recently finished for work that is simply waiting for its appointment. */
|
|
1215
|
-
autoResumeAt:
|
|
1578
|
+
autoResumeAt: z13.string().optional(),
|
|
1216
1579
|
/** The workflow the run executes — the global Tasks page shows it in a column and groups by
|
|
1217
1580
|
* it. Always present on the record (`RunRecord.workflow`), so required here; the display
|
|
1218
1581
|
* refinement `workflowLabel` applies needs `steps[]`, which this row deliberately omits, so
|
|
1219
1582
|
* a `(planned)` chain reads as itself here rather than as its first agent's name. */
|
|
1220
|
-
workflow:
|
|
1583
|
+
workflow: z13.string(),
|
|
1221
1584
|
/** The task's branch, when it has one — a column on the global page, and the one field that
|
|
1222
1585
|
* makes a cross-project row identifiable at a glance without opening it. */
|
|
1223
|
-
branch:
|
|
1586
|
+
branch: z13.string().optional(),
|
|
1224
1587
|
/** When the agent actually started, as opposed to when the task was created. The global page's
|
|
1225
1588
|
* age column prefers it and falls back to `createdAt`, exactly as the per-project table does. */
|
|
1226
|
-
startedAt:
|
|
1589
|
+
startedAt: z13.string().optional(),
|
|
1227
1590
|
/**
|
|
1228
1591
|
* The six fields `taskReference()` (`web/src/lib/tasks-table.ts`) reads to decide a task's PR
|
|
1229
1592
|
* or issue chip. Carried verbatim rather than pre-resolved into a `{kind, number, url}` on the
|
|
@@ -1235,20 +1598,20 @@ var runIndexEntrySchema = z11.object({
|
|
|
1235
1598
|
* Six scalars is still the slim row this schema exists to keep: `steps[]` and `workflowDef`,
|
|
1236
1599
|
* the expensive half, stay off it.
|
|
1237
1600
|
*/
|
|
1238
|
-
pullRequestUrl:
|
|
1239
|
-
referencedPullRequestUrl:
|
|
1240
|
-
prNumber:
|
|
1241
|
-
issueNumber:
|
|
1242
|
-
referencedIssueUrl:
|
|
1243
|
-
markerRefs:
|
|
1601
|
+
pullRequestUrl: z13.string().optional(),
|
|
1602
|
+
referencedPullRequestUrl: z13.string().optional(),
|
|
1603
|
+
prNumber: z13.number().optional(),
|
|
1604
|
+
issueNumber: z13.number().optional(),
|
|
1605
|
+
referencedIssueUrl: z13.string().optional(),
|
|
1606
|
+
markerRefs: z13.object({ pr: z13.number().optional(), issue: z13.number().optional() }).optional(),
|
|
1244
1607
|
/** What the run has cost so far. Absent means nothing was recorded, which is NOT `$0` — the
|
|
1245
1608
|
* cockpit prints an em dash rather than claiming a measurement that never happened. */
|
|
1246
|
-
costUsd:
|
|
1609
|
+
costUsd: z13.number().optional(),
|
|
1247
1610
|
/** The persisted high-water marks a FINISHED run leaves behind. `usage` below stops existing
|
|
1248
1611
|
* the moment the process tree does, so without these a finished row could say nothing at all
|
|
1249
1612
|
* about what it took to run. */
|
|
1250
|
-
peakRssBytes:
|
|
1251
|
-
peakProcCount:
|
|
1613
|
+
peakRssBytes: z13.number().optional(),
|
|
1614
|
+
peakProcCount: z13.number().optional(),
|
|
1252
1615
|
/**
|
|
1253
1616
|
* The live CPU/RSS sample of this run's process tree, attached on the way out exactly as
|
|
1254
1617
|
* `GET /runs` attaches it (`withUsage`) — never persisted.
|
|
@@ -1260,90 +1623,90 @@ var runIndexEntrySchema = z11.object({
|
|
|
1260
1623
|
*/
|
|
1261
1624
|
usage: processUsageSchema.optional()
|
|
1262
1625
|
});
|
|
1263
|
-
var referenceStatusesByProjectSchema =
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
prs:
|
|
1267
|
-
issues:
|
|
1626
|
+
var referenceStatusesByProjectSchema = z13.record(
|
|
1627
|
+
z13.string(),
|
|
1628
|
+
z13.object({
|
|
1629
|
+
prs: z13.record(z13.number(), referenceStatusSchema),
|
|
1630
|
+
issues: z13.record(z13.number(), referenceStatusSchema)
|
|
1268
1631
|
})
|
|
1269
1632
|
);
|
|
1270
|
-
var runsIndexResponseSchema =
|
|
1633
|
+
var runsIndexResponseSchema = z13.object({
|
|
1271
1634
|
/** Newest first, across every registered project. Archived runs are included — `GET /runs`
|
|
1272
1635
|
* carries them for the project you are standing in, and a finder that dropped them elsewhere
|
|
1273
1636
|
* would make a task vanish the moment you left its project. */
|
|
1274
|
-
runs:
|
|
1637
|
+
runs: z13.array(runIndexEntrySchema),
|
|
1275
1638
|
/** Additive: absent statuses mean "nothing warm", never "nothing to show". */
|
|
1276
1639
|
referenceStatuses: referenceStatusesByProjectSchema,
|
|
1277
1640
|
/** The per-project cap that produced this list. */
|
|
1278
|
-
perProjectLimit:
|
|
1641
|
+
perProjectLimit: z13.number(),
|
|
1279
1642
|
/** Ids of the projects that had more runs than the cap allowed. */
|
|
1280
|
-
truncated:
|
|
1643
|
+
truncated: z13.array(z13.string())
|
|
1281
1644
|
});
|
|
1282
|
-
var createRunResponseSchema =
|
|
1645
|
+
var createRunResponseSchema = z13.union([
|
|
1283
1646
|
runRecordSchema,
|
|
1284
|
-
|
|
1647
|
+
z13.object({ runs: z13.array(runRecordSchema) })
|
|
1285
1648
|
]);
|
|
1286
|
-
var cancelResponseSchema =
|
|
1287
|
-
var cancelAutoResumeResponseSchema =
|
|
1288
|
-
var archiveFinishedResponseSchema =
|
|
1289
|
-
var markAllReadResponseSchema =
|
|
1290
|
-
var deleteRunResponseSchema =
|
|
1291
|
-
var finishResponseSchema =
|
|
1292
|
-
var continueResponseSchema =
|
|
1293
|
-
var createPrResponseSchema =
|
|
1294
|
-
url:
|
|
1295
|
-
dryRun:
|
|
1296
|
-
});
|
|
1297
|
-
var messageResponseSchema =
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1649
|
+
var cancelResponseSchema = z13.object({ cancelled: z13.boolean() });
|
|
1650
|
+
var cancelAutoResumeResponseSchema = z13.object({ cancelled: z13.literal(true) });
|
|
1651
|
+
var archiveFinishedResponseSchema = z13.object({ archived: z13.number() });
|
|
1652
|
+
var markAllReadResponseSchema = z13.object({ read: z13.number() });
|
|
1653
|
+
var deleteRunResponseSchema = z13.object({ deleted: z13.literal(true) });
|
|
1654
|
+
var finishResponseSchema = z13.object({ finished: z13.literal(true) });
|
|
1655
|
+
var continueResponseSchema = z13.object({ continued: z13.literal(true) });
|
|
1656
|
+
var createPrResponseSchema = z13.object({
|
|
1657
|
+
url: z13.string(),
|
|
1658
|
+
dryRun: z13.boolean()
|
|
1659
|
+
});
|
|
1660
|
+
var messageResponseSchema = z13.union([
|
|
1661
|
+
z13.object({ delivered: z13.literal(true) }),
|
|
1662
|
+
z13.object({ queued: z13.literal(true), message: queuedMessageSchema }),
|
|
1663
|
+
z13.object({ deferred: z13.literal(true) })
|
|
1301
1664
|
]);
|
|
1302
|
-
var editQueuedMessageResponseSchema =
|
|
1303
|
-
var removeQueuedMessageResponseSchema =
|
|
1304
|
-
var openInCliResponseSchema =
|
|
1305
|
-
opened:
|
|
1306
|
-
command:
|
|
1307
|
-
});
|
|
1308
|
-
var removeWorktreeResponseSchema =
|
|
1309
|
-
var gitCommitResponseSchema =
|
|
1310
|
-
committed:
|
|
1311
|
-
sha:
|
|
1312
|
-
});
|
|
1313
|
-
var gitPushResponseSchema =
|
|
1314
|
-
pushed:
|
|
1315
|
-
branch:
|
|
1316
|
-
remote:
|
|
1317
|
-
upstreamSet:
|
|
1318
|
-
});
|
|
1319
|
-
var runCommitSchema =
|
|
1320
|
-
sha:
|
|
1321
|
-
subject:
|
|
1322
|
-
author:
|
|
1665
|
+
var editQueuedMessageResponseSchema = z13.object({ message: queuedMessageSchema });
|
|
1666
|
+
var removeQueuedMessageResponseSchema = z13.object({ removed: z13.literal(true) });
|
|
1667
|
+
var openInCliResponseSchema = z13.object({
|
|
1668
|
+
opened: z13.literal(true),
|
|
1669
|
+
command: z13.string()
|
|
1670
|
+
});
|
|
1671
|
+
var removeWorktreeResponseSchema = z13.object({ removed: z13.literal(true) });
|
|
1672
|
+
var gitCommitResponseSchema = z13.object({
|
|
1673
|
+
committed: z13.literal(true),
|
|
1674
|
+
sha: z13.string()
|
|
1675
|
+
});
|
|
1676
|
+
var gitPushResponseSchema = z13.object({
|
|
1677
|
+
pushed: z13.literal(true),
|
|
1678
|
+
branch: z13.string(),
|
|
1679
|
+
remote: z13.string(),
|
|
1680
|
+
upstreamSet: z13.boolean()
|
|
1681
|
+
});
|
|
1682
|
+
var runCommitSchema = z13.object({
|
|
1683
|
+
sha: z13.string(),
|
|
1684
|
+
subject: z13.string(),
|
|
1685
|
+
author: z13.string(),
|
|
1323
1686
|
/** Relative time ("3 hours ago") — git's `%cr`. */
|
|
1324
|
-
when:
|
|
1687
|
+
when: z13.string()
|
|
1325
1688
|
});
|
|
1326
|
-
var runCommitsResponseSchema =
|
|
1327
|
-
var groupVariantSchema =
|
|
1328
|
-
id:
|
|
1689
|
+
var runCommitsResponseSchema = z13.object({ commits: z13.array(runCommitSchema) });
|
|
1690
|
+
var groupVariantSchema = z13.object({
|
|
1691
|
+
id: z13.string(),
|
|
1329
1692
|
/** 'A' | 'B' | 'C' in practice; `'?'` for a record that lost its letter. */
|
|
1330
|
-
variant:
|
|
1331
|
-
title:
|
|
1693
|
+
variant: z13.string(),
|
|
1694
|
+
title: z13.string(),
|
|
1332
1695
|
status: runStatusSchema,
|
|
1333
|
-
archived:
|
|
1334
|
-
tokensUsed:
|
|
1696
|
+
archived: z13.boolean(),
|
|
1697
|
+
tokensUsed: z13.number(),
|
|
1335
1698
|
inputTokens: usageCounterSchema.optional(),
|
|
1336
1699
|
outputTokens: usageCounterSchema.optional(),
|
|
1337
|
-
costUsd:
|
|
1338
|
-
diffStat:
|
|
1700
|
+
costUsd: z13.number().optional(),
|
|
1701
|
+
diffStat: z13.string(),
|
|
1339
1702
|
/** First lines of the handoff journal's "## Progress log" section, as markdown. */
|
|
1340
|
-
handoffExcerpt:
|
|
1703
|
+
handoffExcerpt: z13.string()
|
|
1341
1704
|
});
|
|
1342
|
-
var groupResponseSchema =
|
|
1343
|
-
groupId:
|
|
1344
|
-
runs:
|
|
1705
|
+
var groupResponseSchema = z13.object({
|
|
1706
|
+
groupId: z13.string(),
|
|
1707
|
+
runs: z13.array(groupVariantSchema)
|
|
1345
1708
|
});
|
|
1346
|
-
var pickVariantResponseSchema =
|
|
1709
|
+
var pickVariantResponseSchema = z13.object({
|
|
1347
1710
|
winner: runRecordSchema.optional()
|
|
1348
1711
|
});
|
|
1349
1712
|
var FILE_ATTACHMENT_MEDIA_TYPES = [
|
|
@@ -1366,182 +1729,189 @@ function isImageAttachmentName(name) {
|
|
|
1366
1729
|
const ext = name.split(".").pop()?.toLowerCase();
|
|
1367
1730
|
return ext !== void 0 && IMAGE_ATTACHMENT_EXTENSIONS.has(ext);
|
|
1368
1731
|
}
|
|
1369
|
-
var attachmentFileParamSchema =
|
|
1370
|
-
id:
|
|
1371
|
-
file:
|
|
1732
|
+
var attachmentFileParamSchema = z13.object({
|
|
1733
|
+
id: z13.string().min(1),
|
|
1734
|
+
file: z13.string().regex(/^[A-Za-z0-9_-][A-Za-z0-9._-]*$/).refine((name) => !name.includes(".."))
|
|
1372
1735
|
});
|
|
1373
|
-
var attachmentInputSchema =
|
|
1374
|
-
mediaType:
|
|
1736
|
+
var attachmentInputSchema = z13.object({
|
|
1737
|
+
mediaType: z13.string().refine(isAttachmentMediaType, {
|
|
1375
1738
|
message: "unsupported attachment type \u2014 images, plain text, markdown and PDF only"
|
|
1376
1739
|
}),
|
|
1377
|
-
data:
|
|
1740
|
+
data: z13.string().min(1).max(7e6)
|
|
1378
1741
|
});
|
|
1379
1742
|
var imageInputSchema = attachmentInputSchema;
|
|
1380
1743
|
var CLIENT_REQUEST_VARIANTS_ERROR = "clientRequestId names one run; it cannot be combined with variants > 1";
|
|
1381
|
-
var createRunInputBaseSchema =
|
|
1382
|
-
workflow:
|
|
1744
|
+
var createRunInputBaseSchema = z13.object({
|
|
1745
|
+
workflow: z13.string().min(1).optional(),
|
|
1383
1746
|
/** An inline chain (spec 008 — an approved plan runs as an ad-hoc workflow, never written to
|
|
1384
1747
|
* a file). The catalog's own step shape, not a copy of it. */
|
|
1385
|
-
steps:
|
|
1386
|
-
task:
|
|
1387
|
-
model:
|
|
1748
|
+
steps: z13.array(workflowStepDefSchema).min(1).max(8).optional(),
|
|
1749
|
+
task: z13.string().min(1).max(1e5, "must be at most 100000 characters"),
|
|
1750
|
+
model: z13.string().optional(),
|
|
1388
1751
|
/** Reasoning-effort pin (#45). Omit for the harness default; empty/`auto` stay implicit. */
|
|
1389
|
-
effort:
|
|
1752
|
+
effort: z13.string().max(32).optional(),
|
|
1390
1753
|
runner: runnerSchema.optional(),
|
|
1391
1754
|
/** Agent account for this task (spec 2026-07-29-agent-profiles). Omit to follow the
|
|
1392
1755
|
* project's own selection; an id that no longer exists is a 400, not a silent default. */
|
|
1393
|
-
agentProfile:
|
|
1756
|
+
agentProfile: z13.string().max(64).optional(),
|
|
1394
1757
|
/** 1–3. Above 1 the response is `{ runs }` rather than a single record. */
|
|
1395
|
-
variants:
|
|
1758
|
+
variants: z13.number().int().min(1).max(3).optional(),
|
|
1396
1759
|
/** false → run in the repo working tree instead of an isolated worktree (read-only skills).
|
|
1397
1760
|
* Omit for the default. Ignored server-side when variants > 1. */
|
|
1398
|
-
worktree:
|
|
1761
|
+
worktree: z13.boolean().optional(),
|
|
1399
1762
|
/** true → autonomous run: never parks at "waiting"; auto-continues until done. */
|
|
1400
|
-
autonomous:
|
|
1763
|
+
autonomous: z13.boolean().optional(),
|
|
1401
1764
|
/** false → keep the handoff journal but do not expose or request a follow-up todos file.
|
|
1402
1765
|
* Omit for the default (enabled); a server with the capability off pins it to false. */
|
|
1403
|
-
generateFollowups:
|
|
1766
|
+
generateFollowups: z13.boolean().optional(),
|
|
1404
1767
|
/** Per-run system-prompt override (R2 2.3) — programmatic callers only. Wins over the
|
|
1405
1768
|
* config.json default; whitespace-only degrades to absent. */
|
|
1406
|
-
systemPrompt:
|
|
1769
|
+
systemPrompt: z13.string().trim().max(2e4, "must be at most 20000 characters").optional().transform((s) => s ? s : void 0),
|
|
1407
1770
|
/** Attachments pasted into the new-task form — screenshots, and since #950 PDF/TXT/MD files
|
|
1408
1771
|
* too; delivered with the first agent step. The key keeps its name: the wire contract widened
|
|
1409
1772
|
* in place rather than growing a second list. */
|
|
1410
|
-
images:
|
|
1773
|
+
images: z13.array(attachmentInputSchema).max(4).optional(),
|
|
1411
1774
|
/** The inbox entry this task came from (#374). Best-effort bookkeeping: an unknown or
|
|
1412
1775
|
* already-started id never fails the run. For ×2/×3 the FIRST variant is recorded. */
|
|
1413
|
-
todoId:
|
|
1776
|
+
todoId: z13.string().min(1).max(200, "must be at most 200 characters").optional()
|
|
1414
1777
|
});
|
|
1415
1778
|
var createRunInputSchema = createRunInputBaseSchema.extend({
|
|
1416
1779
|
/** Idempotent start (#504): a retry with the same id and payload answers `200` with the run
|
|
1417
1780
|
* the first request created; a different payload answers `409`. Scoped to the project. Not
|
|
1418
1781
|
* on the base schema, so an automation's task definition cannot carry one. */
|
|
1419
|
-
clientRequestId:
|
|
1782
|
+
clientRequestId: z13.string().uuid().optional(),
|
|
1783
|
+
/** Task webhook opt-in (#589). Absent = off. `true` on a project with no webhook is a 400.
|
|
1784
|
+
* Not on the base schema, and not part of the idempotent-start hash: it can change later. */
|
|
1785
|
+
notify: z13.boolean().optional()
|
|
1420
1786
|
}).refine(
|
|
1421
1787
|
(b) => Boolean(b.workflow) !== Boolean(b.steps),
|
|
1422
1788
|
{ message: 'provide either "workflow" or "steps", not both' }
|
|
1423
1789
|
).refine((b) => !(b.clientRequestId && (b.variants ?? 1) > 1), {
|
|
1424
1790
|
message: CLIENT_REQUEST_VARIANTS_ERROR
|
|
1425
1791
|
});
|
|
1426
|
-
var messageInputSchema =
|
|
1427
|
-
text:
|
|
1428
|
-
images:
|
|
1792
|
+
var messageInputSchema = z13.object({
|
|
1793
|
+
text: z13.string().max(1e5).default(""),
|
|
1794
|
+
images: z13.array(attachmentInputSchema).max(4).default([])
|
|
1429
1795
|
}).refine((m) => m.text.trim().length > 0 || m.images.length > 0, {
|
|
1430
1796
|
message: "message needs text or at least one attachment"
|
|
1431
1797
|
});
|
|
1432
|
-
var patchRunInputSchema =
|
|
1433
|
-
title:
|
|
1434
|
-
task:
|
|
1798
|
+
var patchRunInputSchema = z13.object({
|
|
1799
|
+
title: z13.string().trim().min(1).max(300).optional(),
|
|
1800
|
+
task: z13.string().trim().min(1).max(1e5).optional()
|
|
1801
|
+
});
|
|
1802
|
+
var pinRunInputSchema = z13.object({ pinned: z13.boolean().optional() });
|
|
1803
|
+
var notifyRunInputSchema = z13.object({
|
|
1804
|
+
notify: z13.boolean(),
|
|
1805
|
+
message: z13.string().trim().max(1e5).optional().transform((text) => text ? text : void 0)
|
|
1435
1806
|
});
|
|
1436
|
-
var pinRunInputSchema = z11.object({ pinned: z11.boolean().optional() });
|
|
1437
1807
|
|
|
1438
1808
|
// ../contract/src/repo.ts
|
|
1439
|
-
import { z as
|
|
1440
|
-
var statusEntrySchema =
|
|
1441
|
-
status:
|
|
1442
|
-
path:
|
|
1809
|
+
import { z as z14 } from "zod";
|
|
1810
|
+
var statusEntrySchema = z14.object({
|
|
1811
|
+
status: z14.string(),
|
|
1812
|
+
path: z14.string()
|
|
1443
1813
|
});
|
|
1444
|
-
var logEntrySchema =
|
|
1445
|
-
hash:
|
|
1446
|
-
subject:
|
|
1447
|
-
author:
|
|
1448
|
-
when:
|
|
1449
|
-
});
|
|
1450
|
-
var repoResponseSchema =
|
|
1451
|
-
|
|
1452
|
-
info:
|
|
1453
|
-
status:
|
|
1454
|
-
log:
|
|
1455
|
-
branches:
|
|
1456
|
-
baseBranch:
|
|
1814
|
+
var logEntrySchema = z14.object({
|
|
1815
|
+
hash: z14.string(),
|
|
1816
|
+
subject: z14.string(),
|
|
1817
|
+
author: z14.string(),
|
|
1818
|
+
when: z14.string()
|
|
1819
|
+
});
|
|
1820
|
+
var repoResponseSchema = z14.union([
|
|
1821
|
+
z14.object({
|
|
1822
|
+
info: z14.null(),
|
|
1823
|
+
status: z14.array(z14.never()),
|
|
1824
|
+
log: z14.array(z14.never()),
|
|
1825
|
+
branches: z14.array(z14.never()),
|
|
1826
|
+
baseBranch: z14.null()
|
|
1457
1827
|
}),
|
|
1458
|
-
|
|
1828
|
+
z14.object({
|
|
1459
1829
|
info: repoInfoSchema,
|
|
1460
|
-
status:
|
|
1461
|
-
log:
|
|
1462
|
-
branches:
|
|
1463
|
-
baseBranch:
|
|
1830
|
+
status: z14.array(statusEntrySchema),
|
|
1831
|
+
log: z14.array(logEntrySchema),
|
|
1832
|
+
branches: z14.array(z14.string()),
|
|
1833
|
+
baseBranch: z14.string().nullable()
|
|
1464
1834
|
})
|
|
1465
1835
|
]);
|
|
1466
|
-
var repoBranchResponseSchema =
|
|
1467
|
-
branch:
|
|
1468
|
-
created:
|
|
1469
|
-
});
|
|
1470
|
-
var repoPullBranchesResponseSchema =
|
|
1471
|
-
var repoPullInputSchema =
|
|
1472
|
-
branch:
|
|
1473
|
-
confirm:
|
|
1474
|
-
});
|
|
1475
|
-
var repoPullResponseSchema =
|
|
1476
|
-
branch:
|
|
1477
|
-
pulled:
|
|
1478
|
-
summary:
|
|
1479
|
-
});
|
|
1480
|
-
var repoPullConfirmationSchema =
|
|
1481
|
-
error:
|
|
1482
|
-
branch:
|
|
1483
|
-
risks:
|
|
1484
|
-
});
|
|
1485
|
-
var repoPullErrorSchema =
|
|
1836
|
+
var repoBranchResponseSchema = z14.object({
|
|
1837
|
+
branch: z14.string(),
|
|
1838
|
+
created: z14.boolean()
|
|
1839
|
+
});
|
|
1840
|
+
var repoPullBranchesResponseSchema = z14.object({ branches: z14.array(z14.string()) });
|
|
1841
|
+
var repoPullInputSchema = z14.object({
|
|
1842
|
+
branch: z14.string().trim().min(1).max(200).optional(),
|
|
1843
|
+
confirm: z14.boolean().optional()
|
|
1844
|
+
});
|
|
1845
|
+
var repoPullResponseSchema = z14.object({
|
|
1846
|
+
branch: z14.string(),
|
|
1847
|
+
pulled: z14.literal(true),
|
|
1848
|
+
summary: z14.string()
|
|
1849
|
+
});
|
|
1850
|
+
var repoPullConfirmationSchema = z14.object({
|
|
1851
|
+
error: z14.string(),
|
|
1852
|
+
branch: z14.string(),
|
|
1853
|
+
risks: z14.array(z14.enum(["active_runs", "dirty_tree"]))
|
|
1854
|
+
});
|
|
1855
|
+
var repoPullErrorSchema = z14.union([
|
|
1486
1856
|
repoPullConfirmationSchema,
|
|
1487
|
-
|
|
1857
|
+
z14.object({ error: z14.string() })
|
|
1488
1858
|
]);
|
|
1489
|
-
var diffStatSchema2 =
|
|
1490
|
-
adds:
|
|
1491
|
-
dels:
|
|
1492
|
-
files:
|
|
1859
|
+
var diffStatSchema2 = z14.object({
|
|
1860
|
+
adds: z14.number(),
|
|
1861
|
+
dels: z14.number(),
|
|
1862
|
+
files: z14.number()
|
|
1493
1863
|
});
|
|
1494
|
-
var changedFileSchema =
|
|
1495
|
-
path:
|
|
1864
|
+
var changedFileSchema = z14.object({
|
|
1865
|
+
path: z14.string(),
|
|
1496
1866
|
/** Rename/copy source — present only when `status` is renamed/copied. */
|
|
1497
|
-
oldPath:
|
|
1498
|
-
status:
|
|
1499
|
-
adds:
|
|
1500
|
-
dels:
|
|
1867
|
+
oldPath: z14.string().optional(),
|
|
1868
|
+
status: z14.enum(["added", "modified", "deleted", "renamed", "copied"]),
|
|
1869
|
+
adds: z14.number(),
|
|
1870
|
+
dels: z14.number(),
|
|
1501
1871
|
/** Binary per numstat — there is no text patch to render. */
|
|
1502
|
-
binary:
|
|
1872
|
+
binary: z14.boolean(),
|
|
1503
1873
|
/** True when the path is one the raw-bytes route serves as an `<img>` (#365) — present only
|
|
1504
1874
|
* when true, so old clients that never read it stay correct. */
|
|
1505
|
-
image:
|
|
1875
|
+
image: z14.boolean().optional(),
|
|
1506
1876
|
/** This file's unified-diff section; possibly `… (patch truncated)`, possibly empty. */
|
|
1507
|
-
patch:
|
|
1877
|
+
patch: z14.string()
|
|
1508
1878
|
});
|
|
1509
|
-
var changesPayloadSchema =
|
|
1510
|
-
files:
|
|
1879
|
+
var changesPayloadSchema = z14.object({
|
|
1880
|
+
files: z14.array(changedFileSchema),
|
|
1511
1881
|
stat: diffStatSchema2,
|
|
1512
1882
|
/** Additive context for review tasks whose worktree HEAD no longer matches their own branch. */
|
|
1513
|
-
repointedHead:
|
|
1883
|
+
repointedHead: z14.object({ headBranch: z14.string(), taskBranch: z14.string() }).optional()
|
|
1514
1884
|
});
|
|
1515
|
-
var repoCommitPayloadSchema =
|
|
1516
|
-
sha:
|
|
1517
|
-
subject:
|
|
1518
|
-
author:
|
|
1885
|
+
var repoCommitPayloadSchema = z14.object({
|
|
1886
|
+
sha: z14.string(),
|
|
1887
|
+
subject: z14.string(),
|
|
1888
|
+
author: z14.string(),
|
|
1519
1889
|
/** Relative time ("3 hours ago") — same `%cr` format as the /api/v1/repo log. */
|
|
1520
|
-
when:
|
|
1521
|
-
files:
|
|
1890
|
+
when: z14.string(),
|
|
1891
|
+
files: z14.array(changedFileSchema),
|
|
1522
1892
|
stat: diffStatSchema2
|
|
1523
1893
|
});
|
|
1524
|
-
var worktreeDirEntrySchema =
|
|
1525
|
-
name:
|
|
1526
|
-
type:
|
|
1527
|
-
size:
|
|
1528
|
-
});
|
|
1529
|
-
var worktreeEntrySchema =
|
|
1530
|
-
|
|
1531
|
-
type:
|
|
1532
|
-
path:
|
|
1533
|
-
entries:
|
|
1894
|
+
var worktreeDirEntrySchema = z14.object({
|
|
1895
|
+
name: z14.string(),
|
|
1896
|
+
type: z14.enum(["dir", "file"]),
|
|
1897
|
+
size: z14.number().optional()
|
|
1898
|
+
});
|
|
1899
|
+
var worktreeEntrySchema = z14.discriminatedUnion("type", [
|
|
1900
|
+
z14.object({
|
|
1901
|
+
type: z14.literal("dir"),
|
|
1902
|
+
path: z14.string(),
|
|
1903
|
+
entries: z14.array(worktreeDirEntrySchema)
|
|
1534
1904
|
}),
|
|
1535
|
-
|
|
1536
|
-
type:
|
|
1537
|
-
path:
|
|
1538
|
-
size:
|
|
1539
|
-
binary:
|
|
1540
|
-
tooLarge:
|
|
1541
|
-
content:
|
|
1905
|
+
z14.object({
|
|
1906
|
+
type: z14.literal("file"),
|
|
1907
|
+
path: z14.string(),
|
|
1908
|
+
size: z14.number(),
|
|
1909
|
+
binary: z14.boolean(),
|
|
1910
|
+
tooLarge: z14.boolean(),
|
|
1911
|
+
content: z14.string().optional()
|
|
1542
1912
|
})
|
|
1543
1913
|
]);
|
|
1544
|
-
var worktreeRunStatusSchema =
|
|
1914
|
+
var worktreeRunStatusSchema = z14.enum([
|
|
1545
1915
|
"queued",
|
|
1546
1916
|
"running",
|
|
1547
1917
|
"waiting",
|
|
@@ -1550,41 +1920,41 @@ var worktreeRunStatusSchema = z12.enum([
|
|
|
1550
1920
|
"failed",
|
|
1551
1921
|
"cancelled"
|
|
1552
1922
|
]);
|
|
1553
|
-
var worktreeInfoSchema =
|
|
1554
|
-
runId:
|
|
1555
|
-
title:
|
|
1923
|
+
var worktreeInfoSchema = z14.object({
|
|
1924
|
+
runId: z14.string(),
|
|
1925
|
+
title: z14.string(),
|
|
1556
1926
|
status: worktreeRunStatusSchema,
|
|
1557
|
-
branch:
|
|
1558
|
-
sizeBytes:
|
|
1559
|
-
finishedAt:
|
|
1560
|
-
reclaimable:
|
|
1927
|
+
branch: z14.string().nullable(),
|
|
1928
|
+
sizeBytes: z14.number().nullable(),
|
|
1929
|
+
finishedAt: z14.string().nullable(),
|
|
1930
|
+
reclaimable: z14.boolean()
|
|
1561
1931
|
});
|
|
1562
|
-
var worktreesResponseSchema =
|
|
1563
|
-
worktrees:
|
|
1564
|
-
totalBytes:
|
|
1565
|
-
keep:
|
|
1932
|
+
var worktreesResponseSchema = z14.object({
|
|
1933
|
+
worktrees: z14.array(worktreeInfoSchema),
|
|
1934
|
+
totalBytes: z14.number().nullable(),
|
|
1935
|
+
keep: z14.number()
|
|
1566
1936
|
});
|
|
1567
|
-
var reclaimWorktreesResponseSchema =
|
|
1568
|
-
reclaimed:
|
|
1937
|
+
var reclaimWorktreesResponseSchema = z14.object({
|
|
1938
|
+
reclaimed: z14.array(z14.string())
|
|
1569
1939
|
});
|
|
1570
1940
|
|
|
1571
1941
|
// ../contract/src/projects.ts
|
|
1572
|
-
import { z as
|
|
1573
|
-
var projectListEntrySchema =
|
|
1574
|
-
id:
|
|
1575
|
-
name:
|
|
1942
|
+
import { z as z15 } from "zod";
|
|
1943
|
+
var projectListEntrySchema = z15.object({
|
|
1944
|
+
id: z15.string(),
|
|
1945
|
+
name: z15.string(),
|
|
1576
1946
|
/** Absolute, realpath-normalized repo root. */
|
|
1577
|
-
root:
|
|
1578
|
-
addedAt:
|
|
1579
|
-
lastOpenedAt:
|
|
1580
|
-
source:
|
|
1947
|
+
root: z15.string(),
|
|
1948
|
+
addedAt: z15.string(),
|
|
1949
|
+
lastOpenedAt: z15.string(),
|
|
1950
|
+
source: z15.enum(["local", "checkout"]),
|
|
1581
1951
|
/** `not-git` is fully usable (degraded single-queue mode); only `missing` blocks. */
|
|
1582
|
-
status:
|
|
1952
|
+
status: z15.enum(["ok", "missing", "not-git"]),
|
|
1583
1953
|
/** Current branch when cheaply available (omitted e.g. on an unborn HEAD). */
|
|
1584
|
-
branch:
|
|
1954
|
+
branch: z15.string().optional(),
|
|
1585
1955
|
/** Which forge this project's remote belongs to (#698) — classified server-side from the
|
|
1586
1956
|
* remote URL alone. Gates the project group's GitHub nav item; omitted = no forge remote. */
|
|
1587
|
-
forge:
|
|
1957
|
+
forge: z15.literal("github").optional(),
|
|
1588
1958
|
/**
|
|
1589
1959
|
* The remote's web root, `https://github.com/owner/repo`. Rebuilt server-side from the parsed
|
|
1590
1960
|
* remote rather than passed through, so a remote carrying credentials cannot leak into the
|
|
@@ -1594,10 +1964,10 @@ var projectListEntrySchema = z13.object({
|
|
|
1594
1964
|
* the global Tasks page has one row per project, so it cannot use any single repo's base the
|
|
1595
1965
|
* way a project-scoped view can. With this, every reference it shows is a link.
|
|
1596
1966
|
*/
|
|
1597
|
-
repoUrl:
|
|
1967
|
+
repoUrl: z15.string().optional(),
|
|
1598
1968
|
/** Per-project cap on concurrently running tasks (spec 2026-07-22). Omitted = inherit the
|
|
1599
1969
|
* workspace `resources.maxParallel`; a number pins this project. */
|
|
1600
|
-
maxParallel:
|
|
1970
|
+
maxParallel: z15.number().optional(),
|
|
1601
1971
|
/**
|
|
1602
1972
|
* Free-form labels grouping CONNECTED repositories — a `storefront` tag on the API, the web
|
|
1603
1973
|
* app and the design system says those three are one piece of work spread over three repos.
|
|
@@ -1609,528 +1979,218 @@ var projectListEntrySchema = z13.object({
|
|
|
1609
1979
|
* server-side (trimmed, deduped case-insensitively, sorted), so a consumer may compare them
|
|
1610
1980
|
* directly.
|
|
1611
1981
|
*/
|
|
1612
|
-
tags:
|
|
1982
|
+
tags: z15.array(z15.string()).optional(),
|
|
1983
|
+
/** The task webhook (#589). The token is write-only: the wire says only whether one is set. */
|
|
1984
|
+
webhook: z15.object({ url: z15.string(), tokenSet: z15.boolean() }).optional()
|
|
1613
1985
|
});
|
|
1614
|
-
var projectsResponseSchema =
|
|
1615
|
-
projects:
|
|
1616
|
-
bootProject:
|
|
1617
|
-
projectsDir:
|
|
1986
|
+
var projectsResponseSchema = z15.object({
|
|
1987
|
+
projects: z15.array(projectListEntrySchema),
|
|
1988
|
+
bootProject: z15.string(),
|
|
1989
|
+
projectsDir: z15.string()
|
|
1618
1990
|
});
|
|
1619
|
-
var registerProjectResponseSchema =
|
|
1991
|
+
var registerProjectResponseSchema = z15.object({
|
|
1620
1992
|
project: projectListEntrySchema,
|
|
1621
|
-
error:
|
|
1993
|
+
error: z15.string().optional()
|
|
1622
1994
|
});
|
|
1623
|
-
var removeProjectResponseSchema =
|
|
1624
|
-
removed:
|
|
1625
|
-
id:
|
|
1995
|
+
var removeProjectResponseSchema = z15.object({
|
|
1996
|
+
removed: z15.literal(true),
|
|
1997
|
+
id: z15.string()
|
|
1626
1998
|
});
|
|
1627
|
-
var updateProjectResponseSchema =
|
|
1999
|
+
var updateProjectResponseSchema = z15.object({
|
|
1628
2000
|
project: projectListEntrySchema
|
|
1629
2001
|
});
|
|
1630
2002
|
var PROJECT_TAG_MAX_LENGTH = 32;
|
|
1631
2003
|
var PROJECT_TAGS_MAX = 20;
|
|
1632
|
-
var
|
|
1633
|
-
|
|
1634
|
-
|
|
2004
|
+
var PROJECT_WEBHOOK_URL_MAX_LENGTH = 2048;
|
|
2005
|
+
var PROJECT_WEBHOOK_TOKEN_MAX_LENGTH = 1024;
|
|
2006
|
+
var projectWebhookUrlSchema = z15.string().trim().max(PROJECT_WEBHOOK_URL_MAX_LENGTH).pipe(z15.url({ protocol: /^https?$/, error: "webhook url must be an http(s) URL" })).refine((value) => !/^https?:\/\/[^/?#]*@/i.test(value), "webhook url must not contain credentials; put the secret in the token");
|
|
2007
|
+
var projectWebhookInputSchema = z15.object({
|
|
2008
|
+
url: projectWebhookUrlSchema,
|
|
2009
|
+
token: z15.string().trim().max(PROJECT_WEBHOOK_TOKEN_MAX_LENGTH).optional()
|
|
2010
|
+
});
|
|
2011
|
+
var testProjectWebhookResponseSchema = z15.object({
|
|
2012
|
+
ok: z15.boolean(),
|
|
2013
|
+
status: z15.number().optional(),
|
|
2014
|
+
error: z15.string().optional(),
|
|
2015
|
+
dryRun: z15.boolean().optional()
|
|
2016
|
+
});
|
|
2017
|
+
var updateProjectInputSchema = z15.object({
|
|
2018
|
+
maxParallel: z15.number().int().min(1).max(16).nullable().optional(),
|
|
2019
|
+
tags: z15.array(z15.string().trim().min(1).max(PROJECT_TAG_MAX_LENGTH)).max(PROJECT_TAGS_MAX).nullable().optional(),
|
|
2020
|
+
/**
|
|
2021
|
+
* The task webhook (#589). `null` removes it. An omitted `token` keeps the stored one, so the
|
|
2022
|
+
* settings form can change the URL without asking for a secret it never shows again; `''`
|
|
2023
|
+
* clears the token.
|
|
2024
|
+
*/
|
|
2025
|
+
webhook: projectWebhookInputSchema.nullable().optional()
|
|
1635
2026
|
}).refine(
|
|
1636
|
-
(body) => body.maxParallel !== void 0 || body.tags !== void 0,
|
|
1637
|
-
"specify maxParallel or
|
|
2027
|
+
(body) => body.maxParallel !== void 0 || body.tags !== void 0 || body.webhook !== void 0,
|
|
2028
|
+
"specify maxParallel, tags or webhook"
|
|
1638
2029
|
);
|
|
1639
|
-
var checkoutProjectInputSchema =
|
|
1640
|
-
url:
|
|
1641
|
-
name:
|
|
1642
|
-
checkoutId:
|
|
2030
|
+
var checkoutProjectInputSchema = z15.object({
|
|
2031
|
+
url: z15.string().trim().min(1).max(512),
|
|
2032
|
+
name: z15.string().trim().max(128).optional(),
|
|
2033
|
+
checkoutId: z15.string().trim().max(128).optional()
|
|
1643
2034
|
});
|
|
1644
|
-
var fsBrowseDirSchema =
|
|
1645
|
-
name:
|
|
1646
|
-
path:
|
|
2035
|
+
var fsBrowseDirSchema = z15.object({
|
|
2036
|
+
name: z15.string(),
|
|
2037
|
+
path: z15.string(),
|
|
1647
2038
|
/** Has a `.git` entry — drives the "git" badge. A non-repo folder is still selectable. */
|
|
1648
|
-
isRepo:
|
|
2039
|
+
isRepo: z15.boolean()
|
|
1649
2040
|
});
|
|
1650
|
-
var fsBrowseResponseSchema =
|
|
2041
|
+
var fsBrowseResponseSchema = z15.object({
|
|
1651
2042
|
/** The realpath'd directory actually listed — never the spelling asked for, so the breadcrumb
|
|
1652
2043
|
* shows where the picker really is. */
|
|
1653
|
-
path:
|
|
2044
|
+
path: z15.string(),
|
|
1654
2045
|
/** `null` AT the browse root: there is no "up" out of it, and the dialog must render no parent
|
|
1655
2046
|
* row rather than one that 400s. */
|
|
1656
|
-
parent:
|
|
1657
|
-
dirs:
|
|
2047
|
+
parent: z15.string().nullable(),
|
|
2048
|
+
dirs: z15.array(fsBrowseDirSchema),
|
|
1658
2049
|
/** True when the listing was capped server-side — surfaced honestly instead of showing a
|
|
1659
2050
|
* silently short list. */
|
|
1660
|
-
truncated:
|
|
1661
|
-
});
|
|
1662
|
-
var launchKeyResponseSchema = z13.object({
|
|
1663
|
-
key: z13.string()
|
|
1664
|
-
});
|
|
1665
|
-
|
|
1666
|
-
// ../contract/src/workspace.ts
|
|
1667
|
-
import { z as z14 } from "zod";
|
|
1668
|
-
var workspaceConfigResponseSchema = z14.object({
|
|
1669
|
-
/** Root exposed by the Add-project directory browser — stored as written (`~` kept). */
|
|
1670
|
-
browseRoot: z14.string(),
|
|
1671
|
-
/** Checkout root for GUI-cloned projects — stored as written (`~` kept). */
|
|
1672
|
-
projectsDir: z14.string(),
|
|
1673
|
-
/** Stored override; `null` means inherit `CEZ_SKILLS_AUTO_UPDATE`, then true. */
|
|
1674
|
-
skillsAutoUpdate: z14.boolean().nullable(),
|
|
1675
|
-
effectiveSkillsAutoUpdate: z14.boolean(),
|
|
1676
|
-
composerDefaults: z14.object({
|
|
1677
|
-
autonomous: z14.boolean().nullable(),
|
|
1678
|
-
worktree: z14.boolean().nullable(),
|
|
1679
|
-
/** `'source-dependent'` when no `CEZ_AUTONOMOUS_DEFAULT` pins it either way. */
|
|
1680
|
-
inheritedAutonomous: z14.union([z14.boolean(), z14.literal("source-dependent")]),
|
|
1681
|
-
inheritedWorktree: z14.boolean()
|
|
1682
|
-
}),
|
|
1683
|
-
resources: z14.object({
|
|
1684
|
-
maxParallel: z14.number(),
|
|
1685
|
-
maxMonitoringSessions: z14.number(),
|
|
1686
|
-
monitoringWakeIntervalMinutes: z14.number().nullable(),
|
|
1687
|
-
/** Resume a run a provider usage limit stopped, once the limit resets. Default `true`. */
|
|
1688
|
-
autoResumeOnUsageLimit: z14.boolean(),
|
|
1689
|
-
memoryLimitMb: z14.number().nullable(),
|
|
1690
|
-
worktreeRetentionDefault: z14.number()
|
|
1691
|
-
}),
|
|
1692
|
-
/**
|
|
1693
|
-
* What a repo that has set none of its own runs (spec 2026-07-29-agent-profiles).
|
|
1694
|
-
*
|
|
1695
|
-
* Both keys are OPTIONAL on the wire, and that is load-bearing rather than lax: absent means
|
|
1696
|
-
* "this machine has no opinion, the built-in default applies", and it has to stay distinguishable
|
|
1697
|
-
* from a value someone chose or the fallback collapses into "always claude". Consulted only where
|
|
1698
|
-
* the repo's own `.ai/cezar/config.json` is silent — a repo that chose is never overruled.
|
|
1699
|
-
*/
|
|
1700
|
-
agentDefaults: z14.object({
|
|
1701
|
-
runner: runnerSchema.optional(),
|
|
1702
|
-
models: z14.object({
|
|
1703
|
-
claude: z14.string().optional(),
|
|
1704
|
-
codex: z14.string().optional(),
|
|
1705
|
-
opencode: z14.string().optional(),
|
|
1706
|
-
pi: z14.string().optional(),
|
|
1707
|
-
cursor: z14.string().optional()
|
|
1708
|
-
}).optional()
|
|
1709
|
-
})
|
|
1710
|
-
});
|
|
1711
|
-
var setWorkspaceConfigInputSchema = z14.object({
|
|
1712
|
-
browseRoot: z14.string().trim().min(1).max(4096).optional(),
|
|
1713
|
-
projectsDir: z14.string().trim().min(1).max(4096).optional(),
|
|
1714
|
-
skillsAutoUpdate: z14.boolean().nullable().optional(),
|
|
1715
|
-
composerDefaults: z14.object({
|
|
1716
|
-
autonomous: z14.boolean().nullable().optional(),
|
|
1717
|
-
worktree: z14.boolean().nullable().optional()
|
|
1718
|
-
}).optional(),
|
|
1719
|
-
/** Machine-wide agent defaults. `null` on a key CLEARS it back to "no opinion", which a bare
|
|
1720
|
-
* absent key cannot say in a partial patch. */
|
|
1721
|
-
agentDefaults: z14.object({
|
|
1722
|
-
runner: runnerSchema.nullable().optional(),
|
|
1723
|
-
models: z14.object({
|
|
1724
|
-
claude: z14.string().trim().min(1).max(200).nullable().optional(),
|
|
1725
|
-
codex: z14.string().trim().min(1).max(200).nullable().optional(),
|
|
1726
|
-
opencode: z14.string().trim().min(1).max(200).nullable().optional(),
|
|
1727
|
-
pi: z14.string().trim().min(1).max(200).nullable().optional(),
|
|
1728
|
-
cursor: z14.string().trim().min(1).max(200).nullable().optional()
|
|
1729
|
-
}).optional()
|
|
1730
|
-
}).optional(),
|
|
1731
|
-
resources: z14.object({
|
|
1732
|
-
maxParallel: z14.number().int().min(1).max(16).optional(),
|
|
1733
|
-
maxMonitoringSessions: z14.number().int().min(0).max(16).optional(),
|
|
1734
|
-
monitoringWakeIntervalMinutes: z14.number().int().min(1).max(60).nullable().optional(),
|
|
1735
|
-
autoResumeOnUsageLimit: z14.boolean().optional(),
|
|
1736
|
-
memoryLimitMb: z14.number().int().min(0).max(1048576).nullable().optional(),
|
|
1737
|
-
worktreeRetentionDefault: z14.number().int().min(0).max(1e3).optional()
|
|
1738
|
-
}).optional()
|
|
1739
|
-
});
|
|
1740
|
-
var appearanceSchema = z14.object({
|
|
1741
|
-
accent: z14.enum(["cezarion", "lime", "violet"]).optional(),
|
|
1742
|
-
density: z14.enum(["comfortable", "compact", "ultra"]).optional(),
|
|
1743
|
-
width: z14.enum(["narrow", "wide"]).optional()
|
|
1744
|
-
});
|
|
1745
|
-
var taskTableUiStateSchema = z14.looseObject({
|
|
1746
|
-
/** Explicit user choices only. Missing ids keep the registry-owned default. */
|
|
1747
|
-
expandedColumns: z14.record(z14.string(), z14.boolean()).optional()
|
|
1748
|
-
});
|
|
1749
|
-
var uiStateSchema = z14.looseObject({
|
|
1750
|
-
/** What the last started run used. `null` is a VALUE, not an absence: it records a run that
|
|
1751
|
-
* chose neither a skill nor a workflow (the plain built-in `quick-task`), which the composer
|
|
1752
|
-
* can now express since the source picker grew an empty state. Absent still means "no
|
|
1753
|
-
* run has been recorded here" — a cockpit reading either one selects nothing. */
|
|
1754
|
-
lastTask: z14.object({ source: z14.enum(["workflow", "skill"]), ref: z14.string() }).nullable().optional(),
|
|
1755
|
-
/** Most-recently-run sources, newest first (deduped, capped). Feeds the composer picker's
|
|
1756
|
-
* recency sort. */
|
|
1757
|
-
recentSources: z14.array(z14.object({ source: z14.enum(["workflow", "skill"]), ref: z14.string() })).optional(),
|
|
1758
|
-
/** The last worktree choice for a single-skill run. Absent → the default (isolated worktree). */
|
|
1759
|
-
lastWorktree: z14.boolean().optional(),
|
|
1760
|
-
/** The last autonomous choice — remembered like `lastWorktree`. Absent → off. */
|
|
1761
|
-
lastAutonomous: z14.boolean().optional(),
|
|
1762
|
-
/** Whether new runs should ask agents to append follow-up work. Absent → on. */
|
|
1763
|
-
lastGenerateFollowups: z14.boolean().optional(),
|
|
1764
|
-
/** Skill selection frequency (#408): name → times chosen, across BOTH composers. */
|
|
1765
|
-
skillUsage: z14.record(z14.string(), z14.number()).optional(),
|
|
1766
|
-
runsView: z14.enum(["list", "table"]).optional(),
|
|
1767
|
-
/** The GitHub tab's last-selected sub-tab (#417). Absent → issues. */
|
|
1768
|
-
githubView: z14.enum(["issues", "prs"]).optional(),
|
|
1769
|
-
/** Settings → Appearance. The theme itself stays in localStorage (`cez-theme`) — it must
|
|
1770
|
-
* pre-paint, and it is per-browser by design. */
|
|
1771
|
-
appearance: appearanceSchema.optional(),
|
|
1772
|
-
/** Follow-up prompt templates (#413). Absent → the built-in defaults; present (even `[]`) is
|
|
1773
|
-
* the user's own edited list. `skills` are the skill names the template auto-applies for. */
|
|
1774
|
-
promptTemplates: z14.array(
|
|
1775
|
-
z14.object({
|
|
1776
|
-
id: z14.string(),
|
|
1777
|
-
label: z14.string(),
|
|
1778
|
-
text: z14.string(),
|
|
1779
|
-
skills: z14.array(z14.string()).optional()
|
|
1780
|
-
})
|
|
1781
|
-
).optional(),
|
|
1782
|
-
/** The open-mercato/skills promo banner (#391), dismissed for good. Legacy — the banner is
|
|
1783
|
-
* gone, replaced by `WorkspaceUiState.importedSkills`; retained so old files round-trip. */
|
|
1784
|
-
dismissedSkillsBanner: z14.boolean().optional()
|
|
1785
|
-
});
|
|
1786
|
-
var workspaceLastLocationSchema = z14.strictObject({
|
|
1787
|
-
projectId: z14.string().min(1).max(64),
|
|
1788
|
-
pathname: z14.string().min(1).max(2048).startsWith("/p/"),
|
|
1789
|
-
search: z14.string().max(4096).startsWith("?").optional(),
|
|
1790
|
-
hash: z14.string().max(2048).startsWith("#").optional()
|
|
1791
|
-
});
|
|
1792
|
-
var workspaceUiStateSchema = z14.looseObject({
|
|
1793
|
-
/** LEGACY — the sidebar's per-project collapse map (step 3.3). Still accepted and still
|
|
1794
|
-
* round-tripped so an older cockpit sharing this home keeps working, but the current cockpit
|
|
1795
|
-
* neither reads nor writes it: which groups are shut describes the WINDOW, not the workspace,
|
|
1796
|
-
* so it lives in that browser's localStorage (`packages/web/src/lib/sidebar-collapse.ts`).
|
|
1797
|
-
* One shared answer meant a phone collapsing a group collapsed it on the desktop too. */
|
|
1798
|
-
sidebar: z14.looseObject({ collapsed: z14.record(z14.string(), z14.boolean()).optional() }).optional(),
|
|
1799
|
-
/** Dismissed runtime-auth incident IDs, keyed by provider. An ID is only dismissed until the
|
|
1800
|
-
* provider reports a different incident, so this stays workspace-global with the browser
|
|
1801
|
-
* rather than one project checkout. */
|
|
1802
|
-
dismissedProviderAuthFailures: z14.object({
|
|
1803
|
-
claude: z14.string().optional(),
|
|
1804
|
-
codex: z14.string().optional(),
|
|
1805
|
-
opencode: z14.string().optional(),
|
|
1806
|
-
pi: z14.string().optional(),
|
|
1807
|
-
cursor: z14.string().optional()
|
|
1808
|
-
}).optional(),
|
|
1809
|
-
/** Settings → Appearance, GLOBAL since step 3.5: accent + density describe the person at the
|
|
1810
|
-
* keyboard, not a repo. */
|
|
1811
|
-
appearance: appearanceSchema.optional(),
|
|
1812
|
-
/** Settings → Notifications, GLOBAL since step 3.5 — one answer for the whole workspace, since
|
|
1813
|
-
* the delivering browser is one browser whichever project you are looking at. */
|
|
1814
|
-
notifications: z14.looseObject({ enabled: z14.boolean().optional() }).optional(),
|
|
1815
|
-
/** Desktop Tasks-table density, shared across every project in this workspace. */
|
|
1816
|
-
taskTable: taskTableUiStateSchema.optional(),
|
|
1817
|
-
/** LEGACY, exactly like `sidebar` above — the last settled project-scoped page, restored when
|
|
1818
|
-
* entering at the exact bare root. The shape is unchanged and still accepted, but the current
|
|
1819
|
-
* cockpit keeps it in localStorage (`packages/web/src/lib/last-location.ts`): stored here, the
|
|
1820
|
-
* last client to navigate decided where every OTHER client's next launch landed. */
|
|
1821
|
-
lastLocation: workspaceLastLocationSchema.optional(),
|
|
1822
|
-
/** The user's curated selection of default (vendor) skills. Tri-state: ABSENT means "not
|
|
1823
|
-
* curated", so every default skill shows; a PRESENT array (even `[]`) means only those names
|
|
1824
|
-
* show from that repo. */
|
|
1825
|
-
importedSkills: z14.array(z14.string()).optional()
|
|
1826
|
-
});
|
|
1827
|
-
var WORKSPACE_UI_STATE_MAX_KEYS = 200;
|
|
1828
|
-
var TASK_TABLE_MAX_COLUMNS = 50;
|
|
1829
|
-
var setWorkspaceUiStateInputSchema = z14.looseObject({
|
|
1830
|
-
...workspaceUiStateSchema.shape,
|
|
1831
|
-
sidebar: z14.looseObject({
|
|
1832
|
-
collapsed: z14.record(z14.string().min(1).max(64), z14.boolean()).refine((map) => Object.keys(map).length <= WORKSPACE_UI_STATE_MAX_KEYS, {
|
|
1833
|
-
message: `sidebar.collapsed must have at most ${WORKSPACE_UI_STATE_MAX_KEYS} entries`
|
|
1834
|
-
}).optional()
|
|
1835
|
-
}).optional(),
|
|
1836
|
-
dismissedProviderAuthFailures: z14.strictObject({
|
|
1837
|
-
claude: z14.string().min(1).max(128).optional(),
|
|
1838
|
-
codex: z14.string().min(1).max(128).optional(),
|
|
1839
|
-
opencode: z14.string().min(1).max(128).optional(),
|
|
1840
|
-
pi: z14.string().min(1).max(128).optional(),
|
|
1841
|
-
cursor: z14.string().min(1).max(128).optional()
|
|
1842
|
-
}).optional(),
|
|
1843
|
-
importedSkills: z14.array(z14.string().min(1).max(200)).max(WORKSPACE_UI_STATE_MAX_KEYS).optional(),
|
|
1844
|
-
taskTable: taskTableUiStateSchema.extend({
|
|
1845
|
-
expandedColumns: z14.record(z14.string().min(1).max(64), z14.boolean()).refine((map) => Object.keys(map).length <= TASK_TABLE_MAX_COLUMNS, {
|
|
1846
|
-
message: `taskTable.expandedColumns must have at most ${TASK_TABLE_MAX_COLUMNS} entries`
|
|
1847
|
-
}).optional()
|
|
1848
|
-
}).optional()
|
|
1849
|
-
}).superRefine((data, ctx) => {
|
|
1850
|
-
if (Object.keys(data).length > WORKSPACE_UI_STATE_MAX_KEYS) {
|
|
1851
|
-
ctx.addIssue({
|
|
1852
|
-
code: "custom",
|
|
1853
|
-
message: `ui-state has too many keys (max ${WORKSPACE_UI_STATE_MAX_KEYS})`
|
|
1854
|
-
});
|
|
1855
|
-
}
|
|
1856
|
-
});
|
|
1857
|
-
var runnerModelsSchema = z14.object({
|
|
1858
|
-
claude: z14.string().optional(),
|
|
1859
|
-
codex: z14.string().optional(),
|
|
1860
|
-
opencode: z14.string().optional(),
|
|
1861
|
-
pi: z14.string().optional(),
|
|
1862
|
-
cursor: z14.string().optional()
|
|
1863
|
-
});
|
|
1864
|
-
var configResponseSchema = z14.object({
|
|
1865
|
-
baseBranch: z14.string().nullable(),
|
|
1866
|
-
defaultRunner: runnerSchema,
|
|
1867
|
-
systemPrompt: z14.string().nullable(),
|
|
1868
|
-
defaultModels: runnerModelsSchema,
|
|
1869
|
-
/** True when native coding-agent settings are authoritative and model picks are read-only. */
|
|
1870
|
-
modelsLocked: z14.boolean(),
|
|
1871
|
-
/** How many tasks run at once (1–16). */
|
|
1872
|
-
maxParallel: z14.number(),
|
|
1873
|
-
/** Per-task memory ceiling in MiB (whole process tree); null = no limit. */
|
|
1874
|
-
memoryLimitMb: z14.number().nullable(),
|
|
1875
|
-
/** Keep the last N finished worktrees on disk (#483); 0 = unlimited. Older ones are reclaimed
|
|
1876
|
-
* (directory only — branch kept, so work is recoverable). */
|
|
1877
|
-
worktreeRetention: z14.number(),
|
|
1878
|
-
/** Live title updates: null = no config key, the `CEZ_TITLE_UPDATES` env default (ON) decides. */
|
|
1879
|
-
liveTitleUpdates: z14.boolean().nullable(),
|
|
1880
|
-
/** Optional review gate (#489): null = no config key, the `CEZ_REVIEW_GATE` env default (OFF)
|
|
1881
|
-
* decides. */
|
|
1882
|
-
reviewGate: z14.boolean().nullable()
|
|
1883
|
-
});
|
|
1884
|
-
var setConfigResponseSchema = configResponseSchema;
|
|
1885
|
-
var setConfigInputSchema = z14.object({
|
|
1886
|
-
baseBranch: z14.string().trim().min(1).max(200).nullable().optional(),
|
|
1887
|
-
defaultRunner: runnerSchema.optional(),
|
|
1888
|
-
systemPrompt: z14.string().trim().max(2e4).nullable().optional(),
|
|
1889
|
-
defaultModels: z14.object({
|
|
1890
|
-
claude: z14.string().trim().max(200).nullable().optional(),
|
|
1891
|
-
codex: z14.string().trim().max(200).nullable().optional(),
|
|
1892
|
-
opencode: z14.string().trim().max(200).nullable().optional(),
|
|
1893
|
-
pi: z14.string().trim().max(200).nullable().optional(),
|
|
1894
|
-
cursor: z14.string().trim().max(200).nullable().optional()
|
|
1895
|
-
}).optional(),
|
|
1896
|
-
maxParallel: z14.number().int().min(1).max(16).optional(),
|
|
1897
|
-
/** null or 0 clears the ceiling back to "no limit". */
|
|
1898
|
-
memoryLimitMb: z14.number().int().min(0).max(1048576).nullable().optional(),
|
|
1899
|
-
/** Keep last N finished worktrees (#483); 0 = unlimited, null clears back to the default (10). */
|
|
1900
|
-
worktreeRetention: z14.number().int().min(0).max(1e3).nullable().optional(),
|
|
1901
|
-
/** null clears the key back to the env-default behavior. */
|
|
1902
|
-
liveTitleUpdates: z14.boolean().nullable().optional(),
|
|
1903
|
-
/** null clears the key back to the env-default behavior (OFF). */
|
|
1904
|
-
reviewGate: z14.boolean().nullable().optional()
|
|
1905
|
-
});
|
|
1906
|
-
var skillsUpdateStatusSchema = z14.enum([
|
|
1907
|
-
"idle",
|
|
1908
|
-
"checking",
|
|
1909
|
-
"available",
|
|
1910
|
-
"updating",
|
|
1911
|
-
"current",
|
|
1912
|
-
"unavailable",
|
|
1913
|
-
"error"
|
|
1914
|
-
]);
|
|
1915
|
-
var skillsUpdateScopeStateSchema = z14.object({
|
|
1916
|
-
scope: z14.enum(["project", "global"]),
|
|
1917
|
-
status: skillsUpdateStatusSchema,
|
|
1918
|
-
available: z14.boolean(),
|
|
1919
|
-
skills: z14.array(z14.string()),
|
|
1920
|
-
checkedAt: z14.string().nullable(),
|
|
1921
|
-
updatedAt: z14.string().nullable(),
|
|
1922
|
-
reason: z14.string().optional()
|
|
1923
|
-
});
|
|
1924
|
-
var skillsUpdateStateSchema = z14.object({
|
|
1925
|
-
status: skillsUpdateStatusSchema,
|
|
1926
|
-
available: z14.boolean(),
|
|
1927
|
-
autoUpdateEnabled: z14.boolean(),
|
|
1928
|
-
inherited: z14.boolean(),
|
|
1929
|
-
checkedAt: z14.string().nullable(),
|
|
1930
|
-
updatedAt: z14.string().nullable(),
|
|
1931
|
-
scopes: z14.array(skillsUpdateScopeStateSchema),
|
|
1932
|
-
needsUpgradeNotes: z14.boolean()
|
|
1933
|
-
});
|
|
1934
|
-
var providerIdSchema = runnerSchema;
|
|
1935
|
-
var providerConnectionStateSchema = z14.enum([
|
|
1936
|
-
"connected",
|
|
1937
|
-
"disconnected",
|
|
1938
|
-
"not-installed",
|
|
1939
|
-
"unknown"
|
|
1940
|
-
]);
|
|
1941
|
-
var providerStatusSchema = z14.object({
|
|
1942
|
-
provider: providerIdSchema,
|
|
1943
|
-
status: providerConnectionStateSchema,
|
|
1944
|
-
enabled: z14.boolean().optional(),
|
|
1945
|
-
hint: z14.string().optional(),
|
|
1946
|
-
authFailureId: z14.string().optional(),
|
|
1947
|
-
/** Which agent account this row describes (spec 2026-07-29-agent-profiles). ABSENT on
|
|
1948
|
-
* `GET /api/v1/providers/status`, which deliberately keeps answering exactly one row per
|
|
1949
|
-
* provider — the discovered default — so an older client sees no change at all. Per-account
|
|
1950
|
-
* rows are carried by `GET /api/v1/workspace/agent-profiles` instead. */
|
|
1951
|
-
profileId: z14.string().optional()
|
|
1952
|
-
});
|
|
1953
|
-
var providerStatusResponseSchema = z14.object({
|
|
1954
|
-
providers: z14.array(providerStatusSchema)
|
|
1955
|
-
});
|
|
1956
|
-
var providerConnectResponseSchema = z14.discriminatedUnion("opened", [
|
|
1957
|
-
z14.object({ opened: z14.literal(true), command: z14.string() }),
|
|
1958
|
-
z14.object({ opened: z14.literal(false), connected: z14.literal(true), command: z14.string() })
|
|
1959
|
-
]);
|
|
1960
|
-
var modelDiscoveryRunnerSchema = z14.enum(["claude", "codex", "opencode", "pi", "cursor"]);
|
|
1961
|
-
var MODEL_DISCOVERY_RUNNERS = modelDiscoveryRunnerSchema.options;
|
|
1962
|
-
function runnerDiscoversModels(runner) {
|
|
1963
|
-
return MODEL_DISCOVERY_RUNNERS.includes(runner);
|
|
1964
|
-
}
|
|
1965
|
-
var runnerModelOptionSchema = z14.object({
|
|
1966
|
-
id: z14.string(),
|
|
1967
|
-
label: z14.string(),
|
|
1968
|
-
description: z14.string(),
|
|
1969
|
-
effortLevels: z14.array(effortLevelSchema).optional()
|
|
1970
|
-
});
|
|
1971
|
-
var runnerModelCatalogResponseSchema = z14.object({
|
|
1972
|
-
runner: runnerSchema,
|
|
1973
|
-
models: z14.array(runnerModelOptionSchema),
|
|
1974
|
-
source: z14.enum(["live", "cache", "unavailable"]),
|
|
1975
|
-
stale: z14.boolean(),
|
|
1976
|
-
reason: z14.string().optional()
|
|
1977
|
-
});
|
|
1978
|
-
var openTargetSchema = z14.object({
|
|
1979
|
-
id: z14.string(),
|
|
1980
|
-
label: z14.string(),
|
|
1981
|
-
/** A stable icon key (#361) the UI maps to a concrete icon. Optional: an older server omitting
|
|
1982
|
-
* it just renders the generic fallback icon. */
|
|
1983
|
-
icon: z14.string().optional()
|
|
1984
|
-
});
|
|
1985
|
-
var openTargetsResponseSchema = z14.object({
|
|
1986
|
-
targets: z14.array(openTargetSchema)
|
|
1987
|
-
});
|
|
1988
|
-
var openProjectInSchema = z14.object({
|
|
1989
|
-
// A short bound (#429): matched against a downstream allowlist, so an app id is never long.
|
|
1990
|
-
target: z14.string().trim().min(1, "target required").max(200)
|
|
2051
|
+
truncated: z15.boolean()
|
|
1991
2052
|
});
|
|
1992
|
-
var
|
|
1993
|
-
|
|
1994
|
-
path: z14.string()
|
|
2053
|
+
var launchKeyResponseSchema = z15.object({
|
|
2054
|
+
key: z15.string()
|
|
1995
2055
|
});
|
|
1996
2056
|
|
|
1997
2057
|
// ../contract/src/skills.ts
|
|
1998
|
-
import { z as
|
|
1999
|
-
var skillSchema =
|
|
2000
|
-
name:
|
|
2001
|
-
description:
|
|
2058
|
+
import { z as z16 } from "zod";
|
|
2059
|
+
var skillSchema = z16.object({
|
|
2060
|
+
name: z16.string(),
|
|
2061
|
+
description: z16.string().optional(),
|
|
2002
2062
|
/** Advisory hint for untouched composer run-mode choices. */
|
|
2003
|
-
interactive:
|
|
2004
|
-
body:
|
|
2005
|
-
path:
|
|
2006
|
-
source:
|
|
2063
|
+
interactive: z16.literal(true).optional(),
|
|
2064
|
+
body: z16.string(),
|
|
2065
|
+
path: z16.string(),
|
|
2066
|
+
source: z16.enum(["ai", "cezar", "agents", "global", "team"]),
|
|
2007
2067
|
/** Team skills only: where the definition lives in its skills repo. */
|
|
2008
|
-
team:
|
|
2009
|
-
repo:
|
|
2010
|
-
ref:
|
|
2011
|
-
path:
|
|
2068
|
+
team: z16.object({
|
|
2069
|
+
repo: z16.string(),
|
|
2070
|
+
ref: z16.string(),
|
|
2071
|
+
path: z16.string(),
|
|
2012
2072
|
/** True for the `SKILL.md` convention — a whole directory (references/…). */
|
|
2013
|
-
dir:
|
|
2073
|
+
dir: z16.boolean(),
|
|
2014
2074
|
/**
|
|
2015
2075
|
* The exact commit `ref` resolved to when the skill was read (#428).
|
|
2016
2076
|
*
|
|
2017
2077
|
* The hand-written DTO omitted this field entirely — it was NARROWER than the route,
|
|
2018
2078
|
* which has served it since #428.
|
|
2019
2079
|
*/
|
|
2020
|
-
commit:
|
|
2080
|
+
commit: z16.string().optional()
|
|
2021
2081
|
}).optional()
|
|
2022
2082
|
});
|
|
2023
|
-
var importableSkillSchema =
|
|
2024
|
-
name:
|
|
2025
|
-
description:
|
|
2083
|
+
var importableSkillSchema = z16.object({
|
|
2084
|
+
name: z16.string(),
|
|
2085
|
+
description: z16.string().optional()
|
|
2026
2086
|
});
|
|
2027
|
-
var todoItemSchema =
|
|
2028
|
-
id:
|
|
2029
|
-
ts:
|
|
2030
|
-
taskId:
|
|
2031
|
-
summary:
|
|
2032
|
-
action:
|
|
2033
|
-
prUrl:
|
|
2034
|
-
suggestedSkill:
|
|
2035
|
-
suggestedArgs:
|
|
2036
|
-
suggestedPrompt:
|
|
2087
|
+
var todoItemSchema = z16.object({
|
|
2088
|
+
id: z16.string(),
|
|
2089
|
+
ts: z16.string().optional(),
|
|
2090
|
+
taskId: z16.string().optional(),
|
|
2091
|
+
summary: z16.string().min(1),
|
|
2092
|
+
action: z16.string().optional(),
|
|
2093
|
+
prUrl: z16.string().optional(),
|
|
2094
|
+
suggestedSkill: z16.string().optional(),
|
|
2095
|
+
suggestedArgs: z16.string().optional(),
|
|
2096
|
+
suggestedPrompt: z16.string().optional(),
|
|
2037
2097
|
/** Explicit intent; missing infers from suggestedSkill/suggestedPrompt for old files. */
|
|
2038
|
-
runnable:
|
|
2098
|
+
runnable: z16.boolean().optional(),
|
|
2039
2099
|
/** Set once a task was started from this entry — it then leaves the inbox and stays as
|
|
2040
2100
|
* the audit trail. A later launch never overwrites the first. */
|
|
2041
|
-
startedTaskId:
|
|
2101
|
+
startedTaskId: z16.string().optional()
|
|
2042
2102
|
});
|
|
2043
|
-
var removeTodoResponseSchema =
|
|
2044
|
-
removed:
|
|
2103
|
+
var removeTodoResponseSchema = z16.object({
|
|
2104
|
+
removed: z16.literal(true)
|
|
2045
2105
|
});
|
|
2046
|
-
var startTodoResponseSchema =
|
|
2106
|
+
var startTodoResponseSchema = z16.object({
|
|
2047
2107
|
run: runRecordSchema
|
|
2048
2108
|
});
|
|
2049
2109
|
|
|
2050
2110
|
// ../contract/src/agent-config.ts
|
|
2051
|
-
import { z as
|
|
2052
|
-
var agentConfigFormatSchema =
|
|
2053
|
-
var agentConfigScopeSchema =
|
|
2054
|
-
var agentConfigKindSchema =
|
|
2055
|
-
var agentConfigTrackedSchema =
|
|
2056
|
-
var agentConfigFileSchema =
|
|
2111
|
+
import { z as z17 } from "zod";
|
|
2112
|
+
var agentConfigFormatSchema = z17.enum(["json", "jsonc", "toml", "markdown"]);
|
|
2113
|
+
var agentConfigScopeSchema = z17.enum(["user", "project", "local"]);
|
|
2114
|
+
var agentConfigKindSchema = z17.enum(["settings", "memory", "mcp"]);
|
|
2115
|
+
var agentConfigTrackedSchema = z17.enum(["tracked", "gitignored", "outside-repo"]);
|
|
2116
|
+
var agentConfigFileSchema = z17.object({
|
|
2057
2117
|
/** Stable, opaque, URL-safe — the ONLY thing a client may name (traversal-proof). */
|
|
2058
|
-
id:
|
|
2118
|
+
id: z17.string(),
|
|
2059
2119
|
/** Every runner that reads this file: `<repo>/AGENTS.md` is one file, two readers. */
|
|
2060
|
-
runners:
|
|
2120
|
+
runners: z17.array(runnerSchema),
|
|
2061
2121
|
kind: agentConfigKindSchema,
|
|
2062
2122
|
scope: agentConfigScopeSchema,
|
|
2063
|
-
label:
|
|
2064
|
-
path:
|
|
2123
|
+
label: z17.string(),
|
|
2124
|
+
path: z17.string(),
|
|
2065
2125
|
format: agentConfigFormatSchema,
|
|
2066
2126
|
tracked: agentConfigTrackedSchema,
|
|
2067
|
-
seeded:
|
|
2068
|
-
holdsMcp:
|
|
2127
|
+
seeded: z17.boolean(),
|
|
2128
|
+
holdsMcp: z17.boolean(),
|
|
2069
2129
|
/** VERBATIM from the vendor docs. Never computed, never generic. */
|
|
2070
|
-
precedence:
|
|
2130
|
+
precedence: z17.string(),
|
|
2071
2131
|
/** Documented mid-run reload behaviour, or absent when the vendor is silent. */
|
|
2072
|
-
hotReload:
|
|
2073
|
-
docsUrl:
|
|
2074
|
-
exists:
|
|
2075
|
-
size:
|
|
2132
|
+
hotReload: z17.string().optional(),
|
|
2133
|
+
docsUrl: z17.string(),
|
|
2134
|
+
exists: z17.boolean(),
|
|
2135
|
+
size: z17.number(),
|
|
2076
2136
|
/** sha256 of the bytes, or null when absent. */
|
|
2077
|
-
version:
|
|
2137
|
+
version: z17.string().nullable(),
|
|
2078
2138
|
/** False in hosted mode (whole feature) — the client renders read-only up front. */
|
|
2079
|
-
writable:
|
|
2080
|
-
readOnlyReason:
|
|
2139
|
+
writable: z17.boolean(),
|
|
2140
|
+
readOnlyReason: z17.string().optional()
|
|
2081
2141
|
});
|
|
2082
|
-
var userMcpListingSchema =
|
|
2083
|
-
path:
|
|
2084
|
-
servers:
|
|
2085
|
-
readable:
|
|
2142
|
+
var userMcpListingSchema = z17.object({
|
|
2143
|
+
path: z17.string(),
|
|
2144
|
+
servers: z17.array(z17.string()),
|
|
2145
|
+
readable: z17.boolean()
|
|
2086
2146
|
});
|
|
2087
|
-
var agentConfigListingSchema =
|
|
2088
|
-
editable:
|
|
2089
|
-
files:
|
|
2147
|
+
var agentConfigListingSchema = z17.object({
|
|
2148
|
+
editable: z17.boolean(),
|
|
2149
|
+
files: z17.array(agentConfigFileSchema),
|
|
2090
2150
|
/** null in hosted mode (host-state disclosure guard). */
|
|
2091
2151
|
userMcp: userMcpListingSchema.nullable()
|
|
2092
2152
|
});
|
|
2093
|
-
var agentConfigFileContentSchema =
|
|
2094
|
-
id:
|
|
2095
|
-
path:
|
|
2096
|
-
exists:
|
|
2097
|
-
content:
|
|
2153
|
+
var agentConfigFileContentSchema = z17.object({
|
|
2154
|
+
id: z17.string(),
|
|
2155
|
+
path: z17.string(),
|
|
2156
|
+
exists: z17.boolean(),
|
|
2157
|
+
content: z17.string(),
|
|
2098
2158
|
/** sha256 of the bytes, or null when the file does not exist yet. */
|
|
2099
|
-
version:
|
|
2159
|
+
version: z17.string().nullable()
|
|
2100
2160
|
});
|
|
2101
|
-
var setAgentConfigInputSchema =
|
|
2102
|
-
content:
|
|
2103
|
-
version:
|
|
2161
|
+
var setAgentConfigInputSchema = z17.object({
|
|
2162
|
+
content: z17.string().max(2e6),
|
|
2163
|
+
version: z17.string().nullable()
|
|
2104
2164
|
});
|
|
2105
2165
|
|
|
2106
2166
|
// ../contract/src/agent-profiles.ts
|
|
2107
|
-
import { z as
|
|
2167
|
+
import { z as z18 } from "zod";
|
|
2108
2168
|
var DEFAULT_AGENT_ACCOUNT_ID = "default";
|
|
2109
|
-
var agentAccountFileSchema =
|
|
2110
|
-
id:
|
|
2169
|
+
var agentAccountFileSchema = z18.object({
|
|
2170
|
+
id: z18.string(),
|
|
2111
2171
|
/** e.g. `settings.json` — the file's own name, since the folder is shown once on the account. */
|
|
2112
|
-
label:
|
|
2172
|
+
label: z18.string(),
|
|
2113
2173
|
/** Absolute, resolved inside this account's config folder. */
|
|
2114
|
-
path:
|
|
2115
|
-
exists:
|
|
2174
|
+
path: z18.string(),
|
|
2175
|
+
exists: z18.boolean()
|
|
2116
2176
|
});
|
|
2117
|
-
var agentProfileSchema =
|
|
2177
|
+
var agentProfileSchema = z18.object({
|
|
2118
2178
|
/** `default` for the discovered profile, else the stored slug. */
|
|
2119
|
-
id:
|
|
2179
|
+
id: z18.string(),
|
|
2120
2180
|
provider: providerIdSchema,
|
|
2121
|
-
label:
|
|
2181
|
+
label: z18.string(),
|
|
2122
2182
|
/** As the user wrote it — a literal `~` is preserved, matching `browseRoot`/`projectsDir`. */
|
|
2123
|
-
configDir:
|
|
2183
|
+
configDir: z18.string(),
|
|
2124
2184
|
/** Expanded absolute path. Same-origin route, like `ProjectListEntry.root`. */
|
|
2125
|
-
path:
|
|
2185
|
+
path: z18.string(),
|
|
2126
2186
|
/** False for a dir the CLI has not created yet — legitimate, and NOT a reason to fall back
|
|
2127
2187
|
* to another account at run time (that would silently bill the wrong subscription). */
|
|
2128
|
-
exists:
|
|
2188
|
+
exists: z18.boolean(),
|
|
2129
2189
|
/** Whether the dir carries this agent's own marker files. ADVISORY: an unrecognised dir is
|
|
2130
2190
|
* still accepted, because "add profile → Connect → the CLI creates it" is the real flow. */
|
|
2131
|
-
looksValid:
|
|
2191
|
+
looksValid: z18.boolean(),
|
|
2132
2192
|
/** True for the profile cezar discovers from the environment. Never stored, never deletable. */
|
|
2133
|
-
isDefault:
|
|
2193
|
+
isDefault: z18.boolean(),
|
|
2134
2194
|
/** This account's own authentication state — two Claude logins answer independently.
|
|
2135
2195
|
*
|
|
2136
2196
|
* **Absent until the probe has warmed.** Every probe shells out to an agent CLI, and this
|
|
@@ -2141,36 +2201,36 @@ var agentProfileSchema = z17.object({
|
|
|
2141
2201
|
status: providerStatusSchema.optional(),
|
|
2142
2202
|
/** This agent's own user-scope config files, resolved inside THIS account's folder — so a
|
|
2143
2203
|
* second login's `settings.json` is the one you open, not the default account's. */
|
|
2144
|
-
files:
|
|
2204
|
+
files: z18.array(agentAccountFileSchema)
|
|
2145
2205
|
});
|
|
2146
2206
|
function agentAccountRouteId(profile) {
|
|
2147
2207
|
return profile.isDefault ? `default:${profile.provider}` : profile.id;
|
|
2148
2208
|
}
|
|
2149
|
-
var agentAccountSelectionSchema =
|
|
2150
|
-
claude:
|
|
2151
|
-
codex:
|
|
2152
|
-
opencode:
|
|
2153
|
-
pi:
|
|
2154
|
-
cursor:
|
|
2155
|
-
});
|
|
2156
|
-
var agentProfilesResponseSchema =
|
|
2157
|
-
editable:
|
|
2158
|
-
profiles:
|
|
2209
|
+
var agentAccountSelectionSchema = z18.object({
|
|
2210
|
+
claude: z18.string().optional(),
|
|
2211
|
+
codex: z18.string().optional(),
|
|
2212
|
+
opencode: z18.string().optional(),
|
|
2213
|
+
pi: z18.string().optional(),
|
|
2214
|
+
cursor: z18.string().optional()
|
|
2215
|
+
});
|
|
2216
|
+
var agentProfilesResponseSchema = z18.object({
|
|
2217
|
+
editable: z18.boolean(),
|
|
2218
|
+
profiles: z18.array(agentProfileSchema),
|
|
2159
2219
|
/** Providers that can carry more than one account at all — what "Add account" is offered for.
|
|
2160
2220
|
* OpenCode is absent: its credentials live in a SQLite DB behind a separate `OPENCODE_DB`, so
|
|
2161
2221
|
* a config-dir profile would swap settings while still billing the other account. */
|
|
2162
|
-
profileCapableProviders:
|
|
2222
|
+
profileCapableProviders: z18.array(providerIdSchema),
|
|
2163
2223
|
/** Which account each project uses, keyed by the project's realpath'd ROOT.
|
|
2164
2224
|
*
|
|
2165
2225
|
* Served here rather than on `GET /api/v1/projects` because it is stored beside the accounts it
|
|
2166
2226
|
* names (`~/.cezar/agent-accounts.json`) — one file, so deleting an account and scrubbing every
|
|
2167
2227
|
* reference to it is one atomic write, and neither can be dropped by a cezar version that never
|
|
2168
2228
|
* heard of accounts. Empty in hosted mode, where the whole family is withheld. */
|
|
2169
|
-
selections:
|
|
2229
|
+
selections: z18.record(z18.string(), agentAccountSelectionSchema),
|
|
2170
2230
|
/** The machine-wide fallback account per provider, used by any repo that has chosen none. */
|
|
2171
2231
|
defaults: agentAccountSelectionSchema
|
|
2172
2232
|
});
|
|
2173
|
-
var selectAgentProfileInputSchema =
|
|
2233
|
+
var selectAgentProfileInputSchema = z18.object({
|
|
2174
2234
|
/**
|
|
2175
2235
|
* Registry slug, or the reserved `default` boot alias. Resolved to a root server-side.
|
|
2176
2236
|
*
|
|
@@ -2178,223 +2238,224 @@ var selectAgentProfileInputSchema = z17.object({
|
|
|
2178
2238
|
* chosen nothing uses, so a second login is set up once rather than per checkout. A repo's own
|
|
2179
2239
|
* choice always wins over it, which is what keeps this a default and not an override.
|
|
2180
2240
|
*/
|
|
2181
|
-
projectId:
|
|
2241
|
+
projectId: z18.string().min(1).max(64).nullable(),
|
|
2182
2242
|
provider: providerIdSchema,
|
|
2183
|
-
profileId:
|
|
2243
|
+
profileId: z18.string().max(64).nullable()
|
|
2184
2244
|
});
|
|
2185
|
-
var agentProfileSelectionsResponseSchema =
|
|
2186
|
-
selections:
|
|
2245
|
+
var agentProfileSelectionsResponseSchema = z18.object({
|
|
2246
|
+
selections: z18.record(z18.string(), agentAccountSelectionSchema),
|
|
2187
2247
|
/** The machine-wide fallback, for repos with no selection of their own. */
|
|
2188
2248
|
defaults: agentAccountSelectionSchema
|
|
2189
2249
|
});
|
|
2190
|
-
var agentAccountStatusResponseSchema =
|
|
2191
|
-
var agentAccountDetailsResponseSchema =
|
|
2192
|
-
available:
|
|
2193
|
-
reason:
|
|
2194
|
-
fields:
|
|
2250
|
+
var agentAccountStatusResponseSchema = z18.object({ status: providerStatusSchema });
|
|
2251
|
+
var agentAccountDetailsResponseSchema = z18.object({
|
|
2252
|
+
available: z18.boolean(),
|
|
2253
|
+
reason: z18.string().optional(),
|
|
2254
|
+
fields: z18.array(z18.object({ label: z18.string(), value: z18.string() }))
|
|
2195
2255
|
});
|
|
2196
|
-
var openAgentAccountFileInputSchema =
|
|
2197
|
-
file:
|
|
2198
|
-
target:
|
|
2256
|
+
var openAgentAccountFileInputSchema = z18.object({
|
|
2257
|
+
file: z18.string().min(1).max(200),
|
|
2258
|
+
target: z18.string().min(1).max(64).optional()
|
|
2199
2259
|
});
|
|
2200
|
-
var openAgentAccountFileResponseSchema =
|
|
2201
|
-
opened:
|
|
2202
|
-
path:
|
|
2260
|
+
var openAgentAccountFileResponseSchema = z18.object({
|
|
2261
|
+
opened: z18.literal(true),
|
|
2262
|
+
path: z18.string()
|
|
2203
2263
|
});
|
|
2204
|
-
var createAgentProfileInputSchema =
|
|
2264
|
+
var createAgentProfileInputSchema = z18.object({
|
|
2205
2265
|
provider: providerIdSchema,
|
|
2206
|
-
label:
|
|
2266
|
+
label: z18.string().trim().max(200).optional(),
|
|
2207
2267
|
/** Stored as written; validated absolute after `~` expansion, server-side. */
|
|
2208
|
-
configDir:
|
|
2268
|
+
configDir: z18.string().trim().min(1).max(4096)
|
|
2209
2269
|
});
|
|
2210
|
-
var agentProfileResponseSchema =
|
|
2211
|
-
var updateAgentProfileInputSchema =
|
|
2212
|
-
label:
|
|
2213
|
-
configDir:
|
|
2270
|
+
var agentProfileResponseSchema = z18.object({ profile: agentProfileSchema });
|
|
2271
|
+
var updateAgentProfileInputSchema = z18.object({
|
|
2272
|
+
label: z18.string().trim().max(200).optional(),
|
|
2273
|
+
configDir: z18.string().trim().min(1).max(4096).optional()
|
|
2214
2274
|
});
|
|
2215
|
-
var removeAgentProfileResponseSchema =
|
|
2216
|
-
removed:
|
|
2217
|
-
id:
|
|
2275
|
+
var removeAgentProfileResponseSchema = z18.object({
|
|
2276
|
+
removed: z18.literal(true),
|
|
2277
|
+
id: z18.string()
|
|
2218
2278
|
});
|
|
2219
2279
|
|
|
2220
2280
|
// ../contract/src/automations.ts
|
|
2221
|
-
import { z as
|
|
2222
|
-
var automationEventSchema =
|
|
2281
|
+
import { z as z19 } from "zod";
|
|
2282
|
+
var automationEventSchema = z19.enum([
|
|
2223
2283
|
"pull_request.opened",
|
|
2224
2284
|
"issue.opened",
|
|
2225
2285
|
"issue.labeled",
|
|
2226
2286
|
"issue.unlabeled"
|
|
2227
2287
|
]);
|
|
2228
|
-
var automationFiltersSchema =
|
|
2229
|
-
authors:
|
|
2230
|
-
assignees:
|
|
2231
|
-
allLabels:
|
|
2232
|
-
anyLabels:
|
|
2233
|
-
excludeLabels:
|
|
2288
|
+
var automationFiltersSchema = z19.object({
|
|
2289
|
+
authors: z19.array(z19.string()).optional(),
|
|
2290
|
+
assignees: z19.array(z19.string()).optional(),
|
|
2291
|
+
allLabels: z19.array(z19.string()).optional(),
|
|
2292
|
+
anyLabels: z19.array(z19.string()).optional(),
|
|
2293
|
+
excludeLabels: z19.array(z19.string()).optional(),
|
|
2234
2294
|
/** Required for the two label events — the server rejects a definition without it. */
|
|
2235
|
-
changedLabels:
|
|
2236
|
-
lookbackDays:
|
|
2237
|
-
maxRecords:
|
|
2295
|
+
changedLabels: z19.array(z19.string()).optional(),
|
|
2296
|
+
lookbackDays: z19.number(),
|
|
2297
|
+
maxRecords: z19.number()
|
|
2238
2298
|
});
|
|
2239
2299
|
var automationTaskSchema = createRunInputBaseSchema.omit({ task: true, images: true, todoId: true, systemPrompt: true }).extend({
|
|
2240
2300
|
/** The prompt template. `{{github.number}}`, `{{github.title}}`, `{{github.url}}` and
|
|
2241
2301
|
* `{{github.labels}}` are substituted per match; GitHub content is appended as untrusted
|
|
2242
2302
|
* context, never interpolated into instructions. */
|
|
2243
|
-
prompt:
|
|
2244
|
-
variants:
|
|
2245
|
-
systemPrompt:
|
|
2303
|
+
prompt: z19.string(),
|
|
2304
|
+
variants: z19.union([z19.literal(1), z19.literal(2), z19.literal(3)]).optional(),
|
|
2305
|
+
systemPrompt: z19.string().optional()
|
|
2246
2306
|
});
|
|
2247
|
-
var automationDefinitionSchema =
|
|
2248
|
-
id:
|
|
2307
|
+
var automationDefinitionSchema = z19.object({
|
|
2308
|
+
id: z19.string(),
|
|
2249
2309
|
/** Bumped on every edit; a PUT must echo the revision it read (optimistic concurrency). */
|
|
2250
|
-
revision:
|
|
2251
|
-
name:
|
|
2252
|
-
description:
|
|
2310
|
+
revision: z19.number(),
|
|
2311
|
+
name: z19.string(),
|
|
2312
|
+
description: z19.string().optional(),
|
|
2253
2313
|
/** Always present: the storage schema defaults it to `false`, so a definition is created
|
|
2254
2314
|
* PAUSED and enabling it is a separate, baseline-establishing act. */
|
|
2255
|
-
enabled:
|
|
2256
|
-
events:
|
|
2257
|
-
intervalSeconds:
|
|
2315
|
+
enabled: z19.boolean(),
|
|
2316
|
+
events: z19.array(automationEventSchema),
|
|
2317
|
+
intervalSeconds: z19.number(),
|
|
2258
2318
|
filters: automationFiltersSchema,
|
|
2259
2319
|
task: automationTaskSchema,
|
|
2260
|
-
createdAt:
|
|
2261
|
-
updatedAt:
|
|
2320
|
+
createdAt: z19.string(),
|
|
2321
|
+
updatedAt: z19.string()
|
|
2262
2322
|
});
|
|
2263
|
-
var automationCursorSchema =
|
|
2264
|
-
timestamp:
|
|
2265
|
-
tieBreaker:
|
|
2323
|
+
var automationCursorSchema = z19.object({
|
|
2324
|
+
timestamp: z19.string(),
|
|
2325
|
+
tieBreaker: z19.string().optional()
|
|
2266
2326
|
});
|
|
2267
|
-
var automationRuntimeStateSchema =
|
|
2327
|
+
var automationRuntimeStateSchema = z19.object({
|
|
2268
2328
|
/** The definition revision this state belongs to; a bumped revision re-baselines. */
|
|
2269
|
-
revision:
|
|
2329
|
+
revision: z19.number().optional(),
|
|
2270
2330
|
/** Enabling establishes a CURRENT-TIME baseline: records older than this never launch. */
|
|
2271
|
-
baselineAt:
|
|
2331
|
+
baselineAt: z19.string().optional(),
|
|
2272
2332
|
cursor: automationCursorSchema.optional(),
|
|
2273
|
-
frozenHighWatermark: automationCursorSchema.extend({ tieBreaker:
|
|
2274
|
-
backlogAfter: automationCursorSchema.extend({ tieBreaker:
|
|
2275
|
-
nextCheckAt:
|
|
2276
|
-
lastSuccessAt:
|
|
2333
|
+
frozenHighWatermark: automationCursorSchema.extend({ tieBreaker: z19.string() }).optional(),
|
|
2334
|
+
backlogAfter: automationCursorSchema.extend({ tieBreaker: z19.string() }).optional(),
|
|
2335
|
+
nextCheckAt: z19.string().optional(),
|
|
2336
|
+
lastSuccessAt: z19.string().optional(),
|
|
2277
2337
|
/** Per-query GitHub ETags, so an unchanged page costs no rate-limit budget. */
|
|
2278
|
-
etags:
|
|
2279
|
-
backoffUntil:
|
|
2280
|
-
consecutiveFailures:
|
|
2338
|
+
etags: z19.record(z19.string(), z19.string()).optional(),
|
|
2339
|
+
backoffUntil: z19.string().optional(),
|
|
2340
|
+
consecutiveFailures: z19.number().optional()
|
|
2281
2341
|
});
|
|
2282
|
-
var automationLogResultSchema =
|
|
2342
|
+
var automationLogResultSchema = z19.enum([
|
|
2283
2343
|
"launched",
|
|
2284
2344
|
"no-match",
|
|
2285
2345
|
"duplicate",
|
|
2286
2346
|
"rate-limited",
|
|
2287
2347
|
"error",
|
|
2288
2348
|
"baseline",
|
|
2289
|
-
"preview"
|
|
2349
|
+
"preview",
|
|
2350
|
+
"skipped"
|
|
2290
2351
|
]);
|
|
2291
|
-
var automationLogRecordSchema =
|
|
2292
|
-
seq:
|
|
2293
|
-
ts:
|
|
2294
|
-
automationId:
|
|
2295
|
-
revision:
|
|
2352
|
+
var automationLogRecordSchema = z19.object({
|
|
2353
|
+
seq: z19.number(),
|
|
2354
|
+
ts: z19.string(),
|
|
2355
|
+
automationId: z19.string(),
|
|
2356
|
+
revision: z19.number(),
|
|
2296
2357
|
event: automationEventSchema.optional(),
|
|
2297
2358
|
result: automationLogResultSchema,
|
|
2298
|
-
reason:
|
|
2299
|
-
durationMs:
|
|
2300
|
-
receiptId:
|
|
2301
|
-
runId:
|
|
2302
|
-
githubNumber:
|
|
2303
|
-
githubTitle:
|
|
2304
|
-
githubUrl:
|
|
2305
|
-
rateLimit:
|
|
2306
|
-
bucket:
|
|
2307
|
-
remaining:
|
|
2308
|
-
resetAt:
|
|
2359
|
+
reason: z19.string().optional(),
|
|
2360
|
+
durationMs: z19.number().optional(),
|
|
2361
|
+
receiptId: z19.string().optional(),
|
|
2362
|
+
runId: z19.string().optional(),
|
|
2363
|
+
githubNumber: z19.number().optional(),
|
|
2364
|
+
githubTitle: z19.string().optional(),
|
|
2365
|
+
githubUrl: z19.string().optional(),
|
|
2366
|
+
rateLimit: z19.object({
|
|
2367
|
+
bucket: z19.enum(["core", "search"]),
|
|
2368
|
+
remaining: z19.number().optional(),
|
|
2369
|
+
resetAt: z19.string().optional()
|
|
2309
2370
|
}).optional()
|
|
2310
2371
|
});
|
|
2311
|
-
var automationCountsSchema =
|
|
2312
|
-
matches:
|
|
2313
|
-
launched:
|
|
2314
|
-
duplicates:
|
|
2315
|
-
errors:
|
|
2372
|
+
var automationCountsSchema = z19.object({
|
|
2373
|
+
matches: z19.number(),
|
|
2374
|
+
launched: z19.number(),
|
|
2375
|
+
duplicates: z19.number(),
|
|
2376
|
+
errors: z19.number()
|
|
2316
2377
|
});
|
|
2317
2378
|
var automationListEntrySchema = automationDefinitionSchema.extend({
|
|
2318
2379
|
state: automationRuntimeStateSchema.optional(),
|
|
2319
2380
|
latestLog: automationLogRecordSchema.optional(),
|
|
2320
2381
|
counts: automationCountsSchema
|
|
2321
2382
|
});
|
|
2322
|
-
var automationsResponseSchema =
|
|
2323
|
-
available:
|
|
2324
|
-
reason:
|
|
2325
|
-
scheduler:
|
|
2326
|
-
state:
|
|
2327
|
-
nextDue:
|
|
2383
|
+
var automationsResponseSchema = z19.object({
|
|
2384
|
+
available: z19.boolean(),
|
|
2385
|
+
reason: z19.string().optional(),
|
|
2386
|
+
scheduler: z19.object({
|
|
2387
|
+
state: z19.enum(["scheduled", "idle"]),
|
|
2388
|
+
nextDue: z19.string().optional()
|
|
2328
2389
|
}),
|
|
2329
|
-
automations:
|
|
2390
|
+
automations: z19.array(automationListEntrySchema)
|
|
2330
2391
|
});
|
|
2331
|
-
var automationResponseSchema =
|
|
2332
|
-
var automationDetailResponseSchema =
|
|
2392
|
+
var automationResponseSchema = z19.object({ automation: automationDefinitionSchema });
|
|
2393
|
+
var automationDetailResponseSchema = z19.object({
|
|
2333
2394
|
automation: automationDefinitionSchema,
|
|
2334
2395
|
state: automationRuntimeStateSchema.optional(),
|
|
2335
2396
|
latestLog: automationLogRecordSchema.optional()
|
|
2336
2397
|
});
|
|
2337
|
-
var automationCheckSchema =
|
|
2338
|
-
id:
|
|
2339
|
-
automationId:
|
|
2340
|
-
mode:
|
|
2341
|
-
status:
|
|
2342
|
-
createdAt:
|
|
2343
|
-
completedAt:
|
|
2344
|
-
matches:
|
|
2345
|
-
truncated:
|
|
2346
|
-
error:
|
|
2347
|
-
});
|
|
2348
|
-
var automationCheckQueuedResponseSchema =
|
|
2349
|
-
var automationLogResponseSchema =
|
|
2350
|
-
records:
|
|
2351
|
-
});
|
|
2352
|
-
var automationRetryResponseSchema =
|
|
2353
|
-
receiptId:
|
|
2354
|
-
runId:
|
|
2355
|
-
});
|
|
2356
|
-
var createAutomationInputSchema = automationDefinitionSchema.omit({ id: true, revision: true, createdAt: true, updatedAt: true, enabled: true }).extend({ enable:
|
|
2398
|
+
var automationCheckSchema = z19.object({
|
|
2399
|
+
id: z19.string(),
|
|
2400
|
+
automationId: z19.string(),
|
|
2401
|
+
mode: z19.enum(["preview", "execute"]),
|
|
2402
|
+
status: z19.enum(["queued", "running", "complete", "error"]),
|
|
2403
|
+
createdAt: z19.string(),
|
|
2404
|
+
completedAt: z19.string().optional(),
|
|
2405
|
+
matches: z19.number().optional(),
|
|
2406
|
+
truncated: z19.boolean().optional(),
|
|
2407
|
+
error: z19.string().optional()
|
|
2408
|
+
});
|
|
2409
|
+
var automationCheckQueuedResponseSchema = z19.object({ checkId: z19.string() });
|
|
2410
|
+
var automationLogResponseSchema = z19.object({
|
|
2411
|
+
records: z19.array(automationLogRecordSchema)
|
|
2412
|
+
});
|
|
2413
|
+
var automationRetryResponseSchema = z19.object({
|
|
2414
|
+
receiptId: z19.string(),
|
|
2415
|
+
runId: z19.string()
|
|
2416
|
+
});
|
|
2417
|
+
var createAutomationInputSchema = automationDefinitionSchema.omit({ id: true, revision: true, createdAt: true, updatedAt: true, enabled: true }).extend({ enable: z19.boolean().optional() });
|
|
2357
2418
|
var updateAutomationInputSchema = createAutomationInputSchema.omit({ enable: true }).extend({
|
|
2358
|
-
enabled:
|
|
2359
|
-
expectedRevision:
|
|
2419
|
+
enabled: z19.boolean().optional(),
|
|
2420
|
+
expectedRevision: z19.number()
|
|
2360
2421
|
});
|
|
2361
|
-
var automationCheckInputSchema =
|
|
2362
|
-
mode:
|
|
2422
|
+
var automationCheckInputSchema = z19.object({
|
|
2423
|
+
mode: z19.enum(["preview", "execute"])
|
|
2363
2424
|
});
|
|
2364
2425
|
|
|
2365
2426
|
// ../contract/src/artifacts.ts
|
|
2366
|
-
import { z as
|
|
2367
|
-
var pathSchema =
|
|
2368
|
-
var publishedArtifactSchema =
|
|
2369
|
-
id:
|
|
2370
|
-
runId:
|
|
2371
|
-
name:
|
|
2427
|
+
import { z as z20 } from "zod";
|
|
2428
|
+
var pathSchema = z20.string().min(1).max(8192).refine((value) => !value.includes("\0"), "Path contains NUL");
|
|
2429
|
+
var publishedArtifactSchema = z20.object({
|
|
2430
|
+
id: z20.uuid(),
|
|
2431
|
+
runId: z20.uuid(),
|
|
2432
|
+
name: z20.string().min(1).max(255),
|
|
2372
2433
|
sourcePath: pathSchema.refine((value) => /^(?:\/|[A-Za-z]:[\\/]|\\\\)/.test(value), "Expected an absolute source path"),
|
|
2373
|
-
createdAt:
|
|
2374
|
-
size:
|
|
2375
|
-
sha256:
|
|
2434
|
+
createdAt: z20.iso.datetime(),
|
|
2435
|
+
size: z20.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
|
|
2436
|
+
sha256: z20.string().regex(/^[a-f0-9]{64}$/)
|
|
2376
2437
|
}).strict();
|
|
2377
|
-
var filePreviewDataSchema =
|
|
2378
|
-
type:
|
|
2438
|
+
var filePreviewDataSchema = z20.object({
|
|
2439
|
+
type: z20.literal("file"),
|
|
2379
2440
|
path: pathSchema,
|
|
2380
|
-
size:
|
|
2381
|
-
binary:
|
|
2382
|
-
tooLarge:
|
|
2383
|
-
content:
|
|
2384
|
-
source:
|
|
2441
|
+
size: z20.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
|
|
2442
|
+
binary: z20.boolean(),
|
|
2443
|
+
tooLarge: z20.boolean(),
|
|
2444
|
+
content: z20.string().optional(),
|
|
2445
|
+
source: z20.enum(["worktree", "project", "artifact"]),
|
|
2385
2446
|
artifact: publishedArtifactSchema.optional()
|
|
2386
2447
|
}).strict();
|
|
2387
|
-
var fileLinkResultSchema =
|
|
2448
|
+
var fileLinkResultSchema = z20.union([
|
|
2388
2449
|
filePreviewDataSchema,
|
|
2389
|
-
|
|
2390
|
-
type:
|
|
2450
|
+
z20.object({
|
|
2451
|
+
type: z20.enum(["unavailable", "unpublished"]),
|
|
2391
2452
|
path: pathSchema,
|
|
2392
|
-
reason:
|
|
2453
|
+
reason: z20.string().min(1).max(4096)
|
|
2393
2454
|
}).strict()
|
|
2394
2455
|
]);
|
|
2395
|
-
var artifactListSchema =
|
|
2396
|
-
var fileLinkQuerySchema =
|
|
2397
|
-
var artifactParamsSchema =
|
|
2456
|
+
var artifactListSchema = z20.object({ artifacts: z20.array(publishedArtifactSchema).max(64) }).strict();
|
|
2457
|
+
var fileLinkQuerySchema = z20.object({ path: pathSchema, raw: z20.literal("1").optional() }).strict();
|
|
2458
|
+
var artifactParamsSchema = z20.object({ id: z20.uuid(), artifactId: z20.uuid() });
|
|
2398
2459
|
export {
|
|
2399
2460
|
CI_WAIT_LIMITATION,
|
|
2400
2461
|
CI_WAIT_RECEIPT_INSTRUCTION,
|
|
@@ -2406,6 +2467,8 @@ export {
|
|
|
2406
2467
|
MODEL_DISCOVERY_RUNNERS,
|
|
2407
2468
|
PROJECT_TAGS_MAX,
|
|
2408
2469
|
PROJECT_TAG_MAX_LENGTH,
|
|
2470
|
+
PROJECT_WEBHOOK_TOKEN_MAX_LENGTH,
|
|
2471
|
+
PROJECT_WEBHOOK_URL_MAX_LENGTH,
|
|
2409
2472
|
REFERENCE_STATUS_MAX,
|
|
2410
2473
|
RUN_HISTORY_PAGE_ITEMS,
|
|
2411
2474
|
advancePendingHumanAsk,
|
|
@@ -2498,6 +2561,10 @@ export {
|
|
|
2498
2561
|
deleteRunResponseSchema,
|
|
2499
2562
|
deleteWorkflowResponseSchema,
|
|
2500
2563
|
diffStatSchema,
|
|
2564
|
+
discoveredRunnerSchema,
|
|
2565
|
+
discoveredRunnersSchema,
|
|
2566
|
+
discoveryRequestSchema,
|
|
2567
|
+
discoveryResponseSchema,
|
|
2501
2568
|
editQueuedMessageResponseSchema,
|
|
2502
2569
|
effortFieldSchema,
|
|
2503
2570
|
effortLevelSchema,
|
|
@@ -2546,7 +2613,9 @@ export {
|
|
|
2546
2613
|
markAllReadResponseSchema,
|
|
2547
2614
|
messageInputSchema,
|
|
2548
2615
|
messageResponseSchema,
|
|
2616
|
+
modelChoicesSchema,
|
|
2549
2617
|
modelDiscoveryRunnerSchema,
|
|
2618
|
+
notifyRunInputSchema,
|
|
2550
2619
|
openAgentAccountFileInputSchema,
|
|
2551
2620
|
openAgentAccountFileResponseSchema,
|
|
2552
2621
|
openInCliResponseSchema,
|
|
@@ -2563,6 +2632,8 @@ export {
|
|
|
2563
2632
|
planResponseSchema,
|
|
2564
2633
|
processUsageSchema,
|
|
2565
2634
|
projectListEntrySchema,
|
|
2635
|
+
projectWebhookInputSchema,
|
|
2636
|
+
projectWebhookUrlSchema,
|
|
2566
2637
|
projectsResponseSchema,
|
|
2567
2638
|
providerConnectResponseSchema,
|
|
2568
2639
|
providerConnectionStateSchema,
|
|
@@ -2609,6 +2680,7 @@ export {
|
|
|
2609
2680
|
runRecordSchema,
|
|
2610
2681
|
runRelationshipsSchema,
|
|
2611
2682
|
runStatusSchema,
|
|
2683
|
+
runWebhookOutcomeSchema,
|
|
2612
2684
|
runnerDiscoversModels,
|
|
2613
2685
|
runnerModelCatalogResponseSchema,
|
|
2614
2686
|
runnerModelOptionSchema,
|
|
@@ -2631,6 +2703,7 @@ export {
|
|
|
2631
2703
|
statusEntrySchema,
|
|
2632
2704
|
stepStateSchema,
|
|
2633
2705
|
stepStatusSchema,
|
|
2706
|
+
testProjectWebhookResponseSchema,
|
|
2634
2707
|
todoItemSchema,
|
|
2635
2708
|
uiStateSchema,
|
|
2636
2709
|
updateAgentProfileInputSchema,
|