@wjarka/cezarion 0.11.1 → 0.11.2-pr50.83
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/automations/task-template.js +1 -0
- package/dist/automations/task-template.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 +8 -0
- package/dist/contract/effort.d.ts +18 -0
- package/dist/contract/index.d.ts +1 -0
- package/dist/contract/index.js +919 -898
- package/dist/contract/runs.d.ts +7 -0
- package/dist/contract/skills.d.ts +1 -0
- package/dist/core/agent-runner.d.ts +4 -0
- package/dist/core/agent-runner.js.map +1 -1
- package/dist/core/claude-cli-runner.js +4 -0
- package/dist/core/claude-cli-runner.js.map +1 -1
- package/dist/core/codex-app-server-runner.d.ts +9 -0
- package/dist/core/codex-app-server-runner.js +14 -1
- package/dist/core/codex-app-server-runner.js.map +1 -1
- package/dist/core/opencode-server-runner.js +4 -0
- package/dist/core/opencode-server-runner.js.map +1 -1
- package/dist/core/pi-runner.js +4 -0
- package/dist/core/pi-runner.js.map +1 -1
- package/dist/runs/store.d.ts +3 -0
- package/dist/runs/store.js +4 -0
- package/dist/runs/store.js.map +1 -1
- package/dist/server/server.d.ts +68 -0
- package/dist/server/server.js +14 -3
- package/dist/server/server.js.map +1 -1
- package/dist/workflows/run.d.ts +7 -0
- package/dist/workflows/run.js +109 -52
- package/dist/workflows/run.js.map +1 -1
- package/package.json +3 -3
- package/scripts/mock-claude.mjs +72 -2
- package/web/dist/assets/{alert-dialog-B4Ofsgv7.js → alert-dialog-g-GVThSw.js} +1 -1
- package/web/dist/assets/arrow-down-BzmL0uj0.js +1 -0
- package/web/dist/assets/arrow-left-DtUM7GFU.js +1 -0
- package/web/dist/assets/{centered-state-duPW0phQ.js → centered-state-DdbE_pNl.js} +2 -2
- package/web/dist/assets/chevron-right-DnLh0uM2.js +1 -0
- package/web/dist/assets/{collapsible-DdcNBdSk.js → collapsible-R1r7zUOB.js} +1 -1
- package/web/dist/assets/{commit-list-CgvN9vec.js → commit-list-Bgb1DHBX.js} +1 -1
- package/web/dist/assets/{compare-variants-CQA2nd65.js → compare-variants-UA_0n_5a.js} +1 -1
- package/web/dist/assets/{diff-B6Agp5Hl.js → diff-Cv3z9esx.js} +2 -2
- package/web/dist/assets/{diff-stat-BoXuGkgq.js → diff-stat-ydfu0_5T.js} +1 -1
- package/web/dist/assets/{diff-view-CD8XI-fj.js → diff-view-DnPdkmk2.js} +1 -1
- package/web/dist/assets/{dropdown-menu-B3SYw-k5.js → dropdown-menu-CPP9gEmn.js} +1 -1
- package/web/dist/assets/{editable-title-B-hjp5wl.js → editable-title-D_bWdmY0.js} +1 -1
- package/web/dist/assets/{ellipsis-vertical-BYwzw0xl.js → ellipsis-vertical-WNkaehnw.js} +1 -1
- package/web/dist/assets/{file-BRj5eISx.js → file-RvhJlchx.js} +1 -1
- package/web/dist/assets/{folder-z4oT5981.js → folder-Dz-weqBo.js} +1 -1
- package/web/dist/assets/{git-toolbar-owSEkYld.js → git-toolbar-BEKuAjHk.js} +1 -1
- package/web/dist/assets/github-CmFHDNje.js +1 -0
- package/web/dist/assets/{image-preview-h3WFluuy.js → image-preview-DYiOSYoY.js} +1 -1
- package/web/dist/assets/index-BQTfjxFm.js +7 -0
- package/web/dist/assets/{markdown-DqBKYPiB.js → markdown-DQHRRO9e.js} +1 -1
- package/web/dist/assets/new-task-form-D2KlpqYC.js +1 -0
- package/web/dist/assets/{pill-BQfmfpYp.js → pill-FAFXjmY6.js} +1 -1
- package/web/dist/assets/{project-router-DxgFZY1l.js → project-router-Dzc0JK2j.js} +1 -1
- package/web/dist/assets/{prompt-templates-B6m16gq-.js → prompt-templates-DmqtzSPL.js} +1 -1
- package/web/dist/assets/{refresh-cw-mhSpxf2a.js → refresh-cw-BP4TkA4M.js} +1 -1
- package/web/dist/assets/{repo-git-CUNRxR3_.js → repo-git-C20pc5tT.js} +1 -1
- package/web/dist/assets/{run-diff-DsmmDVfx.js → run-diff-CvcsWwew.js} +1 -1
- package/web/dist/assets/run-header-xFlbebSJ.js +1 -0
- package/web/dist/assets/{search-x-BqDMB2g8.js → search-x-Drnmsmd0.js} +1 -1
- package/web/dist/assets/{skill-empty-hint-BWEvTggc.js → skill-empty-hint-D2l_OqZ5.js} +1 -1
- package/web/dist/assets/{skills-DwIxnnWO.js → skills-Cn2ppPow.js} +1 -1
- package/web/dist/assets/{sparkles-DIoTQpyx.js → sparkles-B9ja4FHw.js} +1 -1
- package/web/dist/assets/{square-terminal-Cc7CuQxc.js → square-terminal-CB2du-YG.js} +1 -1
- package/web/dist/assets/{tab-link-D1fQgpmO.js → tab-link-C5FWJ66Y.js} +1 -1
- package/web/dist/assets/{task-changes-BKeLlDpK.js → task-changes-CuUmQArS.js} +1 -1
- package/web/dist/assets/{task-commits-gcEFZIa5.js → task-commits-DgIWIhW9.js} +1 -1
- package/web/dist/assets/{task-files-BGAqoXTW.js → task-files-BeDXPyz5.js} +1 -1
- package/web/dist/assets/task-thread-2nmi0vcz.js +9 -0
- package/web/dist/assets/{textarea-BOVbfy5C.js → textarea-Sm6doUPO.js} +1 -1
- package/web/dist/assets/{thread-loading-CypW73KD.js → thread-loading-DojNeADh.js} +1 -1
- package/web/dist/assets/{trash-2-CJq6LHWn.js → trash-2-C_lGBXG2.js} +1 -1
- package/web/dist/assets/{triangle-alert-CjDFvU27.js → triangle-alert-Brk_ldFl.js} +1 -1
- package/web/dist/assets/{upload-CPDZlJeK.js → upload-Cxs1UROt.js} +1 -1
- package/web/dist/assets/{use-desktop-5JsLmi0a.js → use-desktop-Cmrz3npD.js} +1 -1
- package/web/dist/assets/{use-submit-shortcut-CHVFevty.js → use-submit-shortcut-DzeqN3GK.js} +1 -1
- package/web/dist/assets/{utils-DiO6zyJd.js → utils-Unt0mZvU.js} +1 -1
- package/web/dist/assets/{workflows-rQDFzWRt.js → workflows-D_GyBbup.js} +1 -1
- package/web/dist/assets/{zoomable-image-COWqb11v.js → zoomable-image-ByySCppM.js} +1 -1
- package/web/dist/index.html +22 -22
- package/web/dist/assets/arrow-down-Dy8dup7j.js +0 -1
- package/web/dist/assets/arrow-left-BJaucbhn.js +0 -1
- package/web/dist/assets/chevron-right-Be4A5TCS.js +0 -1
- package/web/dist/assets/github-Bz2VgRX3.js +0 -1
- package/web/dist/assets/index-EtQQQ6Kj.js +0 -7
- package/web/dist/assets/new-task-form-BdJKRBJX.js +0 -1
- package/web/dist/assets/run-header-BkhrseLJ.js +0 -1
- package/web/dist/assets/task-thread-DT8aUYTS.js +0 -9
package/dist/contract/index.js
CHANGED
|
@@ -45,22 +45,34 @@ var checkoutProgressEventSchema = z.object({
|
|
|
45
45
|
error: z.string().optional()
|
|
46
46
|
});
|
|
47
47
|
|
|
48
|
-
// ../contract/src/
|
|
48
|
+
// ../contract/src/effort.ts
|
|
49
49
|
import { z as z2 } from "zod";
|
|
50
|
-
var
|
|
51
|
-
var
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
var
|
|
63
|
-
|
|
50
|
+
var EFFORT_LEVELS = ["low", "medium", "high", "xhigh", "max"];
|
|
51
|
+
var effortLevelSchema = z2.enum(EFFORT_LEVELS);
|
|
52
|
+
var effortFieldSchema = z2.string().max(32).optional();
|
|
53
|
+
function parseEffort(value) {
|
|
54
|
+
const trimmed = value?.trim().toLowerCase();
|
|
55
|
+
if (!trimmed || trimmed === "auto") return void 0;
|
|
56
|
+
const parsed = effortLevelSchema.safeParse(trimmed);
|
|
57
|
+
return parsed.success ? parsed.data : void 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// ../contract/src/health.ts
|
|
61
|
+
import { z as z3 } from "zod";
|
|
62
|
+
var runnerSchema = z3.enum(["claude", "codex", "opencode", "pi"]);
|
|
63
|
+
var repoInfoSchema = z3.object({
|
|
64
|
+
root: z3.string(),
|
|
65
|
+
branch: z3.string(),
|
|
66
|
+
remote: z3.string().optional()
|
|
67
|
+
});
|
|
68
|
+
var backendCheckSchema = z3.object({
|
|
69
|
+
name: z3.enum(["claude", "codex", "opencode", "pi", "gh", "git"]),
|
|
70
|
+
available: z3.boolean(),
|
|
71
|
+
version: z3.string().optional(),
|
|
72
|
+
hint: z3.string().optional()
|
|
73
|
+
});
|
|
74
|
+
var forgeInfoSchema = z3.object({
|
|
75
|
+
kind: z3.literal("github"),
|
|
64
76
|
/**
|
|
65
77
|
* Whether the forge is reachable — **absent until the availability probe has warmed**.
|
|
66
78
|
*
|
|
@@ -68,13 +80,13 @@ var forgeInfoSchema = z2.object({
|
|
|
68
80
|
* "not determined yet", which is not the same as `false`, and the cockpit renders the two
|
|
69
81
|
* differently. Declaring it required is what made an earlier hand-written mirror wrong.
|
|
70
82
|
*/
|
|
71
|
-
available:
|
|
72
|
-
reason:
|
|
83
|
+
available: z3.boolean().optional(),
|
|
84
|
+
reason: z3.string().optional()
|
|
73
85
|
});
|
|
74
|
-
var capabilitiesSchema =
|
|
75
|
-
localHandoff:
|
|
76
|
-
followups:
|
|
77
|
-
singleProject:
|
|
86
|
+
var capabilitiesSchema = z3.object({
|
|
87
|
+
localHandoff: z3.boolean(),
|
|
88
|
+
followups: z3.boolean(),
|
|
89
|
+
singleProject: z3.boolean(),
|
|
78
90
|
/**
|
|
79
91
|
* `true` means `CEZ_AUTOMATIONS=1` opted this server into GitHub automations (#801). Off — the
|
|
80
92
|
* default — the whole feature is absent: no `Automations` nav item anywhere it is rendered, the
|
|
@@ -82,7 +94,7 @@ var capabilitiesSchema = z2.object({
|
|
|
82
94
|
*
|
|
83
95
|
* REQUIRED for the same reason as `tokenMetrics` below: this server always sends it.
|
|
84
96
|
*/
|
|
85
|
-
automations:
|
|
97
|
+
automations: z3.boolean(),
|
|
86
98
|
/**
|
|
87
99
|
* `false` means `CEZ_HIDE_TOKEN_METRICS=1` asks the browser to omit token counts and monetary
|
|
88
100
|
* cost (#481). The telemetry itself still rides in run/event payloads — this is presentation
|
|
@@ -95,74 +107,74 @@ var capabilitiesSchema = z2.object({
|
|
|
95
107
|
* `web/src/lib/token-metrics.ts`, whose `!== false` read still treats an absent field as
|
|
96
108
|
* visible.
|
|
97
109
|
*/
|
|
98
|
-
tokenMetrics:
|
|
110
|
+
tokenMetrics: z3.boolean(),
|
|
99
111
|
/** Current token-count presentation policy. Required on current servers;
|
|
100
112
|
* older payload tolerance belongs in the browser resolver. */
|
|
101
|
-
tokenUsageMetrics:
|
|
113
|
+
tokenUsageMetrics: z3.boolean(),
|
|
102
114
|
/** Current backend-reported-cost presentation policy. */
|
|
103
|
-
costMetrics:
|
|
115
|
+
costMetrics: z3.boolean()
|
|
104
116
|
});
|
|
105
|
-
var healthResponseSchema =
|
|
106
|
-
version:
|
|
107
|
-
latestVersion:
|
|
108
|
-
repoRoot:
|
|
117
|
+
var healthResponseSchema = z3.object({
|
|
118
|
+
version: z3.string(),
|
|
119
|
+
latestVersion: z3.string().optional(),
|
|
120
|
+
repoRoot: z3.string(),
|
|
109
121
|
repo: repoInfoSchema.nullable(),
|
|
110
|
-
checks:
|
|
122
|
+
checks: z3.array(backendCheckSchema),
|
|
111
123
|
defaultRunner: runnerSchema,
|
|
112
124
|
forge: forgeInfoSchema.nullable(),
|
|
113
125
|
capabilities: capabilitiesSchema,
|
|
114
126
|
// Always sent: `workspaceSummary()` returns both unconditionally, and an unreadable workspace
|
|
115
127
|
// degrades to `projects: []` rather than to an absent key. The hand-written DTO declared them
|
|
116
128
|
// optional, which was wider than the server has ever been.
|
|
117
|
-
projects:
|
|
118
|
-
bootProject:
|
|
129
|
+
projects: z3.array(z3.object({ id: z3.string(), name: z3.string() })),
|
|
130
|
+
bootProject: z3.string()
|
|
119
131
|
});
|
|
120
132
|
|
|
121
133
|
// ../contract/src/runs.ts
|
|
122
|
-
import { z as
|
|
134
|
+
import { z as z6 } from "zod";
|
|
123
135
|
|
|
124
136
|
// ../contract/src/github.ts
|
|
125
|
-
import { z as
|
|
126
|
-
var checksGlyphSchema =
|
|
127
|
-
var githubItemSchema =
|
|
128
|
-
kind:
|
|
129
|
-
number:
|
|
130
|
-
title:
|
|
131
|
-
author:
|
|
132
|
-
createdAt:
|
|
133
|
-
labels:
|
|
134
|
-
body:
|
|
135
|
-
url:
|
|
136
|
-
comments:
|
|
137
|
+
import { z as z4 } from "zod";
|
|
138
|
+
var checksGlyphSchema = z4.enum(["passing", "failing", "pending"]).nullable();
|
|
139
|
+
var githubItemSchema = z4.object({
|
|
140
|
+
kind: z4.enum(["issue", "pr"]),
|
|
141
|
+
number: z4.number(),
|
|
142
|
+
title: z4.string(),
|
|
143
|
+
author: z4.string(),
|
|
144
|
+
createdAt: z4.string(),
|
|
145
|
+
labels: z4.array(z4.string()),
|
|
146
|
+
body: z4.string(),
|
|
147
|
+
url: z4.string(),
|
|
148
|
+
comments: z4.number(),
|
|
137
149
|
/** PRs only. */
|
|
138
|
-
isDraft:
|
|
139
|
-
additions:
|
|
140
|
-
deletions:
|
|
150
|
+
isDraft: z4.boolean().optional(),
|
|
151
|
+
additions: z4.number().optional(),
|
|
152
|
+
deletions: z4.number().optional(),
|
|
141
153
|
checks: checksGlyphSchema.optional()
|
|
142
154
|
});
|
|
143
|
-
var githubDataSchema =
|
|
144
|
-
available:
|
|
155
|
+
var githubDataSchema = z4.object({
|
|
156
|
+
available: z4.boolean(),
|
|
145
157
|
/** Why it is unavailable (`gh` missing, no remote, offline…). Never an error — a hint. */
|
|
146
|
-
reason:
|
|
158
|
+
reason: z4.string().optional(),
|
|
147
159
|
/** owner/name, when known. */
|
|
148
|
-
repo:
|
|
149
|
-
syncedAt:
|
|
150
|
-
issues:
|
|
151
|
-
prs:
|
|
160
|
+
repo: z4.string().optional(),
|
|
161
|
+
syncedAt: z4.string().optional(),
|
|
162
|
+
issues: z4.array(githubItemSchema),
|
|
163
|
+
prs: z4.array(githubItemSchema),
|
|
152
164
|
/** Repo-wide label name → 6-hex color (no `#`); lets chips tint like GitHub. Additive. */
|
|
153
|
-
labelColors:
|
|
165
|
+
labelColors: z4.record(z4.string(), z4.string()).optional()
|
|
154
166
|
});
|
|
155
|
-
var githubChecksDataSchema =
|
|
156
|
-
|
|
157
|
-
available:
|
|
158
|
-
checks:
|
|
167
|
+
var githubChecksDataSchema = z4.discriminatedUnion("available", [
|
|
168
|
+
z4.object({
|
|
169
|
+
available: z4.literal(true),
|
|
170
|
+
checks: z4.record(z4.number(), checksGlyphSchema)
|
|
159
171
|
}),
|
|
160
|
-
|
|
161
|
-
available:
|
|
162
|
-
reason:
|
|
172
|
+
z4.object({
|
|
173
|
+
available: z4.literal(false),
|
|
174
|
+
reason: z4.string()
|
|
163
175
|
})
|
|
164
176
|
]);
|
|
165
|
-
var referenceStatusSchema =
|
|
177
|
+
var referenceStatusSchema = z4.enum([
|
|
166
178
|
"draft",
|
|
167
179
|
"review-required",
|
|
168
180
|
"changes-requested",
|
|
@@ -175,13 +187,13 @@ var referenceStatusSchema = z3.enum([
|
|
|
175
187
|
"completed",
|
|
176
188
|
"not-planned"
|
|
177
189
|
]);
|
|
178
|
-
var recheckAfterMsSchema =
|
|
190
|
+
var recheckAfterMsSchema = z4.number().nullable();
|
|
179
191
|
var REFERENCE_STATUS_MAX = 100;
|
|
180
|
-
var githubRefStatusDataSchema =
|
|
181
|
-
|
|
182
|
-
available:
|
|
183
|
-
prs:
|
|
184
|
-
issues:
|
|
192
|
+
var githubRefStatusDataSchema = z4.discriminatedUnion("available", [
|
|
193
|
+
z4.object({
|
|
194
|
+
available: z4.literal(true),
|
|
195
|
+
prs: z4.record(z4.number(), referenceStatusSchema),
|
|
196
|
+
issues: z4.record(z4.number(), referenceStatusSchema),
|
|
185
197
|
/**
|
|
186
198
|
* The pull request numbers that do NOT merge cleanly into their base right now.
|
|
187
199
|
*
|
|
@@ -201,28 +213,28 @@ var githubRefStatusDataSchema = z3.discriminatedUnion("available", [
|
|
|
201
213
|
* ever named — GitHub reports `UNKNOWN` for merged and closed ones, and `UNKNOWN` (which is
|
|
202
214
|
* also what it answers while it is still computing) is never listed.
|
|
203
215
|
*/
|
|
204
|
-
conflicts:
|
|
216
|
+
conflicts: z4.array(z4.number()).optional(),
|
|
205
217
|
recheckAfterMs: recheckAfterMsSchema
|
|
206
218
|
}),
|
|
207
|
-
|
|
208
|
-
available:
|
|
209
|
-
reason:
|
|
219
|
+
z4.object({
|
|
220
|
+
available: z4.literal(false),
|
|
221
|
+
reason: z4.string(),
|
|
210
222
|
recheckAfterMs: recheckAfterMsSchema
|
|
211
223
|
})
|
|
212
224
|
]);
|
|
213
|
-
var githubCommentSchema =
|
|
214
|
-
id:
|
|
225
|
+
var githubCommentSchema = z4.object({
|
|
226
|
+
id: z4.number(),
|
|
215
227
|
/** Author login, `'?'` fallback when gh omits the user. */
|
|
216
|
-
author:
|
|
217
|
-
avatarUrl:
|
|
218
|
-
createdAt:
|
|
219
|
-
body:
|
|
220
|
-
kind:
|
|
228
|
+
author: z4.string(),
|
|
229
|
+
avatarUrl: z4.string().optional(),
|
|
230
|
+
createdAt: z4.string(),
|
|
231
|
+
body: z4.string(),
|
|
232
|
+
kind: z4.enum(["comment", "review"]),
|
|
221
233
|
/** Reviews only — drives the state chip. */
|
|
222
|
-
reviewState:
|
|
223
|
-
url:
|
|
234
|
+
reviewState: z4.enum(["approved", "changes_requested", "commented", "dismissed"]).optional(),
|
|
235
|
+
url: z4.string()
|
|
224
236
|
});
|
|
225
|
-
var githubTimelineEventKindSchema =
|
|
237
|
+
var githubTimelineEventKindSchema = z4.enum([
|
|
226
238
|
"committed",
|
|
227
239
|
"labeled",
|
|
228
240
|
"unlabeled",
|
|
@@ -235,172 +247,172 @@ var githubTimelineEventKindSchema = z3.enum([
|
|
|
235
247
|
"cross-referenced",
|
|
236
248
|
"renamed"
|
|
237
249
|
]);
|
|
238
|
-
var githubTimelineEventSchema =
|
|
239
|
-
id:
|
|
250
|
+
var githubTimelineEventSchema = z4.object({
|
|
251
|
+
id: z4.string(),
|
|
240
252
|
kind: githubTimelineEventKindSchema,
|
|
241
253
|
/** Login — or the git author name for `committed`, which carries no GitHub actor. */
|
|
242
|
-
actor:
|
|
254
|
+
actor: z4.string(),
|
|
243
255
|
/** Absent for `committed`. */
|
|
244
|
-
avatarUrl:
|
|
245
|
-
createdAt:
|
|
246
|
-
url:
|
|
256
|
+
avatarUrl: z4.string().optional(),
|
|
257
|
+
createdAt: z4.string(),
|
|
258
|
+
url: z4.string().optional(),
|
|
247
259
|
/** `committed` — full 40-char SHA. */
|
|
248
|
-
sha:
|
|
260
|
+
sha: z4.string().optional(),
|
|
249
261
|
/** `committed` — first line, capped at 120 chars. */
|
|
250
|
-
message:
|
|
262
|
+
message: z4.string().optional(),
|
|
251
263
|
/** `committed` — **absent** (lookup failed/skipped) and **`null`** (no CI configured) both
|
|
252
264
|
* render no glyph, but stay distinct values. */
|
|
253
265
|
checks: checksGlyphSchema.optional(),
|
|
254
|
-
label:
|
|
266
|
+
label: z4.object({ name: z4.string(), color: z4.string().optional() }).optional(),
|
|
255
267
|
/** `assigned`/`unassigned` login, or the new title for `renamed`. */
|
|
256
|
-
subject:
|
|
257
|
-
refNumber:
|
|
258
|
-
refTitle:
|
|
259
|
-
refIsPr:
|
|
260
|
-
});
|
|
261
|
-
var githubCommentsDataSchema =
|
|
262
|
-
available:
|
|
263
|
-
reason:
|
|
268
|
+
subject: z4.string().optional(),
|
|
269
|
+
refNumber: z4.number().optional(),
|
|
270
|
+
refTitle: z4.string().optional(),
|
|
271
|
+
refIsPr: z4.boolean().optional()
|
|
272
|
+
});
|
|
273
|
+
var githubCommentsDataSchema = z4.object({
|
|
274
|
+
available: z4.boolean(),
|
|
275
|
+
reason: z4.string().optional(),
|
|
264
276
|
/** Chronological, oldest first. */
|
|
265
|
-
comments:
|
|
277
|
+
comments: z4.array(githubCommentSchema),
|
|
266
278
|
/** True when either stream hit its cap, or the timeline fetch stopped short. */
|
|
267
|
-
truncated:
|
|
279
|
+
truncated: z4.boolean().optional(),
|
|
268
280
|
/** Timeline events (#525) — additive; absent when the server degraded to the legacy
|
|
269
281
|
* comments-only fetch. Capped independently of `comments`. */
|
|
270
|
-
events:
|
|
271
|
-
});
|
|
272
|
-
var githubMergeMethodSchema =
|
|
273
|
-
var githubPrCheckSchema =
|
|
274
|
-
name:
|
|
275
|
-
state:
|
|
276
|
-
required:
|
|
277
|
-
url:
|
|
278
|
-
});
|
|
279
|
-
var githubPrMergeStateSchema =
|
|
280
|
-
number:
|
|
281
|
-
title:
|
|
282
|
-
url:
|
|
283
|
-
state:
|
|
284
|
-
isDraft:
|
|
285
|
-
headRef:
|
|
286
|
-
baseRef:
|
|
287
|
-
headSha:
|
|
288
|
-
mergeable:
|
|
289
|
-
reviewDecision:
|
|
290
|
-
checks:
|
|
291
|
-
methods:
|
|
282
|
+
events: z4.array(githubTimelineEventSchema).optional()
|
|
283
|
+
});
|
|
284
|
+
var githubMergeMethodSchema = z4.enum(["merge", "squash", "rebase"]);
|
|
285
|
+
var githubPrCheckSchema = z4.object({
|
|
286
|
+
name: z4.string(),
|
|
287
|
+
state: z4.enum(["passing", "failing", "pending", "unknown"]),
|
|
288
|
+
required: z4.boolean().nullable(),
|
|
289
|
+
url: z4.string().optional()
|
|
290
|
+
});
|
|
291
|
+
var githubPrMergeStateSchema = z4.object({
|
|
292
|
+
number: z4.number(),
|
|
293
|
+
title: z4.string(),
|
|
294
|
+
url: z4.string(),
|
|
295
|
+
state: z4.enum(["open", "closed", "merged"]),
|
|
296
|
+
isDraft: z4.boolean(),
|
|
297
|
+
headRef: z4.string(),
|
|
298
|
+
baseRef: z4.string(),
|
|
299
|
+
headSha: z4.string(),
|
|
300
|
+
mergeable: z4.enum(["mergeable", "conflicting", "unknown"]),
|
|
301
|
+
reviewDecision: z4.enum(["approved", "changes-requested", "review-required", "unknown"]),
|
|
302
|
+
checks: z4.array(githubPrCheckSchema),
|
|
303
|
+
methods: z4.array(githubMergeMethodSchema),
|
|
292
304
|
defaultMethod: githubMergeMethodSchema.nullable(),
|
|
293
|
-
eligibility:
|
|
294
|
-
blockers:
|
|
295
|
-
canMerge:
|
|
296
|
-
canOverride:
|
|
297
|
-
});
|
|
298
|
-
var githubPrMergeStateResponseSchema =
|
|
299
|
-
|
|
300
|
-
|
|
305
|
+
eligibility: z4.enum(["ready", "blocked", "pending", "unauthorized", "terminal", "unknown"]),
|
|
306
|
+
blockers: z4.array(z4.object({ code: z4.string(), message: z4.string() })),
|
|
307
|
+
canMerge: z4.boolean(),
|
|
308
|
+
canOverride: z4.boolean()
|
|
309
|
+
});
|
|
310
|
+
var githubPrMergeStateResponseSchema = z4.discriminatedUnion("available", [
|
|
311
|
+
z4.object({ available: z4.literal(true), mergeState: githubPrMergeStateSchema }),
|
|
312
|
+
z4.object({ available: z4.literal(false), reason: z4.string() })
|
|
301
313
|
]);
|
|
302
|
-
var githubMergeResponseSchema =
|
|
303
|
-
merged:
|
|
304
|
-
number:
|
|
305
|
-
url:
|
|
314
|
+
var githubMergeResponseSchema = z4.object({
|
|
315
|
+
merged: z4.literal(true),
|
|
316
|
+
number: z4.number(),
|
|
317
|
+
url: z4.string(),
|
|
306
318
|
method: githubMergeMethodSchema,
|
|
307
|
-
mergeCommitSha:
|
|
308
|
-
});
|
|
309
|
-
var githubPrChangeSchema =
|
|
310
|
-
path:
|
|
311
|
-
previousPath:
|
|
312
|
-
status:
|
|
313
|
-
additions:
|
|
314
|
-
deletions:
|
|
315
|
-
patch:
|
|
316
|
-
patchUnavailableReason:
|
|
317
|
-
truncated:
|
|
318
|
-
});
|
|
319
|
-
var githubPrChangesDataSchema =
|
|
320
|
-
|
|
321
|
-
available:
|
|
322
|
-
number:
|
|
323
|
-
headSha:
|
|
324
|
-
files:
|
|
325
|
-
additions:
|
|
326
|
-
deletions:
|
|
327
|
-
truncated:
|
|
319
|
+
mergeCommitSha: z4.string().optional()
|
|
320
|
+
});
|
|
321
|
+
var githubPrChangeSchema = z4.object({
|
|
322
|
+
path: z4.string(),
|
|
323
|
+
previousPath: z4.string().optional(),
|
|
324
|
+
status: z4.enum(["added", "modified", "removed", "renamed", "copied", "changed"]),
|
|
325
|
+
additions: z4.number(),
|
|
326
|
+
deletions: z4.number(),
|
|
327
|
+
patch: z4.string().optional(),
|
|
328
|
+
patchUnavailableReason: z4.enum(["binary", "too-large", "not-provided"]).optional(),
|
|
329
|
+
truncated: z4.boolean().optional()
|
|
330
|
+
});
|
|
331
|
+
var githubPrChangesDataSchema = z4.discriminatedUnion("available", [
|
|
332
|
+
z4.object({
|
|
333
|
+
available: z4.literal(true),
|
|
334
|
+
number: z4.number(),
|
|
335
|
+
headSha: z4.string(),
|
|
336
|
+
files: z4.array(githubPrChangeSchema),
|
|
337
|
+
additions: z4.number(),
|
|
338
|
+
deletions: z4.number(),
|
|
339
|
+
truncated: z4.boolean(),
|
|
328
340
|
/** Present when the payload is complete but partial in some other way (a capped patch). */
|
|
329
|
-
reason:
|
|
341
|
+
reason: z4.string().optional()
|
|
330
342
|
}),
|
|
331
|
-
|
|
343
|
+
z4.object({ available: z4.literal(false), reason: z4.string() })
|
|
332
344
|
]);
|
|
333
345
|
|
|
334
346
|
// ../contract/src/workflows.ts
|
|
335
|
-
import { z as
|
|
336
|
-
var workflowStepDefSchema =
|
|
337
|
-
id:
|
|
338
|
-
name:
|
|
347
|
+
import { z as z5 } from "zod";
|
|
348
|
+
var workflowStepDefSchema = z5.object({
|
|
349
|
+
id: z5.string().min(1),
|
|
350
|
+
name: z5.string().optional(),
|
|
339
351
|
// agent step
|
|
340
|
-
prompt:
|
|
341
|
-
skill:
|
|
342
|
-
model:
|
|
352
|
+
prompt: z5.string().optional(),
|
|
353
|
+
skill: z5.string().optional(),
|
|
354
|
+
model: z5.string().optional(),
|
|
343
355
|
/** Per-step agent backend override (falls back to the task / config default). */
|
|
344
356
|
runner: runnerSchema.optional(),
|
|
345
|
-
allowedTools:
|
|
346
|
-
bashAllowlist:
|
|
357
|
+
allowedTools: z5.array(z5.string()).optional(),
|
|
358
|
+
bashAllowlist: z5.array(z5.string()).optional(),
|
|
347
359
|
// check step
|
|
348
|
-
command:
|
|
349
|
-
onFail:
|
|
350
|
-
retry:
|
|
351
|
-
max:
|
|
360
|
+
command: z5.string().optional(),
|
|
361
|
+
onFail: z5.object({
|
|
362
|
+
retry: z5.string().min(1),
|
|
363
|
+
max: z5.number().int().positive().default(2)
|
|
352
364
|
}).optional()
|
|
353
365
|
}).refine((s) => Boolean(s.command) !== Boolean(s.prompt ?? s.skill), {
|
|
354
366
|
message: "a step is either an agent step (prompt/skill) or a check step (command), not both"
|
|
355
367
|
});
|
|
356
|
-
var workflowDefSchema =
|
|
357
|
-
name:
|
|
358
|
-
description:
|
|
359
|
-
steps:
|
|
360
|
-
source:
|
|
368
|
+
var workflowDefSchema = z5.object({
|
|
369
|
+
name: z5.string(),
|
|
370
|
+
description: z5.string().optional(),
|
|
371
|
+
steps: z5.array(workflowStepDefSchema),
|
|
372
|
+
source: z5.enum(["built-in", "file"]),
|
|
361
373
|
/** Absent on built-ins — which is exactly what makes them undeletable. */
|
|
362
|
-
path:
|
|
374
|
+
path: z5.string().optional()
|
|
363
375
|
});
|
|
364
|
-
var workflowLoadIssueSchema =
|
|
365
|
-
path:
|
|
366
|
-
message:
|
|
367
|
-
});
|
|
368
|
-
var workflowsResponseSchema =
|
|
369
|
-
workflows:
|
|
370
|
-
issues:
|
|
371
|
-
});
|
|
372
|
-
var saveWorkflowInputSchema =
|
|
373
|
-
name:
|
|
374
|
-
description:
|
|
375
|
-
steps:
|
|
376
|
-
skills:
|
|
377
|
-
overwrite:
|
|
376
|
+
var workflowLoadIssueSchema = z5.object({
|
|
377
|
+
path: z5.string(),
|
|
378
|
+
message: z5.string()
|
|
379
|
+
});
|
|
380
|
+
var workflowsResponseSchema = z5.object({
|
|
381
|
+
workflows: z5.array(workflowDefSchema),
|
|
382
|
+
issues: z5.array(workflowLoadIssueSchema)
|
|
383
|
+
});
|
|
384
|
+
var saveWorkflowInputSchema = z5.object({
|
|
385
|
+
name: z5.string().trim().min(1).max(80),
|
|
386
|
+
description: z5.string().max(2e3, "must be at most 2000 characters").optional(),
|
|
387
|
+
steps: z5.array(workflowStepDefSchema).min(1).max(8).optional(),
|
|
388
|
+
skills: z5.array(z5.string().trim().min(1)).min(1).max(8).optional(),
|
|
389
|
+
overwrite: z5.boolean().optional()
|
|
378
390
|
}).refine((b) => Boolean(b.steps) !== Boolean(b.skills), {
|
|
379
391
|
message: 'provide either "steps" or "skills", not both'
|
|
380
392
|
});
|
|
381
|
-
var saveWorkflowResponseSchema =
|
|
382
|
-
path:
|
|
383
|
-
name:
|
|
393
|
+
var saveWorkflowResponseSchema = z5.object({
|
|
394
|
+
path: z5.string(),
|
|
395
|
+
name: z5.string()
|
|
384
396
|
});
|
|
385
|
-
var parsedWorkflowSchema =
|
|
386
|
-
name:
|
|
387
|
-
description:
|
|
388
|
-
steps:
|
|
397
|
+
var parsedWorkflowSchema = z5.object({
|
|
398
|
+
name: z5.string(),
|
|
399
|
+
description: z5.string().optional(),
|
|
400
|
+
steps: z5.array(workflowStepDefSchema)
|
|
389
401
|
});
|
|
390
|
-
var deleteWorkflowResponseSchema =
|
|
391
|
-
ok:
|
|
392
|
-
path:
|
|
402
|
+
var deleteWorkflowResponseSchema = z5.object({
|
|
403
|
+
ok: z5.literal(true),
|
|
404
|
+
path: z5.string()
|
|
393
405
|
});
|
|
394
|
-
var planResponseSchema =
|
|
406
|
+
var planResponseSchema = z5.object({
|
|
395
407
|
/** The kebab-case workflow title the planner proposed. Absent on the degraded fallback. */
|
|
396
|
-
name:
|
|
397
|
-
steps:
|
|
398
|
-
rationale:
|
|
399
|
-
fallback:
|
|
408
|
+
name: z5.string().optional(),
|
|
409
|
+
steps: z5.array(workflowStepDefSchema),
|
|
410
|
+
rationale: z5.string(),
|
|
411
|
+
fallback: z5.boolean()
|
|
400
412
|
});
|
|
401
413
|
|
|
402
414
|
// ../contract/src/runs.ts
|
|
403
|
-
var runStatusSchema =
|
|
415
|
+
var runStatusSchema = z6.enum([
|
|
404
416
|
"queued",
|
|
405
417
|
"running",
|
|
406
418
|
"waiting",
|
|
@@ -409,8 +421,8 @@ var runStatusSchema = z5.enum([
|
|
|
409
421
|
"failed",
|
|
410
422
|
"cancelled"
|
|
411
423
|
]);
|
|
412
|
-
var runActivitySchema =
|
|
413
|
-
var stepStatusSchema =
|
|
424
|
+
var runActivitySchema = z6.enum(["monitoring"]);
|
|
425
|
+
var stepStatusSchema = z6.enum([
|
|
414
426
|
"pending",
|
|
415
427
|
"running",
|
|
416
428
|
"waiting",
|
|
@@ -420,14 +432,14 @@ var stepStatusSchema = z5.enum([
|
|
|
420
432
|
"cancelled",
|
|
421
433
|
"skipped"
|
|
422
434
|
]);
|
|
423
|
-
var usageCounterSchema =
|
|
424
|
-
var stepStateSchema =
|
|
425
|
-
id:
|
|
426
|
-
name:
|
|
427
|
-
kind:
|
|
435
|
+
var usageCounterSchema = z6.number().finite().nonnegative();
|
|
436
|
+
var stepStateSchema = z6.object({
|
|
437
|
+
id: z6.string(),
|
|
438
|
+
name: z6.string(),
|
|
439
|
+
kind: z6.enum(["agent", "check"]),
|
|
428
440
|
status: stepStatusSchema,
|
|
429
|
-
iterations:
|
|
430
|
-
tokensUsed:
|
|
441
|
+
iterations: z6.number(),
|
|
442
|
+
tokensUsed: z6.number(),
|
|
431
443
|
inputTokens: usageCounterSchema.optional(),
|
|
432
444
|
outputTokens: usageCounterSchema.optional(),
|
|
433
445
|
usageInvocationsStarted: usageCounterSchema.optional(),
|
|
@@ -435,74 +447,77 @@ var stepStateSchema = z5.object({
|
|
|
435
447
|
usageTurnsStarted: usageCounterSchema.optional(),
|
|
436
448
|
usageTurnsRecorded: usageCounterSchema.optional(),
|
|
437
449
|
usageInvocationEpoch: usageCounterSchema.optional(),
|
|
438
|
-
startedAt:
|
|
439
|
-
finishedAt:
|
|
440
|
-
error:
|
|
450
|
+
startedAt: z6.string().optional(),
|
|
451
|
+
finishedAt: z6.string().optional(),
|
|
452
|
+
error: z6.string().optional(),
|
|
441
453
|
/** Latest agent session id — `claude --resume <id>` and friends. */
|
|
442
|
-
sessionId:
|
|
454
|
+
sessionId: z6.string().optional(),
|
|
443
455
|
/** Backend that owns `sessionId`; absent on records written before backend affinity. */
|
|
444
456
|
backend: runnerSchema.optional(),
|
|
445
457
|
/** Agent account (spec 2026-07-29-agent-profiles) that owns `sessionId` — `default`, or a
|
|
446
458
|
* stored profile id. The two are a PAIR: a session id only resolves inside the config dir
|
|
447
459
|
* that created it, so resume and Continue read this rather than the project's current
|
|
448
460
|
* selection. Absent on records written before accounts existed. */
|
|
449
|
-
profileId:
|
|
450
|
-
costUsd:
|
|
461
|
+
profileId: z6.string().optional(),
|
|
462
|
+
costUsd: z6.number().optional()
|
|
451
463
|
});
|
|
452
|
-
var diffStatSchema =
|
|
453
|
-
adds:
|
|
454
|
-
dels:
|
|
455
|
-
files:
|
|
464
|
+
var diffStatSchema = z6.object({
|
|
465
|
+
adds: z6.number(),
|
|
466
|
+
dels: z6.number(),
|
|
467
|
+
files: z6.number(),
|
|
456
468
|
/** Additive since #751, and present ONLY when true: the numbers were measured against a
|
|
457
469
|
* branch the agent checked out into the task's worktree, as the run found it, because the
|
|
458
470
|
* worktree's HEAD had been repointed off the task's own branch (every review/QA run does
|
|
459
471
|
* this) and the merge-base anchor would otherwise have reported that branch's entire diff
|
|
460
472
|
* as this task's. Absent on every normal run and on every record written before #751 — a
|
|
461
473
|
* consumer that ignores it sees exactly the old shape. */
|
|
462
|
-
repointed:
|
|
474
|
+
repointed: z6.boolean().optional()
|
|
463
475
|
});
|
|
464
|
-
var queuedMessageSchema =
|
|
465
|
-
id:
|
|
466
|
-
text:
|
|
476
|
+
var queuedMessageSchema = z6.object({
|
|
477
|
+
id: z6.string(),
|
|
478
|
+
text: z6.string(),
|
|
467
479
|
/** `/api/v1/runs/:id/images/…` URLs — attachments are persisted, never inlined. */
|
|
468
|
-
images:
|
|
469
|
-
createdAt:
|
|
480
|
+
images: z6.array(z6.string()).optional(),
|
|
481
|
+
createdAt: z6.string()
|
|
470
482
|
});
|
|
471
|
-
var processUsageSchema =
|
|
483
|
+
var processUsageSchema = z6.object({
|
|
472
484
|
/** Sum of `%cpu` across the tree — can exceed 100 on multi-core work. */
|
|
473
|
-
cpuPct:
|
|
474
|
-
rssBytes:
|
|
475
|
-
procCount:
|
|
485
|
+
cpuPct: z6.number(),
|
|
486
|
+
rssBytes: z6.number(),
|
|
487
|
+
procCount: z6.number()
|
|
476
488
|
});
|
|
477
|
-
var runRecordSchema =
|
|
478
|
-
id:
|
|
479
|
-
title:
|
|
489
|
+
var runRecordSchema = z6.object({
|
|
490
|
+
id: z6.string(),
|
|
491
|
+
title: z6.string(),
|
|
480
492
|
/** Display title (#389): auto-derived from the first agent turn, or the user's inline edit
|
|
481
493
|
* (`PATCH /runs/:id` sets it together with `title`). Show `titleSummary ?? title`. */
|
|
482
|
-
titleSummary:
|
|
494
|
+
titleSummary: z6.string().optional(),
|
|
483
495
|
/** Refreshed on every turn-end; absent until the first turn ends (and on worktree-less runs). */
|
|
484
496
|
diffStat: diffStatSchema.optional(),
|
|
485
|
-
workflow:
|
|
486
|
-
task:
|
|
497
|
+
workflow: z6.string(),
|
|
498
|
+
task: z6.string(),
|
|
487
499
|
/** Prompt messages stacked onto the run while it waited for a free agent slot (#472). Folded
|
|
488
500
|
* into the prompt at dequeue — never delivered as their own turns. Absent on pre-#472 runs. */
|
|
489
|
-
queuedMessages:
|
|
501
|
+
queuedMessages: z6.array(queuedMessageSchema).optional(),
|
|
490
502
|
/** URLs of images attached to the initial task prompt (#image-display). */
|
|
491
|
-
taskImages:
|
|
492
|
-
model:
|
|
503
|
+
taskImages: z6.array(z6.string()).optional(),
|
|
504
|
+
model: z6.string().optional(),
|
|
505
|
+
/** Reasoning-effort pin (#45). Canonical `low`/`medium`/`high`/`xhigh`/`max`.
|
|
506
|
+
* Absent = harness default. Additive: pre-#45 records omit it and still parse. */
|
|
507
|
+
effort: z6.string().max(32).optional(),
|
|
493
508
|
/** Normalized provider/model identity used for attribution and reproducible replay. */
|
|
494
|
-
modelIdentity:
|
|
509
|
+
modelIdentity: z6.string().optional(),
|
|
495
510
|
runner: runnerSchema.optional(),
|
|
496
511
|
/** The composer's per-task agent account (spec 2026-07-29-agent-profiles), applying to steps
|
|
497
512
|
* on `runner`. Absent = the run follows the project's own selection. */
|
|
498
|
-
agentProfile:
|
|
513
|
+
agentProfile: z6.string().optional(),
|
|
499
514
|
/** Echo of the extra system prompt the run used (POST override or config default). */
|
|
500
|
-
systemPrompt:
|
|
515
|
+
systemPrompt: z6.string().optional(),
|
|
501
516
|
/** false when the run deliberately disabled follow-up todo generation. Absent means enabled. */
|
|
502
|
-
generateFollowups:
|
|
517
|
+
generateFollowups: z6.boolean().optional(),
|
|
503
518
|
/** Autonomous mode (#autonomous): the run never parks at `waiting` or the terminal `review`
|
|
504
519
|
* gate. Absent = falsy = not autonomous. */
|
|
505
|
-
autonomous:
|
|
520
|
+
autonomous: z6.boolean().optional(),
|
|
506
521
|
/**
|
|
507
522
|
* Provenance for a task a project GitHub automation launched (#694). Absent on every ordinary
|
|
508
523
|
* run, which is what makes it additive — the cockpit shows the "from automation" link only when
|
|
@@ -512,83 +527,83 @@ var runRecordSchema = z5.object({
|
|
|
512
527
|
* launching definition matched, recorded on the run for the audit trail, and `src/runs/store.ts`
|
|
513
528
|
* persists it as free text so an older cezar can still read a record written by a newer one.
|
|
514
529
|
*/
|
|
515
|
-
automation:
|
|
516
|
-
automationId:
|
|
517
|
-
automationRevision:
|
|
518
|
-
receiptId:
|
|
519
|
-
event:
|
|
520
|
-
githubUrl:
|
|
530
|
+
automation: z6.object({
|
|
531
|
+
automationId: z6.string(),
|
|
532
|
+
automationRevision: z6.number(),
|
|
533
|
+
receiptId: z6.string(),
|
|
534
|
+
event: z6.string(),
|
|
535
|
+
githubUrl: z6.string()
|
|
521
536
|
}).optional(),
|
|
522
537
|
status: runStatusSchema,
|
|
523
538
|
/** `monitoring` while `status === 'running'` and the agent is working on downstream work.
|
|
524
539
|
* Absent on old runs; cleared on resume/end. */
|
|
525
540
|
activity: runActivitySchema.optional(),
|
|
526
541
|
/** Exact ISO-8601 deadline for the next automatic monitoring check. */
|
|
527
|
-
monitoringWakeAt:
|
|
542
|
+
monitoringWakeAt: z6.string().optional(),
|
|
528
543
|
/** The current live monitoring epoch exhausted its 40 automatic checks. */
|
|
529
|
-
monitoringWakeCapReached:
|
|
544
|
+
monitoringWakeCapReached: z6.boolean().optional(),
|
|
530
545
|
/** Exact ISO-8601 instant this run resumes itself after a provider usage limit stopped it
|
|
531
546
|
* (spec 2026-08-03-auto-resume-after-usage-limit). Present only on a `failed` run with a
|
|
532
547
|
* pending automatic resume — its absence is what "no resume is scheduled" looks like. */
|
|
533
|
-
autoResumeAt:
|
|
548
|
+
autoResumeAt: z6.string().optional(),
|
|
534
549
|
/** Consecutive automatic resumes since the last human turn, against the safety cap. */
|
|
535
|
-
autoResumeAttempts:
|
|
536
|
-
createdAt:
|
|
537
|
-
startedAt:
|
|
538
|
-
finishedAt:
|
|
539
|
-
tokensUsed:
|
|
550
|
+
autoResumeAttempts: z6.number().optional(),
|
|
551
|
+
createdAt: z6.string(),
|
|
552
|
+
startedAt: z6.string().optional(),
|
|
553
|
+
finishedAt: z6.string().optional(),
|
|
554
|
+
tokensUsed: z6.number(),
|
|
540
555
|
inputTokens: usageCounterSchema.optional(),
|
|
541
556
|
outputTokens: usageCounterSchema.optional(),
|
|
542
|
-
costUsd:
|
|
543
|
-
pullRequestUrl:
|
|
557
|
+
costUsd: z6.number().optional(),
|
|
558
|
+
pullRequestUrl: z6.string().optional(),
|
|
544
559
|
/** The PR this task is ABOUT (#407) — auto-discovered from conversation references. Display
|
|
545
560
|
* tier only: `pullRequestUrl` (the PR this task CREATED) wins, and the action gates ignore it. */
|
|
546
|
-
referencedPullRequestUrl:
|
|
561
|
+
referencedPullRequestUrl: z6.string().optional(),
|
|
547
562
|
/** The PR/issue number this task is ABOUT (task auto-naming spec) — display tier only. */
|
|
548
|
-
prNumber:
|
|
549
|
-
issueNumber:
|
|
563
|
+
prNumber: z6.number().optional(),
|
|
564
|
+
issueNumber: z6.number().optional(),
|
|
550
565
|
/** Server-side provenance: referenced-issue discovery currently owns `issueNumber`. */
|
|
551
|
-
referencedIssueNumberSeeded:
|
|
566
|
+
referencedIssueNumberSeeded: z6.boolean().optional(),
|
|
552
567
|
/** 'user' = renamed via PATCH, never auto-overwritten; 'marker' = agent-declared via
|
|
553
568
|
* CEZ:TITLE (spec 2026-07-18-task-ref-markers); 'auto' = namer-owned. */
|
|
554
|
-
titleOrigin:
|
|
569
|
+
titleOrigin: z6.enum(["user", "auto", "marker"]).optional(),
|
|
555
570
|
/** References the agent declared via CEZ:PR/CEZ:ISSUE markers — authoritative over the namer
|
|
556
571
|
* for the matching kind. */
|
|
557
|
-
markerRefs:
|
|
572
|
+
markerRefs: z6.object({ pr: z6.number().optional(), issue: z6.number().optional() }).optional(),
|
|
558
573
|
/** The referenced tier's working set (distinct PR URLs spotted, capped server-side). */
|
|
559
|
-
referencedPrCandidates:
|
|
574
|
+
referencedPrCandidates: z6.array(z6.string()).optional(),
|
|
560
575
|
/** The issue this task is ABOUT (spec 2026-07-21-report-ref-discovery). Display-only. */
|
|
561
|
-
referencedIssueUrl:
|
|
576
|
+
referencedIssueUrl: z6.string().optional(),
|
|
562
577
|
/** The referenced-issue working set, persisted like `referencedPrCandidates`. Capped. */
|
|
563
|
-
referencedIssueCandidates:
|
|
578
|
+
referencedIssueCandidates: z6.array(z6.string()).optional(),
|
|
564
579
|
/** Explicit execution policy. `false` means the run intentionally uses the repo root;
|
|
565
580
|
* absent on older runs and for the default isolated-worktree mode. */
|
|
566
|
-
worktree:
|
|
581
|
+
worktree: z6.literal(false).optional(),
|
|
567
582
|
/** Absent for in-place runs and after an isolated worktree is removed. */
|
|
568
|
-
worktreePath:
|
|
569
|
-
branch:
|
|
583
|
+
worktreePath: z6.string().optional(),
|
|
584
|
+
branch: z6.string().optional(),
|
|
570
585
|
/** Stable baseline for session git views: a worktree's fork ref, or an in-place run's starting commit. */
|
|
571
|
-
baseBranch:
|
|
586
|
+
baseBranch: z6.string().optional(),
|
|
572
587
|
/** Set when count-based retention (#483) reclaimed the worktree DIRECTORY (the branch is
|
|
573
588
|
* kept): the dir is gone but recoverable. */
|
|
574
|
-
worktreeReclaimedAt:
|
|
589
|
+
worktreeReclaimedAt: z6.string().optional(),
|
|
575
590
|
/** Parallel variants (spec 010): runs sharing a groupId are one group. */
|
|
576
|
-
groupId:
|
|
591
|
+
groupId: z6.string().optional(),
|
|
577
592
|
/** Variant letter within the group — 'A' | 'B' | 'C'. */
|
|
578
|
-
variant:
|
|
579
|
-
peakRssBytes:
|
|
580
|
-
peakProcCount:
|
|
581
|
-
archived:
|
|
582
|
-
archivedAt:
|
|
593
|
+
variant: z6.string().optional(),
|
|
594
|
+
peakRssBytes: z6.number().optional(),
|
|
595
|
+
peakProcCount: z6.number().optional(),
|
|
596
|
+
archived: z6.boolean(),
|
|
597
|
+
archivedAt: z6.string().optional(),
|
|
583
598
|
/** Read receipt (#unread-done-items): ISO time the cockpit last opened this run's
|
|
584
599
|
* thread. A finished (`done`/`failed`) run reads as *unread* until seen since it
|
|
585
600
|
* finished — see `isUnread()` in the cockpit's `lib/read-state.ts`. Absent on old
|
|
586
601
|
* runs, on any run not yet opened, and on one deliberately put back to unread via
|
|
587
602
|
* `POST /runs/:id/unread` (#775) — all three count as unread. */
|
|
588
|
-
seenAt:
|
|
589
|
-
currentStepId:
|
|
590
|
-
error:
|
|
591
|
-
steps:
|
|
603
|
+
seenAt: z6.string().optional(),
|
|
604
|
+
currentStepId: z6.string().optional(),
|
|
605
|
+
error: z6.string().optional(),
|
|
606
|
+
steps: z6.array(stepStateSchema),
|
|
592
607
|
/**
|
|
593
608
|
* The persisted workflow definition, so a `queued` run survives a restart — including the ad-hoc
|
|
594
609
|
* "(planned)" chains that exist nowhere else.
|
|
@@ -606,40 +621,40 @@ var runRecordSchema = z5.object({
|
|
|
606
621
|
var apiRunSchema = runRecordSchema.extend({
|
|
607
622
|
usage: processUsageSchema.optional()
|
|
608
623
|
});
|
|
609
|
-
var runIndexEntrySchema =
|
|
624
|
+
var runIndexEntrySchema = z6.object({
|
|
610
625
|
/** The registered project this run belongs to. Joins against `GET /projects`. */
|
|
611
|
-
projectId:
|
|
612
|
-
id:
|
|
613
|
-
title:
|
|
614
|
-
titleSummary:
|
|
615
|
-
titleOrigin:
|
|
626
|
+
projectId: z6.string(),
|
|
627
|
+
id: z6.string(),
|
|
628
|
+
title: z6.string(),
|
|
629
|
+
titleSummary: z6.string().optional(),
|
|
630
|
+
titleOrigin: z6.enum(["user", "auto", "marker"]).optional(),
|
|
616
631
|
status: runStatusSchema,
|
|
617
632
|
activity: runActivitySchema.optional(),
|
|
618
|
-
createdAt:
|
|
619
|
-
finishedAt:
|
|
633
|
+
createdAt: z6.string(),
|
|
634
|
+
finishedAt: z6.string().optional(),
|
|
620
635
|
/** With `status`/`finishedAt`/`archived`, the four inputs `isUnread` reads — what lets the
|
|
621
636
|
* palette lead with "finished while you weren't looking" across every project, not just the
|
|
622
637
|
* one you happen to be standing in. */
|
|
623
|
-
seenAt:
|
|
638
|
+
seenAt: z6.string().optional(),
|
|
624
639
|
/** Always present, like `RunRecord.archived`: absent would read as "not archived", and the
|
|
625
640
|
* unread rule treats archiving as a stronger "done with this" than reading. */
|
|
626
|
-
archived:
|
|
641
|
+
archived: z6.boolean(),
|
|
627
642
|
/** A run parked by a provider usage limit is `failed` on the record with a resume booked
|
|
628
643
|
* (spec 2026-08-03-auto-resume-after-usage-limit). Both `deriveAttention` and `isUnread` read
|
|
629
644
|
* it, so without it here a cross-project row would show a red "failed" dot and land in
|
|
630
645
|
* Recently finished for work that is simply waiting for its appointment. */
|
|
631
|
-
autoResumeAt:
|
|
646
|
+
autoResumeAt: z6.string().optional(),
|
|
632
647
|
/** The workflow the run executes — the global Tasks page shows it in a column and groups by
|
|
633
648
|
* it. Always present on the record (`RunRecord.workflow`), so required here; the display
|
|
634
649
|
* refinement `workflowLabel` applies needs `steps[]`, which this row deliberately omits, so
|
|
635
650
|
* a `(planned)` chain reads as itself here rather than as its first agent's name. */
|
|
636
|
-
workflow:
|
|
651
|
+
workflow: z6.string(),
|
|
637
652
|
/** The task's branch, when it has one — a column on the global page, and the one field that
|
|
638
653
|
* makes a cross-project row identifiable at a glance without opening it. */
|
|
639
|
-
branch:
|
|
654
|
+
branch: z6.string().optional(),
|
|
640
655
|
/** When the agent actually started, as opposed to when the task was created. The global page's
|
|
641
656
|
* age column prefers it and falls back to `createdAt`, exactly as the per-project table does. */
|
|
642
|
-
startedAt:
|
|
657
|
+
startedAt: z6.string().optional(),
|
|
643
658
|
/**
|
|
644
659
|
* The six fields `taskReference()` (`web/src/lib/tasks-table.ts`) reads to decide a task's PR
|
|
645
660
|
* or issue chip. Carried verbatim rather than pre-resolved into a `{kind, number, url}` on the
|
|
@@ -651,20 +666,20 @@ var runIndexEntrySchema = z5.object({
|
|
|
651
666
|
* Six scalars is still the slim row this schema exists to keep: `steps[]` and `workflowDef`,
|
|
652
667
|
* the expensive half, stay off it.
|
|
653
668
|
*/
|
|
654
|
-
pullRequestUrl:
|
|
655
|
-
referencedPullRequestUrl:
|
|
656
|
-
prNumber:
|
|
657
|
-
issueNumber:
|
|
658
|
-
referencedIssueUrl:
|
|
659
|
-
markerRefs:
|
|
669
|
+
pullRequestUrl: z6.string().optional(),
|
|
670
|
+
referencedPullRequestUrl: z6.string().optional(),
|
|
671
|
+
prNumber: z6.number().optional(),
|
|
672
|
+
issueNumber: z6.number().optional(),
|
|
673
|
+
referencedIssueUrl: z6.string().optional(),
|
|
674
|
+
markerRefs: z6.object({ pr: z6.number().optional(), issue: z6.number().optional() }).optional(),
|
|
660
675
|
/** What the run has cost so far. Absent means nothing was recorded, which is NOT `$0` — the
|
|
661
676
|
* cockpit prints an em dash rather than claiming a measurement that never happened. */
|
|
662
|
-
costUsd:
|
|
677
|
+
costUsd: z6.number().optional(),
|
|
663
678
|
/** The persisted high-water marks a FINISHED run leaves behind. `usage` below stops existing
|
|
664
679
|
* the moment the process tree does, so without these a finished row could say nothing at all
|
|
665
680
|
* about what it took to run. */
|
|
666
|
-
peakRssBytes:
|
|
667
|
-
peakProcCount:
|
|
681
|
+
peakRssBytes: z6.number().optional(),
|
|
682
|
+
peakProcCount: z6.number().optional(),
|
|
668
683
|
/**
|
|
669
684
|
* The live CPU/RSS sample of this run's process tree, attached on the way out exactly as
|
|
670
685
|
* `GET /runs` attaches it (`withUsage`) — never persisted.
|
|
@@ -676,229 +691,231 @@ var runIndexEntrySchema = z5.object({
|
|
|
676
691
|
*/
|
|
677
692
|
usage: processUsageSchema.optional()
|
|
678
693
|
});
|
|
679
|
-
var referenceStatusesByProjectSchema =
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
prs:
|
|
683
|
-
issues:
|
|
694
|
+
var referenceStatusesByProjectSchema = z6.record(
|
|
695
|
+
z6.string(),
|
|
696
|
+
z6.object({
|
|
697
|
+
prs: z6.record(z6.number(), referenceStatusSchema),
|
|
698
|
+
issues: z6.record(z6.number(), referenceStatusSchema)
|
|
684
699
|
})
|
|
685
700
|
);
|
|
686
|
-
var runsIndexResponseSchema =
|
|
701
|
+
var runsIndexResponseSchema = z6.object({
|
|
687
702
|
/** Newest first, across every registered project. Archived runs are included — `GET /runs`
|
|
688
703
|
* carries them for the project you are standing in, and a finder that dropped them elsewhere
|
|
689
704
|
* would make a task vanish the moment you left its project. */
|
|
690
|
-
runs:
|
|
705
|
+
runs: z6.array(runIndexEntrySchema),
|
|
691
706
|
/** Additive: absent statuses mean "nothing warm", never "nothing to show". */
|
|
692
707
|
referenceStatuses: referenceStatusesByProjectSchema,
|
|
693
708
|
/** The per-project cap that produced this list. */
|
|
694
|
-
perProjectLimit:
|
|
709
|
+
perProjectLimit: z6.number(),
|
|
695
710
|
/** Ids of the projects that had more runs than the cap allowed. */
|
|
696
|
-
truncated:
|
|
711
|
+
truncated: z6.array(z6.string())
|
|
697
712
|
});
|
|
698
|
-
var createRunResponseSchema =
|
|
713
|
+
var createRunResponseSchema = z6.union([
|
|
699
714
|
runRecordSchema,
|
|
700
|
-
|
|
715
|
+
z6.object({ runs: z6.array(runRecordSchema) })
|
|
701
716
|
]);
|
|
702
|
-
var cancelResponseSchema =
|
|
703
|
-
var cancelAutoResumeResponseSchema =
|
|
704
|
-
var archiveFinishedResponseSchema =
|
|
705
|
-
var markAllReadResponseSchema =
|
|
706
|
-
var deleteRunResponseSchema =
|
|
707
|
-
var finishResponseSchema =
|
|
708
|
-
var continueResponseSchema =
|
|
709
|
-
var createPrResponseSchema =
|
|
710
|
-
url:
|
|
711
|
-
dryRun:
|
|
712
|
-
});
|
|
713
|
-
var messageResponseSchema =
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
+
var cancelResponseSchema = z6.object({ cancelled: z6.boolean() });
|
|
718
|
+
var cancelAutoResumeResponseSchema = z6.object({ cancelled: z6.literal(true) });
|
|
719
|
+
var archiveFinishedResponseSchema = z6.object({ archived: z6.number() });
|
|
720
|
+
var markAllReadResponseSchema = z6.object({ read: z6.number() });
|
|
721
|
+
var deleteRunResponseSchema = z6.object({ deleted: z6.literal(true) });
|
|
722
|
+
var finishResponseSchema = z6.object({ finished: z6.literal(true) });
|
|
723
|
+
var continueResponseSchema = z6.object({ continued: z6.literal(true) });
|
|
724
|
+
var createPrResponseSchema = z6.object({
|
|
725
|
+
url: z6.string(),
|
|
726
|
+
dryRun: z6.boolean()
|
|
727
|
+
});
|
|
728
|
+
var messageResponseSchema = z6.union([
|
|
729
|
+
z6.object({ delivered: z6.literal(true) }),
|
|
730
|
+
z6.object({ queued: z6.literal(true), message: queuedMessageSchema }),
|
|
731
|
+
z6.object({ deferred: z6.literal(true) })
|
|
717
732
|
]);
|
|
718
|
-
var editQueuedMessageResponseSchema =
|
|
719
|
-
var removeQueuedMessageResponseSchema =
|
|
720
|
-
var openInCliResponseSchema =
|
|
721
|
-
opened:
|
|
722
|
-
command:
|
|
723
|
-
});
|
|
724
|
-
var removeWorktreeResponseSchema =
|
|
725
|
-
var gitCommitResponseSchema =
|
|
726
|
-
committed:
|
|
727
|
-
sha:
|
|
728
|
-
});
|
|
729
|
-
var gitPushResponseSchema =
|
|
730
|
-
pushed:
|
|
731
|
-
branch:
|
|
732
|
-
remote:
|
|
733
|
-
upstreamSet:
|
|
734
|
-
});
|
|
735
|
-
var runCommitSchema =
|
|
736
|
-
sha:
|
|
737
|
-
subject:
|
|
738
|
-
author:
|
|
733
|
+
var editQueuedMessageResponseSchema = z6.object({ message: queuedMessageSchema });
|
|
734
|
+
var removeQueuedMessageResponseSchema = z6.object({ removed: z6.literal(true) });
|
|
735
|
+
var openInCliResponseSchema = z6.object({
|
|
736
|
+
opened: z6.literal(true),
|
|
737
|
+
command: z6.string()
|
|
738
|
+
});
|
|
739
|
+
var removeWorktreeResponseSchema = z6.object({ removed: z6.literal(true) });
|
|
740
|
+
var gitCommitResponseSchema = z6.object({
|
|
741
|
+
committed: z6.literal(true),
|
|
742
|
+
sha: z6.string()
|
|
743
|
+
});
|
|
744
|
+
var gitPushResponseSchema = z6.object({
|
|
745
|
+
pushed: z6.literal(true),
|
|
746
|
+
branch: z6.string(),
|
|
747
|
+
remote: z6.string(),
|
|
748
|
+
upstreamSet: z6.boolean()
|
|
749
|
+
});
|
|
750
|
+
var runCommitSchema = z6.object({
|
|
751
|
+
sha: z6.string(),
|
|
752
|
+
subject: z6.string(),
|
|
753
|
+
author: z6.string(),
|
|
739
754
|
/** Relative time ("3 hours ago") — git's `%cr`. */
|
|
740
|
-
when:
|
|
755
|
+
when: z6.string()
|
|
741
756
|
});
|
|
742
|
-
var runCommitsResponseSchema =
|
|
743
|
-
var groupVariantSchema =
|
|
744
|
-
id:
|
|
757
|
+
var runCommitsResponseSchema = z6.object({ commits: z6.array(runCommitSchema) });
|
|
758
|
+
var groupVariantSchema = z6.object({
|
|
759
|
+
id: z6.string(),
|
|
745
760
|
/** 'A' | 'B' | 'C' in practice; `'?'` for a record that lost its letter. */
|
|
746
|
-
variant:
|
|
747
|
-
title:
|
|
761
|
+
variant: z6.string(),
|
|
762
|
+
title: z6.string(),
|
|
748
763
|
status: runStatusSchema,
|
|
749
|
-
archived:
|
|
750
|
-
tokensUsed:
|
|
764
|
+
archived: z6.boolean(),
|
|
765
|
+
tokensUsed: z6.number(),
|
|
751
766
|
inputTokens: usageCounterSchema.optional(),
|
|
752
767
|
outputTokens: usageCounterSchema.optional(),
|
|
753
|
-
costUsd:
|
|
754
|
-
diffStat:
|
|
768
|
+
costUsd: z6.number().optional(),
|
|
769
|
+
diffStat: z6.string(),
|
|
755
770
|
/** First lines of the handoff journal's "## Progress log" section, as markdown. */
|
|
756
|
-
handoffExcerpt:
|
|
771
|
+
handoffExcerpt: z6.string()
|
|
757
772
|
});
|
|
758
|
-
var groupResponseSchema =
|
|
759
|
-
groupId:
|
|
760
|
-
runs:
|
|
773
|
+
var groupResponseSchema = z6.object({
|
|
774
|
+
groupId: z6.string(),
|
|
775
|
+
runs: z6.array(groupVariantSchema)
|
|
761
776
|
});
|
|
762
|
-
var pickVariantResponseSchema =
|
|
777
|
+
var pickVariantResponseSchema = z6.object({
|
|
763
778
|
winner: runRecordSchema.optional()
|
|
764
779
|
});
|
|
765
|
-
var imageInputSchema =
|
|
766
|
-
mediaType:
|
|
767
|
-
data:
|
|
780
|
+
var imageInputSchema = z6.object({
|
|
781
|
+
mediaType: z6.string().regex(/^image\//),
|
|
782
|
+
data: z6.string().min(1).max(7e6)
|
|
768
783
|
});
|
|
769
|
-
var createRunInputBaseSchema =
|
|
770
|
-
workflow:
|
|
784
|
+
var createRunInputBaseSchema = z6.object({
|
|
785
|
+
workflow: z6.string().min(1).optional(),
|
|
771
786
|
/** An inline chain (spec 008 — an approved plan runs as an ad-hoc workflow, never written to
|
|
772
787
|
* a file). The catalog's own step shape, not a copy of it. */
|
|
773
|
-
steps:
|
|
774
|
-
task:
|
|
775
|
-
model:
|
|
788
|
+
steps: z6.array(workflowStepDefSchema).min(1).max(8).optional(),
|
|
789
|
+
task: z6.string().min(1).max(1e5, "must be at most 100000 characters"),
|
|
790
|
+
model: z6.string().optional(),
|
|
791
|
+
/** Reasoning-effort pin (#45). Omit for the harness default; empty/`auto` stay implicit. */
|
|
792
|
+
effort: z6.string().max(32).optional(),
|
|
776
793
|
runner: runnerSchema.optional(),
|
|
777
794
|
/** Agent account for this task (spec 2026-07-29-agent-profiles). Omit to follow the
|
|
778
795
|
* project's own selection; an id that no longer exists is a 400, not a silent default. */
|
|
779
|
-
agentProfile:
|
|
796
|
+
agentProfile: z6.string().max(64).optional(),
|
|
780
797
|
/** 1–3. Above 1 the response is `{ runs }` rather than a single record. */
|
|
781
|
-
variants:
|
|
798
|
+
variants: z6.number().int().min(1).max(3).optional(),
|
|
782
799
|
/** false → run in the repo working tree instead of an isolated worktree (read-only skills).
|
|
783
800
|
* Omit for the default. Ignored server-side when variants > 1. */
|
|
784
|
-
worktree:
|
|
801
|
+
worktree: z6.boolean().optional(),
|
|
785
802
|
/** true → autonomous run: never parks at "waiting"; auto-continues until done. */
|
|
786
|
-
autonomous:
|
|
803
|
+
autonomous: z6.boolean().optional(),
|
|
787
804
|
/** false → keep the handoff journal but do not expose or request a follow-up todos file.
|
|
788
805
|
* Omit for the default (enabled); a server with the capability off pins it to false. */
|
|
789
|
-
generateFollowups:
|
|
806
|
+
generateFollowups: z6.boolean().optional(),
|
|
790
807
|
/** Per-run system-prompt override (R2 2.3) — programmatic callers only. Wins over the
|
|
791
808
|
* config.json default; whitespace-only degrades to absent. */
|
|
792
|
-
systemPrompt:
|
|
809
|
+
systemPrompt: z6.string().trim().max(2e4, "must be at most 20000 characters").optional().transform((s) => s ? s : void 0),
|
|
793
810
|
/** Screenshots pasted into the new-task form; delivered with the first agent step. */
|
|
794
|
-
images:
|
|
811
|
+
images: z6.array(imageInputSchema).max(4).optional(),
|
|
795
812
|
/** The inbox entry this task came from (#374). Best-effort bookkeeping: an unknown or
|
|
796
813
|
* already-started id never fails the run. For ×2/×3 the FIRST variant is recorded. */
|
|
797
|
-
todoId:
|
|
814
|
+
todoId: z6.string().min(1).max(200, "must be at most 200 characters").optional()
|
|
798
815
|
});
|
|
799
816
|
var createRunInputSchema = createRunInputBaseSchema.refine(
|
|
800
817
|
(b) => Boolean(b.workflow) !== Boolean(b.steps),
|
|
801
818
|
{ message: 'provide either "workflow" or "steps", not both' }
|
|
802
819
|
);
|
|
803
|
-
var messageInputSchema =
|
|
804
|
-
text:
|
|
805
|
-
images:
|
|
820
|
+
var messageInputSchema = z6.object({
|
|
821
|
+
text: z6.string().max(1e5).default(""),
|
|
822
|
+
images: z6.array(imageInputSchema).max(4).default([])
|
|
806
823
|
}).refine((m) => m.text.trim().length > 0 || m.images.length > 0, {
|
|
807
824
|
message: "message needs text or at least one image"
|
|
808
825
|
});
|
|
809
|
-
var patchRunInputSchema =
|
|
810
|
-
title:
|
|
811
|
-
task:
|
|
826
|
+
var patchRunInputSchema = z6.object({
|
|
827
|
+
title: z6.string().trim().min(1).max(300).optional(),
|
|
828
|
+
task: z6.string().trim().min(1).max(1e5).optional()
|
|
812
829
|
});
|
|
813
830
|
|
|
814
831
|
// ../contract/src/repo.ts
|
|
815
|
-
import { z as
|
|
816
|
-
var statusEntrySchema =
|
|
817
|
-
status:
|
|
818
|
-
path:
|
|
819
|
-
});
|
|
820
|
-
var logEntrySchema =
|
|
821
|
-
hash:
|
|
822
|
-
subject:
|
|
823
|
-
author:
|
|
824
|
-
when:
|
|
825
|
-
});
|
|
826
|
-
var repoResponseSchema =
|
|
827
|
-
|
|
828
|
-
info:
|
|
829
|
-
status:
|
|
830
|
-
log:
|
|
831
|
-
branches:
|
|
832
|
-
baseBranch:
|
|
832
|
+
import { z as z7 } from "zod";
|
|
833
|
+
var statusEntrySchema = z7.object({
|
|
834
|
+
status: z7.string(),
|
|
835
|
+
path: z7.string()
|
|
836
|
+
});
|
|
837
|
+
var logEntrySchema = z7.object({
|
|
838
|
+
hash: z7.string(),
|
|
839
|
+
subject: z7.string(),
|
|
840
|
+
author: z7.string(),
|
|
841
|
+
when: z7.string()
|
|
842
|
+
});
|
|
843
|
+
var repoResponseSchema = z7.union([
|
|
844
|
+
z7.object({
|
|
845
|
+
info: z7.null(),
|
|
846
|
+
status: z7.array(z7.never()),
|
|
847
|
+
log: z7.array(z7.never()),
|
|
848
|
+
branches: z7.array(z7.never()),
|
|
849
|
+
baseBranch: z7.null()
|
|
833
850
|
}),
|
|
834
|
-
|
|
851
|
+
z7.object({
|
|
835
852
|
info: repoInfoSchema,
|
|
836
|
-
status:
|
|
837
|
-
log:
|
|
838
|
-
branches:
|
|
839
|
-
baseBranch:
|
|
853
|
+
status: z7.array(statusEntrySchema),
|
|
854
|
+
log: z7.array(logEntrySchema),
|
|
855
|
+
branches: z7.array(z7.string()),
|
|
856
|
+
baseBranch: z7.string().nullable()
|
|
840
857
|
})
|
|
841
858
|
]);
|
|
842
|
-
var repoBranchResponseSchema =
|
|
843
|
-
branch:
|
|
844
|
-
created:
|
|
859
|
+
var repoBranchResponseSchema = z7.object({
|
|
860
|
+
branch: z7.string(),
|
|
861
|
+
created: z7.boolean()
|
|
845
862
|
});
|
|
846
|
-
var diffStatSchema2 =
|
|
847
|
-
adds:
|
|
848
|
-
dels:
|
|
849
|
-
files:
|
|
863
|
+
var diffStatSchema2 = z7.object({
|
|
864
|
+
adds: z7.number(),
|
|
865
|
+
dels: z7.number(),
|
|
866
|
+
files: z7.number()
|
|
850
867
|
});
|
|
851
|
-
var changedFileSchema =
|
|
852
|
-
path:
|
|
868
|
+
var changedFileSchema = z7.object({
|
|
869
|
+
path: z7.string(),
|
|
853
870
|
/** Rename/copy source — present only when `status` is renamed/copied. */
|
|
854
|
-
oldPath:
|
|
855
|
-
status:
|
|
856
|
-
adds:
|
|
857
|
-
dels:
|
|
871
|
+
oldPath: z7.string().optional(),
|
|
872
|
+
status: z7.enum(["added", "modified", "deleted", "renamed", "copied"]),
|
|
873
|
+
adds: z7.number(),
|
|
874
|
+
dels: z7.number(),
|
|
858
875
|
/** Binary per numstat — there is no text patch to render. */
|
|
859
|
-
binary:
|
|
876
|
+
binary: z7.boolean(),
|
|
860
877
|
/** True when the path is one the raw-bytes route serves as an `<img>` (#365) — present only
|
|
861
878
|
* when true, so old clients that never read it stay correct. */
|
|
862
|
-
image:
|
|
879
|
+
image: z7.boolean().optional(),
|
|
863
880
|
/** This file's unified-diff section; possibly `… (patch truncated)`, possibly empty. */
|
|
864
|
-
patch:
|
|
881
|
+
patch: z7.string()
|
|
865
882
|
});
|
|
866
|
-
var changesPayloadSchema =
|
|
867
|
-
files:
|
|
883
|
+
var changesPayloadSchema = z7.object({
|
|
884
|
+
files: z7.array(changedFileSchema),
|
|
868
885
|
stat: diffStatSchema2,
|
|
869
886
|
/** Additive context for review tasks whose worktree HEAD no longer matches their own branch. */
|
|
870
|
-
repointedHead:
|
|
887
|
+
repointedHead: z7.object({ headBranch: z7.string(), taskBranch: z7.string() }).optional()
|
|
871
888
|
});
|
|
872
|
-
var repoCommitPayloadSchema =
|
|
873
|
-
sha:
|
|
874
|
-
subject:
|
|
875
|
-
author:
|
|
889
|
+
var repoCommitPayloadSchema = z7.object({
|
|
890
|
+
sha: z7.string(),
|
|
891
|
+
subject: z7.string(),
|
|
892
|
+
author: z7.string(),
|
|
876
893
|
/** Relative time ("3 hours ago") — same `%cr` format as the /api/v1/repo log. */
|
|
877
|
-
when:
|
|
878
|
-
files:
|
|
894
|
+
when: z7.string(),
|
|
895
|
+
files: z7.array(changedFileSchema),
|
|
879
896
|
stat: diffStatSchema2
|
|
880
897
|
});
|
|
881
|
-
var worktreeDirEntrySchema =
|
|
882
|
-
name:
|
|
883
|
-
type:
|
|
884
|
-
size:
|
|
885
|
-
});
|
|
886
|
-
var worktreeEntrySchema =
|
|
887
|
-
|
|
888
|
-
type:
|
|
889
|
-
path:
|
|
890
|
-
entries:
|
|
898
|
+
var worktreeDirEntrySchema = z7.object({
|
|
899
|
+
name: z7.string(),
|
|
900
|
+
type: z7.enum(["dir", "file"]),
|
|
901
|
+
size: z7.number().optional()
|
|
902
|
+
});
|
|
903
|
+
var worktreeEntrySchema = z7.discriminatedUnion("type", [
|
|
904
|
+
z7.object({
|
|
905
|
+
type: z7.literal("dir"),
|
|
906
|
+
path: z7.string(),
|
|
907
|
+
entries: z7.array(worktreeDirEntrySchema)
|
|
891
908
|
}),
|
|
892
|
-
|
|
893
|
-
type:
|
|
894
|
-
path:
|
|
895
|
-
size:
|
|
896
|
-
binary:
|
|
897
|
-
tooLarge:
|
|
898
|
-
content:
|
|
909
|
+
z7.object({
|
|
910
|
+
type: z7.literal("file"),
|
|
911
|
+
path: z7.string(),
|
|
912
|
+
size: z7.number(),
|
|
913
|
+
binary: z7.boolean(),
|
|
914
|
+
tooLarge: z7.boolean(),
|
|
915
|
+
content: z7.string().optional()
|
|
899
916
|
})
|
|
900
917
|
]);
|
|
901
|
-
var worktreeRunStatusSchema =
|
|
918
|
+
var worktreeRunStatusSchema = z7.enum([
|
|
902
919
|
"queued",
|
|
903
920
|
"running",
|
|
904
921
|
"waiting",
|
|
@@ -907,41 +924,41 @@ var worktreeRunStatusSchema = z6.enum([
|
|
|
907
924
|
"failed",
|
|
908
925
|
"cancelled"
|
|
909
926
|
]);
|
|
910
|
-
var worktreeInfoSchema =
|
|
911
|
-
runId:
|
|
912
|
-
title:
|
|
927
|
+
var worktreeInfoSchema = z7.object({
|
|
928
|
+
runId: z7.string(),
|
|
929
|
+
title: z7.string(),
|
|
913
930
|
status: worktreeRunStatusSchema,
|
|
914
|
-
branch:
|
|
915
|
-
sizeBytes:
|
|
916
|
-
finishedAt:
|
|
917
|
-
reclaimable:
|
|
931
|
+
branch: z7.string().nullable(),
|
|
932
|
+
sizeBytes: z7.number().nullable(),
|
|
933
|
+
finishedAt: z7.string().nullable(),
|
|
934
|
+
reclaimable: z7.boolean()
|
|
918
935
|
});
|
|
919
|
-
var worktreesResponseSchema =
|
|
920
|
-
worktrees:
|
|
921
|
-
totalBytes:
|
|
922
|
-
keep:
|
|
936
|
+
var worktreesResponseSchema = z7.object({
|
|
937
|
+
worktrees: z7.array(worktreeInfoSchema),
|
|
938
|
+
totalBytes: z7.number().nullable(),
|
|
939
|
+
keep: z7.number()
|
|
923
940
|
});
|
|
924
|
-
var reclaimWorktreesResponseSchema =
|
|
925
|
-
reclaimed:
|
|
941
|
+
var reclaimWorktreesResponseSchema = z7.object({
|
|
942
|
+
reclaimed: z7.array(z7.string())
|
|
926
943
|
});
|
|
927
944
|
|
|
928
945
|
// ../contract/src/projects.ts
|
|
929
|
-
import { z as
|
|
930
|
-
var projectListEntrySchema =
|
|
931
|
-
id:
|
|
932
|
-
name:
|
|
946
|
+
import { z as z8 } from "zod";
|
|
947
|
+
var projectListEntrySchema = z8.object({
|
|
948
|
+
id: z8.string(),
|
|
949
|
+
name: z8.string(),
|
|
933
950
|
/** Absolute, realpath-normalized repo root. */
|
|
934
|
-
root:
|
|
935
|
-
addedAt:
|
|
936
|
-
lastOpenedAt:
|
|
937
|
-
source:
|
|
951
|
+
root: z8.string(),
|
|
952
|
+
addedAt: z8.string(),
|
|
953
|
+
lastOpenedAt: z8.string(),
|
|
954
|
+
source: z8.enum(["local", "checkout"]),
|
|
938
955
|
/** `not-git` is fully usable (degraded single-queue mode); only `missing` blocks. */
|
|
939
|
-
status:
|
|
956
|
+
status: z8.enum(["ok", "missing", "not-git"]),
|
|
940
957
|
/** Current branch when cheaply available (omitted e.g. on an unborn HEAD). */
|
|
941
|
-
branch:
|
|
958
|
+
branch: z8.string().optional(),
|
|
942
959
|
/** Which forge this project's remote belongs to (#698) — classified server-side from the
|
|
943
960
|
* remote URL alone. Gates the project group's GitHub nav item; omitted = no forge remote. */
|
|
944
|
-
forge:
|
|
961
|
+
forge: z8.literal("github").optional(),
|
|
945
962
|
/**
|
|
946
963
|
* The remote's web root, `https://github.com/owner/repo`. Rebuilt server-side from the parsed
|
|
947
964
|
* remote rather than passed through, so a remote carrying credentials cannot leak into the
|
|
@@ -951,10 +968,10 @@ var projectListEntrySchema = z7.object({
|
|
|
951
968
|
* the global Tasks page has one row per project, so it cannot use any single repo's base the
|
|
952
969
|
* way a project-scoped view can. With this, every reference it shows is a link.
|
|
953
970
|
*/
|
|
954
|
-
repoUrl:
|
|
971
|
+
repoUrl: z8.string().optional(),
|
|
955
972
|
/** Per-project cap on concurrently running tasks (spec 2026-07-22). Omitted = inherit the
|
|
956
973
|
* workspace `resources.maxParallel`; a number pins this project. */
|
|
957
|
-
maxParallel:
|
|
974
|
+
maxParallel: z8.number().optional(),
|
|
958
975
|
/**
|
|
959
976
|
* Free-form labels grouping CONNECTED repositories — a `storefront` tag on the API, the web
|
|
960
977
|
* app and the design system says those three are one piece of work spread over three repos.
|
|
@@ -966,85 +983,85 @@ var projectListEntrySchema = z7.object({
|
|
|
966
983
|
* server-side (trimmed, deduped case-insensitively, sorted), so a consumer may compare them
|
|
967
984
|
* directly.
|
|
968
985
|
*/
|
|
969
|
-
tags:
|
|
986
|
+
tags: z8.array(z8.string()).optional()
|
|
970
987
|
});
|
|
971
|
-
var projectsResponseSchema =
|
|
972
|
-
projects:
|
|
973
|
-
bootProject:
|
|
974
|
-
projectsDir:
|
|
988
|
+
var projectsResponseSchema = z8.object({
|
|
989
|
+
projects: z8.array(projectListEntrySchema),
|
|
990
|
+
bootProject: z8.string(),
|
|
991
|
+
projectsDir: z8.string()
|
|
975
992
|
});
|
|
976
|
-
var registerProjectResponseSchema =
|
|
993
|
+
var registerProjectResponseSchema = z8.object({
|
|
977
994
|
project: projectListEntrySchema,
|
|
978
|
-
error:
|
|
995
|
+
error: z8.string().optional()
|
|
979
996
|
});
|
|
980
|
-
var removeProjectResponseSchema =
|
|
981
|
-
removed:
|
|
982
|
-
id:
|
|
997
|
+
var removeProjectResponseSchema = z8.object({
|
|
998
|
+
removed: z8.literal(true),
|
|
999
|
+
id: z8.string()
|
|
983
1000
|
});
|
|
984
|
-
var updateProjectResponseSchema =
|
|
1001
|
+
var updateProjectResponseSchema = z8.object({
|
|
985
1002
|
project: projectListEntrySchema
|
|
986
1003
|
});
|
|
987
1004
|
var PROJECT_TAG_MAX_LENGTH = 32;
|
|
988
1005
|
var PROJECT_TAGS_MAX = 20;
|
|
989
|
-
var updateProjectInputSchema =
|
|
990
|
-
maxParallel:
|
|
991
|
-
tags:
|
|
1006
|
+
var updateProjectInputSchema = z8.object({
|
|
1007
|
+
maxParallel: z8.number().int().min(1).max(16).nullable().optional(),
|
|
1008
|
+
tags: z8.array(z8.string().trim().min(1).max(PROJECT_TAG_MAX_LENGTH)).max(PROJECT_TAGS_MAX).nullable().optional()
|
|
992
1009
|
}).refine(
|
|
993
1010
|
(body) => body.maxParallel !== void 0 || body.tags !== void 0,
|
|
994
1011
|
"specify maxParallel or tags"
|
|
995
1012
|
);
|
|
996
|
-
var checkoutProjectInputSchema =
|
|
997
|
-
url:
|
|
998
|
-
name:
|
|
999
|
-
checkoutId:
|
|
1000
|
-
});
|
|
1001
|
-
var fsBrowseDirSchema =
|
|
1002
|
-
name:
|
|
1003
|
-
path:
|
|
1013
|
+
var checkoutProjectInputSchema = z8.object({
|
|
1014
|
+
url: z8.string().trim().min(1).max(512),
|
|
1015
|
+
name: z8.string().trim().max(128).optional(),
|
|
1016
|
+
checkoutId: z8.string().trim().max(128).optional()
|
|
1017
|
+
});
|
|
1018
|
+
var fsBrowseDirSchema = z8.object({
|
|
1019
|
+
name: z8.string(),
|
|
1020
|
+
path: z8.string(),
|
|
1004
1021
|
/** Has a `.git` entry — drives the "git" badge. A non-repo folder is still selectable. */
|
|
1005
|
-
isRepo:
|
|
1022
|
+
isRepo: z8.boolean()
|
|
1006
1023
|
});
|
|
1007
|
-
var fsBrowseResponseSchema =
|
|
1024
|
+
var fsBrowseResponseSchema = z8.object({
|
|
1008
1025
|
/** The realpath'd directory actually listed — never the spelling asked for, so the breadcrumb
|
|
1009
1026
|
* shows where the picker really is. */
|
|
1010
|
-
path:
|
|
1027
|
+
path: z8.string(),
|
|
1011
1028
|
/** `null` AT the browse root: there is no "up" out of it, and the dialog must render no parent
|
|
1012
1029
|
* row rather than one that 400s. */
|
|
1013
|
-
parent:
|
|
1014
|
-
dirs:
|
|
1030
|
+
parent: z8.string().nullable(),
|
|
1031
|
+
dirs: z8.array(fsBrowseDirSchema),
|
|
1015
1032
|
/** True when the listing was capped server-side — surfaced honestly instead of showing a
|
|
1016
1033
|
* silently short list. */
|
|
1017
|
-
truncated:
|
|
1034
|
+
truncated: z8.boolean()
|
|
1018
1035
|
});
|
|
1019
|
-
var launchKeyResponseSchema =
|
|
1020
|
-
key:
|
|
1036
|
+
var launchKeyResponseSchema = z8.object({
|
|
1037
|
+
key: z8.string()
|
|
1021
1038
|
});
|
|
1022
1039
|
|
|
1023
1040
|
// ../contract/src/workspace.ts
|
|
1024
|
-
import { z as
|
|
1025
|
-
var workspaceConfigResponseSchema =
|
|
1041
|
+
import { z as z9 } from "zod";
|
|
1042
|
+
var workspaceConfigResponseSchema = z9.object({
|
|
1026
1043
|
/** Root exposed by the Add-project directory browser — stored as written (`~` kept). */
|
|
1027
|
-
browseRoot:
|
|
1044
|
+
browseRoot: z9.string(),
|
|
1028
1045
|
/** Checkout root for GUI-cloned projects — stored as written (`~` kept). */
|
|
1029
|
-
projectsDir:
|
|
1046
|
+
projectsDir: z9.string(),
|
|
1030
1047
|
/** Stored override; `null` means inherit `CEZ_SKILLS_AUTO_UPDATE`, then true. */
|
|
1031
|
-
skillsAutoUpdate:
|
|
1032
|
-
effectiveSkillsAutoUpdate:
|
|
1033
|
-
composerDefaults:
|
|
1034
|
-
autonomous:
|
|
1035
|
-
worktree:
|
|
1048
|
+
skillsAutoUpdate: z9.boolean().nullable(),
|
|
1049
|
+
effectiveSkillsAutoUpdate: z9.boolean(),
|
|
1050
|
+
composerDefaults: z9.object({
|
|
1051
|
+
autonomous: z9.boolean().nullable(),
|
|
1052
|
+
worktree: z9.boolean().nullable(),
|
|
1036
1053
|
/** `'source-dependent'` when no `CEZ_AUTONOMOUS_DEFAULT` pins it either way. */
|
|
1037
|
-
inheritedAutonomous:
|
|
1038
|
-
inheritedWorktree:
|
|
1054
|
+
inheritedAutonomous: z9.union([z9.boolean(), z9.literal("source-dependent")]),
|
|
1055
|
+
inheritedWorktree: z9.boolean()
|
|
1039
1056
|
}),
|
|
1040
|
-
resources:
|
|
1041
|
-
maxParallel:
|
|
1042
|
-
maxMonitoringSessions:
|
|
1043
|
-
monitoringWakeIntervalMinutes:
|
|
1057
|
+
resources: z9.object({
|
|
1058
|
+
maxParallel: z9.number(),
|
|
1059
|
+
maxMonitoringSessions: z9.number(),
|
|
1060
|
+
monitoringWakeIntervalMinutes: z9.number().nullable(),
|
|
1044
1061
|
/** Resume a run a provider usage limit stopped, once the limit resets. Default `true`. */
|
|
1045
|
-
autoResumeOnUsageLimit:
|
|
1046
|
-
memoryLimitMb:
|
|
1047
|
-
worktreeRetentionDefault:
|
|
1062
|
+
autoResumeOnUsageLimit: z9.boolean(),
|
|
1063
|
+
memoryLimitMb: z9.number().nullable(),
|
|
1064
|
+
worktreeRetentionDefault: z9.number()
|
|
1048
1065
|
}),
|
|
1049
1066
|
/**
|
|
1050
1067
|
* What a repo that has set none of its own runs (spec 2026-07-29-agent-profiles).
|
|
@@ -1054,118 +1071,118 @@ var workspaceConfigResponseSchema = z8.object({
|
|
|
1054
1071
|
* from a value someone chose or the fallback collapses into "always claude". Consulted only where
|
|
1055
1072
|
* the repo's own `.ai/cezar/config.json` is silent — a repo that chose is never overruled.
|
|
1056
1073
|
*/
|
|
1057
|
-
agentDefaults:
|
|
1074
|
+
agentDefaults: z9.object({
|
|
1058
1075
|
runner: runnerSchema.optional(),
|
|
1059
|
-
models:
|
|
1060
|
-
claude:
|
|
1061
|
-
codex:
|
|
1062
|
-
opencode:
|
|
1063
|
-
pi:
|
|
1076
|
+
models: z9.object({
|
|
1077
|
+
claude: z9.string().optional(),
|
|
1078
|
+
codex: z9.string().optional(),
|
|
1079
|
+
opencode: z9.string().optional(),
|
|
1080
|
+
pi: z9.string().optional()
|
|
1064
1081
|
}).optional()
|
|
1065
1082
|
})
|
|
1066
1083
|
});
|
|
1067
|
-
var setWorkspaceConfigInputSchema =
|
|
1068
|
-
browseRoot:
|
|
1069
|
-
projectsDir:
|
|
1070
|
-
skillsAutoUpdate:
|
|
1071
|
-
composerDefaults:
|
|
1072
|
-
autonomous:
|
|
1073
|
-
worktree:
|
|
1084
|
+
var setWorkspaceConfigInputSchema = z9.object({
|
|
1085
|
+
browseRoot: z9.string().trim().min(1).max(4096).optional(),
|
|
1086
|
+
projectsDir: z9.string().trim().min(1).max(4096).optional(),
|
|
1087
|
+
skillsAutoUpdate: z9.boolean().nullable().optional(),
|
|
1088
|
+
composerDefaults: z9.object({
|
|
1089
|
+
autonomous: z9.boolean().nullable().optional(),
|
|
1090
|
+
worktree: z9.boolean().nullable().optional()
|
|
1074
1091
|
}).optional(),
|
|
1075
1092
|
/** Machine-wide agent defaults. `null` on a key CLEARS it back to "no opinion", which a bare
|
|
1076
1093
|
* absent key cannot say in a partial patch. */
|
|
1077
|
-
agentDefaults:
|
|
1094
|
+
agentDefaults: z9.object({
|
|
1078
1095
|
runner: runnerSchema.nullable().optional(),
|
|
1079
|
-
models:
|
|
1080
|
-
claude:
|
|
1081
|
-
codex:
|
|
1082
|
-
opencode:
|
|
1083
|
-
pi:
|
|
1096
|
+
models: z9.object({
|
|
1097
|
+
claude: z9.string().trim().min(1).max(200).nullable().optional(),
|
|
1098
|
+
codex: z9.string().trim().min(1).max(200).nullable().optional(),
|
|
1099
|
+
opencode: z9.string().trim().min(1).max(200).nullable().optional(),
|
|
1100
|
+
pi: z9.string().trim().min(1).max(200).nullable().optional()
|
|
1084
1101
|
}).optional()
|
|
1085
1102
|
}).optional(),
|
|
1086
|
-
resources:
|
|
1087
|
-
maxParallel:
|
|
1088
|
-
maxMonitoringSessions:
|
|
1089
|
-
monitoringWakeIntervalMinutes:
|
|
1090
|
-
autoResumeOnUsageLimit:
|
|
1091
|
-
memoryLimitMb:
|
|
1092
|
-
worktreeRetentionDefault:
|
|
1103
|
+
resources: z9.object({
|
|
1104
|
+
maxParallel: z9.number().int().min(1).max(16).optional(),
|
|
1105
|
+
maxMonitoringSessions: z9.number().int().min(0).max(16).optional(),
|
|
1106
|
+
monitoringWakeIntervalMinutes: z9.number().int().min(1).max(60).nullable().optional(),
|
|
1107
|
+
autoResumeOnUsageLimit: z9.boolean().optional(),
|
|
1108
|
+
memoryLimitMb: z9.number().int().min(0).max(1048576).nullable().optional(),
|
|
1109
|
+
worktreeRetentionDefault: z9.number().int().min(0).max(1e3).optional()
|
|
1093
1110
|
}).optional()
|
|
1094
1111
|
});
|
|
1095
|
-
var appearanceSchema =
|
|
1096
|
-
accent:
|
|
1097
|
-
density:
|
|
1098
|
-
width:
|
|
1112
|
+
var appearanceSchema = z9.object({
|
|
1113
|
+
accent: z9.enum(["lime", "violet"]).optional(),
|
|
1114
|
+
density: z9.enum(["comfortable", "compact", "ultra"]).optional(),
|
|
1115
|
+
width: z9.enum(["narrow", "wide"]).optional()
|
|
1099
1116
|
});
|
|
1100
|
-
var taskTableUiStateSchema =
|
|
1117
|
+
var taskTableUiStateSchema = z9.looseObject({
|
|
1101
1118
|
/** Explicit user choices only. Missing ids keep the registry-owned default. */
|
|
1102
|
-
expandedColumns:
|
|
1119
|
+
expandedColumns: z9.record(z9.string(), z9.boolean()).optional()
|
|
1103
1120
|
});
|
|
1104
|
-
var uiStateSchema =
|
|
1121
|
+
var uiStateSchema = z9.looseObject({
|
|
1105
1122
|
/** What the last started run used. `null` is a VALUE, not an absence: it records a run that
|
|
1106
1123
|
* chose neither a skill nor a workflow (the plain built-in `quick-task`), which the composer
|
|
1107
1124
|
* can now express since the source picker grew an empty state. Absent still means "no
|
|
1108
1125
|
* run has been recorded here" — a cockpit reading either one selects nothing. */
|
|
1109
|
-
lastTask:
|
|
1126
|
+
lastTask: z9.object({ source: z9.enum(["workflow", "skill"]), ref: z9.string() }).nullable().optional(),
|
|
1110
1127
|
/** Most-recently-run sources, newest first (deduped, capped). Feeds the composer picker's
|
|
1111
1128
|
* recency sort. */
|
|
1112
|
-
recentSources:
|
|
1129
|
+
recentSources: z9.array(z9.object({ source: z9.enum(["workflow", "skill"]), ref: z9.string() })).optional(),
|
|
1113
1130
|
/** The last worktree choice for a single-skill run. Absent → the default (isolated worktree). */
|
|
1114
|
-
lastWorktree:
|
|
1131
|
+
lastWorktree: z9.boolean().optional(),
|
|
1115
1132
|
/** The last autonomous choice — remembered like `lastWorktree`. Absent → off. */
|
|
1116
|
-
lastAutonomous:
|
|
1133
|
+
lastAutonomous: z9.boolean().optional(),
|
|
1117
1134
|
/** Whether new runs should ask agents to append follow-up work. Absent → on. */
|
|
1118
|
-
lastGenerateFollowups:
|
|
1135
|
+
lastGenerateFollowups: z9.boolean().optional(),
|
|
1119
1136
|
/** Skill selection frequency (#408): name → times chosen, across BOTH composers. */
|
|
1120
|
-
skillUsage:
|
|
1121
|
-
runsView:
|
|
1137
|
+
skillUsage: z9.record(z9.string(), z9.number()).optional(),
|
|
1138
|
+
runsView: z9.enum(["list", "table"]).optional(),
|
|
1122
1139
|
/** The GitHub tab's last-selected sub-tab (#417). Absent → issues. */
|
|
1123
|
-
githubView:
|
|
1140
|
+
githubView: z9.enum(["issues", "prs"]).optional(),
|
|
1124
1141
|
/** Settings → Appearance. The theme itself stays in localStorage (`cez-theme`) — it must
|
|
1125
1142
|
* pre-paint, and it is per-browser by design. */
|
|
1126
1143
|
appearance: appearanceSchema.optional(),
|
|
1127
1144
|
/** Follow-up prompt templates (#413). Absent → the built-in defaults; present (even `[]`) is
|
|
1128
1145
|
* the user's own edited list. `skills` are the skill names the template auto-applies for. */
|
|
1129
|
-
promptTemplates:
|
|
1130
|
-
|
|
1131
|
-
id:
|
|
1132
|
-
label:
|
|
1133
|
-
text:
|
|
1134
|
-
skills:
|
|
1146
|
+
promptTemplates: z9.array(
|
|
1147
|
+
z9.object({
|
|
1148
|
+
id: z9.string(),
|
|
1149
|
+
label: z9.string(),
|
|
1150
|
+
text: z9.string(),
|
|
1151
|
+
skills: z9.array(z9.string()).optional()
|
|
1135
1152
|
})
|
|
1136
1153
|
).optional(),
|
|
1137
1154
|
/** The open-mercato/skills promo banner (#391), dismissed for good. Legacy — the banner is
|
|
1138
1155
|
* gone, replaced by `WorkspaceUiState.importedSkills`; retained so old files round-trip. */
|
|
1139
|
-
dismissedSkillsBanner:
|
|
1156
|
+
dismissedSkillsBanner: z9.boolean().optional()
|
|
1140
1157
|
});
|
|
1141
|
-
var workspaceLastLocationSchema =
|
|
1142
|
-
projectId:
|
|
1143
|
-
pathname:
|
|
1144
|
-
search:
|
|
1145
|
-
hash:
|
|
1158
|
+
var workspaceLastLocationSchema = z9.strictObject({
|
|
1159
|
+
projectId: z9.string().min(1).max(64),
|
|
1160
|
+
pathname: z9.string().min(1).max(2048).startsWith("/p/"),
|
|
1161
|
+
search: z9.string().max(4096).startsWith("?").optional(),
|
|
1162
|
+
hash: z9.string().max(2048).startsWith("#").optional()
|
|
1146
1163
|
});
|
|
1147
|
-
var workspaceUiStateSchema =
|
|
1164
|
+
var workspaceUiStateSchema = z9.looseObject({
|
|
1148
1165
|
/** LEGACY — the sidebar's per-project collapse map (step 3.3). Still accepted and still
|
|
1149
1166
|
* round-tripped so an older cockpit sharing this home keeps working, but the current cockpit
|
|
1150
1167
|
* neither reads nor writes it: which groups are shut describes the WINDOW, not the workspace,
|
|
1151
1168
|
* so it lives in that browser's localStorage (`packages/web/src/lib/sidebar-collapse.ts`).
|
|
1152
1169
|
* One shared answer meant a phone collapsing a group collapsed it on the desktop too. */
|
|
1153
|
-
sidebar:
|
|
1170
|
+
sidebar: z9.looseObject({ collapsed: z9.record(z9.string(), z9.boolean()).optional() }).optional(),
|
|
1154
1171
|
/** Dismissed runtime-auth incident IDs, keyed by provider. An ID is only dismissed until the
|
|
1155
1172
|
* provider reports a different incident, so this stays workspace-global with the browser
|
|
1156
1173
|
* rather than one project checkout. */
|
|
1157
|
-
dismissedProviderAuthFailures:
|
|
1158
|
-
claude:
|
|
1159
|
-
codex:
|
|
1160
|
-
opencode:
|
|
1161
|
-
pi:
|
|
1174
|
+
dismissedProviderAuthFailures: z9.object({
|
|
1175
|
+
claude: z9.string().optional(),
|
|
1176
|
+
codex: z9.string().optional(),
|
|
1177
|
+
opencode: z9.string().optional(),
|
|
1178
|
+
pi: z9.string().optional()
|
|
1162
1179
|
}).optional(),
|
|
1163
1180
|
/** Settings → Appearance, GLOBAL since step 3.5: accent + density describe the person at the
|
|
1164
1181
|
* keyboard, not a repo. */
|
|
1165
1182
|
appearance: appearanceSchema.optional(),
|
|
1166
1183
|
/** Settings → Notifications, GLOBAL since step 3.5 — one answer for the whole workspace, since
|
|
1167
1184
|
* the delivering browser is one browser whichever project you are looking at. */
|
|
1168
|
-
notifications:
|
|
1185
|
+
notifications: z9.looseObject({ enabled: z9.boolean().optional() }).optional(),
|
|
1169
1186
|
/** Desktop Tasks-table density, shared across every project in this workspace. */
|
|
1170
1187
|
taskTable: taskTableUiStateSchema.optional(),
|
|
1171
1188
|
/** LEGACY, exactly like `sidebar` above — the last settled project-scoped page, restored when
|
|
@@ -1176,26 +1193,26 @@ var workspaceUiStateSchema = z8.looseObject({
|
|
|
1176
1193
|
/** The user's curated selection of default (vendor) skills. Tri-state: ABSENT means "not
|
|
1177
1194
|
* curated", so every default skill shows; a PRESENT array (even `[]`) means only those names
|
|
1178
1195
|
* show from that repo. */
|
|
1179
|
-
importedSkills:
|
|
1196
|
+
importedSkills: z9.array(z9.string()).optional()
|
|
1180
1197
|
});
|
|
1181
1198
|
var WORKSPACE_UI_STATE_MAX_KEYS = 200;
|
|
1182
1199
|
var TASK_TABLE_MAX_COLUMNS = 50;
|
|
1183
|
-
var setWorkspaceUiStateInputSchema =
|
|
1200
|
+
var setWorkspaceUiStateInputSchema = z9.looseObject({
|
|
1184
1201
|
...workspaceUiStateSchema.shape,
|
|
1185
|
-
sidebar:
|
|
1186
|
-
collapsed:
|
|
1202
|
+
sidebar: z9.looseObject({
|
|
1203
|
+
collapsed: z9.record(z9.string().min(1).max(64), z9.boolean()).refine((map) => Object.keys(map).length <= WORKSPACE_UI_STATE_MAX_KEYS, {
|
|
1187
1204
|
message: `sidebar.collapsed must have at most ${WORKSPACE_UI_STATE_MAX_KEYS} entries`
|
|
1188
1205
|
}).optional()
|
|
1189
1206
|
}).optional(),
|
|
1190
|
-
dismissedProviderAuthFailures:
|
|
1191
|
-
claude:
|
|
1192
|
-
codex:
|
|
1193
|
-
opencode:
|
|
1194
|
-
pi:
|
|
1207
|
+
dismissedProviderAuthFailures: z9.strictObject({
|
|
1208
|
+
claude: z9.string().min(1).max(128).optional(),
|
|
1209
|
+
codex: z9.string().min(1).max(128).optional(),
|
|
1210
|
+
opencode: z9.string().min(1).max(128).optional(),
|
|
1211
|
+
pi: z9.string().min(1).max(128).optional()
|
|
1195
1212
|
}).optional(),
|
|
1196
|
-
importedSkills:
|
|
1213
|
+
importedSkills: z9.array(z9.string().min(1).max(200)).max(WORKSPACE_UI_STATE_MAX_KEYS).optional(),
|
|
1197
1214
|
taskTable: taskTableUiStateSchema.extend({
|
|
1198
|
-
expandedColumns:
|
|
1215
|
+
expandedColumns: z9.record(z9.string().min(1).max(64), z9.boolean()).refine((map) => Object.keys(map).length <= TASK_TABLE_MAX_COLUMNS, {
|
|
1199
1216
|
message: `taskTable.expandedColumns must have at most ${TASK_TABLE_MAX_COLUMNS} entries`
|
|
1200
1217
|
}).optional()
|
|
1201
1218
|
}).optional()
|
|
@@ -1207,54 +1224,54 @@ var setWorkspaceUiStateInputSchema = z8.looseObject({
|
|
|
1207
1224
|
});
|
|
1208
1225
|
}
|
|
1209
1226
|
});
|
|
1210
|
-
var runnerModelsSchema =
|
|
1211
|
-
claude:
|
|
1212
|
-
codex:
|
|
1213
|
-
opencode:
|
|
1214
|
-
pi:
|
|
1227
|
+
var runnerModelsSchema = z9.object({
|
|
1228
|
+
claude: z9.string().optional(),
|
|
1229
|
+
codex: z9.string().optional(),
|
|
1230
|
+
opencode: z9.string().optional(),
|
|
1231
|
+
pi: z9.string().optional()
|
|
1215
1232
|
});
|
|
1216
|
-
var configResponseSchema =
|
|
1217
|
-
baseBranch:
|
|
1233
|
+
var configResponseSchema = z9.object({
|
|
1234
|
+
baseBranch: z9.string().nullable(),
|
|
1218
1235
|
defaultRunner: runnerSchema,
|
|
1219
|
-
systemPrompt:
|
|
1236
|
+
systemPrompt: z9.string().nullable(),
|
|
1220
1237
|
defaultModels: runnerModelsSchema,
|
|
1221
1238
|
/** True when native coding-agent settings are authoritative and model picks are read-only. */
|
|
1222
|
-
modelsLocked:
|
|
1239
|
+
modelsLocked: z9.boolean(),
|
|
1223
1240
|
/** How many tasks run at once (1–16). */
|
|
1224
|
-
maxParallel:
|
|
1241
|
+
maxParallel: z9.number(),
|
|
1225
1242
|
/** Per-task memory ceiling in MiB (whole process tree); null = no limit. */
|
|
1226
|
-
memoryLimitMb:
|
|
1243
|
+
memoryLimitMb: z9.number().nullable(),
|
|
1227
1244
|
/** Keep the last N finished worktrees on disk (#483); 0 = unlimited. Older ones are reclaimed
|
|
1228
1245
|
* (directory only — branch kept, so work is recoverable). */
|
|
1229
|
-
worktreeRetention:
|
|
1246
|
+
worktreeRetention: z9.number(),
|
|
1230
1247
|
/** Live title updates: null = no config key, the `CEZ_TITLE_UPDATES` env default (ON) decides. */
|
|
1231
|
-
liveTitleUpdates:
|
|
1248
|
+
liveTitleUpdates: z9.boolean().nullable(),
|
|
1232
1249
|
/** Optional review gate (#489): null = no config key, the `CEZ_REVIEW_GATE` env default (OFF)
|
|
1233
1250
|
* decides. */
|
|
1234
|
-
reviewGate:
|
|
1251
|
+
reviewGate: z9.boolean().nullable()
|
|
1235
1252
|
});
|
|
1236
1253
|
var setConfigResponseSchema = configResponseSchema;
|
|
1237
|
-
var setConfigInputSchema =
|
|
1238
|
-
baseBranch:
|
|
1254
|
+
var setConfigInputSchema = z9.object({
|
|
1255
|
+
baseBranch: z9.string().trim().min(1).max(200).nullable().optional(),
|
|
1239
1256
|
defaultRunner: runnerSchema.optional(),
|
|
1240
|
-
systemPrompt:
|
|
1241
|
-
defaultModels:
|
|
1242
|
-
claude:
|
|
1243
|
-
codex:
|
|
1244
|
-
opencode:
|
|
1245
|
-
pi:
|
|
1257
|
+
systemPrompt: z9.string().trim().max(2e4).nullable().optional(),
|
|
1258
|
+
defaultModels: z9.object({
|
|
1259
|
+
claude: z9.string().trim().max(200).nullable().optional(),
|
|
1260
|
+
codex: z9.string().trim().max(200).nullable().optional(),
|
|
1261
|
+
opencode: z9.string().trim().max(200).nullable().optional(),
|
|
1262
|
+
pi: z9.string().trim().max(200).nullable().optional()
|
|
1246
1263
|
}).optional(),
|
|
1247
|
-
maxParallel:
|
|
1264
|
+
maxParallel: z9.number().int().min(1).max(16).optional(),
|
|
1248
1265
|
/** null or 0 clears the ceiling back to "no limit". */
|
|
1249
|
-
memoryLimitMb:
|
|
1266
|
+
memoryLimitMb: z9.number().int().min(0).max(1048576).nullable().optional(),
|
|
1250
1267
|
/** Keep last N finished worktrees (#483); 0 = unlimited, null clears back to the default (10). */
|
|
1251
|
-
worktreeRetention:
|
|
1268
|
+
worktreeRetention: z9.number().int().min(0).max(1e3).nullable().optional(),
|
|
1252
1269
|
/** null clears the key back to the env-default behavior. */
|
|
1253
|
-
liveTitleUpdates:
|
|
1270
|
+
liveTitleUpdates: z9.boolean().nullable().optional(),
|
|
1254
1271
|
/** null clears the key back to the env-default behavior (OFF). */
|
|
1255
|
-
reviewGate:
|
|
1272
|
+
reviewGate: z9.boolean().nullable().optional()
|
|
1256
1273
|
});
|
|
1257
|
-
var skillsUpdateStatusSchema =
|
|
1274
|
+
var skillsUpdateStatusSchema = z9.enum([
|
|
1258
1275
|
"idle",
|
|
1259
1276
|
"checking",
|
|
1260
1277
|
"available",
|
|
@@ -1263,224 +1280,224 @@ var skillsUpdateStatusSchema = z8.enum([
|
|
|
1263
1280
|
"unavailable",
|
|
1264
1281
|
"error"
|
|
1265
1282
|
]);
|
|
1266
|
-
var skillsUpdateScopeStateSchema =
|
|
1267
|
-
scope:
|
|
1283
|
+
var skillsUpdateScopeStateSchema = z9.object({
|
|
1284
|
+
scope: z9.enum(["project", "global"]),
|
|
1268
1285
|
status: skillsUpdateStatusSchema,
|
|
1269
|
-
available:
|
|
1270
|
-
skills:
|
|
1271
|
-
checkedAt:
|
|
1272
|
-
updatedAt:
|
|
1273
|
-
reason:
|
|
1286
|
+
available: z9.boolean(),
|
|
1287
|
+
skills: z9.array(z9.string()),
|
|
1288
|
+
checkedAt: z9.string().nullable(),
|
|
1289
|
+
updatedAt: z9.string().nullable(),
|
|
1290
|
+
reason: z9.string().optional()
|
|
1274
1291
|
});
|
|
1275
|
-
var skillsUpdateStateSchema =
|
|
1292
|
+
var skillsUpdateStateSchema = z9.object({
|
|
1276
1293
|
status: skillsUpdateStatusSchema,
|
|
1277
|
-
available:
|
|
1278
|
-
autoUpdateEnabled:
|
|
1279
|
-
inherited:
|
|
1280
|
-
checkedAt:
|
|
1281
|
-
updatedAt:
|
|
1282
|
-
scopes:
|
|
1283
|
-
needsUpgradeNotes:
|
|
1294
|
+
available: z9.boolean(),
|
|
1295
|
+
autoUpdateEnabled: z9.boolean(),
|
|
1296
|
+
inherited: z9.boolean(),
|
|
1297
|
+
checkedAt: z9.string().nullable(),
|
|
1298
|
+
updatedAt: z9.string().nullable(),
|
|
1299
|
+
scopes: z9.array(skillsUpdateScopeStateSchema),
|
|
1300
|
+
needsUpgradeNotes: z9.boolean()
|
|
1284
1301
|
});
|
|
1285
1302
|
var providerIdSchema = runnerSchema;
|
|
1286
|
-
var providerConnectionStateSchema =
|
|
1303
|
+
var providerConnectionStateSchema = z9.enum([
|
|
1287
1304
|
"connected",
|
|
1288
1305
|
"disconnected",
|
|
1289
1306
|
"not-installed",
|
|
1290
1307
|
"unknown"
|
|
1291
1308
|
]);
|
|
1292
|
-
var providerStatusSchema =
|
|
1309
|
+
var providerStatusSchema = z9.object({
|
|
1293
1310
|
provider: providerIdSchema,
|
|
1294
1311
|
status: providerConnectionStateSchema,
|
|
1295
|
-
enabled:
|
|
1296
|
-
hint:
|
|
1297
|
-
authFailureId:
|
|
1312
|
+
enabled: z9.boolean().optional(),
|
|
1313
|
+
hint: z9.string().optional(),
|
|
1314
|
+
authFailureId: z9.string().optional(),
|
|
1298
1315
|
/** Which agent account this row describes (spec 2026-07-29-agent-profiles). ABSENT on
|
|
1299
1316
|
* `GET /api/v1/providers/status`, which deliberately keeps answering exactly one row per
|
|
1300
1317
|
* provider — the discovered default — so an older client sees no change at all. Per-account
|
|
1301
1318
|
* rows are carried by `GET /api/v1/workspace/agent-profiles` instead. */
|
|
1302
|
-
profileId:
|
|
1319
|
+
profileId: z9.string().optional()
|
|
1303
1320
|
});
|
|
1304
|
-
var providerStatusResponseSchema =
|
|
1305
|
-
providers:
|
|
1321
|
+
var providerStatusResponseSchema = z9.object({
|
|
1322
|
+
providers: z9.array(providerStatusSchema)
|
|
1306
1323
|
});
|
|
1307
|
-
var providerConnectResponseSchema =
|
|
1308
|
-
|
|
1309
|
-
|
|
1324
|
+
var providerConnectResponseSchema = z9.discriminatedUnion("opened", [
|
|
1325
|
+
z9.object({ opened: z9.literal(true), command: z9.string() }),
|
|
1326
|
+
z9.object({ opened: z9.literal(false), connected: z9.literal(true), command: z9.string() })
|
|
1310
1327
|
]);
|
|
1311
|
-
var modelDiscoveryRunnerSchema =
|
|
1328
|
+
var modelDiscoveryRunnerSchema = z9.enum(["codex", "opencode", "pi"]);
|
|
1312
1329
|
var MODEL_DISCOVERY_RUNNERS = modelDiscoveryRunnerSchema.options;
|
|
1313
1330
|
function runnerDiscoversModels(runner) {
|
|
1314
1331
|
return MODEL_DISCOVERY_RUNNERS.includes(runner);
|
|
1315
1332
|
}
|
|
1316
|
-
var runnerModelOptionSchema =
|
|
1317
|
-
id:
|
|
1318
|
-
label:
|
|
1319
|
-
description:
|
|
1333
|
+
var runnerModelOptionSchema = z9.object({
|
|
1334
|
+
id: z9.string(),
|
|
1335
|
+
label: z9.string(),
|
|
1336
|
+
description: z9.string()
|
|
1320
1337
|
});
|
|
1321
|
-
var runnerModelCatalogResponseSchema =
|
|
1338
|
+
var runnerModelCatalogResponseSchema = z9.object({
|
|
1322
1339
|
runner: runnerSchema,
|
|
1323
|
-
models:
|
|
1324
|
-
source:
|
|
1325
|
-
stale:
|
|
1326
|
-
reason:
|
|
1340
|
+
models: z9.array(runnerModelOptionSchema),
|
|
1341
|
+
source: z9.enum(["live", "cache", "unavailable"]),
|
|
1342
|
+
stale: z9.boolean(),
|
|
1343
|
+
reason: z9.string().optional()
|
|
1327
1344
|
});
|
|
1328
|
-
var openTargetSchema =
|
|
1329
|
-
id:
|
|
1330
|
-
label:
|
|
1345
|
+
var openTargetSchema = z9.object({
|
|
1346
|
+
id: z9.string(),
|
|
1347
|
+
label: z9.string(),
|
|
1331
1348
|
/** A stable icon key (#361) the UI maps to a concrete icon. Optional: an older server omitting
|
|
1332
1349
|
* it just renders the generic fallback icon. */
|
|
1333
|
-
icon:
|
|
1350
|
+
icon: z9.string().optional()
|
|
1334
1351
|
});
|
|
1335
|
-
var openTargetsResponseSchema =
|
|
1336
|
-
targets:
|
|
1352
|
+
var openTargetsResponseSchema = z9.object({
|
|
1353
|
+
targets: z9.array(openTargetSchema)
|
|
1337
1354
|
});
|
|
1338
|
-
var openProjectInSchema =
|
|
1355
|
+
var openProjectInSchema = z9.object({
|
|
1339
1356
|
// A short bound (#429): matched against a downstream allowlist, so an app id is never long.
|
|
1340
|
-
target:
|
|
1357
|
+
target: z9.string().trim().min(1, "target required").max(200)
|
|
1341
1358
|
});
|
|
1342
|
-
var openProjectInResponseSchema =
|
|
1343
|
-
opened:
|
|
1344
|
-
path:
|
|
1359
|
+
var openProjectInResponseSchema = z9.object({
|
|
1360
|
+
opened: z9.literal(true),
|
|
1361
|
+
path: z9.string()
|
|
1345
1362
|
});
|
|
1346
1363
|
|
|
1347
1364
|
// ../contract/src/skills.ts
|
|
1348
|
-
import { z as
|
|
1349
|
-
var skillSchema =
|
|
1350
|
-
name:
|
|
1351
|
-
description:
|
|
1365
|
+
import { z as z10 } from "zod";
|
|
1366
|
+
var skillSchema = z10.object({
|
|
1367
|
+
name: z10.string(),
|
|
1368
|
+
description: z10.string().optional(),
|
|
1352
1369
|
/** Advisory hint for untouched composer run-mode choices. */
|
|
1353
|
-
interactive:
|
|
1354
|
-
body:
|
|
1355
|
-
path:
|
|
1356
|
-
source:
|
|
1370
|
+
interactive: z10.literal(true).optional(),
|
|
1371
|
+
body: z10.string(),
|
|
1372
|
+
path: z10.string(),
|
|
1373
|
+
source: z10.enum(["ai", "cezar", "agents", "global", "team"]),
|
|
1357
1374
|
/** Team skills only: where the definition lives in its skills repo. */
|
|
1358
|
-
team:
|
|
1359
|
-
repo:
|
|
1360
|
-
ref:
|
|
1361
|
-
path:
|
|
1375
|
+
team: z10.object({
|
|
1376
|
+
repo: z10.string(),
|
|
1377
|
+
ref: z10.string(),
|
|
1378
|
+
path: z10.string(),
|
|
1362
1379
|
/** True for the `SKILL.md` convention — a whole directory (references/…). */
|
|
1363
|
-
dir:
|
|
1380
|
+
dir: z10.boolean(),
|
|
1364
1381
|
/**
|
|
1365
1382
|
* The exact commit `ref` resolved to when the skill was read (#428).
|
|
1366
1383
|
*
|
|
1367
1384
|
* The hand-written DTO omitted this field entirely — it was NARROWER than the route,
|
|
1368
1385
|
* which has served it since #428.
|
|
1369
1386
|
*/
|
|
1370
|
-
commit:
|
|
1387
|
+
commit: z10.string().optional()
|
|
1371
1388
|
}).optional()
|
|
1372
1389
|
});
|
|
1373
|
-
var importableSkillSchema =
|
|
1374
|
-
name:
|
|
1375
|
-
description:
|
|
1390
|
+
var importableSkillSchema = z10.object({
|
|
1391
|
+
name: z10.string(),
|
|
1392
|
+
description: z10.string().optional()
|
|
1376
1393
|
});
|
|
1377
|
-
var todoItemSchema =
|
|
1378
|
-
id:
|
|
1379
|
-
ts:
|
|
1380
|
-
taskId:
|
|
1381
|
-
summary:
|
|
1382
|
-
action:
|
|
1383
|
-
prUrl:
|
|
1384
|
-
suggestedSkill:
|
|
1385
|
-
suggestedArgs:
|
|
1386
|
-
suggestedPrompt:
|
|
1394
|
+
var todoItemSchema = z10.object({
|
|
1395
|
+
id: z10.string(),
|
|
1396
|
+
ts: z10.string().optional(),
|
|
1397
|
+
taskId: z10.string().optional(),
|
|
1398
|
+
summary: z10.string().min(1),
|
|
1399
|
+
action: z10.string().optional(),
|
|
1400
|
+
prUrl: z10.string().optional(),
|
|
1401
|
+
suggestedSkill: z10.string().optional(),
|
|
1402
|
+
suggestedArgs: z10.string().optional(),
|
|
1403
|
+
suggestedPrompt: z10.string().optional(),
|
|
1387
1404
|
/** Explicit intent; missing infers from suggestedSkill/suggestedPrompt for old files. */
|
|
1388
|
-
runnable:
|
|
1405
|
+
runnable: z10.boolean().optional(),
|
|
1389
1406
|
/** Set once a task was started from this entry — it then leaves the inbox and stays as
|
|
1390
1407
|
* the audit trail. A later launch never overwrites the first. */
|
|
1391
|
-
startedTaskId:
|
|
1408
|
+
startedTaskId: z10.string().optional()
|
|
1392
1409
|
});
|
|
1393
|
-
var removeTodoResponseSchema =
|
|
1394
|
-
removed:
|
|
1410
|
+
var removeTodoResponseSchema = z10.object({
|
|
1411
|
+
removed: z10.literal(true)
|
|
1395
1412
|
});
|
|
1396
|
-
var startTodoResponseSchema =
|
|
1413
|
+
var startTodoResponseSchema = z10.object({
|
|
1397
1414
|
run: runRecordSchema
|
|
1398
1415
|
});
|
|
1399
1416
|
|
|
1400
1417
|
// ../contract/src/agent-config.ts
|
|
1401
|
-
import { z as
|
|
1402
|
-
var agentConfigFormatSchema =
|
|
1403
|
-
var agentConfigScopeSchema =
|
|
1404
|
-
var agentConfigKindSchema =
|
|
1405
|
-
var agentConfigTrackedSchema =
|
|
1406
|
-
var agentConfigFileSchema =
|
|
1418
|
+
import { z as z11 } from "zod";
|
|
1419
|
+
var agentConfigFormatSchema = z11.enum(["json", "jsonc", "toml", "markdown"]);
|
|
1420
|
+
var agentConfigScopeSchema = z11.enum(["user", "project", "local"]);
|
|
1421
|
+
var agentConfigKindSchema = z11.enum(["settings", "memory", "mcp"]);
|
|
1422
|
+
var agentConfigTrackedSchema = z11.enum(["tracked", "gitignored", "outside-repo"]);
|
|
1423
|
+
var agentConfigFileSchema = z11.object({
|
|
1407
1424
|
/** Stable, opaque, URL-safe — the ONLY thing a client may name (traversal-proof). */
|
|
1408
|
-
id:
|
|
1425
|
+
id: z11.string(),
|
|
1409
1426
|
/** Every runner that reads this file: `<repo>/AGENTS.md` is one file, two readers. */
|
|
1410
|
-
runners:
|
|
1427
|
+
runners: z11.array(runnerSchema),
|
|
1411
1428
|
kind: agentConfigKindSchema,
|
|
1412
1429
|
scope: agentConfigScopeSchema,
|
|
1413
|
-
label:
|
|
1414
|
-
path:
|
|
1430
|
+
label: z11.string(),
|
|
1431
|
+
path: z11.string(),
|
|
1415
1432
|
format: agentConfigFormatSchema,
|
|
1416
1433
|
tracked: agentConfigTrackedSchema,
|
|
1417
|
-
seeded:
|
|
1418
|
-
holdsMcp:
|
|
1434
|
+
seeded: z11.boolean(),
|
|
1435
|
+
holdsMcp: z11.boolean(),
|
|
1419
1436
|
/** VERBATIM from the vendor docs. Never computed, never generic. */
|
|
1420
|
-
precedence:
|
|
1437
|
+
precedence: z11.string(),
|
|
1421
1438
|
/** Documented mid-run reload behaviour, or absent when the vendor is silent. */
|
|
1422
|
-
hotReload:
|
|
1423
|
-
docsUrl:
|
|
1424
|
-
exists:
|
|
1425
|
-
size:
|
|
1439
|
+
hotReload: z11.string().optional(),
|
|
1440
|
+
docsUrl: z11.string(),
|
|
1441
|
+
exists: z11.boolean(),
|
|
1442
|
+
size: z11.number(),
|
|
1426
1443
|
/** sha256 of the bytes, or null when absent. */
|
|
1427
|
-
version:
|
|
1444
|
+
version: z11.string().nullable(),
|
|
1428
1445
|
/** False in hosted mode (whole feature) — the client renders read-only up front. */
|
|
1429
|
-
writable:
|
|
1430
|
-
readOnlyReason:
|
|
1446
|
+
writable: z11.boolean(),
|
|
1447
|
+
readOnlyReason: z11.string().optional()
|
|
1431
1448
|
});
|
|
1432
|
-
var userMcpListingSchema =
|
|
1433
|
-
path:
|
|
1434
|
-
servers:
|
|
1435
|
-
readable:
|
|
1449
|
+
var userMcpListingSchema = z11.object({
|
|
1450
|
+
path: z11.string(),
|
|
1451
|
+
servers: z11.array(z11.string()),
|
|
1452
|
+
readable: z11.boolean()
|
|
1436
1453
|
});
|
|
1437
|
-
var agentConfigListingSchema =
|
|
1438
|
-
editable:
|
|
1439
|
-
files:
|
|
1454
|
+
var agentConfigListingSchema = z11.object({
|
|
1455
|
+
editable: z11.boolean(),
|
|
1456
|
+
files: z11.array(agentConfigFileSchema),
|
|
1440
1457
|
/** null in hosted mode (host-state disclosure guard). */
|
|
1441
1458
|
userMcp: userMcpListingSchema.nullable()
|
|
1442
1459
|
});
|
|
1443
|
-
var agentConfigFileContentSchema =
|
|
1444
|
-
id:
|
|
1445
|
-
path:
|
|
1446
|
-
exists:
|
|
1447
|
-
content:
|
|
1460
|
+
var agentConfigFileContentSchema = z11.object({
|
|
1461
|
+
id: z11.string(),
|
|
1462
|
+
path: z11.string(),
|
|
1463
|
+
exists: z11.boolean(),
|
|
1464
|
+
content: z11.string(),
|
|
1448
1465
|
/** sha256 of the bytes, or null when the file does not exist yet. */
|
|
1449
|
-
version:
|
|
1466
|
+
version: z11.string().nullable()
|
|
1450
1467
|
});
|
|
1451
|
-
var setAgentConfigInputSchema =
|
|
1452
|
-
content:
|
|
1453
|
-
version:
|
|
1468
|
+
var setAgentConfigInputSchema = z11.object({
|
|
1469
|
+
content: z11.string().max(2e6),
|
|
1470
|
+
version: z11.string().nullable()
|
|
1454
1471
|
});
|
|
1455
1472
|
|
|
1456
1473
|
// ../contract/src/agent-profiles.ts
|
|
1457
|
-
import { z as
|
|
1474
|
+
import { z as z12 } from "zod";
|
|
1458
1475
|
var DEFAULT_AGENT_ACCOUNT_ID = "default";
|
|
1459
|
-
var agentAccountFileSchema =
|
|
1460
|
-
id:
|
|
1476
|
+
var agentAccountFileSchema = z12.object({
|
|
1477
|
+
id: z12.string(),
|
|
1461
1478
|
/** e.g. `settings.json` — the file's own name, since the folder is shown once on the account. */
|
|
1462
|
-
label:
|
|
1479
|
+
label: z12.string(),
|
|
1463
1480
|
/** Absolute, resolved inside this account's config folder. */
|
|
1464
|
-
path:
|
|
1465
|
-
exists:
|
|
1481
|
+
path: z12.string(),
|
|
1482
|
+
exists: z12.boolean()
|
|
1466
1483
|
});
|
|
1467
|
-
var agentProfileSchema =
|
|
1484
|
+
var agentProfileSchema = z12.object({
|
|
1468
1485
|
/** `default` for the discovered profile, else the stored slug. */
|
|
1469
|
-
id:
|
|
1486
|
+
id: z12.string(),
|
|
1470
1487
|
provider: providerIdSchema,
|
|
1471
|
-
label:
|
|
1488
|
+
label: z12.string(),
|
|
1472
1489
|
/** As the user wrote it — a literal `~` is preserved, matching `browseRoot`/`projectsDir`. */
|
|
1473
|
-
configDir:
|
|
1490
|
+
configDir: z12.string(),
|
|
1474
1491
|
/** Expanded absolute path. Same-origin route, like `ProjectListEntry.root`. */
|
|
1475
|
-
path:
|
|
1492
|
+
path: z12.string(),
|
|
1476
1493
|
/** False for a dir the CLI has not created yet — legitimate, and NOT a reason to fall back
|
|
1477
1494
|
* to another account at run time (that would silently bill the wrong subscription). */
|
|
1478
|
-
exists:
|
|
1495
|
+
exists: z12.boolean(),
|
|
1479
1496
|
/** Whether the dir carries this agent's own marker files. ADVISORY: an unrecognised dir is
|
|
1480
1497
|
* still accepted, because "add profile → Connect → the CLI creates it" is the real flow. */
|
|
1481
|
-
looksValid:
|
|
1498
|
+
looksValid: z12.boolean(),
|
|
1482
1499
|
/** True for the profile cezar discovers from the environment. Never stored, never deletable. */
|
|
1483
|
-
isDefault:
|
|
1500
|
+
isDefault: z12.boolean(),
|
|
1484
1501
|
/** This account's own authentication state — two Claude logins answer independently.
|
|
1485
1502
|
*
|
|
1486
1503
|
* **Absent until the probe has warmed.** Every probe shells out to an agent CLI, and this
|
|
@@ -1491,35 +1508,35 @@ var agentProfileSchema = z11.object({
|
|
|
1491
1508
|
status: providerStatusSchema.optional(),
|
|
1492
1509
|
/** This agent's own user-scope config files, resolved inside THIS account's folder — so a
|
|
1493
1510
|
* second login's `settings.json` is the one you open, not the default account's. */
|
|
1494
|
-
files:
|
|
1511
|
+
files: z12.array(agentAccountFileSchema)
|
|
1495
1512
|
});
|
|
1496
1513
|
function agentAccountRouteId(profile) {
|
|
1497
1514
|
return profile.isDefault ? `default:${profile.provider}` : profile.id;
|
|
1498
1515
|
}
|
|
1499
|
-
var agentAccountSelectionSchema =
|
|
1500
|
-
claude:
|
|
1501
|
-
codex:
|
|
1502
|
-
opencode:
|
|
1503
|
-
pi:
|
|
1504
|
-
});
|
|
1505
|
-
var agentProfilesResponseSchema =
|
|
1506
|
-
editable:
|
|
1507
|
-
profiles:
|
|
1516
|
+
var agentAccountSelectionSchema = z12.object({
|
|
1517
|
+
claude: z12.string().optional(),
|
|
1518
|
+
codex: z12.string().optional(),
|
|
1519
|
+
opencode: z12.string().optional(),
|
|
1520
|
+
pi: z12.string().optional()
|
|
1521
|
+
});
|
|
1522
|
+
var agentProfilesResponseSchema = z12.object({
|
|
1523
|
+
editable: z12.boolean(),
|
|
1524
|
+
profiles: z12.array(agentProfileSchema),
|
|
1508
1525
|
/** Providers that can carry more than one account at all — what "Add account" is offered for.
|
|
1509
1526
|
* OpenCode is absent: its credentials live in a SQLite DB behind a separate `OPENCODE_DB`, so
|
|
1510
1527
|
* a config-dir profile would swap settings while still billing the other account. */
|
|
1511
|
-
profileCapableProviders:
|
|
1528
|
+
profileCapableProviders: z12.array(providerIdSchema),
|
|
1512
1529
|
/** Which account each project uses, keyed by the project's realpath'd ROOT.
|
|
1513
1530
|
*
|
|
1514
1531
|
* Served here rather than on `GET /api/v1/projects` because it is stored beside the accounts it
|
|
1515
1532
|
* names (`~/.cezar/agent-accounts.json`) — one file, so deleting an account and scrubbing every
|
|
1516
1533
|
* reference to it is one atomic write, and neither can be dropped by a cezar version that never
|
|
1517
1534
|
* heard of accounts. Empty in hosted mode, where the whole family is withheld. */
|
|
1518
|
-
selections:
|
|
1535
|
+
selections: z12.record(z12.string(), agentAccountSelectionSchema),
|
|
1519
1536
|
/** The machine-wide fallback account per provider, used by any repo that has chosen none. */
|
|
1520
1537
|
defaults: agentAccountSelectionSchema
|
|
1521
1538
|
});
|
|
1522
|
-
var selectAgentProfileInputSchema =
|
|
1539
|
+
var selectAgentProfileInputSchema = z12.object({
|
|
1523
1540
|
/**
|
|
1524
1541
|
* Registry slug, or the reserved `default` boot alias. Resolved to a root server-side.
|
|
1525
1542
|
*
|
|
@@ -1527,108 +1544,108 @@ var selectAgentProfileInputSchema = z11.object({
|
|
|
1527
1544
|
* chosen nothing uses, so a second login is set up once rather than per checkout. A repo's own
|
|
1528
1545
|
* choice always wins over it, which is what keeps this a default and not an override.
|
|
1529
1546
|
*/
|
|
1530
|
-
projectId:
|
|
1547
|
+
projectId: z12.string().min(1).max(64).nullable(),
|
|
1531
1548
|
provider: providerIdSchema,
|
|
1532
|
-
profileId:
|
|
1549
|
+
profileId: z12.string().max(64).nullable()
|
|
1533
1550
|
});
|
|
1534
|
-
var agentProfileSelectionsResponseSchema =
|
|
1535
|
-
selections:
|
|
1551
|
+
var agentProfileSelectionsResponseSchema = z12.object({
|
|
1552
|
+
selections: z12.record(z12.string(), agentAccountSelectionSchema),
|
|
1536
1553
|
/** The machine-wide fallback, for repos with no selection of their own. */
|
|
1537
1554
|
defaults: agentAccountSelectionSchema
|
|
1538
1555
|
});
|
|
1539
|
-
var agentAccountStatusResponseSchema =
|
|
1540
|
-
var agentAccountDetailsResponseSchema =
|
|
1541
|
-
available:
|
|
1542
|
-
reason:
|
|
1543
|
-
fields:
|
|
1556
|
+
var agentAccountStatusResponseSchema = z12.object({ status: providerStatusSchema });
|
|
1557
|
+
var agentAccountDetailsResponseSchema = z12.object({
|
|
1558
|
+
available: z12.boolean(),
|
|
1559
|
+
reason: z12.string().optional(),
|
|
1560
|
+
fields: z12.array(z12.object({ label: z12.string(), value: z12.string() }))
|
|
1544
1561
|
});
|
|
1545
|
-
var openAgentAccountFileInputSchema =
|
|
1546
|
-
file:
|
|
1547
|
-
target:
|
|
1562
|
+
var openAgentAccountFileInputSchema = z12.object({
|
|
1563
|
+
file: z12.string().min(1).max(200),
|
|
1564
|
+
target: z12.string().min(1).max(64).optional()
|
|
1548
1565
|
});
|
|
1549
|
-
var openAgentAccountFileResponseSchema =
|
|
1550
|
-
opened:
|
|
1551
|
-
path:
|
|
1566
|
+
var openAgentAccountFileResponseSchema = z12.object({
|
|
1567
|
+
opened: z12.literal(true),
|
|
1568
|
+
path: z12.string()
|
|
1552
1569
|
});
|
|
1553
|
-
var createAgentProfileInputSchema =
|
|
1570
|
+
var createAgentProfileInputSchema = z12.object({
|
|
1554
1571
|
provider: providerIdSchema,
|
|
1555
|
-
label:
|
|
1572
|
+
label: z12.string().trim().max(200).optional(),
|
|
1556
1573
|
/** Stored as written; validated absolute after `~` expansion, server-side. */
|
|
1557
|
-
configDir:
|
|
1574
|
+
configDir: z12.string().trim().min(1).max(4096)
|
|
1558
1575
|
});
|
|
1559
|
-
var agentProfileResponseSchema =
|
|
1560
|
-
var updateAgentProfileInputSchema =
|
|
1561
|
-
label:
|
|
1562
|
-
configDir:
|
|
1576
|
+
var agentProfileResponseSchema = z12.object({ profile: agentProfileSchema });
|
|
1577
|
+
var updateAgentProfileInputSchema = z12.object({
|
|
1578
|
+
label: z12.string().trim().max(200).optional(),
|
|
1579
|
+
configDir: z12.string().trim().min(1).max(4096).optional()
|
|
1563
1580
|
});
|
|
1564
|
-
var removeAgentProfileResponseSchema =
|
|
1565
|
-
removed:
|
|
1566
|
-
id:
|
|
1581
|
+
var removeAgentProfileResponseSchema = z12.object({
|
|
1582
|
+
removed: z12.literal(true),
|
|
1583
|
+
id: z12.string()
|
|
1567
1584
|
});
|
|
1568
1585
|
|
|
1569
1586
|
// ../contract/src/automations.ts
|
|
1570
|
-
import { z as
|
|
1571
|
-
var automationEventSchema =
|
|
1587
|
+
import { z as z13 } from "zod";
|
|
1588
|
+
var automationEventSchema = z13.enum([
|
|
1572
1589
|
"pull_request.opened",
|
|
1573
1590
|
"issue.opened",
|
|
1574
1591
|
"issue.labeled",
|
|
1575
1592
|
"issue.unlabeled"
|
|
1576
1593
|
]);
|
|
1577
|
-
var automationFiltersSchema =
|
|
1578
|
-
authors:
|
|
1579
|
-
assignees:
|
|
1580
|
-
allLabels:
|
|
1581
|
-
anyLabels:
|
|
1582
|
-
excludeLabels:
|
|
1594
|
+
var automationFiltersSchema = z13.object({
|
|
1595
|
+
authors: z13.array(z13.string()).optional(),
|
|
1596
|
+
assignees: z13.array(z13.string()).optional(),
|
|
1597
|
+
allLabels: z13.array(z13.string()).optional(),
|
|
1598
|
+
anyLabels: z13.array(z13.string()).optional(),
|
|
1599
|
+
excludeLabels: z13.array(z13.string()).optional(),
|
|
1583
1600
|
/** Required for the two label events — the server rejects a definition without it. */
|
|
1584
|
-
changedLabels:
|
|
1585
|
-
lookbackDays:
|
|
1586
|
-
maxRecords:
|
|
1601
|
+
changedLabels: z13.array(z13.string()).optional(),
|
|
1602
|
+
lookbackDays: z13.number(),
|
|
1603
|
+
maxRecords: z13.number()
|
|
1587
1604
|
});
|
|
1588
1605
|
var automationTaskSchema = createRunInputBaseSchema.omit({ task: true, images: true, todoId: true, systemPrompt: true }).extend({
|
|
1589
1606
|
/** The prompt template. `{{github.number}}`, `{{github.title}}`, `{{github.url}}` and
|
|
1590
1607
|
* `{{github.labels}}` are substituted per match; GitHub content is appended as untrusted
|
|
1591
1608
|
* context, never interpolated into instructions. */
|
|
1592
|
-
prompt:
|
|
1593
|
-
variants:
|
|
1594
|
-
systemPrompt:
|
|
1609
|
+
prompt: z13.string(),
|
|
1610
|
+
variants: z13.union([z13.literal(1), z13.literal(2), z13.literal(3)]).optional(),
|
|
1611
|
+
systemPrompt: z13.string().optional()
|
|
1595
1612
|
});
|
|
1596
|
-
var automationDefinitionSchema =
|
|
1597
|
-
id:
|
|
1613
|
+
var automationDefinitionSchema = z13.object({
|
|
1614
|
+
id: z13.string(),
|
|
1598
1615
|
/** Bumped on every edit; a PUT must echo the revision it read (optimistic concurrency). */
|
|
1599
|
-
revision:
|
|
1600
|
-
name:
|
|
1601
|
-
description:
|
|
1616
|
+
revision: z13.number(),
|
|
1617
|
+
name: z13.string(),
|
|
1618
|
+
description: z13.string().optional(),
|
|
1602
1619
|
/** Always present: the storage schema defaults it to `false`, so a definition is created
|
|
1603
1620
|
* PAUSED and enabling it is a separate, baseline-establishing act. */
|
|
1604
|
-
enabled:
|
|
1605
|
-
events:
|
|
1606
|
-
intervalSeconds:
|
|
1621
|
+
enabled: z13.boolean(),
|
|
1622
|
+
events: z13.array(automationEventSchema),
|
|
1623
|
+
intervalSeconds: z13.number(),
|
|
1607
1624
|
filters: automationFiltersSchema,
|
|
1608
1625
|
task: automationTaskSchema,
|
|
1609
|
-
createdAt:
|
|
1610
|
-
updatedAt:
|
|
1626
|
+
createdAt: z13.string(),
|
|
1627
|
+
updatedAt: z13.string()
|
|
1611
1628
|
});
|
|
1612
|
-
var automationCursorSchema =
|
|
1613
|
-
timestamp:
|
|
1614
|
-
tieBreaker:
|
|
1629
|
+
var automationCursorSchema = z13.object({
|
|
1630
|
+
timestamp: z13.string(),
|
|
1631
|
+
tieBreaker: z13.string().optional()
|
|
1615
1632
|
});
|
|
1616
|
-
var automationRuntimeStateSchema =
|
|
1633
|
+
var automationRuntimeStateSchema = z13.object({
|
|
1617
1634
|
/** The definition revision this state belongs to; a bumped revision re-baselines. */
|
|
1618
|
-
revision:
|
|
1635
|
+
revision: z13.number().optional(),
|
|
1619
1636
|
/** Enabling establishes a CURRENT-TIME baseline: records older than this never launch. */
|
|
1620
|
-
baselineAt:
|
|
1637
|
+
baselineAt: z13.string().optional(),
|
|
1621
1638
|
cursor: automationCursorSchema.optional(),
|
|
1622
|
-
frozenHighWatermark: automationCursorSchema.extend({ tieBreaker:
|
|
1623
|
-
backlogAfter: automationCursorSchema.extend({ tieBreaker:
|
|
1624
|
-
nextCheckAt:
|
|
1625
|
-
lastSuccessAt:
|
|
1639
|
+
frozenHighWatermark: automationCursorSchema.extend({ tieBreaker: z13.string() }).optional(),
|
|
1640
|
+
backlogAfter: automationCursorSchema.extend({ tieBreaker: z13.string() }).optional(),
|
|
1641
|
+
nextCheckAt: z13.string().optional(),
|
|
1642
|
+
lastSuccessAt: z13.string().optional(),
|
|
1626
1643
|
/** Per-query GitHub ETags, so an unchanged page costs no rate-limit budget. */
|
|
1627
|
-
etags:
|
|
1628
|
-
backoffUntil:
|
|
1629
|
-
consecutiveFailures:
|
|
1644
|
+
etags: z13.record(z13.string(), z13.string()).optional(),
|
|
1645
|
+
backoffUntil: z13.string().optional(),
|
|
1646
|
+
consecutiveFailures: z13.number().optional()
|
|
1630
1647
|
});
|
|
1631
|
-
var automationLogResultSchema =
|
|
1648
|
+
var automationLogResultSchema = z13.enum([
|
|
1632
1649
|
"launched",
|
|
1633
1650
|
"no-match",
|
|
1634
1651
|
"duplicate",
|
|
@@ -1637,81 +1654,82 @@ var automationLogResultSchema = z12.enum([
|
|
|
1637
1654
|
"baseline",
|
|
1638
1655
|
"preview"
|
|
1639
1656
|
]);
|
|
1640
|
-
var automationLogRecordSchema =
|
|
1641
|
-
seq:
|
|
1642
|
-
ts:
|
|
1643
|
-
automationId:
|
|
1644
|
-
revision:
|
|
1657
|
+
var automationLogRecordSchema = z13.object({
|
|
1658
|
+
seq: z13.number(),
|
|
1659
|
+
ts: z13.string(),
|
|
1660
|
+
automationId: z13.string(),
|
|
1661
|
+
revision: z13.number(),
|
|
1645
1662
|
event: automationEventSchema.optional(),
|
|
1646
1663
|
result: automationLogResultSchema,
|
|
1647
|
-
reason:
|
|
1648
|
-
durationMs:
|
|
1649
|
-
receiptId:
|
|
1650
|
-
runId:
|
|
1651
|
-
githubNumber:
|
|
1652
|
-
githubTitle:
|
|
1653
|
-
githubUrl:
|
|
1654
|
-
rateLimit:
|
|
1655
|
-
bucket:
|
|
1656
|
-
remaining:
|
|
1657
|
-
resetAt:
|
|
1664
|
+
reason: z13.string().optional(),
|
|
1665
|
+
durationMs: z13.number().optional(),
|
|
1666
|
+
receiptId: z13.string().optional(),
|
|
1667
|
+
runId: z13.string().optional(),
|
|
1668
|
+
githubNumber: z13.number().optional(),
|
|
1669
|
+
githubTitle: z13.string().optional(),
|
|
1670
|
+
githubUrl: z13.string().optional(),
|
|
1671
|
+
rateLimit: z13.object({
|
|
1672
|
+
bucket: z13.enum(["core", "search"]),
|
|
1673
|
+
remaining: z13.number().optional(),
|
|
1674
|
+
resetAt: z13.string().optional()
|
|
1658
1675
|
}).optional()
|
|
1659
1676
|
});
|
|
1660
|
-
var automationCountsSchema =
|
|
1661
|
-
matches:
|
|
1662
|
-
launched:
|
|
1663
|
-
duplicates:
|
|
1664
|
-
errors:
|
|
1677
|
+
var automationCountsSchema = z13.object({
|
|
1678
|
+
matches: z13.number(),
|
|
1679
|
+
launched: z13.number(),
|
|
1680
|
+
duplicates: z13.number(),
|
|
1681
|
+
errors: z13.number()
|
|
1665
1682
|
});
|
|
1666
1683
|
var automationListEntrySchema = automationDefinitionSchema.extend({
|
|
1667
1684
|
state: automationRuntimeStateSchema.optional(),
|
|
1668
1685
|
latestLog: automationLogRecordSchema.optional(),
|
|
1669
1686
|
counts: automationCountsSchema
|
|
1670
1687
|
});
|
|
1671
|
-
var automationsResponseSchema =
|
|
1672
|
-
available:
|
|
1673
|
-
reason:
|
|
1674
|
-
scheduler:
|
|
1675
|
-
state:
|
|
1676
|
-
nextDue:
|
|
1688
|
+
var automationsResponseSchema = z13.object({
|
|
1689
|
+
available: z13.boolean(),
|
|
1690
|
+
reason: z13.string().optional(),
|
|
1691
|
+
scheduler: z13.object({
|
|
1692
|
+
state: z13.enum(["scheduled", "idle"]),
|
|
1693
|
+
nextDue: z13.string().optional()
|
|
1677
1694
|
}),
|
|
1678
|
-
automations:
|
|
1695
|
+
automations: z13.array(automationListEntrySchema)
|
|
1679
1696
|
});
|
|
1680
|
-
var automationResponseSchema =
|
|
1681
|
-
var automationDetailResponseSchema =
|
|
1697
|
+
var automationResponseSchema = z13.object({ automation: automationDefinitionSchema });
|
|
1698
|
+
var automationDetailResponseSchema = z13.object({
|
|
1682
1699
|
automation: automationDefinitionSchema,
|
|
1683
1700
|
state: automationRuntimeStateSchema.optional(),
|
|
1684
1701
|
latestLog: automationLogRecordSchema.optional()
|
|
1685
1702
|
});
|
|
1686
|
-
var automationCheckSchema =
|
|
1687
|
-
id:
|
|
1688
|
-
automationId:
|
|
1689
|
-
mode:
|
|
1690
|
-
status:
|
|
1691
|
-
createdAt:
|
|
1692
|
-
completedAt:
|
|
1693
|
-
matches:
|
|
1694
|
-
truncated:
|
|
1695
|
-
error:
|
|
1696
|
-
});
|
|
1697
|
-
var automationCheckQueuedResponseSchema =
|
|
1698
|
-
var automationLogResponseSchema =
|
|
1699
|
-
records:
|
|
1700
|
-
});
|
|
1701
|
-
var automationRetryResponseSchema =
|
|
1702
|
-
receiptId:
|
|
1703
|
-
runId:
|
|
1704
|
-
});
|
|
1705
|
-
var createAutomationInputSchema = automationDefinitionSchema.omit({ id: true, revision: true, createdAt: true, updatedAt: true, enabled: true }).extend({ enable:
|
|
1703
|
+
var automationCheckSchema = z13.object({
|
|
1704
|
+
id: z13.string(),
|
|
1705
|
+
automationId: z13.string(),
|
|
1706
|
+
mode: z13.enum(["preview", "execute"]),
|
|
1707
|
+
status: z13.enum(["queued", "running", "complete", "error"]),
|
|
1708
|
+
createdAt: z13.string(),
|
|
1709
|
+
completedAt: z13.string().optional(),
|
|
1710
|
+
matches: z13.number().optional(),
|
|
1711
|
+
truncated: z13.boolean().optional(),
|
|
1712
|
+
error: z13.string().optional()
|
|
1713
|
+
});
|
|
1714
|
+
var automationCheckQueuedResponseSchema = z13.object({ checkId: z13.string() });
|
|
1715
|
+
var automationLogResponseSchema = z13.object({
|
|
1716
|
+
records: z13.array(automationLogRecordSchema)
|
|
1717
|
+
});
|
|
1718
|
+
var automationRetryResponseSchema = z13.object({
|
|
1719
|
+
receiptId: z13.string(),
|
|
1720
|
+
runId: z13.string()
|
|
1721
|
+
});
|
|
1722
|
+
var createAutomationInputSchema = automationDefinitionSchema.omit({ id: true, revision: true, createdAt: true, updatedAt: true, enabled: true }).extend({ enable: z13.boolean().optional() });
|
|
1706
1723
|
var updateAutomationInputSchema = createAutomationInputSchema.omit({ enable: true }).extend({
|
|
1707
|
-
enabled:
|
|
1708
|
-
expectedRevision:
|
|
1724
|
+
enabled: z13.boolean().optional(),
|
|
1725
|
+
expectedRevision: z13.number()
|
|
1709
1726
|
});
|
|
1710
|
-
var automationCheckInputSchema =
|
|
1711
|
-
mode:
|
|
1727
|
+
var automationCheckInputSchema = z13.object({
|
|
1728
|
+
mode: z13.enum(["preview", "execute"])
|
|
1712
1729
|
});
|
|
1713
1730
|
export {
|
|
1714
1731
|
DEFAULT_AGENT_ACCOUNT_ID,
|
|
1732
|
+
EFFORT_LEVELS,
|
|
1715
1733
|
MODEL_DISCOVERY_RUNNERS,
|
|
1716
1734
|
PROJECT_TAGS_MAX,
|
|
1717
1735
|
PROJECT_TAG_MAX_LENGTH,
|
|
@@ -1773,6 +1791,8 @@ export {
|
|
|
1773
1791
|
deleteWorkflowResponseSchema,
|
|
1774
1792
|
diffStatSchema,
|
|
1775
1793
|
editQueuedMessageResponseSchema,
|
|
1794
|
+
effortFieldSchema,
|
|
1795
|
+
effortLevelSchema,
|
|
1776
1796
|
finishResponseSchema,
|
|
1777
1797
|
forgeInfoSchema,
|
|
1778
1798
|
fsBrowseDirSchema,
|
|
@@ -1812,6 +1832,7 @@ export {
|
|
|
1812
1832
|
openProjectInSchema,
|
|
1813
1833
|
openTargetSchema,
|
|
1814
1834
|
openTargetsResponseSchema,
|
|
1835
|
+
parseEffort,
|
|
1815
1836
|
parsedWorkflowSchema,
|
|
1816
1837
|
patchRunInputSchema,
|
|
1817
1838
|
pickVariantResponseSchema,
|