@wjarka/cezarion 0.14.6 → 0.14.7-pr488.741
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -2
- package/dist/agent-config/model-settings/shared.d.ts +2 -1
- package/dist/agent-config/model-settings/shared.js +1 -1
- package/dist/agent-config/model-settings/shared.js.map +1 -1
- package/dist/ci-wait/client.d.ts +4 -0
- package/dist/ci-wait/client.js +67 -0
- package/dist/ci-wait/client.js.map +1 -0
- package/dist/ci-wait/controller.d.ts +78 -0
- package/dist/ci-wait/controller.js +148 -0
- package/dist/ci-wait/controller.js.map +1 -0
- package/dist/ci-wait/github.d.ts +61 -0
- package/dist/ci-wait/github.js +209 -0
- package/dist/ci-wait/github.js.map +1 -0
- package/dist/ci-wait/injection.d.ts +3 -0
- package/dist/ci-wait/injection.js +26 -0
- package/dist/ci-wait/injection.js.map +1 -0
- package/dist/ci-wait/mcp.d.ts +97 -0
- package/dist/ci-wait/mcp.js +35 -0
- package/dist/ci-wait/mcp.js.map +1 -0
- package/dist/ci-wait/resources.d.ts +7 -0
- package/dist/ci-wait/resources.js +32 -0
- package/dist/ci-wait/resources.js.map +1 -0
- package/dist/ci-wait/supervisor.d.ts +21 -0
- package/dist/ci-wait/supervisor.js +163 -0
- package/dist/ci-wait/supervisor.js.map +1 -0
- package/dist/contract/ci-wait.d.ts +151 -0
- package/dist/contract/conversations.d.ts +105 -0
- package/dist/contract/delegation.d.ts +17 -0
- package/dist/contract/events.d.ts +10 -0
- package/dist/contract/index.d.ts +1 -0
- package/dist/contract/index.js +1046 -936
- package/dist/contract/runs.d.ts +496 -0
- package/dist/contract/skills.d.ts +99 -0
- package/dist/core/agent-env.js +2 -0
- package/dist/core/agent-env.js.map +1 -1
- package/dist/core/agent-runner.d.ts +6 -0
- package/dist/core/agent-runner.js +1 -0
- package/dist/core/agent-runner.js.map +1 -1
- package/dist/core/claude-cli-runner.js +10 -0
- package/dist/core/claude-cli-runner.js.map +1 -1
- package/dist/core/codex-app-server-runner.js +5 -1
- package/dist/core/codex-app-server-runner.js.map +1 -1
- package/dist/core/codex-app-server-transport.js +3 -1
- package/dist/core/codex-app-server-transport.js.map +1 -1
- package/dist/core/cursor-acp-runner.js +9 -1
- package/dist/core/cursor-acp-runner.js.map +1 -1
- package/dist/core/opencode-server-runner.js +6 -2
- package/dist/core/opencode-server-runner.js.map +1 -1
- package/dist/core/pi-runner.js +7 -1
- package/dist/core/pi-runner.js.map +1 -1
- package/dist/delegation/cli.js +110 -10
- package/dist/delegation/cli.js.map +1 -1
- package/dist/delegation/conversations.js +2 -1
- package/dist/delegation/conversations.js.map +1 -1
- package/dist/delegation/input.d.ts +7 -0
- package/dist/delegation/input.js +27 -0
- package/dist/delegation/input.js.map +1 -1
- package/dist/delegation/provision.js +4 -1
- package/dist/delegation/provision.js.map +1 -1
- package/dist/delegation/routes.d.ts +78 -0
- package/dist/delegation/routes.js +4 -1
- package/dist/delegation/routes.js.map +1 -1
- package/dist/delegation/service.d.ts +6 -2
- package/dist/delegation/service.js +113 -9
- package/dist/delegation/service.js.map +1 -1
- package/dist/delegation/transport.d.ts +78 -0
- package/dist/runs/delegation-state.d.ts +2 -0
- package/dist/runs/run-index.js +2 -3
- package/dist/runs/run-index.js.map +1 -1
- package/dist/runs/store.d.ts +534 -3
- package/dist/runs/store.js +186 -6
- package/dist/runs/store.js.map +1 -1
- package/dist/server/server.d.ts +1530 -12
- package/dist/workflows/run.d.ts +39 -1
- package/dist/workflows/run.js +606 -50
- package/dist/workflows/run.js.map +1 -1
- package/package.json +4 -3
- package/scripts/mock-ci-tool.mjs +53 -0
- package/scripts/mock-claude.mjs +8 -0
- package/scripts/mock-codex-app-server.mjs +212 -0
- package/scripts/mock-cursor-acp.mjs +6 -2
- package/scripts/mock-opencode-serve.mjs +392 -0
- package/scripts/mock-pi-rpc.mjs +7 -0
- package/scripts/pi-ci-wait.mjs +14 -0
- package/web/dist/assets/{agent-accounts-lP_xK83o.js → agent-accounts-DveiLHoy.js} +1 -1
- package/web/dist/assets/{alert-dialog-CmDuefYh.js → alert-dialog-BRmsCA3M.js} +1 -1
- package/web/dist/assets/{collapsible-BqX8REmY.js → collapsible-BWfM2PdZ.js} +1 -1
- package/web/dist/assets/{commit-list-BWvv1H7A.js → commit-list-C-rCgcKm.js} +1 -1
- package/web/dist/assets/{compare-variants-Bg7eLW3z.js → compare-variants-Ccp9IYp-.js} +1 -1
- package/web/dist/assets/{diff-0GBum40Q2.js → diff-BvZErqfg2.js} +2 -2
- package/web/dist/assets/{diff-controls-HwWHHait.js → diff-controls-BFI8ngtw.js} +1 -1
- package/web/dist/assets/{diff-stat-mNkhAc5m.js → diff-stat-CVFxf2Ar.js} +1 -1
- package/web/dist/assets/{diff-view-DW64doDY.js → diff-view-B35r8kQK.js} +1 -1
- package/web/dist/assets/{dropdown-menu-sZjYPcLh.js → dropdown-menu-C_fj6kzP.js} +1 -1
- package/web/dist/assets/{git-toolbar-DBW5EIcY.js → git-toolbar-BaqAvRC1.js} +1 -1
- package/web/dist/assets/{github-CkZ4hWI5.js → github-DIkBazPA.js} +1 -1
- package/web/dist/assets/{image-preview-DZicGNkU.js → image-preview-BBqbaKaq.js} +1 -1
- package/web/dist/assets/{index-DWWI-B9n.js → index-BIae70yp.js} +3 -3
- package/web/dist/assets/index-CXZukB1O.css +1 -0
- package/web/dist/assets/{markdown-AY2K3kIV.js → markdown-kouQNPB6.js} +1 -1
- package/web/dist/assets/{pill-CcJqA1cL.js → pill-mHX_rKXP.js} +1 -1
- package/web/dist/assets/{project-router-SwsXRKXs.js → project-router-Ds9EvxjN.js} +1 -1
- package/web/dist/assets/{prompt-templates-iV2WD2jy.js → prompt-templates-AaKKdIiY.js} +1 -1
- package/web/dist/assets/{repo-git-BW3TOs3U.js → repo-git-6StCwqhj.js} +1 -1
- package/web/dist/assets/{run-diff-DPUNj56q.js → run-diff-fChfUdwr.js} +1 -1
- package/web/dist/assets/run-header-B3ZPhDZr.js +1 -0
- package/web/dist/assets/{run-header-CSaJIGXl.css → run-header-BJQfFL2l.css} +1 -1
- package/web/dist/assets/{skills-Dv8Vwv5D.js → skills-DSWaVvcu.js} +1 -1
- package/web/dist/assets/{tab-link-DSftvkZS.js → tab-link-Db6yDTIQ.js} +1 -1
- package/web/dist/assets/{task-changes-CTCuVls1.js → task-changes-DdmerESW.js} +1 -1
- package/web/dist/assets/{task-commits-weJQ5GSl.js → task-commits-Co-bb1P6.js} +1 -1
- package/web/dist/assets/{task-files-B4bUimY8.js → task-files-B2KASfyL.js} +1 -1
- package/web/dist/assets/{task-thread-BuXrVB9K.js → task-thread-8kGLJO4Q.js} +4 -4
- package/web/dist/assets/task-thread-Dc3wplva.css +1 -0
- package/web/dist/assets/{textarea-CxRdTWlq.js → textarea-Qhdzn_oU.js} +1 -1
- package/web/dist/assets/thread-loading-C6ENzZYk.js +1 -0
- package/web/dist/assets/{token-metrics-Z3UFYbuD.js → token-metrics-BsT6Rqji.js} +1 -1
- package/web/dist/assets/utils-VFstALJW.js +64 -0
- package/web/dist/assets/{workflows-vA27Yi8W.js → workflows-UKoofNFJ.js} +1 -1
- package/web/dist/assets/{zoomable-image-DUE1KFJ0.js → zoomable-image-DpL5gtv4.js} +1 -1
- package/web/dist/index.html +14 -14
- package/web/dist/assets/index-DK0Mkv2m.css +0 -1
- package/web/dist/assets/run-header-DbDluWoV.js +0 -1
- package/web/dist/assets/task-thread-DMRD0IVt.css +0 -1
- package/web/dist/assets/thread-loading-JlP6dUpX.js +0 -1
- package/web/dist/assets/utils-CUnaAifW.js +0 -64
package/dist/contract/index.js
CHANGED
|
@@ -15,7 +15,10 @@ var conversationMessageSchema = conversationAttributionSchema.extend({
|
|
|
15
15
|
createdAt: z.iso.datetime(),
|
|
16
16
|
deadline: z.iso.datetime().optional(),
|
|
17
17
|
requestHash: z.string().regex(/^[0-9a-f]{64}$/),
|
|
18
|
-
state: z.enum(["accepted", "continuation-required", "destroyed", "late"])
|
|
18
|
+
state: z.enum(["accepted", "continuation-required", "destroyed", "late"]),
|
|
19
|
+
/** A parent-authorized new execution; retained on exact message retries. */
|
|
20
|
+
resumed: z.literal(true).optional(),
|
|
21
|
+
instruction: z.string().max(2048).optional()
|
|
19
22
|
});
|
|
20
23
|
var requestOutcomeSchema = z.object({
|
|
21
24
|
requestId: z.uuid(),
|
|
@@ -24,14 +27,30 @@ var requestOutcomeSchema = z.object({
|
|
|
24
27
|
replyId: z.uuid().optional()
|
|
25
28
|
}).strict();
|
|
26
29
|
var conversationStateSchema = z.object({ messages: z.array(conversationMessageSchema).max(1024), outcomes: z.array(requestOutcomeSchema).max(1024) }).strict();
|
|
30
|
+
var conversationInspectResultSchema = conversationStateSchema.extend({ hint: z.string().optional() });
|
|
31
|
+
var inboxReserveResultSchema = z.object({
|
|
32
|
+
messages: z.array(conversationMessageSchema).max(32),
|
|
33
|
+
outcomes: z.array(requestOutcomeSchema).max(32),
|
|
34
|
+
receiptId: z.uuid().optional(),
|
|
35
|
+
expiresAt: z.iso.datetime().optional()
|
|
36
|
+
}).strict().refine(
|
|
37
|
+
(value) => value.messages.length > 0 ? value.receiptId !== void 0 && value.expiresAt !== void 0 : value.receiptId === void 0 && value.expiresAt === void 0,
|
|
38
|
+
{ message: "A nonempty inbox batch requires a receipt and expiry" }
|
|
39
|
+
);
|
|
40
|
+
var inboxReceiptRequestSchema = z.object({ receiptId: z.uuid() }).strict();
|
|
41
|
+
var inboxReceiptResultSchema = z.object({
|
|
42
|
+
receiptId: z.uuid(),
|
|
43
|
+
status: z.enum(["acknowledged", "already-acknowledged", "released"])
|
|
44
|
+
}).strict();
|
|
27
45
|
var conversationSendRequestSchema = z.object({
|
|
28
46
|
id: z.uuid(),
|
|
29
47
|
recipientRunId: z.uuid(),
|
|
30
48
|
kind: conversationAttributionSchema.shape.kind,
|
|
31
49
|
requestId: z.uuid().optional(),
|
|
32
50
|
text: z.string().min(1).max(1e5).refine((text) => text.trim().length > 0),
|
|
33
|
-
timeoutSeconds: z.number().int().min(1).max(1800).default(600)
|
|
34
|
-
|
|
51
|
+
timeoutSeconds: z.number().int().min(1).max(1800).default(600),
|
|
52
|
+
resume: z.boolean().optional()
|
|
53
|
+
}).strict().refine((value) => (value.kind === "reply" || value.kind === "follow-up") === (value.requestId !== void 0), { message: "Replies and follow-ups require a request ID; new messages must omit it" }).refine((value) => !value.resume || value.kind === "request" || value.kind === "progress", { message: "--resume requires a new request or progress instruction" });
|
|
35
54
|
var conversationSendResultSchema = z.object({ message: conversationMessageSchema, delivery: z.enum(["queued", "delivered", "not-delivered"]), outcome: requestOutcomeSchema.optional() }).strict();
|
|
36
55
|
var conversationInspectRequestSchema = z.object({ recipientRunId: z.uuid() }).strict();
|
|
37
56
|
var conversationCancelRequestSchema = z.object({ requestId: z.uuid() }).strict();
|
|
@@ -240,6 +259,14 @@ var workerWaitRequestSchema = z3.object({
|
|
|
240
259
|
timeoutSeconds: z3.number().int().min(1).max(1800).default(600),
|
|
241
260
|
mode: workerWaitModeSchema.optional()
|
|
242
261
|
}).strict().refine((request) => request.mode !== "one" || request.workerIds.length === 1, { message: "one mode requires exactly one worker" });
|
|
262
|
+
var inboxClaimSchema = z3.object({
|
|
263
|
+
receiptId: z3.uuid(),
|
|
264
|
+
generation: z3.uuid(),
|
|
265
|
+
expiresAt: z3.iso.datetime(),
|
|
266
|
+
acknowledgedAt: z3.iso.datetime().optional(),
|
|
267
|
+
/** Optional on read for receipts persisted before member manifests existed. */
|
|
268
|
+
memberIds: z3.array(z3.uuid()).min(1).max(32).refine((ids) => new Set(ids).size === ids.length).optional()
|
|
269
|
+
}).strict();
|
|
243
270
|
var agentInputSchema = z3.object({
|
|
244
271
|
conversation: conversationAttributionSchema.optional(),
|
|
245
272
|
id: z3.uuid(),
|
|
@@ -247,7 +274,8 @@ var agentInputSchema = z3.object({
|
|
|
247
274
|
parentRunId: z3.uuid(),
|
|
248
275
|
text: z3.string().min(1).max(1e5),
|
|
249
276
|
createdAt: z3.iso.datetime(),
|
|
250
|
-
deliveredAt: z3.iso.datetime().optional()
|
|
277
|
+
deliveredAt: z3.iso.datetime().optional(),
|
|
278
|
+
inboxClaim: inboxClaimSchema.optional()
|
|
251
279
|
}).strict();
|
|
252
280
|
var workerInspectionSchema = z3.object({
|
|
253
281
|
workerId: z3.uuid(),
|
|
@@ -316,7 +344,7 @@ var runEventSchema = z4.looseObject({
|
|
|
316
344
|
stepId: z4.string().optional(),
|
|
317
345
|
type: z4.string()
|
|
318
346
|
});
|
|
319
|
-
var conversationMessageEventSchema = runEventSchema.extend({ type: z4.literal("conversation-message"), message: conversationMessageSchema, delivery: z4.enum(["queued", "delivered", "not-delivered"]) });
|
|
347
|
+
var conversationMessageEventSchema = runEventSchema.extend({ type: z4.literal("conversation-message"), message: conversationMessageSchema, delivery: z4.enum(["queued", "delivered", "not-delivered"]), deliveredAt: z4.iso.datetime().optional() });
|
|
320
348
|
var requestOutcomeEventSchema = runEventSchema.extend({ type: z4.literal("request-outcome"), outcome: requestOutcomeSchema });
|
|
321
349
|
var agentInputEventSchema = runEventSchema.extend({
|
|
322
350
|
type: z4.literal("agent-input"),
|
|
@@ -478,84 +506,144 @@ var healthResponseSchema = z6.object({
|
|
|
478
506
|
bootProject: z6.string()
|
|
479
507
|
});
|
|
480
508
|
|
|
509
|
+
// ../contract/src/ci-wait.ts
|
|
510
|
+
import { z as z7 } from "zod";
|
|
511
|
+
var CI_WAIT_LIMITATION = "Passing reported checks does not prove that every expected workflow has appeared or that the PR is merge-ready. This observation is not merge approval.";
|
|
512
|
+
var CI_WAIT_RECEIPT_INSTRUCTION = "End your turn to wait for CI; no marker is needed. " + CI_WAIT_LIMITATION;
|
|
513
|
+
var prPattern = /^https:\/\/([a-zA-Z0-9](?:[a-zA-Z0-9.-]*[a-zA-Z0-9])?)\/([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_.-]+)\/pull\/([1-9][0-9]*)$/;
|
|
514
|
+
var ciPrUrlSchema = z7.string().max(2048).regex(prPattern).refine((value) => {
|
|
515
|
+
const match = prPattern.exec(value);
|
|
516
|
+
return !!match && Number.isSafeInteger(Number(match[4])) && match[3] !== "." && match[3] !== "..";
|
|
517
|
+
}, "Expected an HTTPS GitHub PR URL with a positive integer PR number");
|
|
518
|
+
var ciWaitRequestSchema = z7.object({
|
|
519
|
+
pr: ciPrUrlSchema,
|
|
520
|
+
timeout_seconds: z7.number().int().min(1).max(7200).default(1800)
|
|
521
|
+
}).strict();
|
|
522
|
+
var sha = z7.string().regex(/^[0-9a-f]{40}$/i);
|
|
523
|
+
var ciPrIdentitySchema = z7.object({
|
|
524
|
+
prUrl: ciPrUrlSchema,
|
|
525
|
+
repository: z7.string().max(2048).regex(/^[a-zA-Z0-9_-]+\/[a-zA-Z0-9_.-]+$/),
|
|
526
|
+
prNumber: z7.number().int().positive().max(Number.MAX_SAFE_INTEGER),
|
|
527
|
+
headSha: sha
|
|
528
|
+
}).strict();
|
|
529
|
+
var ciWaitOutcomeSchema = z7.enum(["passed", "failed", "cancelled", "skipped", "no_checks", "head_changed", "deadline", "error"]);
|
|
530
|
+
var ciWaitErrorCodeSchema = z7.enum(["invalid_request", "unsupported_host", "gh_missing", "authentication", "inaccessible_pr", "malformed_data", "output_limit", "query_timeout", "command_failed", "wait_conflict", "capacity", "unavailable", "unauthorized", "persistence"]);
|
|
531
|
+
var ciWaitErrorSchema = z7.object({ code: ciWaitErrorCodeSchema, message: z7.string().max(4096) }).strict();
|
|
532
|
+
function utf8Bytes(value) {
|
|
533
|
+
let bytes = 0;
|
|
534
|
+
for (const char of value) {
|
|
535
|
+
const point = char.codePointAt(0);
|
|
536
|
+
bytes += point <= 127 ? 1 : point <= 2047 ? 2 : point <= 65535 ? 3 : 4;
|
|
537
|
+
}
|
|
538
|
+
return bytes;
|
|
539
|
+
}
|
|
540
|
+
var ciWaitResultSchema = z7.object({
|
|
541
|
+
outcome: ciWaitOutcomeSchema,
|
|
542
|
+
headSha: sha,
|
|
543
|
+
observedHeadSha: sha.optional(),
|
|
544
|
+
observedAt: z7.iso.datetime(),
|
|
545
|
+
checks: z7.array(z7.object({ name: z7.string().max(256), state: z7.string().max(256), link: z7.string().max(2048) }).strict()).max(100),
|
|
546
|
+
totalChecks: z7.number().int().nonnegative(),
|
|
547
|
+
truncated: z7.boolean(),
|
|
548
|
+
diagnostic: z7.string().max(4096).refine((value) => utf8Bytes(value) <= 4096).optional()
|
|
549
|
+
}).strict().refine((value) => utf8Bytes(JSON.stringify(value)) <= 32 * 1024, "CI result exceeds 32 KiB");
|
|
550
|
+
var ciWaitSchema = ciPrIdentitySchema.extend({
|
|
551
|
+
id: z7.uuid(),
|
|
552
|
+
generation: z7.string().min(1).max(256),
|
|
553
|
+
turnId: z7.string().min(1).max(256),
|
|
554
|
+
timeoutSeconds: z7.number().int().min(1).max(7200),
|
|
555
|
+
registeredAt: z7.iso.datetime(),
|
|
556
|
+
deadline: z7.iso.datetime(),
|
|
557
|
+
phase: z7.enum(["registered", "parked", "wake-pending", "delivered", "withdrawn"]),
|
|
558
|
+
result: ciWaitResultSchema.optional(),
|
|
559
|
+
wakeId: z7.string().min(1).max(256).optional(),
|
|
560
|
+
deliveredAt: z7.iso.datetime().optional()
|
|
561
|
+
}).strict();
|
|
562
|
+
var ciWaitReceiptSchema = ciPrIdentitySchema.extend({
|
|
563
|
+
waitId: z7.uuid(),
|
|
564
|
+
registeredAt: z7.iso.datetime(),
|
|
565
|
+
deadline: z7.iso.datetime(),
|
|
566
|
+
phase: ciWaitSchema.shape.phase
|
|
567
|
+
}).strict();
|
|
568
|
+
|
|
481
569
|
// ../contract/src/runs.ts
|
|
482
|
-
import { z as
|
|
570
|
+
import { z as z10 } from "zod";
|
|
483
571
|
|
|
484
572
|
// ../contract/src/github.ts
|
|
485
|
-
import { z as
|
|
486
|
-
var checksGlyphSchema =
|
|
487
|
-
var githubItemSchema =
|
|
488
|
-
kind:
|
|
489
|
-
number:
|
|
490
|
-
title:
|
|
491
|
-
author:
|
|
492
|
-
createdAt:
|
|
493
|
-
labels:
|
|
494
|
-
body:
|
|
495
|
-
url:
|
|
496
|
-
comments:
|
|
573
|
+
import { z as z8 } from "zod";
|
|
574
|
+
var checksGlyphSchema = z8.enum(["passing", "failing", "pending"]).nullable();
|
|
575
|
+
var githubItemSchema = z8.object({
|
|
576
|
+
kind: z8.enum(["issue", "pr"]),
|
|
577
|
+
number: z8.number(),
|
|
578
|
+
title: z8.string(),
|
|
579
|
+
author: z8.string(),
|
|
580
|
+
createdAt: z8.string(),
|
|
581
|
+
labels: z8.array(z8.string()),
|
|
582
|
+
body: z8.string(),
|
|
583
|
+
url: z8.string(),
|
|
584
|
+
comments: z8.number(),
|
|
497
585
|
/** Issues only; absent on older servers. */
|
|
498
|
-
assignees:
|
|
499
|
-
projectIds:
|
|
586
|
+
assignees: z8.array(z8.string()).optional(),
|
|
587
|
+
projectIds: z8.array(z8.string()).optional(),
|
|
500
588
|
/** PRs only. */
|
|
501
|
-
isDraft:
|
|
502
|
-
additions:
|
|
503
|
-
deletions:
|
|
589
|
+
isDraft: z8.boolean().optional(),
|
|
590
|
+
additions: z8.number().optional(),
|
|
591
|
+
deletions: z8.number().optional(),
|
|
504
592
|
checks: checksGlyphSchema.optional()
|
|
505
593
|
});
|
|
506
|
-
var githubProjectSchema =
|
|
507
|
-
id:
|
|
508
|
-
title:
|
|
509
|
-
url:
|
|
594
|
+
var githubProjectSchema = z8.object({
|
|
595
|
+
id: z8.string(),
|
|
596
|
+
title: z8.string(),
|
|
597
|
+
url: z8.string()
|
|
510
598
|
});
|
|
511
|
-
var githubDataSchema =
|
|
512
|
-
available:
|
|
599
|
+
var githubDataSchema = z8.object({
|
|
600
|
+
available: z8.boolean(),
|
|
513
601
|
/** Why it is unavailable (`gh` missing, no remote, offline…). Never an error — a hint. */
|
|
514
|
-
reason:
|
|
602
|
+
reason: z8.string().optional(),
|
|
515
603
|
/** owner/name, when known. */
|
|
516
|
-
repo:
|
|
517
|
-
syncedAt:
|
|
518
|
-
issues:
|
|
519
|
-
prs:
|
|
604
|
+
repo: z8.string().optional(),
|
|
605
|
+
syncedAt: z8.string().optional(),
|
|
606
|
+
issues: z8.array(githubItemSchema),
|
|
607
|
+
prs: z8.array(githubItemSchema),
|
|
520
608
|
/** Repo-wide label name → 6-hex color (no `#`); lets chips tint like GitHub. Additive. */
|
|
521
|
-
labelColors:
|
|
522
|
-
viewerLogin:
|
|
609
|
+
labelColors: z8.record(z8.string(), z8.string()).optional(),
|
|
610
|
+
viewerLogin: z8.string().optional(),
|
|
523
611
|
/** Repository-linked Projects v2. Absent when lookup is unavailable; [] means none. */
|
|
524
|
-
projects:
|
|
525
|
-
projectsReason:
|
|
612
|
+
projects: z8.array(githubProjectSchema).optional(),
|
|
613
|
+
projectsReason: z8.string().optional()
|
|
526
614
|
});
|
|
527
|
-
var githubChecksDataSchema =
|
|
528
|
-
|
|
529
|
-
available:
|
|
530
|
-
checks:
|
|
615
|
+
var githubChecksDataSchema = z8.discriminatedUnion("available", [
|
|
616
|
+
z8.object({
|
|
617
|
+
available: z8.literal(true),
|
|
618
|
+
checks: z8.record(z8.number(), checksGlyphSchema)
|
|
531
619
|
}),
|
|
532
|
-
|
|
533
|
-
available:
|
|
534
|
-
reason:
|
|
620
|
+
z8.object({
|
|
621
|
+
available: z8.literal(false),
|
|
622
|
+
reason: z8.string()
|
|
535
623
|
})
|
|
536
624
|
]);
|
|
537
625
|
var GITHUB_SEARCH_MAX = 50;
|
|
538
|
-
var githubSearchQuerySchema =
|
|
539
|
-
kind:
|
|
540
|
-
q:
|
|
541
|
-
limit:
|
|
626
|
+
var githubSearchQuerySchema = z8.object({
|
|
627
|
+
kind: z8.enum(["issue", "pr"]),
|
|
628
|
+
q: z8.string().trim().min(1).max(256),
|
|
629
|
+
limit: z8.coerce.number().int().positive().max(GITHUB_SEARCH_MAX).optional()
|
|
542
630
|
});
|
|
543
|
-
var githubSearchDataSchema =
|
|
544
|
-
available:
|
|
631
|
+
var githubSearchDataSchema = z8.object({
|
|
632
|
+
available: z8.boolean(),
|
|
545
633
|
/** Membership is unknown when lookup fails; never substitute empty projectIds. */
|
|
546
|
-
projectsReason:
|
|
634
|
+
projectsReason: z8.string().optional(),
|
|
547
635
|
/** Why it could not search (`gh` missing, no remote, rate-limited…). A hint, never an error. */
|
|
548
|
-
reason:
|
|
636
|
+
reason: z8.string().optional(),
|
|
549
637
|
/** The same rows the list ships. `checks` is always `null` here — hydrated lazily through
|
|
550
638
|
* `/github/checks`, exactly as list rows have been since #664. */
|
|
551
|
-
items:
|
|
639
|
+
items: z8.array(githubItemSchema),
|
|
552
640
|
/** The hit list filled the server's cap; there may be more matches on the forge. */
|
|
553
|
-
truncated:
|
|
641
|
+
truncated: z8.boolean().optional(),
|
|
554
642
|
/** Label name → 6-hex color for the labels these hits carry. A closed item often wears labels
|
|
555
643
|
* no open one does, which the repo-wide map from the list call would not cover. Additive. */
|
|
556
|
-
labelColors:
|
|
644
|
+
labelColors: z8.record(z8.string(), z8.string()).optional()
|
|
557
645
|
});
|
|
558
|
-
var referenceStatusSchema =
|
|
646
|
+
var referenceStatusSchema = z8.enum([
|
|
559
647
|
"draft",
|
|
560
648
|
"review-required",
|
|
561
649
|
"changes-requested",
|
|
@@ -568,13 +656,13 @@ var referenceStatusSchema = z7.enum([
|
|
|
568
656
|
"completed",
|
|
569
657
|
"not-planned"
|
|
570
658
|
]);
|
|
571
|
-
var recheckAfterMsSchema =
|
|
659
|
+
var recheckAfterMsSchema = z8.number().nullable();
|
|
572
660
|
var REFERENCE_STATUS_MAX = 100;
|
|
573
|
-
var githubRefStatusDataSchema =
|
|
574
|
-
|
|
575
|
-
available:
|
|
576
|
-
prs:
|
|
577
|
-
issues:
|
|
661
|
+
var githubRefStatusDataSchema = z8.discriminatedUnion("available", [
|
|
662
|
+
z8.object({
|
|
663
|
+
available: z8.literal(true),
|
|
664
|
+
prs: z8.record(z8.number(), referenceStatusSchema),
|
|
665
|
+
issues: z8.record(z8.number(), referenceStatusSchema),
|
|
578
666
|
/**
|
|
579
667
|
* The pull request numbers that do NOT merge cleanly into their base right now.
|
|
580
668
|
*
|
|
@@ -594,28 +682,28 @@ var githubRefStatusDataSchema = z7.discriminatedUnion("available", [
|
|
|
594
682
|
* ever named — GitHub reports `UNKNOWN` for merged and closed ones, and `UNKNOWN` (which is
|
|
595
683
|
* also what it answers while it is still computing) is never listed.
|
|
596
684
|
*/
|
|
597
|
-
conflicts:
|
|
685
|
+
conflicts: z8.array(z8.number()).optional(),
|
|
598
686
|
recheckAfterMs: recheckAfterMsSchema
|
|
599
687
|
}),
|
|
600
|
-
|
|
601
|
-
available:
|
|
602
|
-
reason:
|
|
688
|
+
z8.object({
|
|
689
|
+
available: z8.literal(false),
|
|
690
|
+
reason: z8.string(),
|
|
603
691
|
recheckAfterMs: recheckAfterMsSchema
|
|
604
692
|
})
|
|
605
693
|
]);
|
|
606
|
-
var githubCommentSchema =
|
|
607
|
-
id:
|
|
694
|
+
var githubCommentSchema = z8.object({
|
|
695
|
+
id: z8.number(),
|
|
608
696
|
/** Author login, `'?'` fallback when gh omits the user. */
|
|
609
|
-
author:
|
|
610
|
-
avatarUrl:
|
|
611
|
-
createdAt:
|
|
612
|
-
body:
|
|
613
|
-
kind:
|
|
697
|
+
author: z8.string(),
|
|
698
|
+
avatarUrl: z8.string().optional(),
|
|
699
|
+
createdAt: z8.string(),
|
|
700
|
+
body: z8.string(),
|
|
701
|
+
kind: z8.enum(["comment", "review"]),
|
|
614
702
|
/** Reviews only — drives the state chip. */
|
|
615
|
-
reviewState:
|
|
616
|
-
url:
|
|
703
|
+
reviewState: z8.enum(["approved", "changes_requested", "commented", "dismissed"]).optional(),
|
|
704
|
+
url: z8.string()
|
|
617
705
|
});
|
|
618
|
-
var githubTimelineEventKindSchema =
|
|
706
|
+
var githubTimelineEventKindSchema = z8.enum([
|
|
619
707
|
"committed",
|
|
620
708
|
"labeled",
|
|
621
709
|
"unlabeled",
|
|
@@ -628,134 +716,134 @@ var githubTimelineEventKindSchema = z7.enum([
|
|
|
628
716
|
"cross-referenced",
|
|
629
717
|
"renamed"
|
|
630
718
|
]);
|
|
631
|
-
var githubTimelineEventSchema =
|
|
632
|
-
id:
|
|
719
|
+
var githubTimelineEventSchema = z8.object({
|
|
720
|
+
id: z8.string(),
|
|
633
721
|
kind: githubTimelineEventKindSchema,
|
|
634
722
|
/** Login — or the git author name for `committed`, which carries no GitHub actor. */
|
|
635
|
-
actor:
|
|
723
|
+
actor: z8.string(),
|
|
636
724
|
/** Absent for `committed`. */
|
|
637
|
-
avatarUrl:
|
|
638
|
-
createdAt:
|
|
639
|
-
url:
|
|
725
|
+
avatarUrl: z8.string().optional(),
|
|
726
|
+
createdAt: z8.string(),
|
|
727
|
+
url: z8.string().optional(),
|
|
640
728
|
/** `committed` — full 40-char SHA. */
|
|
641
|
-
sha:
|
|
729
|
+
sha: z8.string().optional(),
|
|
642
730
|
/** `committed` — first line, capped at 120 chars. */
|
|
643
|
-
message:
|
|
731
|
+
message: z8.string().optional(),
|
|
644
732
|
/** `committed` — **absent** (lookup failed/skipped) and **`null`** (no CI configured) both
|
|
645
733
|
* render no glyph, but stay distinct values. */
|
|
646
734
|
checks: checksGlyphSchema.optional(),
|
|
647
|
-
label:
|
|
735
|
+
label: z8.object({ name: z8.string(), color: z8.string().optional() }).optional(),
|
|
648
736
|
/** `assigned`/`unassigned` login, or the new title for `renamed`. */
|
|
649
|
-
subject:
|
|
650
|
-
refNumber:
|
|
651
|
-
refTitle:
|
|
652
|
-
refIsPr:
|
|
653
|
-
});
|
|
654
|
-
var githubCommentsDataSchema =
|
|
655
|
-
available:
|
|
656
|
-
reason:
|
|
737
|
+
subject: z8.string().optional(),
|
|
738
|
+
refNumber: z8.number().optional(),
|
|
739
|
+
refTitle: z8.string().optional(),
|
|
740
|
+
refIsPr: z8.boolean().optional()
|
|
741
|
+
});
|
|
742
|
+
var githubCommentsDataSchema = z8.object({
|
|
743
|
+
available: z8.boolean(),
|
|
744
|
+
reason: z8.string().optional(),
|
|
657
745
|
/** Chronological, oldest first. */
|
|
658
|
-
comments:
|
|
746
|
+
comments: z8.array(githubCommentSchema),
|
|
659
747
|
/** True when either stream hit its cap, or the timeline fetch stopped short. */
|
|
660
|
-
truncated:
|
|
748
|
+
truncated: z8.boolean().optional(),
|
|
661
749
|
/** Timeline events (#525) — additive; absent when the server degraded to the legacy
|
|
662
750
|
* comments-only fetch. Capped independently of `comments`. */
|
|
663
|
-
events:
|
|
664
|
-
});
|
|
665
|
-
var githubMergeMethodSchema =
|
|
666
|
-
var githubPrCheckSchema =
|
|
667
|
-
name:
|
|
668
|
-
state:
|
|
669
|
-
required:
|
|
670
|
-
url:
|
|
671
|
-
});
|
|
672
|
-
var githubPrMergeStateSchema =
|
|
673
|
-
number:
|
|
674
|
-
title:
|
|
675
|
-
url:
|
|
676
|
-
state:
|
|
677
|
-
isDraft:
|
|
678
|
-
headRef:
|
|
679
|
-
baseRef:
|
|
680
|
-
headSha:
|
|
681
|
-
mergeable:
|
|
682
|
-
reviewDecision:
|
|
683
|
-
checks:
|
|
684
|
-
methods:
|
|
751
|
+
events: z8.array(githubTimelineEventSchema).optional()
|
|
752
|
+
});
|
|
753
|
+
var githubMergeMethodSchema = z8.enum(["merge", "squash", "rebase"]);
|
|
754
|
+
var githubPrCheckSchema = z8.object({
|
|
755
|
+
name: z8.string(),
|
|
756
|
+
state: z8.enum(["passing", "failing", "pending", "unknown"]),
|
|
757
|
+
required: z8.boolean().nullable(),
|
|
758
|
+
url: z8.string().optional()
|
|
759
|
+
});
|
|
760
|
+
var githubPrMergeStateSchema = z8.object({
|
|
761
|
+
number: z8.number(),
|
|
762
|
+
title: z8.string(),
|
|
763
|
+
url: z8.string(),
|
|
764
|
+
state: z8.enum(["open", "closed", "merged"]),
|
|
765
|
+
isDraft: z8.boolean(),
|
|
766
|
+
headRef: z8.string(),
|
|
767
|
+
baseRef: z8.string(),
|
|
768
|
+
headSha: z8.string(),
|
|
769
|
+
mergeable: z8.enum(["mergeable", "conflicting", "unknown"]),
|
|
770
|
+
reviewDecision: z8.enum(["approved", "changes-requested", "review-required", "unknown"]),
|
|
771
|
+
checks: z8.array(githubPrCheckSchema),
|
|
772
|
+
methods: z8.array(githubMergeMethodSchema),
|
|
685
773
|
defaultMethod: githubMergeMethodSchema.nullable(),
|
|
686
|
-
eligibility:
|
|
687
|
-
blockers:
|
|
688
|
-
canMerge:
|
|
689
|
-
canOverride:
|
|
690
|
-
});
|
|
691
|
-
var githubPrMergeStateResponseSchema =
|
|
692
|
-
|
|
693
|
-
|
|
774
|
+
eligibility: z8.enum(["ready", "blocked", "pending", "unauthorized", "terminal", "unknown"]),
|
|
775
|
+
blockers: z8.array(z8.object({ code: z8.string(), message: z8.string() })),
|
|
776
|
+
canMerge: z8.boolean(),
|
|
777
|
+
canOverride: z8.boolean()
|
|
778
|
+
});
|
|
779
|
+
var githubPrMergeStateResponseSchema = z8.discriminatedUnion("available", [
|
|
780
|
+
z8.object({ available: z8.literal(true), mergeState: githubPrMergeStateSchema }),
|
|
781
|
+
z8.object({ available: z8.literal(false), reason: z8.string() })
|
|
694
782
|
]);
|
|
695
|
-
var githubMergeResponseSchema =
|
|
696
|
-
merged:
|
|
697
|
-
number:
|
|
698
|
-
url:
|
|
783
|
+
var githubMergeResponseSchema = z8.object({
|
|
784
|
+
merged: z8.literal(true),
|
|
785
|
+
number: z8.number(),
|
|
786
|
+
url: z8.string(),
|
|
699
787
|
method: githubMergeMethodSchema,
|
|
700
|
-
mergeCommitSha:
|
|
701
|
-
});
|
|
702
|
-
var githubPrChangeSchema =
|
|
703
|
-
path:
|
|
704
|
-
previousPath:
|
|
705
|
-
status:
|
|
706
|
-
additions:
|
|
707
|
-
deletions:
|
|
708
|
-
patch:
|
|
709
|
-
patchUnavailableReason:
|
|
710
|
-
truncated:
|
|
711
|
-
});
|
|
712
|
-
var githubPrChangesDataSchema =
|
|
713
|
-
|
|
714
|
-
available:
|
|
715
|
-
number:
|
|
716
|
-
headSha:
|
|
717
|
-
files:
|
|
718
|
-
additions:
|
|
719
|
-
deletions:
|
|
720
|
-
truncated:
|
|
788
|
+
mergeCommitSha: z8.string().optional()
|
|
789
|
+
});
|
|
790
|
+
var githubPrChangeSchema = z8.object({
|
|
791
|
+
path: z8.string(),
|
|
792
|
+
previousPath: z8.string().optional(),
|
|
793
|
+
status: z8.enum(["added", "modified", "removed", "renamed", "copied", "changed"]),
|
|
794
|
+
additions: z8.number(),
|
|
795
|
+
deletions: z8.number(),
|
|
796
|
+
patch: z8.string().optional(),
|
|
797
|
+
patchUnavailableReason: z8.enum(["binary", "too-large", "not-provided"]).optional(),
|
|
798
|
+
truncated: z8.boolean().optional()
|
|
799
|
+
});
|
|
800
|
+
var githubPrChangesDataSchema = z8.discriminatedUnion("available", [
|
|
801
|
+
z8.object({
|
|
802
|
+
available: z8.literal(true),
|
|
803
|
+
number: z8.number(),
|
|
804
|
+
headSha: z8.string(),
|
|
805
|
+
files: z8.array(githubPrChangeSchema),
|
|
806
|
+
additions: z8.number(),
|
|
807
|
+
deletions: z8.number(),
|
|
808
|
+
truncated: z8.boolean(),
|
|
721
809
|
/** Present when the payload is complete but partial in some other way (a capped patch). */
|
|
722
|
-
reason:
|
|
810
|
+
reason: z8.string().optional()
|
|
723
811
|
}),
|
|
724
|
-
|
|
812
|
+
z8.object({ available: z8.literal(false), reason: z8.string() })
|
|
725
813
|
]);
|
|
726
814
|
|
|
727
815
|
// ../contract/src/workflows.ts
|
|
728
|
-
import { z as
|
|
729
|
-
var workflowStepDefSchema =
|
|
730
|
-
id:
|
|
731
|
-
name:
|
|
816
|
+
import { z as z9 } from "zod";
|
|
817
|
+
var workflowStepDefSchema = z9.object({
|
|
818
|
+
id: z9.string().min(1),
|
|
819
|
+
name: z9.string().optional(),
|
|
732
820
|
// agent step
|
|
733
|
-
prompt:
|
|
734
|
-
skill:
|
|
735
|
-
model:
|
|
736
|
-
effort:
|
|
821
|
+
prompt: z9.string().optional(),
|
|
822
|
+
skill: z9.string().optional(),
|
|
823
|
+
model: z9.string().optional(),
|
|
824
|
+
effort: z9.string().max(32).optional(),
|
|
737
825
|
/** Per-step agent backend override (falls back to the task / config default). */
|
|
738
826
|
runner: runnerSchema.optional(),
|
|
739
827
|
/** Agent account id for this step (spec 2026-07-29-agent-profiles); resolved per step for owned workers (#452). */
|
|
740
|
-
agentProfile:
|
|
741
|
-
allowedTools:
|
|
742
|
-
bashAllowlist:
|
|
828
|
+
agentProfile: z9.string().min(1).max(64).optional(),
|
|
829
|
+
allowedTools: z9.array(z9.string()).optional(),
|
|
830
|
+
bashAllowlist: z9.array(z9.string()).optional(),
|
|
743
831
|
// check step
|
|
744
|
-
command:
|
|
745
|
-
onFail:
|
|
746
|
-
retry:
|
|
747
|
-
max:
|
|
832
|
+
command: z9.string().optional(),
|
|
833
|
+
onFail: z9.object({
|
|
834
|
+
retry: z9.string().min(1),
|
|
835
|
+
max: z9.number().int().positive().default(2)
|
|
748
836
|
}).optional()
|
|
749
837
|
}).refine((s) => Boolean(s.command) !== Boolean(s.prompt ?? s.skill), {
|
|
750
838
|
message: "a step is either an agent step (prompt/skill) or a check step (command), not both"
|
|
751
839
|
});
|
|
752
|
-
var workflowDefSchema =
|
|
753
|
-
name:
|
|
754
|
-
description:
|
|
755
|
-
steps:
|
|
756
|
-
source:
|
|
840
|
+
var workflowDefSchema = z9.object({
|
|
841
|
+
name: z9.string(),
|
|
842
|
+
description: z9.string().optional(),
|
|
843
|
+
steps: z9.array(workflowStepDefSchema),
|
|
844
|
+
source: z9.enum(["built-in", "file"]),
|
|
757
845
|
/** Absent on built-ins — which is exactly what makes them undeletable. */
|
|
758
|
-
path:
|
|
846
|
+
path: z9.string().optional()
|
|
759
847
|
});
|
|
760
848
|
function providersRequiredByWorkflow(workflow, fallback) {
|
|
761
849
|
const required = /* @__PURE__ */ new Set();
|
|
@@ -764,46 +852,46 @@ function providersRequiredByWorkflow(workflow, fallback) {
|
|
|
764
852
|
}
|
|
765
853
|
return runnerSchema.options.filter((provider) => required.has(provider));
|
|
766
854
|
}
|
|
767
|
-
var workflowLoadIssueSchema =
|
|
768
|
-
path:
|
|
769
|
-
message:
|
|
770
|
-
});
|
|
771
|
-
var workflowsResponseSchema =
|
|
772
|
-
workflows:
|
|
773
|
-
issues:
|
|
774
|
-
});
|
|
775
|
-
var saveWorkflowInputSchema =
|
|
776
|
-
name:
|
|
777
|
-
description:
|
|
778
|
-
steps:
|
|
779
|
-
skills:
|
|
780
|
-
overwrite:
|
|
855
|
+
var workflowLoadIssueSchema = z9.object({
|
|
856
|
+
path: z9.string(),
|
|
857
|
+
message: z9.string()
|
|
858
|
+
});
|
|
859
|
+
var workflowsResponseSchema = z9.object({
|
|
860
|
+
workflows: z9.array(workflowDefSchema),
|
|
861
|
+
issues: z9.array(workflowLoadIssueSchema)
|
|
862
|
+
});
|
|
863
|
+
var saveWorkflowInputSchema = z9.object({
|
|
864
|
+
name: z9.string().trim().min(1).max(80),
|
|
865
|
+
description: z9.string().max(2e3, "must be at most 2000 characters").optional(),
|
|
866
|
+
steps: z9.array(workflowStepDefSchema).min(1).max(8).optional(),
|
|
867
|
+
skills: z9.array(z9.string().trim().min(1)).min(1).max(8).optional(),
|
|
868
|
+
overwrite: z9.boolean().optional()
|
|
781
869
|
}).refine((b) => Boolean(b.steps) !== Boolean(b.skills), {
|
|
782
870
|
message: 'provide either "steps" or "skills", not both'
|
|
783
871
|
});
|
|
784
|
-
var saveWorkflowResponseSchema =
|
|
785
|
-
path:
|
|
786
|
-
name:
|
|
872
|
+
var saveWorkflowResponseSchema = z9.object({
|
|
873
|
+
path: z9.string(),
|
|
874
|
+
name: z9.string()
|
|
787
875
|
});
|
|
788
|
-
var parsedWorkflowSchema =
|
|
789
|
-
name:
|
|
790
|
-
description:
|
|
791
|
-
steps:
|
|
876
|
+
var parsedWorkflowSchema = z9.object({
|
|
877
|
+
name: z9.string(),
|
|
878
|
+
description: z9.string().optional(),
|
|
879
|
+
steps: z9.array(workflowStepDefSchema)
|
|
792
880
|
});
|
|
793
|
-
var deleteWorkflowResponseSchema =
|
|
794
|
-
ok:
|
|
795
|
-
path:
|
|
881
|
+
var deleteWorkflowResponseSchema = z9.object({
|
|
882
|
+
ok: z9.literal(true),
|
|
883
|
+
path: z9.string()
|
|
796
884
|
});
|
|
797
|
-
var planResponseSchema =
|
|
885
|
+
var planResponseSchema = z9.object({
|
|
798
886
|
/** The kebab-case workflow title the planner proposed. Absent on the degraded fallback. */
|
|
799
|
-
name:
|
|
800
|
-
steps:
|
|
801
|
-
rationale:
|
|
802
|
-
fallback:
|
|
887
|
+
name: z9.string().optional(),
|
|
888
|
+
steps: z9.array(workflowStepDefSchema),
|
|
889
|
+
rationale: z9.string(),
|
|
890
|
+
fallback: z9.boolean()
|
|
803
891
|
});
|
|
804
892
|
|
|
805
893
|
// ../contract/src/runs.ts
|
|
806
|
-
var runStatusSchema =
|
|
894
|
+
var runStatusSchema = z10.enum([
|
|
807
895
|
"queued",
|
|
808
896
|
"running",
|
|
809
897
|
"waiting",
|
|
@@ -812,8 +900,8 @@ var runStatusSchema = z9.enum([
|
|
|
812
900
|
"failed",
|
|
813
901
|
"cancelled"
|
|
814
902
|
]);
|
|
815
|
-
var runActivitySchema =
|
|
816
|
-
var stepStatusSchema =
|
|
903
|
+
var runActivitySchema = z10.enum(["monitoring"]);
|
|
904
|
+
var stepStatusSchema = z10.enum([
|
|
817
905
|
"pending",
|
|
818
906
|
"running",
|
|
819
907
|
"waiting",
|
|
@@ -823,16 +911,16 @@ var stepStatusSchema = z9.enum([
|
|
|
823
911
|
"cancelled",
|
|
824
912
|
"skipped"
|
|
825
913
|
]);
|
|
826
|
-
var usageCounterSchema =
|
|
827
|
-
var stepStateSchema =
|
|
828
|
-
id:
|
|
829
|
-
name:
|
|
830
|
-
kind:
|
|
914
|
+
var usageCounterSchema = z10.number().finite().nonnegative();
|
|
915
|
+
var stepStateSchema = z10.object({
|
|
916
|
+
id: z10.string(),
|
|
917
|
+
name: z10.string(),
|
|
918
|
+
kind: z10.enum(["agent", "check"]),
|
|
831
919
|
status: stepStatusSchema,
|
|
832
|
-
iterations:
|
|
920
|
+
iterations: z10.number(),
|
|
833
921
|
/** Durable count of onFail retry loops consumed by this check. */
|
|
834
|
-
retriesUsed:
|
|
835
|
-
tokensUsed:
|
|
922
|
+
retriesUsed: z10.number().int().nonnegative().optional(),
|
|
923
|
+
tokensUsed: z10.number(),
|
|
836
924
|
inputTokens: usageCounterSchema.optional(),
|
|
837
925
|
outputTokens: usageCounterSchema.optional(),
|
|
838
926
|
usageInvocationsStarted: usageCounterSchema.optional(),
|
|
@@ -840,93 +928,99 @@ var stepStateSchema = z9.object({
|
|
|
840
928
|
usageTurnsStarted: usageCounterSchema.optional(),
|
|
841
929
|
usageTurnsRecorded: usageCounterSchema.optional(),
|
|
842
930
|
usageInvocationEpoch: usageCounterSchema.optional(),
|
|
843
|
-
startedAt:
|
|
844
|
-
finishedAt:
|
|
845
|
-
error:
|
|
931
|
+
startedAt: z10.string().optional(),
|
|
932
|
+
finishedAt: z10.string().optional(),
|
|
933
|
+
error: z10.string().optional(),
|
|
846
934
|
/** Latest agent session id — `claude --resume <id>` and friends. */
|
|
847
|
-
sessionId:
|
|
935
|
+
sessionId: z10.string().optional(),
|
|
848
936
|
/** Backend that owns `sessionId`; absent on records written before backend affinity. */
|
|
849
937
|
backend: runnerSchema.optional(),
|
|
850
938
|
/** Agent account (spec 2026-07-29-agent-profiles) that owns `sessionId` — `default`, or a
|
|
851
939
|
* stored profile id. The two are a PAIR: a session id only resolves inside the config dir
|
|
852
940
|
* that created it, so resume and Continue read this rather than the project's current
|
|
853
941
|
* selection. Absent on records written before accounts existed. */
|
|
854
|
-
profileId:
|
|
855
|
-
costUsd:
|
|
942
|
+
profileId: z10.string().optional(),
|
|
943
|
+
costUsd: z10.number().optional(),
|
|
856
944
|
/** Explicit provenance for engine-generated continuation steps. */
|
|
857
|
-
synthetic:
|
|
945
|
+
synthetic: z10.literal("continuation").optional()
|
|
858
946
|
});
|
|
859
|
-
var diffStatSchema =
|
|
860
|
-
adds:
|
|
861
|
-
dels:
|
|
862
|
-
files:
|
|
947
|
+
var diffStatSchema = z10.object({
|
|
948
|
+
adds: z10.number(),
|
|
949
|
+
dels: z10.number(),
|
|
950
|
+
files: z10.number(),
|
|
863
951
|
/** Additive since #751, and present ONLY when true: the numbers were measured against a
|
|
864
952
|
* branch the agent checked out into the task's worktree, as the run found it, because the
|
|
865
953
|
* worktree's HEAD had been repointed off the task's own branch (every review/QA run does
|
|
866
954
|
* this) and the merge-base anchor would otherwise have reported that branch's entire diff
|
|
867
955
|
* as this task's. Absent on every normal run and on every record written before #751 — a
|
|
868
956
|
* consumer that ignores it sees exactly the old shape. */
|
|
869
|
-
repointed:
|
|
957
|
+
repointed: z10.boolean().optional()
|
|
870
958
|
});
|
|
871
|
-
var queuedMessageSchema =
|
|
872
|
-
id:
|
|
873
|
-
text:
|
|
959
|
+
var queuedMessageSchema = z10.object({
|
|
960
|
+
id: z10.string(),
|
|
961
|
+
text: z10.string(),
|
|
874
962
|
/** `/api/v1/runs/:id/images/…` URLs — attachments are persisted, never inlined. Images and
|
|
875
963
|
* files share this one list; read `isImageAttachmentName` on the file name to tell them apart. */
|
|
876
|
-
images:
|
|
877
|
-
createdAt:
|
|
964
|
+
images: z10.array(z10.string()).optional(),
|
|
965
|
+
createdAt: z10.string()
|
|
878
966
|
});
|
|
879
967
|
var continuationMessageSchema = queuedMessageSchema.extend({
|
|
880
|
-
origin:
|
|
968
|
+
origin: z10.enum(["human", "lifecycle"]).optional(),
|
|
969
|
+
/** An attributed parent message used as the opening prompt, never a human answer. */
|
|
970
|
+
agentInputId: z10.uuid().optional()
|
|
881
971
|
});
|
|
882
|
-
var processUsageSchema =
|
|
972
|
+
var processUsageSchema = z10.object({
|
|
883
973
|
/** Sum of `%cpu` across the tree — can exceed 100 on multi-core work. */
|
|
884
|
-
cpuPct:
|
|
885
|
-
rssBytes:
|
|
886
|
-
procCount:
|
|
974
|
+
cpuPct: z10.number(),
|
|
975
|
+
rssBytes: z10.number(),
|
|
976
|
+
procCount: z10.number()
|
|
887
977
|
});
|
|
888
|
-
var runRecordSchema =
|
|
889
|
-
id:
|
|
890
|
-
title:
|
|
978
|
+
var runRecordSchema = z10.object({
|
|
979
|
+
id: z10.string(),
|
|
980
|
+
title: z10.string(),
|
|
891
981
|
/** Display title (#389): auto-derived from the first agent turn, or the user's inline edit
|
|
892
982
|
* (`PATCH /runs/:id` sets it together with `title`). Show `titleSummary ?? title`. */
|
|
893
|
-
titleSummary:
|
|
983
|
+
titleSummary: z10.string().optional(),
|
|
894
984
|
/** Refreshed on every turn-end; absent until the first turn ends (and on worktree-less runs). */
|
|
895
985
|
diffStat: diffStatSchema.optional(),
|
|
896
|
-
workflow:
|
|
897
|
-
task:
|
|
986
|
+
workflow: z10.string(),
|
|
987
|
+
task: z10.string(),
|
|
898
988
|
/** Prompt messages stacked onto the run while it waited for a free agent slot (#472). Folded
|
|
899
989
|
* into the prompt at dequeue — never delivered as their own turns. Absent on pre-#472 runs. */
|
|
900
|
-
queuedMessages:
|
|
990
|
+
queuedMessages: z10.array(queuedMessageSchema).optional(),
|
|
901
991
|
/** Stop was accepted; execution termination is still pending. */
|
|
902
|
-
stopping:
|
|
992
|
+
stopping: z10.boolean().optional(),
|
|
903
993
|
/** Opening Continue message, retained until its first completed turn for crash recovery. */
|
|
904
994
|
continuationMessage: continuationMessageSchema.optional(),
|
|
905
995
|
/** The last turn carried a malformed explicit structured question. */
|
|
906
|
-
invalidAsk:
|
|
996
|
+
invalidAsk: z10.boolean().optional(),
|
|
907
997
|
/** Owned-run authority; absence is legacy, invalid is explicitly quarantined. */
|
|
908
998
|
delegation: delegationStateSchema.optional(),
|
|
909
999
|
/** Durable non-human input, kept separate from human prompt/answer queues. */
|
|
910
|
-
agentInputs:
|
|
1000
|
+
agentInputs: z10.array(agentInputSchema).optional(),
|
|
1001
|
+
ciWait: ciWaitSchema.optional(),
|
|
1002
|
+
lastCiWait: ciWaitSchema.optional(),
|
|
1003
|
+
/** Retained recovery observation when previous CI metadata cannot be trusted. */
|
|
1004
|
+
lastCiWaitError: z10.string().max(256).optional(),
|
|
911
1005
|
/** URLs of images and document attachments on the initial task prompt; branch on isImageAttachmentName. */
|
|
912
|
-
taskImages:
|
|
913
|
-
model:
|
|
1006
|
+
taskImages: z10.array(z10.string()).optional(),
|
|
1007
|
+
model: z10.string().optional(),
|
|
914
1008
|
/** Reasoning-effort pin (#45). Canonical `low`/`medium`/`high`/`xhigh`/`max`.
|
|
915
1009
|
* Absent = harness default. Additive: pre-#45 records omit it and still parse. */
|
|
916
|
-
effort:
|
|
1010
|
+
effort: z10.string().max(32).optional(),
|
|
917
1011
|
/** Normalized provider/model identity used for attribution and reproducible replay. */
|
|
918
|
-
modelIdentity:
|
|
1012
|
+
modelIdentity: z10.string().optional(),
|
|
919
1013
|
runner: runnerSchema.optional(),
|
|
920
1014
|
/** The composer's per-task agent account (spec 2026-07-29-agent-profiles), applying to steps
|
|
921
1015
|
* on `runner`. Absent = the run follows the project's own selection. */
|
|
922
|
-
agentProfile:
|
|
1016
|
+
agentProfile: z10.string().optional(),
|
|
923
1017
|
/** Echo of the extra system prompt the run used (POST override or config default). */
|
|
924
|
-
systemPrompt:
|
|
1018
|
+
systemPrompt: z10.string().optional(),
|
|
925
1019
|
/** false when the run deliberately disabled follow-up todo generation. Absent means enabled. */
|
|
926
|
-
generateFollowups:
|
|
1020
|
+
generateFollowups: z10.boolean().optional(),
|
|
927
1021
|
/** Autonomous mode (#autonomous): the run never parks at `waiting` or the terminal `review`
|
|
928
1022
|
* gate. Absent = falsy = not autonomous. */
|
|
929
|
-
autonomous:
|
|
1023
|
+
autonomous: z10.boolean().optional(),
|
|
930
1024
|
/**
|
|
931
1025
|
* Provenance for a task a project GitHub automation launched (#694). Absent on every ordinary
|
|
932
1026
|
* run, which is what makes it additive — the cockpit shows the "from automation" link only when
|
|
@@ -936,12 +1030,12 @@ var runRecordSchema = z9.object({
|
|
|
936
1030
|
* launching definition matched, recorded on the run for the audit trail, and `src/runs/store.ts`
|
|
937
1031
|
* persists it as free text so an older cezar can still read a record written by a newer one.
|
|
938
1032
|
*/
|
|
939
|
-
automation:
|
|
940
|
-
automationId:
|
|
941
|
-
automationRevision:
|
|
942
|
-
receiptId:
|
|
943
|
-
event:
|
|
944
|
-
githubUrl:
|
|
1033
|
+
automation: z10.object({
|
|
1034
|
+
automationId: z10.string(),
|
|
1035
|
+
automationRevision: z10.number(),
|
|
1036
|
+
receiptId: z10.string(),
|
|
1037
|
+
event: z10.string(),
|
|
1038
|
+
githubUrl: z10.string()
|
|
945
1039
|
}).optional(),
|
|
946
1040
|
status: runStatusSchema,
|
|
947
1041
|
/** `monitoring` while `status === 'running'` and the agent is working on downstream work.
|
|
@@ -949,84 +1043,84 @@ var runRecordSchema = z9.object({
|
|
|
949
1043
|
activity: runActivitySchema.optional(),
|
|
950
1044
|
/** Derived from valid human questions and matching delivery receipts in durable history.
|
|
951
1045
|
* List attention only; never authorization to deliver an answer or wake a worker. */
|
|
952
|
-
hasPendingHumanAsk:
|
|
1046
|
+
hasPendingHumanAsk: z10.boolean().optional(),
|
|
953
1047
|
/** Exact ISO-8601 deadline for the next automatic monitoring check. */
|
|
954
|
-
monitoringWakeAt:
|
|
1048
|
+
monitoringWakeAt: z10.string().optional(),
|
|
955
1049
|
/** The current live monitoring epoch exhausted its 40 automatic checks. */
|
|
956
|
-
monitoringWakeCapReached:
|
|
1050
|
+
monitoringWakeCapReached: z10.boolean().optional(),
|
|
957
1051
|
/** Exact ISO-8601 instant this run resumes itself after a provider usage limit stopped it
|
|
958
1052
|
* (spec 2026-08-03-auto-resume-after-usage-limit). Present only on a `failed` run with a
|
|
959
1053
|
* pending automatic resume — its absence is what "no resume is scheduled" looks like. */
|
|
960
|
-
autoResumeAt:
|
|
1054
|
+
autoResumeAt: z10.string().optional(),
|
|
961
1055
|
/** Consecutive automatic resumes since the last human turn, against the safety cap. */
|
|
962
|
-
autoResumeAttempts:
|
|
963
|
-
createdAt:
|
|
964
|
-
startedAt:
|
|
965
|
-
finishedAt:
|
|
966
|
-
tokensUsed:
|
|
1056
|
+
autoResumeAttempts: z10.number().optional(),
|
|
1057
|
+
createdAt: z10.string(),
|
|
1058
|
+
startedAt: z10.string().optional(),
|
|
1059
|
+
finishedAt: z10.string().optional(),
|
|
1060
|
+
tokensUsed: z10.number(),
|
|
967
1061
|
inputTokens: usageCounterSchema.optional(),
|
|
968
1062
|
outputTokens: usageCounterSchema.optional(),
|
|
969
|
-
costUsd:
|
|
970
|
-
pullRequestUrl:
|
|
1063
|
+
costUsd: z10.number().optional(),
|
|
1064
|
+
pullRequestUrl: z10.string().optional(),
|
|
971
1065
|
/** The PR this task is ABOUT (#407) — auto-discovered from conversation references. Display
|
|
972
1066
|
* tier only: `pullRequestUrl` (the PR this task CREATED) wins, and the action gates ignore it. */
|
|
973
|
-
referencedPullRequestUrl:
|
|
1067
|
+
referencedPullRequestUrl: z10.string().optional(),
|
|
974
1068
|
/** The PR/issue number this task is ABOUT (task auto-naming spec) — display tier only. */
|
|
975
|
-
prNumber:
|
|
976
|
-
issueNumber:
|
|
1069
|
+
prNumber: z10.number().optional(),
|
|
1070
|
+
issueNumber: z10.number().optional(),
|
|
977
1071
|
/** Server-side provenance: referenced-issue discovery currently owns `issueNumber`. */
|
|
978
|
-
referencedIssueNumberSeeded:
|
|
1072
|
+
referencedIssueNumberSeeded: z10.boolean().optional(),
|
|
979
1073
|
/** 'user' = renamed via PATCH, never auto-overwritten; 'marker' = agent-declared via
|
|
980
1074
|
* CEZ:TITLE (spec 2026-07-18-task-ref-markers); 'auto' = namer-owned. */
|
|
981
|
-
titleOrigin:
|
|
1075
|
+
titleOrigin: z10.enum(["user", "auto", "marker"]).optional(),
|
|
982
1076
|
/** References the agent declared via CEZ:PR/CEZ:ISSUE markers — authoritative over the namer
|
|
983
1077
|
* for the matching kind. */
|
|
984
|
-
markerRefs:
|
|
1078
|
+
markerRefs: z10.object({ pr: z10.number().optional(), issue: z10.number().optional() }).optional(),
|
|
985
1079
|
/** The referenced tier's working set (distinct PR URLs spotted, capped server-side). */
|
|
986
|
-
referencedPrCandidates:
|
|
1080
|
+
referencedPrCandidates: z10.array(z10.string()).optional(),
|
|
987
1081
|
/** The issue this task is ABOUT (spec 2026-07-21-report-ref-discovery). Display-only. */
|
|
988
|
-
referencedIssueUrl:
|
|
1082
|
+
referencedIssueUrl: z10.string().optional(),
|
|
989
1083
|
/** The referenced-issue working set, persisted like `referencedPrCandidates`. Capped. */
|
|
990
|
-
referencedIssueCandidates:
|
|
1084
|
+
referencedIssueCandidates: z10.array(z10.string()).optional(),
|
|
991
1085
|
/** Explicit execution policy. `false` means the run intentionally uses the repo root;
|
|
992
1086
|
* absent on older runs and for the default isolated-worktree mode. */
|
|
993
|
-
worktree:
|
|
1087
|
+
worktree: z10.literal(false).optional(),
|
|
994
1088
|
/** Absent for in-place runs and after an isolated worktree is removed. */
|
|
995
|
-
worktreePath:
|
|
996
|
-
branch:
|
|
1089
|
+
worktreePath: z10.string().optional(),
|
|
1090
|
+
branch: z10.string().optional(),
|
|
997
1091
|
/** Stable baseline for session git views: a worktree's fork ref, or an in-place run's starting commit. */
|
|
998
|
-
baseBranch:
|
|
1092
|
+
baseBranch: z10.string().optional(),
|
|
999
1093
|
/** Set when count-based retention (#483) reclaimed the worktree DIRECTORY (the branch is
|
|
1000
1094
|
* kept): the dir is gone but recoverable. */
|
|
1001
|
-
worktreeReclaimedAt:
|
|
1095
|
+
worktreeReclaimedAt: z10.string().optional(),
|
|
1002
1096
|
/** Parallel variants (spec 010): runs sharing a groupId are one group. */
|
|
1003
|
-
groupId:
|
|
1097
|
+
groupId: z10.string().optional(),
|
|
1004
1098
|
/** Variant letter within the group — 'A' | 'B' | 'C'. */
|
|
1005
|
-
variant:
|
|
1006
|
-
peakRssBytes:
|
|
1007
|
-
peakProcCount:
|
|
1008
|
-
archived:
|
|
1009
|
-
archivedAt:
|
|
1099
|
+
variant: z10.string().optional(),
|
|
1100
|
+
peakRssBytes: z10.number().optional(),
|
|
1101
|
+
peakProcCount: z10.number().optional(),
|
|
1102
|
+
archived: z10.boolean(),
|
|
1103
|
+
archivedAt: z10.string().optional(),
|
|
1010
1104
|
/** Pinned to the top of this project's task list (#935) — the `Pinned` group above
|
|
1011
1105
|
* `Needs you`. Optional, unlike `archived`: absent IS "not pinned", which is what every
|
|
1012
1106
|
* record written before this carries, and the store never writes `false`. Archiving
|
|
1013
1107
|
* clears it, because archiving is how a user resigns from a task. */
|
|
1014
|
-
pinned:
|
|
1108
|
+
pinned: z10.boolean().optional(),
|
|
1015
1109
|
/** When the pin was set. Deliberately WRITE-ONLY today, like the `archivedAt` above it:
|
|
1016
1110
|
* ordering inside `Pinned` uses the ordinary status/recency rules, so nothing reads this
|
|
1017
1111
|
* yet. It is here because a field on a protected surface is far cheaper to add now than to
|
|
1018
1112
|
* add later — "pinned oldest first" and "unpin what you pinned a month ago" both need it,
|
|
1019
1113
|
* and neither can be reconstructed after the fact. */
|
|
1020
|
-
pinnedAt:
|
|
1114
|
+
pinnedAt: z10.string().optional(),
|
|
1021
1115
|
/** Read receipt (#unread-done-items): ISO time the cockpit last opened this run's
|
|
1022
1116
|
* thread. A finished (`done`/`failed`) run reads as *unread* until seen since it
|
|
1023
1117
|
* finished — see `isUnread()` in the cockpit's `lib/read-state.ts`. Absent on old
|
|
1024
1118
|
* runs, on any run not yet opened, and on one deliberately put back to unread via
|
|
1025
1119
|
* `POST /runs/:id/unread` (#775) — all three count as unread. */
|
|
1026
|
-
seenAt:
|
|
1027
|
-
currentStepId:
|
|
1028
|
-
error:
|
|
1029
|
-
steps:
|
|
1120
|
+
seenAt: z10.string().optional(),
|
|
1121
|
+
currentStepId: z10.string().optional(),
|
|
1122
|
+
error: z10.string().optional(),
|
|
1123
|
+
steps: z10.array(stepStateSchema),
|
|
1030
1124
|
/**
|
|
1031
1125
|
* The persisted workflow definition, so a `queued` run survives a restart — including the ad-hoc
|
|
1032
1126
|
* "(planned)" chains that exist nowhere else.
|
|
@@ -1044,48 +1138,48 @@ var runRecordSchema = z9.object({
|
|
|
1044
1138
|
var apiRunSchema = runRecordSchema.extend({
|
|
1045
1139
|
/** Read-only GET /runs/:id verdict: null permits Finish, a string explains refusal.
|
|
1046
1140
|
* Absent on lists, stored records and mutation responses; absence is not permission. */
|
|
1047
|
-
finishBlocked:
|
|
1141
|
+
finishBlocked: z10.string().nullable().optional(),
|
|
1048
1142
|
/** Server-resolved Cursor CLI command, including the configured executable. Never persisted. */
|
|
1049
|
-
cliResumeCommand:
|
|
1143
|
+
cliResumeCommand: z10.string().optional(),
|
|
1050
1144
|
usage: processUsageSchema.optional()
|
|
1051
1145
|
});
|
|
1052
|
-
var runIndexEntrySchema =
|
|
1146
|
+
var runIndexEntrySchema = z10.object({
|
|
1053
1147
|
/** The registered project this run belongs to. Joins against `GET /projects`. */
|
|
1054
|
-
projectId:
|
|
1055
|
-
id:
|
|
1056
|
-
title:
|
|
1057
|
-
titleSummary:
|
|
1058
|
-
titleOrigin:
|
|
1148
|
+
projectId: z10.string(),
|
|
1149
|
+
id: z10.string(),
|
|
1150
|
+
title: z10.string(),
|
|
1151
|
+
titleSummary: z10.string().optional(),
|
|
1152
|
+
titleOrigin: z10.enum(["user", "auto", "marker"]).optional(),
|
|
1059
1153
|
status: runStatusSchema,
|
|
1060
1154
|
activity: runActivitySchema.optional(),
|
|
1061
1155
|
hasPendingHumanAsk: runRecordSchema.shape.hasPendingHumanAsk,
|
|
1062
1156
|
/** Only the relationship role and wait phase used by list attention. */
|
|
1063
1157
|
delegation: runDelegationSummarySchema.optional(),
|
|
1064
|
-
createdAt:
|
|
1065
|
-
finishedAt:
|
|
1158
|
+
createdAt: z10.string(),
|
|
1159
|
+
finishedAt: z10.string().optional(),
|
|
1066
1160
|
/** With `status`/`finishedAt`/`archived`, the four inputs `isUnread` reads — what lets the
|
|
1067
1161
|
* palette lead with "finished while you weren't looking" across every project, not just the
|
|
1068
1162
|
* one you happen to be standing in. */
|
|
1069
|
-
seenAt:
|
|
1163
|
+
seenAt: z10.string().optional(),
|
|
1070
1164
|
/** Always present, like `RunRecord.archived`: absent would read as "not archived", and the
|
|
1071
1165
|
* unread rule treats archiving as a stronger "done with this" than reading. */
|
|
1072
|
-
archived:
|
|
1166
|
+
archived: z10.boolean(),
|
|
1073
1167
|
/** A run parked by a provider usage limit is `failed` on the record with a resume booked
|
|
1074
1168
|
* (spec 2026-08-03-auto-resume-after-usage-limit). Both `deriveAttention` and `isUnread` read
|
|
1075
1169
|
* it, so without it here a cross-project row would show a red "failed" dot and land in
|
|
1076
1170
|
* Recently finished for work that is simply waiting for its appointment. */
|
|
1077
|
-
autoResumeAt:
|
|
1171
|
+
autoResumeAt: z10.string().optional(),
|
|
1078
1172
|
/** The workflow the run executes — the global Tasks page shows it in a column and groups by
|
|
1079
1173
|
* it. Always present on the record (`RunRecord.workflow`), so required here; the display
|
|
1080
1174
|
* refinement `workflowLabel` applies needs `steps[]`, which this row deliberately omits, so
|
|
1081
1175
|
* a `(planned)` chain reads as itself here rather than as its first agent's name. */
|
|
1082
|
-
workflow:
|
|
1176
|
+
workflow: z10.string(),
|
|
1083
1177
|
/** The task's branch, when it has one — a column on the global page, and the one field that
|
|
1084
1178
|
* makes a cross-project row identifiable at a glance without opening it. */
|
|
1085
|
-
branch:
|
|
1179
|
+
branch: z10.string().optional(),
|
|
1086
1180
|
/** When the agent actually started, as opposed to when the task was created. The global page's
|
|
1087
1181
|
* age column prefers it and falls back to `createdAt`, exactly as the per-project table does. */
|
|
1088
|
-
startedAt:
|
|
1182
|
+
startedAt: z10.string().optional(),
|
|
1089
1183
|
/**
|
|
1090
1184
|
* The six fields `taskReference()` (`web/src/lib/tasks-table.ts`) reads to decide a task's PR
|
|
1091
1185
|
* or issue chip. Carried verbatim rather than pre-resolved into a `{kind, number, url}` on the
|
|
@@ -1097,20 +1191,20 @@ var runIndexEntrySchema = z9.object({
|
|
|
1097
1191
|
* Six scalars is still the slim row this schema exists to keep: `steps[]` and `workflowDef`,
|
|
1098
1192
|
* the expensive half, stay off it.
|
|
1099
1193
|
*/
|
|
1100
|
-
pullRequestUrl:
|
|
1101
|
-
referencedPullRequestUrl:
|
|
1102
|
-
prNumber:
|
|
1103
|
-
issueNumber:
|
|
1104
|
-
referencedIssueUrl:
|
|
1105
|
-
markerRefs:
|
|
1194
|
+
pullRequestUrl: z10.string().optional(),
|
|
1195
|
+
referencedPullRequestUrl: z10.string().optional(),
|
|
1196
|
+
prNumber: z10.number().optional(),
|
|
1197
|
+
issueNumber: z10.number().optional(),
|
|
1198
|
+
referencedIssueUrl: z10.string().optional(),
|
|
1199
|
+
markerRefs: z10.object({ pr: z10.number().optional(), issue: z10.number().optional() }).optional(),
|
|
1106
1200
|
/** What the run has cost so far. Absent means nothing was recorded, which is NOT `$0` — the
|
|
1107
1201
|
* cockpit prints an em dash rather than claiming a measurement that never happened. */
|
|
1108
|
-
costUsd:
|
|
1202
|
+
costUsd: z10.number().optional(),
|
|
1109
1203
|
/** The persisted high-water marks a FINISHED run leaves behind. `usage` below stops existing
|
|
1110
1204
|
* the moment the process tree does, so without these a finished row could say nothing at all
|
|
1111
1205
|
* about what it took to run. */
|
|
1112
|
-
peakRssBytes:
|
|
1113
|
-
peakProcCount:
|
|
1206
|
+
peakRssBytes: z10.number().optional(),
|
|
1207
|
+
peakProcCount: z10.number().optional(),
|
|
1114
1208
|
/**
|
|
1115
1209
|
* The live CPU/RSS sample of this run's process tree, attached on the way out exactly as
|
|
1116
1210
|
* `GET /runs` attaches it (`withUsage`) — never persisted.
|
|
@@ -1122,90 +1216,90 @@ var runIndexEntrySchema = z9.object({
|
|
|
1122
1216
|
*/
|
|
1123
1217
|
usage: processUsageSchema.optional()
|
|
1124
1218
|
});
|
|
1125
|
-
var referenceStatusesByProjectSchema =
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
prs:
|
|
1129
|
-
issues:
|
|
1219
|
+
var referenceStatusesByProjectSchema = z10.record(
|
|
1220
|
+
z10.string(),
|
|
1221
|
+
z10.object({
|
|
1222
|
+
prs: z10.record(z10.number(), referenceStatusSchema),
|
|
1223
|
+
issues: z10.record(z10.number(), referenceStatusSchema)
|
|
1130
1224
|
})
|
|
1131
1225
|
);
|
|
1132
|
-
var runsIndexResponseSchema =
|
|
1226
|
+
var runsIndexResponseSchema = z10.object({
|
|
1133
1227
|
/** Newest first, across every registered project. Archived runs are included — `GET /runs`
|
|
1134
1228
|
* carries them for the project you are standing in, and a finder that dropped them elsewhere
|
|
1135
1229
|
* would make a task vanish the moment you left its project. */
|
|
1136
|
-
runs:
|
|
1230
|
+
runs: z10.array(runIndexEntrySchema),
|
|
1137
1231
|
/** Additive: absent statuses mean "nothing warm", never "nothing to show". */
|
|
1138
1232
|
referenceStatuses: referenceStatusesByProjectSchema,
|
|
1139
1233
|
/** The per-project cap that produced this list. */
|
|
1140
|
-
perProjectLimit:
|
|
1234
|
+
perProjectLimit: z10.number(),
|
|
1141
1235
|
/** Ids of the projects that had more runs than the cap allowed. */
|
|
1142
|
-
truncated:
|
|
1236
|
+
truncated: z10.array(z10.string())
|
|
1143
1237
|
});
|
|
1144
|
-
var createRunResponseSchema =
|
|
1238
|
+
var createRunResponseSchema = z10.union([
|
|
1145
1239
|
runRecordSchema,
|
|
1146
|
-
|
|
1240
|
+
z10.object({ runs: z10.array(runRecordSchema) })
|
|
1147
1241
|
]);
|
|
1148
|
-
var cancelResponseSchema =
|
|
1149
|
-
var cancelAutoResumeResponseSchema =
|
|
1150
|
-
var archiveFinishedResponseSchema =
|
|
1151
|
-
var markAllReadResponseSchema =
|
|
1152
|
-
var deleteRunResponseSchema =
|
|
1153
|
-
var finishResponseSchema =
|
|
1154
|
-
var continueResponseSchema =
|
|
1155
|
-
var createPrResponseSchema =
|
|
1156
|
-
url:
|
|
1157
|
-
dryRun:
|
|
1158
|
-
});
|
|
1159
|
-
var messageResponseSchema =
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1242
|
+
var cancelResponseSchema = z10.object({ cancelled: z10.boolean() });
|
|
1243
|
+
var cancelAutoResumeResponseSchema = z10.object({ cancelled: z10.literal(true) });
|
|
1244
|
+
var archiveFinishedResponseSchema = z10.object({ archived: z10.number() });
|
|
1245
|
+
var markAllReadResponseSchema = z10.object({ read: z10.number() });
|
|
1246
|
+
var deleteRunResponseSchema = z10.object({ deleted: z10.literal(true) });
|
|
1247
|
+
var finishResponseSchema = z10.object({ finished: z10.literal(true) });
|
|
1248
|
+
var continueResponseSchema = z10.object({ continued: z10.literal(true) });
|
|
1249
|
+
var createPrResponseSchema = z10.object({
|
|
1250
|
+
url: z10.string(),
|
|
1251
|
+
dryRun: z10.boolean()
|
|
1252
|
+
});
|
|
1253
|
+
var messageResponseSchema = z10.union([
|
|
1254
|
+
z10.object({ delivered: z10.literal(true) }),
|
|
1255
|
+
z10.object({ queued: z10.literal(true), message: queuedMessageSchema }),
|
|
1256
|
+
z10.object({ deferred: z10.literal(true) })
|
|
1163
1257
|
]);
|
|
1164
|
-
var editQueuedMessageResponseSchema =
|
|
1165
|
-
var removeQueuedMessageResponseSchema =
|
|
1166
|
-
var openInCliResponseSchema =
|
|
1167
|
-
opened:
|
|
1168
|
-
command:
|
|
1169
|
-
});
|
|
1170
|
-
var removeWorktreeResponseSchema =
|
|
1171
|
-
var gitCommitResponseSchema =
|
|
1172
|
-
committed:
|
|
1173
|
-
sha:
|
|
1174
|
-
});
|
|
1175
|
-
var gitPushResponseSchema =
|
|
1176
|
-
pushed:
|
|
1177
|
-
branch:
|
|
1178
|
-
remote:
|
|
1179
|
-
upstreamSet:
|
|
1180
|
-
});
|
|
1181
|
-
var runCommitSchema =
|
|
1182
|
-
sha:
|
|
1183
|
-
subject:
|
|
1184
|
-
author:
|
|
1258
|
+
var editQueuedMessageResponseSchema = z10.object({ message: queuedMessageSchema });
|
|
1259
|
+
var removeQueuedMessageResponseSchema = z10.object({ removed: z10.literal(true) });
|
|
1260
|
+
var openInCliResponseSchema = z10.object({
|
|
1261
|
+
opened: z10.literal(true),
|
|
1262
|
+
command: z10.string()
|
|
1263
|
+
});
|
|
1264
|
+
var removeWorktreeResponseSchema = z10.object({ removed: z10.literal(true) });
|
|
1265
|
+
var gitCommitResponseSchema = z10.object({
|
|
1266
|
+
committed: z10.literal(true),
|
|
1267
|
+
sha: z10.string()
|
|
1268
|
+
});
|
|
1269
|
+
var gitPushResponseSchema = z10.object({
|
|
1270
|
+
pushed: z10.literal(true),
|
|
1271
|
+
branch: z10.string(),
|
|
1272
|
+
remote: z10.string(),
|
|
1273
|
+
upstreamSet: z10.boolean()
|
|
1274
|
+
});
|
|
1275
|
+
var runCommitSchema = z10.object({
|
|
1276
|
+
sha: z10.string(),
|
|
1277
|
+
subject: z10.string(),
|
|
1278
|
+
author: z10.string(),
|
|
1185
1279
|
/** Relative time ("3 hours ago") — git's `%cr`. */
|
|
1186
|
-
when:
|
|
1280
|
+
when: z10.string()
|
|
1187
1281
|
});
|
|
1188
|
-
var runCommitsResponseSchema =
|
|
1189
|
-
var groupVariantSchema =
|
|
1190
|
-
id:
|
|
1282
|
+
var runCommitsResponseSchema = z10.object({ commits: z10.array(runCommitSchema) });
|
|
1283
|
+
var groupVariantSchema = z10.object({
|
|
1284
|
+
id: z10.string(),
|
|
1191
1285
|
/** 'A' | 'B' | 'C' in practice; `'?'` for a record that lost its letter. */
|
|
1192
|
-
variant:
|
|
1193
|
-
title:
|
|
1286
|
+
variant: z10.string(),
|
|
1287
|
+
title: z10.string(),
|
|
1194
1288
|
status: runStatusSchema,
|
|
1195
|
-
archived:
|
|
1196
|
-
tokensUsed:
|
|
1289
|
+
archived: z10.boolean(),
|
|
1290
|
+
tokensUsed: z10.number(),
|
|
1197
1291
|
inputTokens: usageCounterSchema.optional(),
|
|
1198
1292
|
outputTokens: usageCounterSchema.optional(),
|
|
1199
|
-
costUsd:
|
|
1200
|
-
diffStat:
|
|
1293
|
+
costUsd: z10.number().optional(),
|
|
1294
|
+
diffStat: z10.string(),
|
|
1201
1295
|
/** First lines of the handoff journal's "## Progress log" section, as markdown. */
|
|
1202
|
-
handoffExcerpt:
|
|
1296
|
+
handoffExcerpt: z10.string()
|
|
1203
1297
|
});
|
|
1204
|
-
var groupResponseSchema =
|
|
1205
|
-
groupId:
|
|
1206
|
-
runs:
|
|
1298
|
+
var groupResponseSchema = z10.object({
|
|
1299
|
+
groupId: z10.string(),
|
|
1300
|
+
runs: z10.array(groupVariantSchema)
|
|
1207
1301
|
});
|
|
1208
|
-
var pickVariantResponseSchema =
|
|
1302
|
+
var pickVariantResponseSchema = z10.object({
|
|
1209
1303
|
winner: runRecordSchema.optional()
|
|
1210
1304
|
});
|
|
1211
1305
|
var FILE_ATTACHMENT_MEDIA_TYPES = [
|
|
@@ -1228,174 +1322,174 @@ function isImageAttachmentName(name) {
|
|
|
1228
1322
|
const ext = name.split(".").pop()?.toLowerCase();
|
|
1229
1323
|
return ext !== void 0 && IMAGE_ATTACHMENT_EXTENSIONS.has(ext);
|
|
1230
1324
|
}
|
|
1231
|
-
var attachmentFileParamSchema =
|
|
1232
|
-
id:
|
|
1233
|
-
file:
|
|
1325
|
+
var attachmentFileParamSchema = z10.object({
|
|
1326
|
+
id: z10.string().min(1),
|
|
1327
|
+
file: z10.string().regex(/^[A-Za-z0-9_-][A-Za-z0-9._-]*$/).refine((name) => !name.includes(".."))
|
|
1234
1328
|
});
|
|
1235
|
-
var attachmentInputSchema =
|
|
1236
|
-
mediaType:
|
|
1329
|
+
var attachmentInputSchema = z10.object({
|
|
1330
|
+
mediaType: z10.string().refine(isAttachmentMediaType, {
|
|
1237
1331
|
message: "unsupported attachment type \u2014 images, plain text, markdown and PDF only"
|
|
1238
1332
|
}),
|
|
1239
|
-
data:
|
|
1333
|
+
data: z10.string().min(1).max(7e6)
|
|
1240
1334
|
});
|
|
1241
1335
|
var imageInputSchema = attachmentInputSchema;
|
|
1242
|
-
var createRunInputBaseSchema =
|
|
1243
|
-
workflow:
|
|
1336
|
+
var createRunInputBaseSchema = z10.object({
|
|
1337
|
+
workflow: z10.string().min(1).optional(),
|
|
1244
1338
|
/** An inline chain (spec 008 — an approved plan runs as an ad-hoc workflow, never written to
|
|
1245
1339
|
* a file). The catalog's own step shape, not a copy of it. */
|
|
1246
|
-
steps:
|
|
1247
|
-
task:
|
|
1248
|
-
model:
|
|
1340
|
+
steps: z10.array(workflowStepDefSchema).min(1).max(8).optional(),
|
|
1341
|
+
task: z10.string().min(1).max(1e5, "must be at most 100000 characters"),
|
|
1342
|
+
model: z10.string().optional(),
|
|
1249
1343
|
/** Reasoning-effort pin (#45). Omit for the harness default; empty/`auto` stay implicit. */
|
|
1250
|
-
effort:
|
|
1344
|
+
effort: z10.string().max(32).optional(),
|
|
1251
1345
|
runner: runnerSchema.optional(),
|
|
1252
1346
|
/** Agent account for this task (spec 2026-07-29-agent-profiles). Omit to follow the
|
|
1253
1347
|
* project's own selection; an id that no longer exists is a 400, not a silent default. */
|
|
1254
|
-
agentProfile:
|
|
1348
|
+
agentProfile: z10.string().max(64).optional(),
|
|
1255
1349
|
/** 1–3. Above 1 the response is `{ runs }` rather than a single record. */
|
|
1256
|
-
variants:
|
|
1350
|
+
variants: z10.number().int().min(1).max(3).optional(),
|
|
1257
1351
|
/** false → run in the repo working tree instead of an isolated worktree (read-only skills).
|
|
1258
1352
|
* Omit for the default. Ignored server-side when variants > 1. */
|
|
1259
|
-
worktree:
|
|
1353
|
+
worktree: z10.boolean().optional(),
|
|
1260
1354
|
/** true → autonomous run: never parks at "waiting"; auto-continues until done. */
|
|
1261
|
-
autonomous:
|
|
1355
|
+
autonomous: z10.boolean().optional(),
|
|
1262
1356
|
/** false → keep the handoff journal but do not expose or request a follow-up todos file.
|
|
1263
1357
|
* Omit for the default (enabled); a server with the capability off pins it to false. */
|
|
1264
|
-
generateFollowups:
|
|
1358
|
+
generateFollowups: z10.boolean().optional(),
|
|
1265
1359
|
/** Per-run system-prompt override (R2 2.3) — programmatic callers only. Wins over the
|
|
1266
1360
|
* config.json default; whitespace-only degrades to absent. */
|
|
1267
|
-
systemPrompt:
|
|
1361
|
+
systemPrompt: z10.string().trim().max(2e4, "must be at most 20000 characters").optional().transform((s) => s ? s : void 0),
|
|
1268
1362
|
/** Attachments pasted into the new-task form — screenshots, and since #950 PDF/TXT/MD files
|
|
1269
1363
|
* too; delivered with the first agent step. The key keeps its name: the wire contract widened
|
|
1270
1364
|
* in place rather than growing a second list. */
|
|
1271
|
-
images:
|
|
1365
|
+
images: z10.array(attachmentInputSchema).max(4).optional(),
|
|
1272
1366
|
/** The inbox entry this task came from (#374). Best-effort bookkeeping: an unknown or
|
|
1273
1367
|
* already-started id never fails the run. For ×2/×3 the FIRST variant is recorded. */
|
|
1274
|
-
todoId:
|
|
1368
|
+
todoId: z10.string().min(1).max(200, "must be at most 200 characters").optional()
|
|
1275
1369
|
});
|
|
1276
1370
|
var createRunInputSchema = createRunInputBaseSchema.refine(
|
|
1277
1371
|
(b) => Boolean(b.workflow) !== Boolean(b.steps),
|
|
1278
1372
|
{ message: 'provide either "workflow" or "steps", not both' }
|
|
1279
1373
|
);
|
|
1280
|
-
var messageInputSchema =
|
|
1281
|
-
text:
|
|
1282
|
-
images:
|
|
1374
|
+
var messageInputSchema = z10.object({
|
|
1375
|
+
text: z10.string().max(1e5).default(""),
|
|
1376
|
+
images: z10.array(attachmentInputSchema).max(4).default([])
|
|
1283
1377
|
}).refine((m) => m.text.trim().length > 0 || m.images.length > 0, {
|
|
1284
1378
|
message: "message needs text or at least one attachment"
|
|
1285
1379
|
});
|
|
1286
|
-
var patchRunInputSchema =
|
|
1287
|
-
title:
|
|
1288
|
-
task:
|
|
1380
|
+
var patchRunInputSchema = z10.object({
|
|
1381
|
+
title: z10.string().trim().min(1).max(300).optional(),
|
|
1382
|
+
task: z10.string().trim().min(1).max(1e5).optional()
|
|
1289
1383
|
});
|
|
1290
|
-
var pinRunInputSchema =
|
|
1384
|
+
var pinRunInputSchema = z10.object({ pinned: z10.boolean().optional() });
|
|
1291
1385
|
|
|
1292
1386
|
// ../contract/src/repo.ts
|
|
1293
|
-
import { z as
|
|
1294
|
-
var statusEntrySchema =
|
|
1295
|
-
status:
|
|
1296
|
-
path:
|
|
1297
|
-
});
|
|
1298
|
-
var logEntrySchema =
|
|
1299
|
-
hash:
|
|
1300
|
-
subject:
|
|
1301
|
-
author:
|
|
1302
|
-
when:
|
|
1303
|
-
});
|
|
1304
|
-
var repoResponseSchema =
|
|
1305
|
-
|
|
1306
|
-
info:
|
|
1307
|
-
status:
|
|
1308
|
-
log:
|
|
1309
|
-
branches:
|
|
1310
|
-
baseBranch:
|
|
1387
|
+
import { z as z11 } from "zod";
|
|
1388
|
+
var statusEntrySchema = z11.object({
|
|
1389
|
+
status: z11.string(),
|
|
1390
|
+
path: z11.string()
|
|
1391
|
+
});
|
|
1392
|
+
var logEntrySchema = z11.object({
|
|
1393
|
+
hash: z11.string(),
|
|
1394
|
+
subject: z11.string(),
|
|
1395
|
+
author: z11.string(),
|
|
1396
|
+
when: z11.string()
|
|
1397
|
+
});
|
|
1398
|
+
var repoResponseSchema = z11.union([
|
|
1399
|
+
z11.object({
|
|
1400
|
+
info: z11.null(),
|
|
1401
|
+
status: z11.array(z11.never()),
|
|
1402
|
+
log: z11.array(z11.never()),
|
|
1403
|
+
branches: z11.array(z11.never()),
|
|
1404
|
+
baseBranch: z11.null()
|
|
1311
1405
|
}),
|
|
1312
|
-
|
|
1406
|
+
z11.object({
|
|
1313
1407
|
info: repoInfoSchema,
|
|
1314
|
-
status:
|
|
1315
|
-
log:
|
|
1316
|
-
branches:
|
|
1317
|
-
baseBranch:
|
|
1408
|
+
status: z11.array(statusEntrySchema),
|
|
1409
|
+
log: z11.array(logEntrySchema),
|
|
1410
|
+
branches: z11.array(z11.string()),
|
|
1411
|
+
baseBranch: z11.string().nullable()
|
|
1318
1412
|
})
|
|
1319
1413
|
]);
|
|
1320
|
-
var repoBranchResponseSchema =
|
|
1321
|
-
branch:
|
|
1322
|
-
created:
|
|
1323
|
-
});
|
|
1324
|
-
var repoPullBranchesResponseSchema =
|
|
1325
|
-
var repoPullInputSchema =
|
|
1326
|
-
branch:
|
|
1327
|
-
confirm:
|
|
1328
|
-
});
|
|
1329
|
-
var repoPullResponseSchema =
|
|
1330
|
-
branch:
|
|
1331
|
-
pulled:
|
|
1332
|
-
summary:
|
|
1333
|
-
});
|
|
1334
|
-
var repoPullConfirmationSchema =
|
|
1335
|
-
error:
|
|
1336
|
-
branch:
|
|
1337
|
-
risks:
|
|
1338
|
-
});
|
|
1339
|
-
var repoPullErrorSchema =
|
|
1414
|
+
var repoBranchResponseSchema = z11.object({
|
|
1415
|
+
branch: z11.string(),
|
|
1416
|
+
created: z11.boolean()
|
|
1417
|
+
});
|
|
1418
|
+
var repoPullBranchesResponseSchema = z11.object({ branches: z11.array(z11.string()) });
|
|
1419
|
+
var repoPullInputSchema = z11.object({
|
|
1420
|
+
branch: z11.string().trim().min(1).max(200).optional(),
|
|
1421
|
+
confirm: z11.boolean().optional()
|
|
1422
|
+
});
|
|
1423
|
+
var repoPullResponseSchema = z11.object({
|
|
1424
|
+
branch: z11.string(),
|
|
1425
|
+
pulled: z11.literal(true),
|
|
1426
|
+
summary: z11.string()
|
|
1427
|
+
});
|
|
1428
|
+
var repoPullConfirmationSchema = z11.object({
|
|
1429
|
+
error: z11.string(),
|
|
1430
|
+
branch: z11.string(),
|
|
1431
|
+
risks: z11.array(z11.enum(["active_runs", "dirty_tree"]))
|
|
1432
|
+
});
|
|
1433
|
+
var repoPullErrorSchema = z11.union([
|
|
1340
1434
|
repoPullConfirmationSchema,
|
|
1341
|
-
|
|
1435
|
+
z11.object({ error: z11.string() })
|
|
1342
1436
|
]);
|
|
1343
|
-
var diffStatSchema2 =
|
|
1344
|
-
adds:
|
|
1345
|
-
dels:
|
|
1346
|
-
files:
|
|
1437
|
+
var diffStatSchema2 = z11.object({
|
|
1438
|
+
adds: z11.number(),
|
|
1439
|
+
dels: z11.number(),
|
|
1440
|
+
files: z11.number()
|
|
1347
1441
|
});
|
|
1348
|
-
var changedFileSchema =
|
|
1349
|
-
path:
|
|
1442
|
+
var changedFileSchema = z11.object({
|
|
1443
|
+
path: z11.string(),
|
|
1350
1444
|
/** Rename/copy source — present only when `status` is renamed/copied. */
|
|
1351
|
-
oldPath:
|
|
1352
|
-
status:
|
|
1353
|
-
adds:
|
|
1354
|
-
dels:
|
|
1445
|
+
oldPath: z11.string().optional(),
|
|
1446
|
+
status: z11.enum(["added", "modified", "deleted", "renamed", "copied"]),
|
|
1447
|
+
adds: z11.number(),
|
|
1448
|
+
dels: z11.number(),
|
|
1355
1449
|
/** Binary per numstat — there is no text patch to render. */
|
|
1356
|
-
binary:
|
|
1450
|
+
binary: z11.boolean(),
|
|
1357
1451
|
/** True when the path is one the raw-bytes route serves as an `<img>` (#365) — present only
|
|
1358
1452
|
* when true, so old clients that never read it stay correct. */
|
|
1359
|
-
image:
|
|
1453
|
+
image: z11.boolean().optional(),
|
|
1360
1454
|
/** This file's unified-diff section; possibly `… (patch truncated)`, possibly empty. */
|
|
1361
|
-
patch:
|
|
1455
|
+
patch: z11.string()
|
|
1362
1456
|
});
|
|
1363
|
-
var changesPayloadSchema =
|
|
1364
|
-
files:
|
|
1457
|
+
var changesPayloadSchema = z11.object({
|
|
1458
|
+
files: z11.array(changedFileSchema),
|
|
1365
1459
|
stat: diffStatSchema2,
|
|
1366
1460
|
/** Additive context for review tasks whose worktree HEAD no longer matches their own branch. */
|
|
1367
|
-
repointedHead:
|
|
1461
|
+
repointedHead: z11.object({ headBranch: z11.string(), taskBranch: z11.string() }).optional()
|
|
1368
1462
|
});
|
|
1369
|
-
var repoCommitPayloadSchema =
|
|
1370
|
-
sha:
|
|
1371
|
-
subject:
|
|
1372
|
-
author:
|
|
1463
|
+
var repoCommitPayloadSchema = z11.object({
|
|
1464
|
+
sha: z11.string(),
|
|
1465
|
+
subject: z11.string(),
|
|
1466
|
+
author: z11.string(),
|
|
1373
1467
|
/** Relative time ("3 hours ago") — same `%cr` format as the /api/v1/repo log. */
|
|
1374
|
-
when:
|
|
1375
|
-
files:
|
|
1468
|
+
when: z11.string(),
|
|
1469
|
+
files: z11.array(changedFileSchema),
|
|
1376
1470
|
stat: diffStatSchema2
|
|
1377
1471
|
});
|
|
1378
|
-
var worktreeDirEntrySchema =
|
|
1379
|
-
name:
|
|
1380
|
-
type:
|
|
1381
|
-
size:
|
|
1382
|
-
});
|
|
1383
|
-
var worktreeEntrySchema =
|
|
1384
|
-
|
|
1385
|
-
type:
|
|
1386
|
-
path:
|
|
1387
|
-
entries:
|
|
1472
|
+
var worktreeDirEntrySchema = z11.object({
|
|
1473
|
+
name: z11.string(),
|
|
1474
|
+
type: z11.enum(["dir", "file"]),
|
|
1475
|
+
size: z11.number().optional()
|
|
1476
|
+
});
|
|
1477
|
+
var worktreeEntrySchema = z11.discriminatedUnion("type", [
|
|
1478
|
+
z11.object({
|
|
1479
|
+
type: z11.literal("dir"),
|
|
1480
|
+
path: z11.string(),
|
|
1481
|
+
entries: z11.array(worktreeDirEntrySchema)
|
|
1388
1482
|
}),
|
|
1389
|
-
|
|
1390
|
-
type:
|
|
1391
|
-
path:
|
|
1392
|
-
size:
|
|
1393
|
-
binary:
|
|
1394
|
-
tooLarge:
|
|
1395
|
-
content:
|
|
1483
|
+
z11.object({
|
|
1484
|
+
type: z11.literal("file"),
|
|
1485
|
+
path: z11.string(),
|
|
1486
|
+
size: z11.number(),
|
|
1487
|
+
binary: z11.boolean(),
|
|
1488
|
+
tooLarge: z11.boolean(),
|
|
1489
|
+
content: z11.string().optional()
|
|
1396
1490
|
})
|
|
1397
1491
|
]);
|
|
1398
|
-
var worktreeRunStatusSchema =
|
|
1492
|
+
var worktreeRunStatusSchema = z11.enum([
|
|
1399
1493
|
"queued",
|
|
1400
1494
|
"running",
|
|
1401
1495
|
"waiting",
|
|
@@ -1404,41 +1498,41 @@ var worktreeRunStatusSchema = z10.enum([
|
|
|
1404
1498
|
"failed",
|
|
1405
1499
|
"cancelled"
|
|
1406
1500
|
]);
|
|
1407
|
-
var worktreeInfoSchema =
|
|
1408
|
-
runId:
|
|
1409
|
-
title:
|
|
1501
|
+
var worktreeInfoSchema = z11.object({
|
|
1502
|
+
runId: z11.string(),
|
|
1503
|
+
title: z11.string(),
|
|
1410
1504
|
status: worktreeRunStatusSchema,
|
|
1411
|
-
branch:
|
|
1412
|
-
sizeBytes:
|
|
1413
|
-
finishedAt:
|
|
1414
|
-
reclaimable:
|
|
1505
|
+
branch: z11.string().nullable(),
|
|
1506
|
+
sizeBytes: z11.number().nullable(),
|
|
1507
|
+
finishedAt: z11.string().nullable(),
|
|
1508
|
+
reclaimable: z11.boolean()
|
|
1415
1509
|
});
|
|
1416
|
-
var worktreesResponseSchema =
|
|
1417
|
-
worktrees:
|
|
1418
|
-
totalBytes:
|
|
1419
|
-
keep:
|
|
1510
|
+
var worktreesResponseSchema = z11.object({
|
|
1511
|
+
worktrees: z11.array(worktreeInfoSchema),
|
|
1512
|
+
totalBytes: z11.number().nullable(),
|
|
1513
|
+
keep: z11.number()
|
|
1420
1514
|
});
|
|
1421
|
-
var reclaimWorktreesResponseSchema =
|
|
1422
|
-
reclaimed:
|
|
1515
|
+
var reclaimWorktreesResponseSchema = z11.object({
|
|
1516
|
+
reclaimed: z11.array(z11.string())
|
|
1423
1517
|
});
|
|
1424
1518
|
|
|
1425
1519
|
// ../contract/src/projects.ts
|
|
1426
|
-
import { z as
|
|
1427
|
-
var projectListEntrySchema =
|
|
1428
|
-
id:
|
|
1429
|
-
name:
|
|
1520
|
+
import { z as z12 } from "zod";
|
|
1521
|
+
var projectListEntrySchema = z12.object({
|
|
1522
|
+
id: z12.string(),
|
|
1523
|
+
name: z12.string(),
|
|
1430
1524
|
/** Absolute, realpath-normalized repo root. */
|
|
1431
|
-
root:
|
|
1432
|
-
addedAt:
|
|
1433
|
-
lastOpenedAt:
|
|
1434
|
-
source:
|
|
1525
|
+
root: z12.string(),
|
|
1526
|
+
addedAt: z12.string(),
|
|
1527
|
+
lastOpenedAt: z12.string(),
|
|
1528
|
+
source: z12.enum(["local", "checkout"]),
|
|
1435
1529
|
/** `not-git` is fully usable (degraded single-queue mode); only `missing` blocks. */
|
|
1436
|
-
status:
|
|
1530
|
+
status: z12.enum(["ok", "missing", "not-git"]),
|
|
1437
1531
|
/** Current branch when cheaply available (omitted e.g. on an unborn HEAD). */
|
|
1438
|
-
branch:
|
|
1532
|
+
branch: z12.string().optional(),
|
|
1439
1533
|
/** Which forge this project's remote belongs to (#698) — classified server-side from the
|
|
1440
1534
|
* remote URL alone. Gates the project group's GitHub nav item; omitted = no forge remote. */
|
|
1441
|
-
forge:
|
|
1535
|
+
forge: z12.literal("github").optional(),
|
|
1442
1536
|
/**
|
|
1443
1537
|
* The remote's web root, `https://github.com/owner/repo`. Rebuilt server-side from the parsed
|
|
1444
1538
|
* remote rather than passed through, so a remote carrying credentials cannot leak into the
|
|
@@ -1448,10 +1542,10 @@ var projectListEntrySchema = z11.object({
|
|
|
1448
1542
|
* the global Tasks page has one row per project, so it cannot use any single repo's base the
|
|
1449
1543
|
* way a project-scoped view can. With this, every reference it shows is a link.
|
|
1450
1544
|
*/
|
|
1451
|
-
repoUrl:
|
|
1545
|
+
repoUrl: z12.string().optional(),
|
|
1452
1546
|
/** Per-project cap on concurrently running tasks (spec 2026-07-22). Omitted = inherit the
|
|
1453
1547
|
* workspace `resources.maxParallel`; a number pins this project. */
|
|
1454
|
-
maxParallel:
|
|
1548
|
+
maxParallel: z12.number().optional(),
|
|
1455
1549
|
/**
|
|
1456
1550
|
* Free-form labels grouping CONNECTED repositories — a `storefront` tag on the API, the web
|
|
1457
1551
|
* app and the design system says those three are one piece of work spread over three repos.
|
|
@@ -1463,85 +1557,85 @@ var projectListEntrySchema = z11.object({
|
|
|
1463
1557
|
* server-side (trimmed, deduped case-insensitively, sorted), so a consumer may compare them
|
|
1464
1558
|
* directly.
|
|
1465
1559
|
*/
|
|
1466
|
-
tags:
|
|
1560
|
+
tags: z12.array(z12.string()).optional()
|
|
1467
1561
|
});
|
|
1468
|
-
var projectsResponseSchema =
|
|
1469
|
-
projects:
|
|
1470
|
-
bootProject:
|
|
1471
|
-
projectsDir:
|
|
1562
|
+
var projectsResponseSchema = z12.object({
|
|
1563
|
+
projects: z12.array(projectListEntrySchema),
|
|
1564
|
+
bootProject: z12.string(),
|
|
1565
|
+
projectsDir: z12.string()
|
|
1472
1566
|
});
|
|
1473
|
-
var registerProjectResponseSchema =
|
|
1567
|
+
var registerProjectResponseSchema = z12.object({
|
|
1474
1568
|
project: projectListEntrySchema,
|
|
1475
|
-
error:
|
|
1569
|
+
error: z12.string().optional()
|
|
1476
1570
|
});
|
|
1477
|
-
var removeProjectResponseSchema =
|
|
1478
|
-
removed:
|
|
1479
|
-
id:
|
|
1571
|
+
var removeProjectResponseSchema = z12.object({
|
|
1572
|
+
removed: z12.literal(true),
|
|
1573
|
+
id: z12.string()
|
|
1480
1574
|
});
|
|
1481
|
-
var updateProjectResponseSchema =
|
|
1575
|
+
var updateProjectResponseSchema = z12.object({
|
|
1482
1576
|
project: projectListEntrySchema
|
|
1483
1577
|
});
|
|
1484
1578
|
var PROJECT_TAG_MAX_LENGTH = 32;
|
|
1485
1579
|
var PROJECT_TAGS_MAX = 20;
|
|
1486
|
-
var updateProjectInputSchema =
|
|
1487
|
-
maxParallel:
|
|
1488
|
-
tags:
|
|
1580
|
+
var updateProjectInputSchema = z12.object({
|
|
1581
|
+
maxParallel: z12.number().int().min(1).max(16).nullable().optional(),
|
|
1582
|
+
tags: z12.array(z12.string().trim().min(1).max(PROJECT_TAG_MAX_LENGTH)).max(PROJECT_TAGS_MAX).nullable().optional()
|
|
1489
1583
|
}).refine(
|
|
1490
1584
|
(body) => body.maxParallel !== void 0 || body.tags !== void 0,
|
|
1491
1585
|
"specify maxParallel or tags"
|
|
1492
1586
|
);
|
|
1493
|
-
var checkoutProjectInputSchema =
|
|
1494
|
-
url:
|
|
1495
|
-
name:
|
|
1496
|
-
checkoutId:
|
|
1497
|
-
});
|
|
1498
|
-
var fsBrowseDirSchema =
|
|
1499
|
-
name:
|
|
1500
|
-
path:
|
|
1587
|
+
var checkoutProjectInputSchema = z12.object({
|
|
1588
|
+
url: z12.string().trim().min(1).max(512),
|
|
1589
|
+
name: z12.string().trim().max(128).optional(),
|
|
1590
|
+
checkoutId: z12.string().trim().max(128).optional()
|
|
1591
|
+
});
|
|
1592
|
+
var fsBrowseDirSchema = z12.object({
|
|
1593
|
+
name: z12.string(),
|
|
1594
|
+
path: z12.string(),
|
|
1501
1595
|
/** Has a `.git` entry — drives the "git" badge. A non-repo folder is still selectable. */
|
|
1502
|
-
isRepo:
|
|
1596
|
+
isRepo: z12.boolean()
|
|
1503
1597
|
});
|
|
1504
|
-
var fsBrowseResponseSchema =
|
|
1598
|
+
var fsBrowseResponseSchema = z12.object({
|
|
1505
1599
|
/** The realpath'd directory actually listed — never the spelling asked for, so the breadcrumb
|
|
1506
1600
|
* shows where the picker really is. */
|
|
1507
|
-
path:
|
|
1601
|
+
path: z12.string(),
|
|
1508
1602
|
/** `null` AT the browse root: there is no "up" out of it, and the dialog must render no parent
|
|
1509
1603
|
* row rather than one that 400s. */
|
|
1510
|
-
parent:
|
|
1511
|
-
dirs:
|
|
1604
|
+
parent: z12.string().nullable(),
|
|
1605
|
+
dirs: z12.array(fsBrowseDirSchema),
|
|
1512
1606
|
/** True when the listing was capped server-side — surfaced honestly instead of showing a
|
|
1513
1607
|
* silently short list. */
|
|
1514
|
-
truncated:
|
|
1608
|
+
truncated: z12.boolean()
|
|
1515
1609
|
});
|
|
1516
|
-
var launchKeyResponseSchema =
|
|
1517
|
-
key:
|
|
1610
|
+
var launchKeyResponseSchema = z12.object({
|
|
1611
|
+
key: z12.string()
|
|
1518
1612
|
});
|
|
1519
1613
|
|
|
1520
1614
|
// ../contract/src/workspace.ts
|
|
1521
|
-
import { z as
|
|
1522
|
-
var workspaceConfigResponseSchema =
|
|
1615
|
+
import { z as z13 } from "zod";
|
|
1616
|
+
var workspaceConfigResponseSchema = z13.object({
|
|
1523
1617
|
/** Root exposed by the Add-project directory browser — stored as written (`~` kept). */
|
|
1524
|
-
browseRoot:
|
|
1618
|
+
browseRoot: z13.string(),
|
|
1525
1619
|
/** Checkout root for GUI-cloned projects — stored as written (`~` kept). */
|
|
1526
|
-
projectsDir:
|
|
1620
|
+
projectsDir: z13.string(),
|
|
1527
1621
|
/** Stored override; `null` means inherit `CEZ_SKILLS_AUTO_UPDATE`, then true. */
|
|
1528
|
-
skillsAutoUpdate:
|
|
1529
|
-
effectiveSkillsAutoUpdate:
|
|
1530
|
-
composerDefaults:
|
|
1531
|
-
autonomous:
|
|
1532
|
-
worktree:
|
|
1622
|
+
skillsAutoUpdate: z13.boolean().nullable(),
|
|
1623
|
+
effectiveSkillsAutoUpdate: z13.boolean(),
|
|
1624
|
+
composerDefaults: z13.object({
|
|
1625
|
+
autonomous: z13.boolean().nullable(),
|
|
1626
|
+
worktree: z13.boolean().nullable(),
|
|
1533
1627
|
/** `'source-dependent'` when no `CEZ_AUTONOMOUS_DEFAULT` pins it either way. */
|
|
1534
|
-
inheritedAutonomous:
|
|
1535
|
-
inheritedWorktree:
|
|
1628
|
+
inheritedAutonomous: z13.union([z13.boolean(), z13.literal("source-dependent")]),
|
|
1629
|
+
inheritedWorktree: z13.boolean()
|
|
1536
1630
|
}),
|
|
1537
|
-
resources:
|
|
1538
|
-
maxParallel:
|
|
1539
|
-
maxMonitoringSessions:
|
|
1540
|
-
monitoringWakeIntervalMinutes:
|
|
1631
|
+
resources: z13.object({
|
|
1632
|
+
maxParallel: z13.number(),
|
|
1633
|
+
maxMonitoringSessions: z13.number(),
|
|
1634
|
+
monitoringWakeIntervalMinutes: z13.number().nullable(),
|
|
1541
1635
|
/** Resume a run a provider usage limit stopped, once the limit resets. Default `true`. */
|
|
1542
|
-
autoResumeOnUsageLimit:
|
|
1543
|
-
memoryLimitMb:
|
|
1544
|
-
worktreeRetentionDefault:
|
|
1636
|
+
autoResumeOnUsageLimit: z13.boolean(),
|
|
1637
|
+
memoryLimitMb: z13.number().nullable(),
|
|
1638
|
+
worktreeRetentionDefault: z13.number()
|
|
1545
1639
|
}),
|
|
1546
1640
|
/**
|
|
1547
1641
|
* What a repo that has set none of its own runs (spec 2026-07-29-agent-profiles).
|
|
@@ -1551,121 +1645,121 @@ var workspaceConfigResponseSchema = z12.object({
|
|
|
1551
1645
|
* from a value someone chose or the fallback collapses into "always claude". Consulted only where
|
|
1552
1646
|
* the repo's own `.ai/cezar/config.json` is silent — a repo that chose is never overruled.
|
|
1553
1647
|
*/
|
|
1554
|
-
agentDefaults:
|
|
1648
|
+
agentDefaults: z13.object({
|
|
1555
1649
|
runner: runnerSchema.optional(),
|
|
1556
|
-
models:
|
|
1557
|
-
claude:
|
|
1558
|
-
codex:
|
|
1559
|
-
opencode:
|
|
1560
|
-
pi:
|
|
1561
|
-
cursor:
|
|
1650
|
+
models: z13.object({
|
|
1651
|
+
claude: z13.string().optional(),
|
|
1652
|
+
codex: z13.string().optional(),
|
|
1653
|
+
opencode: z13.string().optional(),
|
|
1654
|
+
pi: z13.string().optional(),
|
|
1655
|
+
cursor: z13.string().optional()
|
|
1562
1656
|
}).optional()
|
|
1563
1657
|
})
|
|
1564
1658
|
});
|
|
1565
|
-
var setWorkspaceConfigInputSchema =
|
|
1566
|
-
browseRoot:
|
|
1567
|
-
projectsDir:
|
|
1568
|
-
skillsAutoUpdate:
|
|
1569
|
-
composerDefaults:
|
|
1570
|
-
autonomous:
|
|
1571
|
-
worktree:
|
|
1659
|
+
var setWorkspaceConfigInputSchema = z13.object({
|
|
1660
|
+
browseRoot: z13.string().trim().min(1).max(4096).optional(),
|
|
1661
|
+
projectsDir: z13.string().trim().min(1).max(4096).optional(),
|
|
1662
|
+
skillsAutoUpdate: z13.boolean().nullable().optional(),
|
|
1663
|
+
composerDefaults: z13.object({
|
|
1664
|
+
autonomous: z13.boolean().nullable().optional(),
|
|
1665
|
+
worktree: z13.boolean().nullable().optional()
|
|
1572
1666
|
}).optional(),
|
|
1573
1667
|
/** Machine-wide agent defaults. `null` on a key CLEARS it back to "no opinion", which a bare
|
|
1574
1668
|
* absent key cannot say in a partial patch. */
|
|
1575
|
-
agentDefaults:
|
|
1669
|
+
agentDefaults: z13.object({
|
|
1576
1670
|
runner: runnerSchema.nullable().optional(),
|
|
1577
|
-
models:
|
|
1578
|
-
claude:
|
|
1579
|
-
codex:
|
|
1580
|
-
opencode:
|
|
1581
|
-
pi:
|
|
1582
|
-
cursor:
|
|
1671
|
+
models: z13.object({
|
|
1672
|
+
claude: z13.string().trim().min(1).max(200).nullable().optional(),
|
|
1673
|
+
codex: z13.string().trim().min(1).max(200).nullable().optional(),
|
|
1674
|
+
opencode: z13.string().trim().min(1).max(200).nullable().optional(),
|
|
1675
|
+
pi: z13.string().trim().min(1).max(200).nullable().optional(),
|
|
1676
|
+
cursor: z13.string().trim().min(1).max(200).nullable().optional()
|
|
1583
1677
|
}).optional()
|
|
1584
1678
|
}).optional(),
|
|
1585
|
-
resources:
|
|
1586
|
-
maxParallel:
|
|
1587
|
-
maxMonitoringSessions:
|
|
1588
|
-
monitoringWakeIntervalMinutes:
|
|
1589
|
-
autoResumeOnUsageLimit:
|
|
1590
|
-
memoryLimitMb:
|
|
1591
|
-
worktreeRetentionDefault:
|
|
1679
|
+
resources: z13.object({
|
|
1680
|
+
maxParallel: z13.number().int().min(1).max(16).optional(),
|
|
1681
|
+
maxMonitoringSessions: z13.number().int().min(0).max(16).optional(),
|
|
1682
|
+
monitoringWakeIntervalMinutes: z13.number().int().min(1).max(60).nullable().optional(),
|
|
1683
|
+
autoResumeOnUsageLimit: z13.boolean().optional(),
|
|
1684
|
+
memoryLimitMb: z13.number().int().min(0).max(1048576).nullable().optional(),
|
|
1685
|
+
worktreeRetentionDefault: z13.number().int().min(0).max(1e3).optional()
|
|
1592
1686
|
}).optional()
|
|
1593
1687
|
});
|
|
1594
|
-
var appearanceSchema =
|
|
1595
|
-
accent:
|
|
1596
|
-
density:
|
|
1597
|
-
width:
|
|
1688
|
+
var appearanceSchema = z13.object({
|
|
1689
|
+
accent: z13.enum(["cezarion", "lime", "violet"]).optional(),
|
|
1690
|
+
density: z13.enum(["comfortable", "compact", "ultra"]).optional(),
|
|
1691
|
+
width: z13.enum(["narrow", "wide"]).optional()
|
|
1598
1692
|
});
|
|
1599
|
-
var taskTableUiStateSchema =
|
|
1693
|
+
var taskTableUiStateSchema = z13.looseObject({
|
|
1600
1694
|
/** Explicit user choices only. Missing ids keep the registry-owned default. */
|
|
1601
|
-
expandedColumns:
|
|
1695
|
+
expandedColumns: z13.record(z13.string(), z13.boolean()).optional()
|
|
1602
1696
|
});
|
|
1603
|
-
var uiStateSchema =
|
|
1697
|
+
var uiStateSchema = z13.looseObject({
|
|
1604
1698
|
/** What the last started run used. `null` is a VALUE, not an absence: it records a run that
|
|
1605
1699
|
* chose neither a skill nor a workflow (the plain built-in `quick-task`), which the composer
|
|
1606
1700
|
* can now express since the source picker grew an empty state. Absent still means "no
|
|
1607
1701
|
* run has been recorded here" — a cockpit reading either one selects nothing. */
|
|
1608
|
-
lastTask:
|
|
1702
|
+
lastTask: z13.object({ source: z13.enum(["workflow", "skill"]), ref: z13.string() }).nullable().optional(),
|
|
1609
1703
|
/** Most-recently-run sources, newest first (deduped, capped). Feeds the composer picker's
|
|
1610
1704
|
* recency sort. */
|
|
1611
|
-
recentSources:
|
|
1705
|
+
recentSources: z13.array(z13.object({ source: z13.enum(["workflow", "skill"]), ref: z13.string() })).optional(),
|
|
1612
1706
|
/** The last worktree choice for a single-skill run. Absent → the default (isolated worktree). */
|
|
1613
|
-
lastWorktree:
|
|
1707
|
+
lastWorktree: z13.boolean().optional(),
|
|
1614
1708
|
/** The last autonomous choice — remembered like `lastWorktree`. Absent → off. */
|
|
1615
|
-
lastAutonomous:
|
|
1709
|
+
lastAutonomous: z13.boolean().optional(),
|
|
1616
1710
|
/** Whether new runs should ask agents to append follow-up work. Absent → on. */
|
|
1617
|
-
lastGenerateFollowups:
|
|
1711
|
+
lastGenerateFollowups: z13.boolean().optional(),
|
|
1618
1712
|
/** Skill selection frequency (#408): name → times chosen, across BOTH composers. */
|
|
1619
|
-
skillUsage:
|
|
1620
|
-
runsView:
|
|
1713
|
+
skillUsage: z13.record(z13.string(), z13.number()).optional(),
|
|
1714
|
+
runsView: z13.enum(["list", "table"]).optional(),
|
|
1621
1715
|
/** The GitHub tab's last-selected sub-tab (#417). Absent → issues. */
|
|
1622
|
-
githubView:
|
|
1716
|
+
githubView: z13.enum(["issues", "prs"]).optional(),
|
|
1623
1717
|
/** Settings → Appearance. The theme itself stays in localStorage (`cez-theme`) — it must
|
|
1624
1718
|
* pre-paint, and it is per-browser by design. */
|
|
1625
1719
|
appearance: appearanceSchema.optional(),
|
|
1626
1720
|
/** Follow-up prompt templates (#413). Absent → the built-in defaults; present (even `[]`) is
|
|
1627
1721
|
* the user's own edited list. `skills` are the skill names the template auto-applies for. */
|
|
1628
|
-
promptTemplates:
|
|
1629
|
-
|
|
1630
|
-
id:
|
|
1631
|
-
label:
|
|
1632
|
-
text:
|
|
1633
|
-
skills:
|
|
1722
|
+
promptTemplates: z13.array(
|
|
1723
|
+
z13.object({
|
|
1724
|
+
id: z13.string(),
|
|
1725
|
+
label: z13.string(),
|
|
1726
|
+
text: z13.string(),
|
|
1727
|
+
skills: z13.array(z13.string()).optional()
|
|
1634
1728
|
})
|
|
1635
1729
|
).optional(),
|
|
1636
1730
|
/** The open-mercato/skills promo banner (#391), dismissed for good. Legacy — the banner is
|
|
1637
1731
|
* gone, replaced by `WorkspaceUiState.importedSkills`; retained so old files round-trip. */
|
|
1638
|
-
dismissedSkillsBanner:
|
|
1732
|
+
dismissedSkillsBanner: z13.boolean().optional()
|
|
1639
1733
|
});
|
|
1640
|
-
var workspaceLastLocationSchema =
|
|
1641
|
-
projectId:
|
|
1642
|
-
pathname:
|
|
1643
|
-
search:
|
|
1644
|
-
hash:
|
|
1734
|
+
var workspaceLastLocationSchema = z13.strictObject({
|
|
1735
|
+
projectId: z13.string().min(1).max(64),
|
|
1736
|
+
pathname: z13.string().min(1).max(2048).startsWith("/p/"),
|
|
1737
|
+
search: z13.string().max(4096).startsWith("?").optional(),
|
|
1738
|
+
hash: z13.string().max(2048).startsWith("#").optional()
|
|
1645
1739
|
});
|
|
1646
|
-
var workspaceUiStateSchema =
|
|
1740
|
+
var workspaceUiStateSchema = z13.looseObject({
|
|
1647
1741
|
/** LEGACY — the sidebar's per-project collapse map (step 3.3). Still accepted and still
|
|
1648
1742
|
* round-tripped so an older cockpit sharing this home keeps working, but the current cockpit
|
|
1649
1743
|
* neither reads nor writes it: which groups are shut describes the WINDOW, not the workspace,
|
|
1650
1744
|
* so it lives in that browser's localStorage (`packages/web/src/lib/sidebar-collapse.ts`).
|
|
1651
1745
|
* One shared answer meant a phone collapsing a group collapsed it on the desktop too. */
|
|
1652
|
-
sidebar:
|
|
1746
|
+
sidebar: z13.looseObject({ collapsed: z13.record(z13.string(), z13.boolean()).optional() }).optional(),
|
|
1653
1747
|
/** Dismissed runtime-auth incident IDs, keyed by provider. An ID is only dismissed until the
|
|
1654
1748
|
* provider reports a different incident, so this stays workspace-global with the browser
|
|
1655
1749
|
* rather than one project checkout. */
|
|
1656
|
-
dismissedProviderAuthFailures:
|
|
1657
|
-
claude:
|
|
1658
|
-
codex:
|
|
1659
|
-
opencode:
|
|
1660
|
-
pi:
|
|
1661
|
-
cursor:
|
|
1750
|
+
dismissedProviderAuthFailures: z13.object({
|
|
1751
|
+
claude: z13.string().optional(),
|
|
1752
|
+
codex: z13.string().optional(),
|
|
1753
|
+
opencode: z13.string().optional(),
|
|
1754
|
+
pi: z13.string().optional(),
|
|
1755
|
+
cursor: z13.string().optional()
|
|
1662
1756
|
}).optional(),
|
|
1663
1757
|
/** Settings → Appearance, GLOBAL since step 3.5: accent + density describe the person at the
|
|
1664
1758
|
* keyboard, not a repo. */
|
|
1665
1759
|
appearance: appearanceSchema.optional(),
|
|
1666
1760
|
/** Settings → Notifications, GLOBAL since step 3.5 — one answer for the whole workspace, since
|
|
1667
1761
|
* the delivering browser is one browser whichever project you are looking at. */
|
|
1668
|
-
notifications:
|
|
1762
|
+
notifications: z13.looseObject({ enabled: z13.boolean().optional() }).optional(),
|
|
1669
1763
|
/** Desktop Tasks-table density, shared across every project in this workspace. */
|
|
1670
1764
|
taskTable: taskTableUiStateSchema.optional(),
|
|
1671
1765
|
/** LEGACY, exactly like `sidebar` above — the last settled project-scoped page, restored when
|
|
@@ -1676,27 +1770,27 @@ var workspaceUiStateSchema = z12.looseObject({
|
|
|
1676
1770
|
/** The user's curated selection of default (vendor) skills. Tri-state: ABSENT means "not
|
|
1677
1771
|
* curated", so every default skill shows; a PRESENT array (even `[]`) means only those names
|
|
1678
1772
|
* show from that repo. */
|
|
1679
|
-
importedSkills:
|
|
1773
|
+
importedSkills: z13.array(z13.string()).optional()
|
|
1680
1774
|
});
|
|
1681
1775
|
var WORKSPACE_UI_STATE_MAX_KEYS = 200;
|
|
1682
1776
|
var TASK_TABLE_MAX_COLUMNS = 50;
|
|
1683
|
-
var setWorkspaceUiStateInputSchema =
|
|
1777
|
+
var setWorkspaceUiStateInputSchema = z13.looseObject({
|
|
1684
1778
|
...workspaceUiStateSchema.shape,
|
|
1685
|
-
sidebar:
|
|
1686
|
-
collapsed:
|
|
1779
|
+
sidebar: z13.looseObject({
|
|
1780
|
+
collapsed: z13.record(z13.string().min(1).max(64), z13.boolean()).refine((map) => Object.keys(map).length <= WORKSPACE_UI_STATE_MAX_KEYS, {
|
|
1687
1781
|
message: `sidebar.collapsed must have at most ${WORKSPACE_UI_STATE_MAX_KEYS} entries`
|
|
1688
1782
|
}).optional()
|
|
1689
1783
|
}).optional(),
|
|
1690
|
-
dismissedProviderAuthFailures:
|
|
1691
|
-
claude:
|
|
1692
|
-
codex:
|
|
1693
|
-
opencode:
|
|
1694
|
-
pi:
|
|
1695
|
-
cursor:
|
|
1784
|
+
dismissedProviderAuthFailures: z13.strictObject({
|
|
1785
|
+
claude: z13.string().min(1).max(128).optional(),
|
|
1786
|
+
codex: z13.string().min(1).max(128).optional(),
|
|
1787
|
+
opencode: z13.string().min(1).max(128).optional(),
|
|
1788
|
+
pi: z13.string().min(1).max(128).optional(),
|
|
1789
|
+
cursor: z13.string().min(1).max(128).optional()
|
|
1696
1790
|
}).optional(),
|
|
1697
|
-
importedSkills:
|
|
1791
|
+
importedSkills: z13.array(z13.string().min(1).max(200)).max(WORKSPACE_UI_STATE_MAX_KEYS).optional(),
|
|
1698
1792
|
taskTable: taskTableUiStateSchema.extend({
|
|
1699
|
-
expandedColumns:
|
|
1793
|
+
expandedColumns: z13.record(z13.string().min(1).max(64), z13.boolean()).refine((map) => Object.keys(map).length <= TASK_TABLE_MAX_COLUMNS, {
|
|
1700
1794
|
message: `taskTable.expandedColumns must have at most ${TASK_TABLE_MAX_COLUMNS} entries`
|
|
1701
1795
|
}).optional()
|
|
1702
1796
|
}).optional()
|
|
@@ -1708,56 +1802,56 @@ var setWorkspaceUiStateInputSchema = z12.looseObject({
|
|
|
1708
1802
|
});
|
|
1709
1803
|
}
|
|
1710
1804
|
});
|
|
1711
|
-
var runnerModelsSchema =
|
|
1712
|
-
claude:
|
|
1713
|
-
codex:
|
|
1714
|
-
opencode:
|
|
1715
|
-
pi:
|
|
1716
|
-
cursor:
|
|
1805
|
+
var runnerModelsSchema = z13.object({
|
|
1806
|
+
claude: z13.string().optional(),
|
|
1807
|
+
codex: z13.string().optional(),
|
|
1808
|
+
opencode: z13.string().optional(),
|
|
1809
|
+
pi: z13.string().optional(),
|
|
1810
|
+
cursor: z13.string().optional()
|
|
1717
1811
|
});
|
|
1718
|
-
var configResponseSchema =
|
|
1719
|
-
baseBranch:
|
|
1812
|
+
var configResponseSchema = z13.object({
|
|
1813
|
+
baseBranch: z13.string().nullable(),
|
|
1720
1814
|
defaultRunner: runnerSchema,
|
|
1721
|
-
systemPrompt:
|
|
1815
|
+
systemPrompt: z13.string().nullable(),
|
|
1722
1816
|
defaultModels: runnerModelsSchema,
|
|
1723
1817
|
/** True when native coding-agent settings are authoritative and model picks are read-only. */
|
|
1724
|
-
modelsLocked:
|
|
1818
|
+
modelsLocked: z13.boolean(),
|
|
1725
1819
|
/** How many tasks run at once (1–16). */
|
|
1726
|
-
maxParallel:
|
|
1820
|
+
maxParallel: z13.number(),
|
|
1727
1821
|
/** Per-task memory ceiling in MiB (whole process tree); null = no limit. */
|
|
1728
|
-
memoryLimitMb:
|
|
1822
|
+
memoryLimitMb: z13.number().nullable(),
|
|
1729
1823
|
/** Keep the last N finished worktrees on disk (#483); 0 = unlimited. Older ones are reclaimed
|
|
1730
1824
|
* (directory only — branch kept, so work is recoverable). */
|
|
1731
|
-
worktreeRetention:
|
|
1825
|
+
worktreeRetention: z13.number(),
|
|
1732
1826
|
/** Live title updates: null = no config key, the `CEZ_TITLE_UPDATES` env default (ON) decides. */
|
|
1733
|
-
liveTitleUpdates:
|
|
1827
|
+
liveTitleUpdates: z13.boolean().nullable(),
|
|
1734
1828
|
/** Optional review gate (#489): null = no config key, the `CEZ_REVIEW_GATE` env default (OFF)
|
|
1735
1829
|
* decides. */
|
|
1736
|
-
reviewGate:
|
|
1830
|
+
reviewGate: z13.boolean().nullable()
|
|
1737
1831
|
});
|
|
1738
1832
|
var setConfigResponseSchema = configResponseSchema;
|
|
1739
|
-
var setConfigInputSchema =
|
|
1740
|
-
baseBranch:
|
|
1833
|
+
var setConfigInputSchema = z13.object({
|
|
1834
|
+
baseBranch: z13.string().trim().min(1).max(200).nullable().optional(),
|
|
1741
1835
|
defaultRunner: runnerSchema.optional(),
|
|
1742
|
-
systemPrompt:
|
|
1743
|
-
defaultModels:
|
|
1744
|
-
claude:
|
|
1745
|
-
codex:
|
|
1746
|
-
opencode:
|
|
1747
|
-
pi:
|
|
1748
|
-
cursor:
|
|
1836
|
+
systemPrompt: z13.string().trim().max(2e4).nullable().optional(),
|
|
1837
|
+
defaultModels: z13.object({
|
|
1838
|
+
claude: z13.string().trim().max(200).nullable().optional(),
|
|
1839
|
+
codex: z13.string().trim().max(200).nullable().optional(),
|
|
1840
|
+
opencode: z13.string().trim().max(200).nullable().optional(),
|
|
1841
|
+
pi: z13.string().trim().max(200).nullable().optional(),
|
|
1842
|
+
cursor: z13.string().trim().max(200).nullable().optional()
|
|
1749
1843
|
}).optional(),
|
|
1750
|
-
maxParallel:
|
|
1844
|
+
maxParallel: z13.number().int().min(1).max(16).optional(),
|
|
1751
1845
|
/** null or 0 clears the ceiling back to "no limit". */
|
|
1752
|
-
memoryLimitMb:
|
|
1846
|
+
memoryLimitMb: z13.number().int().min(0).max(1048576).nullable().optional(),
|
|
1753
1847
|
/** Keep last N finished worktrees (#483); 0 = unlimited, null clears back to the default (10). */
|
|
1754
|
-
worktreeRetention:
|
|
1848
|
+
worktreeRetention: z13.number().int().min(0).max(1e3).nullable().optional(),
|
|
1755
1849
|
/** null clears the key back to the env-default behavior. */
|
|
1756
|
-
liveTitleUpdates:
|
|
1850
|
+
liveTitleUpdates: z13.boolean().nullable().optional(),
|
|
1757
1851
|
/** null clears the key back to the env-default behavior (OFF). */
|
|
1758
|
-
reviewGate:
|
|
1852
|
+
reviewGate: z13.boolean().nullable().optional()
|
|
1759
1853
|
});
|
|
1760
|
-
var skillsUpdateStatusSchema =
|
|
1854
|
+
var skillsUpdateStatusSchema = z13.enum([
|
|
1761
1855
|
"idle",
|
|
1762
1856
|
"checking",
|
|
1763
1857
|
"available",
|
|
@@ -1766,225 +1860,225 @@ var skillsUpdateStatusSchema = z12.enum([
|
|
|
1766
1860
|
"unavailable",
|
|
1767
1861
|
"error"
|
|
1768
1862
|
]);
|
|
1769
|
-
var skillsUpdateScopeStateSchema =
|
|
1770
|
-
scope:
|
|
1863
|
+
var skillsUpdateScopeStateSchema = z13.object({
|
|
1864
|
+
scope: z13.enum(["project", "global"]),
|
|
1771
1865
|
status: skillsUpdateStatusSchema,
|
|
1772
|
-
available:
|
|
1773
|
-
skills:
|
|
1774
|
-
checkedAt:
|
|
1775
|
-
updatedAt:
|
|
1776
|
-
reason:
|
|
1866
|
+
available: z13.boolean(),
|
|
1867
|
+
skills: z13.array(z13.string()),
|
|
1868
|
+
checkedAt: z13.string().nullable(),
|
|
1869
|
+
updatedAt: z13.string().nullable(),
|
|
1870
|
+
reason: z13.string().optional()
|
|
1777
1871
|
});
|
|
1778
|
-
var skillsUpdateStateSchema =
|
|
1872
|
+
var skillsUpdateStateSchema = z13.object({
|
|
1779
1873
|
status: skillsUpdateStatusSchema,
|
|
1780
|
-
available:
|
|
1781
|
-
autoUpdateEnabled:
|
|
1782
|
-
inherited:
|
|
1783
|
-
checkedAt:
|
|
1784
|
-
updatedAt:
|
|
1785
|
-
scopes:
|
|
1786
|
-
needsUpgradeNotes:
|
|
1874
|
+
available: z13.boolean(),
|
|
1875
|
+
autoUpdateEnabled: z13.boolean(),
|
|
1876
|
+
inherited: z13.boolean(),
|
|
1877
|
+
checkedAt: z13.string().nullable(),
|
|
1878
|
+
updatedAt: z13.string().nullable(),
|
|
1879
|
+
scopes: z13.array(skillsUpdateScopeStateSchema),
|
|
1880
|
+
needsUpgradeNotes: z13.boolean()
|
|
1787
1881
|
});
|
|
1788
1882
|
var providerIdSchema = runnerSchema;
|
|
1789
|
-
var providerConnectionStateSchema =
|
|
1883
|
+
var providerConnectionStateSchema = z13.enum([
|
|
1790
1884
|
"connected",
|
|
1791
1885
|
"disconnected",
|
|
1792
1886
|
"not-installed",
|
|
1793
1887
|
"unknown"
|
|
1794
1888
|
]);
|
|
1795
|
-
var providerStatusSchema =
|
|
1889
|
+
var providerStatusSchema = z13.object({
|
|
1796
1890
|
provider: providerIdSchema,
|
|
1797
1891
|
status: providerConnectionStateSchema,
|
|
1798
|
-
enabled:
|
|
1799
|
-
hint:
|
|
1800
|
-
authFailureId:
|
|
1892
|
+
enabled: z13.boolean().optional(),
|
|
1893
|
+
hint: z13.string().optional(),
|
|
1894
|
+
authFailureId: z13.string().optional(),
|
|
1801
1895
|
/** Which agent account this row describes (spec 2026-07-29-agent-profiles). ABSENT on
|
|
1802
1896
|
* `GET /api/v1/providers/status`, which deliberately keeps answering exactly one row per
|
|
1803
1897
|
* provider — the discovered default — so an older client sees no change at all. Per-account
|
|
1804
1898
|
* rows are carried by `GET /api/v1/workspace/agent-profiles` instead. */
|
|
1805
|
-
profileId:
|
|
1899
|
+
profileId: z13.string().optional()
|
|
1806
1900
|
});
|
|
1807
|
-
var providerStatusResponseSchema =
|
|
1808
|
-
providers:
|
|
1901
|
+
var providerStatusResponseSchema = z13.object({
|
|
1902
|
+
providers: z13.array(providerStatusSchema)
|
|
1809
1903
|
});
|
|
1810
|
-
var providerConnectResponseSchema =
|
|
1811
|
-
|
|
1812
|
-
|
|
1904
|
+
var providerConnectResponseSchema = z13.discriminatedUnion("opened", [
|
|
1905
|
+
z13.object({ opened: z13.literal(true), command: z13.string() }),
|
|
1906
|
+
z13.object({ opened: z13.literal(false), connected: z13.literal(true), command: z13.string() })
|
|
1813
1907
|
]);
|
|
1814
|
-
var modelDiscoveryRunnerSchema =
|
|
1908
|
+
var modelDiscoveryRunnerSchema = z13.enum(["claude", "codex", "opencode", "pi", "cursor"]);
|
|
1815
1909
|
var MODEL_DISCOVERY_RUNNERS = modelDiscoveryRunnerSchema.options;
|
|
1816
1910
|
function runnerDiscoversModels(runner) {
|
|
1817
1911
|
return MODEL_DISCOVERY_RUNNERS.includes(runner);
|
|
1818
1912
|
}
|
|
1819
|
-
var runnerModelOptionSchema =
|
|
1820
|
-
id:
|
|
1821
|
-
label:
|
|
1822
|
-
description:
|
|
1823
|
-
effortLevels:
|
|
1913
|
+
var runnerModelOptionSchema = z13.object({
|
|
1914
|
+
id: z13.string(),
|
|
1915
|
+
label: z13.string(),
|
|
1916
|
+
description: z13.string(),
|
|
1917
|
+
effortLevels: z13.array(effortLevelSchema).optional()
|
|
1824
1918
|
});
|
|
1825
|
-
var runnerModelCatalogResponseSchema =
|
|
1919
|
+
var runnerModelCatalogResponseSchema = z13.object({
|
|
1826
1920
|
runner: runnerSchema,
|
|
1827
|
-
models:
|
|
1828
|
-
source:
|
|
1829
|
-
stale:
|
|
1830
|
-
reason:
|
|
1921
|
+
models: z13.array(runnerModelOptionSchema),
|
|
1922
|
+
source: z13.enum(["live", "cache", "unavailable"]),
|
|
1923
|
+
stale: z13.boolean(),
|
|
1924
|
+
reason: z13.string().optional()
|
|
1831
1925
|
});
|
|
1832
|
-
var openTargetSchema =
|
|
1833
|
-
id:
|
|
1834
|
-
label:
|
|
1926
|
+
var openTargetSchema = z13.object({
|
|
1927
|
+
id: z13.string(),
|
|
1928
|
+
label: z13.string(),
|
|
1835
1929
|
/** A stable icon key (#361) the UI maps to a concrete icon. Optional: an older server omitting
|
|
1836
1930
|
* it just renders the generic fallback icon. */
|
|
1837
|
-
icon:
|
|
1931
|
+
icon: z13.string().optional()
|
|
1838
1932
|
});
|
|
1839
|
-
var openTargetsResponseSchema =
|
|
1840
|
-
targets:
|
|
1933
|
+
var openTargetsResponseSchema = z13.object({
|
|
1934
|
+
targets: z13.array(openTargetSchema)
|
|
1841
1935
|
});
|
|
1842
|
-
var openProjectInSchema =
|
|
1936
|
+
var openProjectInSchema = z13.object({
|
|
1843
1937
|
// A short bound (#429): matched against a downstream allowlist, so an app id is never long.
|
|
1844
|
-
target:
|
|
1938
|
+
target: z13.string().trim().min(1, "target required").max(200)
|
|
1845
1939
|
});
|
|
1846
|
-
var openProjectInResponseSchema =
|
|
1847
|
-
opened:
|
|
1848
|
-
path:
|
|
1940
|
+
var openProjectInResponseSchema = z13.object({
|
|
1941
|
+
opened: z13.literal(true),
|
|
1942
|
+
path: z13.string()
|
|
1849
1943
|
});
|
|
1850
1944
|
|
|
1851
1945
|
// ../contract/src/skills.ts
|
|
1852
|
-
import { z as
|
|
1853
|
-
var skillSchema =
|
|
1854
|
-
name:
|
|
1855
|
-
description:
|
|
1946
|
+
import { z as z14 } from "zod";
|
|
1947
|
+
var skillSchema = z14.object({
|
|
1948
|
+
name: z14.string(),
|
|
1949
|
+
description: z14.string().optional(),
|
|
1856
1950
|
/** Advisory hint for untouched composer run-mode choices. */
|
|
1857
|
-
interactive:
|
|
1858
|
-
body:
|
|
1859
|
-
path:
|
|
1860
|
-
source:
|
|
1951
|
+
interactive: z14.literal(true).optional(),
|
|
1952
|
+
body: z14.string(),
|
|
1953
|
+
path: z14.string(),
|
|
1954
|
+
source: z14.enum(["ai", "cezar", "agents", "global", "team"]),
|
|
1861
1955
|
/** Team skills only: where the definition lives in its skills repo. */
|
|
1862
|
-
team:
|
|
1863
|
-
repo:
|
|
1864
|
-
ref:
|
|
1865
|
-
path:
|
|
1956
|
+
team: z14.object({
|
|
1957
|
+
repo: z14.string(),
|
|
1958
|
+
ref: z14.string(),
|
|
1959
|
+
path: z14.string(),
|
|
1866
1960
|
/** True for the `SKILL.md` convention — a whole directory (references/…). */
|
|
1867
|
-
dir:
|
|
1961
|
+
dir: z14.boolean(),
|
|
1868
1962
|
/**
|
|
1869
1963
|
* The exact commit `ref` resolved to when the skill was read (#428).
|
|
1870
1964
|
*
|
|
1871
1965
|
* The hand-written DTO omitted this field entirely — it was NARROWER than the route,
|
|
1872
1966
|
* which has served it since #428.
|
|
1873
1967
|
*/
|
|
1874
|
-
commit:
|
|
1968
|
+
commit: z14.string().optional()
|
|
1875
1969
|
}).optional()
|
|
1876
1970
|
});
|
|
1877
|
-
var importableSkillSchema =
|
|
1878
|
-
name:
|
|
1879
|
-
description:
|
|
1971
|
+
var importableSkillSchema = z14.object({
|
|
1972
|
+
name: z14.string(),
|
|
1973
|
+
description: z14.string().optional()
|
|
1880
1974
|
});
|
|
1881
|
-
var todoItemSchema =
|
|
1882
|
-
id:
|
|
1883
|
-
ts:
|
|
1884
|
-
taskId:
|
|
1885
|
-
summary:
|
|
1886
|
-
action:
|
|
1887
|
-
prUrl:
|
|
1888
|
-
suggestedSkill:
|
|
1889
|
-
suggestedArgs:
|
|
1890
|
-
suggestedPrompt:
|
|
1975
|
+
var todoItemSchema = z14.object({
|
|
1976
|
+
id: z14.string(),
|
|
1977
|
+
ts: z14.string().optional(),
|
|
1978
|
+
taskId: z14.string().optional(),
|
|
1979
|
+
summary: z14.string().min(1),
|
|
1980
|
+
action: z14.string().optional(),
|
|
1981
|
+
prUrl: z14.string().optional(),
|
|
1982
|
+
suggestedSkill: z14.string().optional(),
|
|
1983
|
+
suggestedArgs: z14.string().optional(),
|
|
1984
|
+
suggestedPrompt: z14.string().optional(),
|
|
1891
1985
|
/** Explicit intent; missing infers from suggestedSkill/suggestedPrompt for old files. */
|
|
1892
|
-
runnable:
|
|
1986
|
+
runnable: z14.boolean().optional(),
|
|
1893
1987
|
/** Set once a task was started from this entry — it then leaves the inbox and stays as
|
|
1894
1988
|
* the audit trail. A later launch never overwrites the first. */
|
|
1895
|
-
startedTaskId:
|
|
1989
|
+
startedTaskId: z14.string().optional()
|
|
1896
1990
|
});
|
|
1897
|
-
var removeTodoResponseSchema =
|
|
1898
|
-
removed:
|
|
1991
|
+
var removeTodoResponseSchema = z14.object({
|
|
1992
|
+
removed: z14.literal(true)
|
|
1899
1993
|
});
|
|
1900
|
-
var startTodoResponseSchema =
|
|
1994
|
+
var startTodoResponseSchema = z14.object({
|
|
1901
1995
|
run: runRecordSchema
|
|
1902
1996
|
});
|
|
1903
1997
|
|
|
1904
1998
|
// ../contract/src/agent-config.ts
|
|
1905
|
-
import { z as
|
|
1906
|
-
var agentConfigFormatSchema =
|
|
1907
|
-
var agentConfigScopeSchema =
|
|
1908
|
-
var agentConfigKindSchema =
|
|
1909
|
-
var agentConfigTrackedSchema =
|
|
1910
|
-
var agentConfigFileSchema =
|
|
1999
|
+
import { z as z15 } from "zod";
|
|
2000
|
+
var agentConfigFormatSchema = z15.enum(["json", "jsonc", "toml", "markdown"]);
|
|
2001
|
+
var agentConfigScopeSchema = z15.enum(["user", "project", "local"]);
|
|
2002
|
+
var agentConfigKindSchema = z15.enum(["settings", "memory", "mcp"]);
|
|
2003
|
+
var agentConfigTrackedSchema = z15.enum(["tracked", "gitignored", "outside-repo"]);
|
|
2004
|
+
var agentConfigFileSchema = z15.object({
|
|
1911
2005
|
/** Stable, opaque, URL-safe — the ONLY thing a client may name (traversal-proof). */
|
|
1912
|
-
id:
|
|
2006
|
+
id: z15.string(),
|
|
1913
2007
|
/** Every runner that reads this file: `<repo>/AGENTS.md` is one file, two readers. */
|
|
1914
|
-
runners:
|
|
2008
|
+
runners: z15.array(runnerSchema),
|
|
1915
2009
|
kind: agentConfigKindSchema,
|
|
1916
2010
|
scope: agentConfigScopeSchema,
|
|
1917
|
-
label:
|
|
1918
|
-
path:
|
|
2011
|
+
label: z15.string(),
|
|
2012
|
+
path: z15.string(),
|
|
1919
2013
|
format: agentConfigFormatSchema,
|
|
1920
2014
|
tracked: agentConfigTrackedSchema,
|
|
1921
|
-
seeded:
|
|
1922
|
-
holdsMcp:
|
|
2015
|
+
seeded: z15.boolean(),
|
|
2016
|
+
holdsMcp: z15.boolean(),
|
|
1923
2017
|
/** VERBATIM from the vendor docs. Never computed, never generic. */
|
|
1924
|
-
precedence:
|
|
2018
|
+
precedence: z15.string(),
|
|
1925
2019
|
/** Documented mid-run reload behaviour, or absent when the vendor is silent. */
|
|
1926
|
-
hotReload:
|
|
1927
|
-
docsUrl:
|
|
1928
|
-
exists:
|
|
1929
|
-
size:
|
|
2020
|
+
hotReload: z15.string().optional(),
|
|
2021
|
+
docsUrl: z15.string(),
|
|
2022
|
+
exists: z15.boolean(),
|
|
2023
|
+
size: z15.number(),
|
|
1930
2024
|
/** sha256 of the bytes, or null when absent. */
|
|
1931
|
-
version:
|
|
2025
|
+
version: z15.string().nullable(),
|
|
1932
2026
|
/** False in hosted mode (whole feature) — the client renders read-only up front. */
|
|
1933
|
-
writable:
|
|
1934
|
-
readOnlyReason:
|
|
2027
|
+
writable: z15.boolean(),
|
|
2028
|
+
readOnlyReason: z15.string().optional()
|
|
1935
2029
|
});
|
|
1936
|
-
var userMcpListingSchema =
|
|
1937
|
-
path:
|
|
1938
|
-
servers:
|
|
1939
|
-
readable:
|
|
2030
|
+
var userMcpListingSchema = z15.object({
|
|
2031
|
+
path: z15.string(),
|
|
2032
|
+
servers: z15.array(z15.string()),
|
|
2033
|
+
readable: z15.boolean()
|
|
1940
2034
|
});
|
|
1941
|
-
var agentConfigListingSchema =
|
|
1942
|
-
editable:
|
|
1943
|
-
files:
|
|
2035
|
+
var agentConfigListingSchema = z15.object({
|
|
2036
|
+
editable: z15.boolean(),
|
|
2037
|
+
files: z15.array(agentConfigFileSchema),
|
|
1944
2038
|
/** null in hosted mode (host-state disclosure guard). */
|
|
1945
2039
|
userMcp: userMcpListingSchema.nullable()
|
|
1946
2040
|
});
|
|
1947
|
-
var agentConfigFileContentSchema =
|
|
1948
|
-
id:
|
|
1949
|
-
path:
|
|
1950
|
-
exists:
|
|
1951
|
-
content:
|
|
2041
|
+
var agentConfigFileContentSchema = z15.object({
|
|
2042
|
+
id: z15.string(),
|
|
2043
|
+
path: z15.string(),
|
|
2044
|
+
exists: z15.boolean(),
|
|
2045
|
+
content: z15.string(),
|
|
1952
2046
|
/** sha256 of the bytes, or null when the file does not exist yet. */
|
|
1953
|
-
version:
|
|
2047
|
+
version: z15.string().nullable()
|
|
1954
2048
|
});
|
|
1955
|
-
var setAgentConfigInputSchema =
|
|
1956
|
-
content:
|
|
1957
|
-
version:
|
|
2049
|
+
var setAgentConfigInputSchema = z15.object({
|
|
2050
|
+
content: z15.string().max(2e6),
|
|
2051
|
+
version: z15.string().nullable()
|
|
1958
2052
|
});
|
|
1959
2053
|
|
|
1960
2054
|
// ../contract/src/agent-profiles.ts
|
|
1961
|
-
import { z as
|
|
2055
|
+
import { z as z16 } from "zod";
|
|
1962
2056
|
var DEFAULT_AGENT_ACCOUNT_ID = "default";
|
|
1963
|
-
var agentAccountFileSchema =
|
|
1964
|
-
id:
|
|
2057
|
+
var agentAccountFileSchema = z16.object({
|
|
2058
|
+
id: z16.string(),
|
|
1965
2059
|
/** e.g. `settings.json` — the file's own name, since the folder is shown once on the account. */
|
|
1966
|
-
label:
|
|
2060
|
+
label: z16.string(),
|
|
1967
2061
|
/** Absolute, resolved inside this account's config folder. */
|
|
1968
|
-
path:
|
|
1969
|
-
exists:
|
|
2062
|
+
path: z16.string(),
|
|
2063
|
+
exists: z16.boolean()
|
|
1970
2064
|
});
|
|
1971
|
-
var agentProfileSchema =
|
|
2065
|
+
var agentProfileSchema = z16.object({
|
|
1972
2066
|
/** `default` for the discovered profile, else the stored slug. */
|
|
1973
|
-
id:
|
|
2067
|
+
id: z16.string(),
|
|
1974
2068
|
provider: providerIdSchema,
|
|
1975
|
-
label:
|
|
2069
|
+
label: z16.string(),
|
|
1976
2070
|
/** As the user wrote it — a literal `~` is preserved, matching `browseRoot`/`projectsDir`. */
|
|
1977
|
-
configDir:
|
|
2071
|
+
configDir: z16.string(),
|
|
1978
2072
|
/** Expanded absolute path. Same-origin route, like `ProjectListEntry.root`. */
|
|
1979
|
-
path:
|
|
2073
|
+
path: z16.string(),
|
|
1980
2074
|
/** False for a dir the CLI has not created yet — legitimate, and NOT a reason to fall back
|
|
1981
2075
|
* to another account at run time (that would silently bill the wrong subscription). */
|
|
1982
|
-
exists:
|
|
2076
|
+
exists: z16.boolean(),
|
|
1983
2077
|
/** Whether the dir carries this agent's own marker files. ADVISORY: an unrecognised dir is
|
|
1984
2078
|
* still accepted, because "add profile → Connect → the CLI creates it" is the real flow. */
|
|
1985
|
-
looksValid:
|
|
2079
|
+
looksValid: z16.boolean(),
|
|
1986
2080
|
/** True for the profile cezar discovers from the environment. Never stored, never deletable. */
|
|
1987
|
-
isDefault:
|
|
2081
|
+
isDefault: z16.boolean(),
|
|
1988
2082
|
/** This account's own authentication state — two Claude logins answer independently.
|
|
1989
2083
|
*
|
|
1990
2084
|
* **Absent until the probe has warmed.** Every probe shells out to an agent CLI, and this
|
|
@@ -1995,36 +2089,36 @@ var agentProfileSchema = z15.object({
|
|
|
1995
2089
|
status: providerStatusSchema.optional(),
|
|
1996
2090
|
/** This agent's own user-scope config files, resolved inside THIS account's folder — so a
|
|
1997
2091
|
* second login's `settings.json` is the one you open, not the default account's. */
|
|
1998
|
-
files:
|
|
2092
|
+
files: z16.array(agentAccountFileSchema)
|
|
1999
2093
|
});
|
|
2000
2094
|
function agentAccountRouteId(profile) {
|
|
2001
2095
|
return profile.isDefault ? `default:${profile.provider}` : profile.id;
|
|
2002
2096
|
}
|
|
2003
|
-
var agentAccountSelectionSchema =
|
|
2004
|
-
claude:
|
|
2005
|
-
codex:
|
|
2006
|
-
opencode:
|
|
2007
|
-
pi:
|
|
2008
|
-
cursor:
|
|
2009
|
-
});
|
|
2010
|
-
var agentProfilesResponseSchema =
|
|
2011
|
-
editable:
|
|
2012
|
-
profiles:
|
|
2097
|
+
var agentAccountSelectionSchema = z16.object({
|
|
2098
|
+
claude: z16.string().optional(),
|
|
2099
|
+
codex: z16.string().optional(),
|
|
2100
|
+
opencode: z16.string().optional(),
|
|
2101
|
+
pi: z16.string().optional(),
|
|
2102
|
+
cursor: z16.string().optional()
|
|
2103
|
+
});
|
|
2104
|
+
var agentProfilesResponseSchema = z16.object({
|
|
2105
|
+
editable: z16.boolean(),
|
|
2106
|
+
profiles: z16.array(agentProfileSchema),
|
|
2013
2107
|
/** Providers that can carry more than one account at all — what "Add account" is offered for.
|
|
2014
2108
|
* OpenCode is absent: its credentials live in a SQLite DB behind a separate `OPENCODE_DB`, so
|
|
2015
2109
|
* a config-dir profile would swap settings while still billing the other account. */
|
|
2016
|
-
profileCapableProviders:
|
|
2110
|
+
profileCapableProviders: z16.array(providerIdSchema),
|
|
2017
2111
|
/** Which account each project uses, keyed by the project's realpath'd ROOT.
|
|
2018
2112
|
*
|
|
2019
2113
|
* Served here rather than on `GET /api/v1/projects` because it is stored beside the accounts it
|
|
2020
2114
|
* names (`~/.cezar/agent-accounts.json`) — one file, so deleting an account and scrubbing every
|
|
2021
2115
|
* reference to it is one atomic write, and neither can be dropped by a cezar version that never
|
|
2022
2116
|
* heard of accounts. Empty in hosted mode, where the whole family is withheld. */
|
|
2023
|
-
selections:
|
|
2117
|
+
selections: z16.record(z16.string(), agentAccountSelectionSchema),
|
|
2024
2118
|
/** The machine-wide fallback account per provider, used by any repo that has chosen none. */
|
|
2025
2119
|
defaults: agentAccountSelectionSchema
|
|
2026
2120
|
});
|
|
2027
|
-
var selectAgentProfileInputSchema =
|
|
2121
|
+
var selectAgentProfileInputSchema = z16.object({
|
|
2028
2122
|
/**
|
|
2029
2123
|
* Registry slug, or the reserved `default` boot alias. Resolved to a root server-side.
|
|
2030
2124
|
*
|
|
@@ -2032,108 +2126,108 @@ var selectAgentProfileInputSchema = z15.object({
|
|
|
2032
2126
|
* chosen nothing uses, so a second login is set up once rather than per checkout. A repo's own
|
|
2033
2127
|
* choice always wins over it, which is what keeps this a default and not an override.
|
|
2034
2128
|
*/
|
|
2035
|
-
projectId:
|
|
2129
|
+
projectId: z16.string().min(1).max(64).nullable(),
|
|
2036
2130
|
provider: providerIdSchema,
|
|
2037
|
-
profileId:
|
|
2131
|
+
profileId: z16.string().max(64).nullable()
|
|
2038
2132
|
});
|
|
2039
|
-
var agentProfileSelectionsResponseSchema =
|
|
2040
|
-
selections:
|
|
2133
|
+
var agentProfileSelectionsResponseSchema = z16.object({
|
|
2134
|
+
selections: z16.record(z16.string(), agentAccountSelectionSchema),
|
|
2041
2135
|
/** The machine-wide fallback, for repos with no selection of their own. */
|
|
2042
2136
|
defaults: agentAccountSelectionSchema
|
|
2043
2137
|
});
|
|
2044
|
-
var agentAccountStatusResponseSchema =
|
|
2045
|
-
var agentAccountDetailsResponseSchema =
|
|
2046
|
-
available:
|
|
2047
|
-
reason:
|
|
2048
|
-
fields:
|
|
2138
|
+
var agentAccountStatusResponseSchema = z16.object({ status: providerStatusSchema });
|
|
2139
|
+
var agentAccountDetailsResponseSchema = z16.object({
|
|
2140
|
+
available: z16.boolean(),
|
|
2141
|
+
reason: z16.string().optional(),
|
|
2142
|
+
fields: z16.array(z16.object({ label: z16.string(), value: z16.string() }))
|
|
2049
2143
|
});
|
|
2050
|
-
var openAgentAccountFileInputSchema =
|
|
2051
|
-
file:
|
|
2052
|
-
target:
|
|
2144
|
+
var openAgentAccountFileInputSchema = z16.object({
|
|
2145
|
+
file: z16.string().min(1).max(200),
|
|
2146
|
+
target: z16.string().min(1).max(64).optional()
|
|
2053
2147
|
});
|
|
2054
|
-
var openAgentAccountFileResponseSchema =
|
|
2055
|
-
opened:
|
|
2056
|
-
path:
|
|
2148
|
+
var openAgentAccountFileResponseSchema = z16.object({
|
|
2149
|
+
opened: z16.literal(true),
|
|
2150
|
+
path: z16.string()
|
|
2057
2151
|
});
|
|
2058
|
-
var createAgentProfileInputSchema =
|
|
2152
|
+
var createAgentProfileInputSchema = z16.object({
|
|
2059
2153
|
provider: providerIdSchema,
|
|
2060
|
-
label:
|
|
2154
|
+
label: z16.string().trim().max(200).optional(),
|
|
2061
2155
|
/** Stored as written; validated absolute after `~` expansion, server-side. */
|
|
2062
|
-
configDir:
|
|
2156
|
+
configDir: z16.string().trim().min(1).max(4096)
|
|
2063
2157
|
});
|
|
2064
|
-
var agentProfileResponseSchema =
|
|
2065
|
-
var updateAgentProfileInputSchema =
|
|
2066
|
-
label:
|
|
2067
|
-
configDir:
|
|
2158
|
+
var agentProfileResponseSchema = z16.object({ profile: agentProfileSchema });
|
|
2159
|
+
var updateAgentProfileInputSchema = z16.object({
|
|
2160
|
+
label: z16.string().trim().max(200).optional(),
|
|
2161
|
+
configDir: z16.string().trim().min(1).max(4096).optional()
|
|
2068
2162
|
});
|
|
2069
|
-
var removeAgentProfileResponseSchema =
|
|
2070
|
-
removed:
|
|
2071
|
-
id:
|
|
2163
|
+
var removeAgentProfileResponseSchema = z16.object({
|
|
2164
|
+
removed: z16.literal(true),
|
|
2165
|
+
id: z16.string()
|
|
2072
2166
|
});
|
|
2073
2167
|
|
|
2074
2168
|
// ../contract/src/automations.ts
|
|
2075
|
-
import { z as
|
|
2076
|
-
var automationEventSchema =
|
|
2169
|
+
import { z as z17 } from "zod";
|
|
2170
|
+
var automationEventSchema = z17.enum([
|
|
2077
2171
|
"pull_request.opened",
|
|
2078
2172
|
"issue.opened",
|
|
2079
2173
|
"issue.labeled",
|
|
2080
2174
|
"issue.unlabeled"
|
|
2081
2175
|
]);
|
|
2082
|
-
var automationFiltersSchema =
|
|
2083
|
-
authors:
|
|
2084
|
-
assignees:
|
|
2085
|
-
allLabels:
|
|
2086
|
-
anyLabels:
|
|
2087
|
-
excludeLabels:
|
|
2176
|
+
var automationFiltersSchema = z17.object({
|
|
2177
|
+
authors: z17.array(z17.string()).optional(),
|
|
2178
|
+
assignees: z17.array(z17.string()).optional(),
|
|
2179
|
+
allLabels: z17.array(z17.string()).optional(),
|
|
2180
|
+
anyLabels: z17.array(z17.string()).optional(),
|
|
2181
|
+
excludeLabels: z17.array(z17.string()).optional(),
|
|
2088
2182
|
/** Required for the two label events — the server rejects a definition without it. */
|
|
2089
|
-
changedLabels:
|
|
2090
|
-
lookbackDays:
|
|
2091
|
-
maxRecords:
|
|
2183
|
+
changedLabels: z17.array(z17.string()).optional(),
|
|
2184
|
+
lookbackDays: z17.number(),
|
|
2185
|
+
maxRecords: z17.number()
|
|
2092
2186
|
});
|
|
2093
2187
|
var automationTaskSchema = createRunInputBaseSchema.omit({ task: true, images: true, todoId: true, systemPrompt: true }).extend({
|
|
2094
2188
|
/** The prompt template. `{{github.number}}`, `{{github.title}}`, `{{github.url}}` and
|
|
2095
2189
|
* `{{github.labels}}` are substituted per match; GitHub content is appended as untrusted
|
|
2096
2190
|
* context, never interpolated into instructions. */
|
|
2097
|
-
prompt:
|
|
2098
|
-
variants:
|
|
2099
|
-
systemPrompt:
|
|
2191
|
+
prompt: z17.string(),
|
|
2192
|
+
variants: z17.union([z17.literal(1), z17.literal(2), z17.literal(3)]).optional(),
|
|
2193
|
+
systemPrompt: z17.string().optional()
|
|
2100
2194
|
});
|
|
2101
|
-
var automationDefinitionSchema =
|
|
2102
|
-
id:
|
|
2195
|
+
var automationDefinitionSchema = z17.object({
|
|
2196
|
+
id: z17.string(),
|
|
2103
2197
|
/** Bumped on every edit; a PUT must echo the revision it read (optimistic concurrency). */
|
|
2104
|
-
revision:
|
|
2105
|
-
name:
|
|
2106
|
-
description:
|
|
2198
|
+
revision: z17.number(),
|
|
2199
|
+
name: z17.string(),
|
|
2200
|
+
description: z17.string().optional(),
|
|
2107
2201
|
/** Always present: the storage schema defaults it to `false`, so a definition is created
|
|
2108
2202
|
* PAUSED and enabling it is a separate, baseline-establishing act. */
|
|
2109
|
-
enabled:
|
|
2110
|
-
events:
|
|
2111
|
-
intervalSeconds:
|
|
2203
|
+
enabled: z17.boolean(),
|
|
2204
|
+
events: z17.array(automationEventSchema),
|
|
2205
|
+
intervalSeconds: z17.number(),
|
|
2112
2206
|
filters: automationFiltersSchema,
|
|
2113
2207
|
task: automationTaskSchema,
|
|
2114
|
-
createdAt:
|
|
2115
|
-
updatedAt:
|
|
2208
|
+
createdAt: z17.string(),
|
|
2209
|
+
updatedAt: z17.string()
|
|
2116
2210
|
});
|
|
2117
|
-
var automationCursorSchema =
|
|
2118
|
-
timestamp:
|
|
2119
|
-
tieBreaker:
|
|
2211
|
+
var automationCursorSchema = z17.object({
|
|
2212
|
+
timestamp: z17.string(),
|
|
2213
|
+
tieBreaker: z17.string().optional()
|
|
2120
2214
|
});
|
|
2121
|
-
var automationRuntimeStateSchema =
|
|
2215
|
+
var automationRuntimeStateSchema = z17.object({
|
|
2122
2216
|
/** The definition revision this state belongs to; a bumped revision re-baselines. */
|
|
2123
|
-
revision:
|
|
2217
|
+
revision: z17.number().optional(),
|
|
2124
2218
|
/** Enabling establishes a CURRENT-TIME baseline: records older than this never launch. */
|
|
2125
|
-
baselineAt:
|
|
2219
|
+
baselineAt: z17.string().optional(),
|
|
2126
2220
|
cursor: automationCursorSchema.optional(),
|
|
2127
|
-
frozenHighWatermark: automationCursorSchema.extend({ tieBreaker:
|
|
2128
|
-
backlogAfter: automationCursorSchema.extend({ tieBreaker:
|
|
2129
|
-
nextCheckAt:
|
|
2130
|
-
lastSuccessAt:
|
|
2221
|
+
frozenHighWatermark: automationCursorSchema.extend({ tieBreaker: z17.string() }).optional(),
|
|
2222
|
+
backlogAfter: automationCursorSchema.extend({ tieBreaker: z17.string() }).optional(),
|
|
2223
|
+
nextCheckAt: z17.string().optional(),
|
|
2224
|
+
lastSuccessAt: z17.string().optional(),
|
|
2131
2225
|
/** Per-query GitHub ETags, so an unchanged page costs no rate-limit budget. */
|
|
2132
|
-
etags:
|
|
2133
|
-
backoffUntil:
|
|
2134
|
-
consecutiveFailures:
|
|
2226
|
+
etags: z17.record(z17.string(), z17.string()).optional(),
|
|
2227
|
+
backoffUntil: z17.string().optional(),
|
|
2228
|
+
consecutiveFailures: z17.number().optional()
|
|
2135
2229
|
});
|
|
2136
|
-
var automationLogResultSchema =
|
|
2230
|
+
var automationLogResultSchema = z17.enum([
|
|
2137
2231
|
"launched",
|
|
2138
2232
|
"no-match",
|
|
2139
2233
|
"duplicate",
|
|
@@ -2142,80 +2236,82 @@ var automationLogResultSchema = z16.enum([
|
|
|
2142
2236
|
"baseline",
|
|
2143
2237
|
"preview"
|
|
2144
2238
|
]);
|
|
2145
|
-
var automationLogRecordSchema =
|
|
2146
|
-
seq:
|
|
2147
|
-
ts:
|
|
2148
|
-
automationId:
|
|
2149
|
-
revision:
|
|
2239
|
+
var automationLogRecordSchema = z17.object({
|
|
2240
|
+
seq: z17.number(),
|
|
2241
|
+
ts: z17.string(),
|
|
2242
|
+
automationId: z17.string(),
|
|
2243
|
+
revision: z17.number(),
|
|
2150
2244
|
event: automationEventSchema.optional(),
|
|
2151
2245
|
result: automationLogResultSchema,
|
|
2152
|
-
reason:
|
|
2153
|
-
durationMs:
|
|
2154
|
-
receiptId:
|
|
2155
|
-
runId:
|
|
2156
|
-
githubNumber:
|
|
2157
|
-
githubTitle:
|
|
2158
|
-
githubUrl:
|
|
2159
|
-
rateLimit:
|
|
2160
|
-
bucket:
|
|
2161
|
-
remaining:
|
|
2162
|
-
resetAt:
|
|
2246
|
+
reason: z17.string().optional(),
|
|
2247
|
+
durationMs: z17.number().optional(),
|
|
2248
|
+
receiptId: z17.string().optional(),
|
|
2249
|
+
runId: z17.string().optional(),
|
|
2250
|
+
githubNumber: z17.number().optional(),
|
|
2251
|
+
githubTitle: z17.string().optional(),
|
|
2252
|
+
githubUrl: z17.string().optional(),
|
|
2253
|
+
rateLimit: z17.object({
|
|
2254
|
+
bucket: z17.enum(["core", "search"]),
|
|
2255
|
+
remaining: z17.number().optional(),
|
|
2256
|
+
resetAt: z17.string().optional()
|
|
2163
2257
|
}).optional()
|
|
2164
2258
|
});
|
|
2165
|
-
var automationCountsSchema =
|
|
2166
|
-
matches:
|
|
2167
|
-
launched:
|
|
2168
|
-
duplicates:
|
|
2169
|
-
errors:
|
|
2259
|
+
var automationCountsSchema = z17.object({
|
|
2260
|
+
matches: z17.number(),
|
|
2261
|
+
launched: z17.number(),
|
|
2262
|
+
duplicates: z17.number(),
|
|
2263
|
+
errors: z17.number()
|
|
2170
2264
|
});
|
|
2171
2265
|
var automationListEntrySchema = automationDefinitionSchema.extend({
|
|
2172
2266
|
state: automationRuntimeStateSchema.optional(),
|
|
2173
2267
|
latestLog: automationLogRecordSchema.optional(),
|
|
2174
2268
|
counts: automationCountsSchema
|
|
2175
2269
|
});
|
|
2176
|
-
var automationsResponseSchema =
|
|
2177
|
-
available:
|
|
2178
|
-
reason:
|
|
2179
|
-
scheduler:
|
|
2180
|
-
state:
|
|
2181
|
-
nextDue:
|
|
2270
|
+
var automationsResponseSchema = z17.object({
|
|
2271
|
+
available: z17.boolean(),
|
|
2272
|
+
reason: z17.string().optional(),
|
|
2273
|
+
scheduler: z17.object({
|
|
2274
|
+
state: z17.enum(["scheduled", "idle"]),
|
|
2275
|
+
nextDue: z17.string().optional()
|
|
2182
2276
|
}),
|
|
2183
|
-
automations:
|
|
2277
|
+
automations: z17.array(automationListEntrySchema)
|
|
2184
2278
|
});
|
|
2185
|
-
var automationResponseSchema =
|
|
2186
|
-
var automationDetailResponseSchema =
|
|
2279
|
+
var automationResponseSchema = z17.object({ automation: automationDefinitionSchema });
|
|
2280
|
+
var automationDetailResponseSchema = z17.object({
|
|
2187
2281
|
automation: automationDefinitionSchema,
|
|
2188
2282
|
state: automationRuntimeStateSchema.optional(),
|
|
2189
2283
|
latestLog: automationLogRecordSchema.optional()
|
|
2190
2284
|
});
|
|
2191
|
-
var automationCheckSchema =
|
|
2192
|
-
id:
|
|
2193
|
-
automationId:
|
|
2194
|
-
mode:
|
|
2195
|
-
status:
|
|
2196
|
-
createdAt:
|
|
2197
|
-
completedAt:
|
|
2198
|
-
matches:
|
|
2199
|
-
truncated:
|
|
2200
|
-
error:
|
|
2201
|
-
});
|
|
2202
|
-
var automationCheckQueuedResponseSchema =
|
|
2203
|
-
var automationLogResponseSchema =
|
|
2204
|
-
records:
|
|
2205
|
-
});
|
|
2206
|
-
var automationRetryResponseSchema =
|
|
2207
|
-
receiptId:
|
|
2208
|
-
runId:
|
|
2209
|
-
});
|
|
2210
|
-
var createAutomationInputSchema = automationDefinitionSchema.omit({ id: true, revision: true, createdAt: true, updatedAt: true, enabled: true }).extend({ enable:
|
|
2285
|
+
var automationCheckSchema = z17.object({
|
|
2286
|
+
id: z17.string(),
|
|
2287
|
+
automationId: z17.string(),
|
|
2288
|
+
mode: z17.enum(["preview", "execute"]),
|
|
2289
|
+
status: z17.enum(["queued", "running", "complete", "error"]),
|
|
2290
|
+
createdAt: z17.string(),
|
|
2291
|
+
completedAt: z17.string().optional(),
|
|
2292
|
+
matches: z17.number().optional(),
|
|
2293
|
+
truncated: z17.boolean().optional(),
|
|
2294
|
+
error: z17.string().optional()
|
|
2295
|
+
});
|
|
2296
|
+
var automationCheckQueuedResponseSchema = z17.object({ checkId: z17.string() });
|
|
2297
|
+
var automationLogResponseSchema = z17.object({
|
|
2298
|
+
records: z17.array(automationLogRecordSchema)
|
|
2299
|
+
});
|
|
2300
|
+
var automationRetryResponseSchema = z17.object({
|
|
2301
|
+
receiptId: z17.string(),
|
|
2302
|
+
runId: z17.string()
|
|
2303
|
+
});
|
|
2304
|
+
var createAutomationInputSchema = automationDefinitionSchema.omit({ id: true, revision: true, createdAt: true, updatedAt: true, enabled: true }).extend({ enable: z17.boolean().optional() });
|
|
2211
2305
|
var updateAutomationInputSchema = createAutomationInputSchema.omit({ enable: true }).extend({
|
|
2212
|
-
enabled:
|
|
2213
|
-
expectedRevision:
|
|
2306
|
+
enabled: z17.boolean().optional(),
|
|
2307
|
+
expectedRevision: z17.number()
|
|
2214
2308
|
});
|
|
2215
|
-
var automationCheckInputSchema =
|
|
2216
|
-
mode:
|
|
2309
|
+
var automationCheckInputSchema = z17.object({
|
|
2310
|
+
mode: z17.enum(["preview", "execute"])
|
|
2217
2311
|
});
|
|
2218
2312
|
export {
|
|
2313
|
+
CI_WAIT_LIMITATION,
|
|
2314
|
+
CI_WAIT_RECEIPT_INSTRUCTION,
|
|
2219
2315
|
DEFAULT_AGENT_ACCOUNT_ID,
|
|
2220
2316
|
EFFORT_LEVELS,
|
|
2221
2317
|
FILE_ATTACHMENT_MEDIA_TYPES,
|
|
@@ -2278,12 +2374,22 @@ export {
|
|
|
2278
2374
|
changesPayloadSchema,
|
|
2279
2375
|
checkoutProgressEventSchema,
|
|
2280
2376
|
checkoutProjectInputSchema,
|
|
2377
|
+
ciPrIdentitySchema,
|
|
2378
|
+
ciPrUrlSchema,
|
|
2379
|
+
ciWaitErrorCodeSchema,
|
|
2380
|
+
ciWaitErrorSchema,
|
|
2381
|
+
ciWaitOutcomeSchema,
|
|
2382
|
+
ciWaitReceiptSchema,
|
|
2383
|
+
ciWaitRequestSchema,
|
|
2384
|
+
ciWaitResultSchema,
|
|
2385
|
+
ciWaitSchema,
|
|
2281
2386
|
configResponseSchema,
|
|
2282
2387
|
continuationMessageSchema,
|
|
2283
2388
|
continueResponseSchema,
|
|
2284
2389
|
conversationAttributionSchema,
|
|
2285
2390
|
conversationCancelRequestSchema,
|
|
2286
2391
|
conversationInspectRequestSchema,
|
|
2392
|
+
conversationInspectResultSchema,
|
|
2287
2393
|
conversationMessageEventSchema,
|
|
2288
2394
|
conversationMessageSchema,
|
|
2289
2395
|
conversationSendRequestSchema,
|
|
@@ -2333,6 +2439,10 @@ export {
|
|
|
2333
2439
|
humanInputDeliveredEventSchema,
|
|
2334
2440
|
imageInputSchema,
|
|
2335
2441
|
importableSkillSchema,
|
|
2442
|
+
inboxClaimSchema,
|
|
2443
|
+
inboxReceiptRequestSchema,
|
|
2444
|
+
inboxReceiptResultSchema,
|
|
2445
|
+
inboxReserveResultSchema,
|
|
2336
2446
|
isAttachmentMediaType,
|
|
2337
2447
|
isImageAttachmentName,
|
|
2338
2448
|
isImageMediaType,
|