@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.
Files changed (126) hide show
  1. package/README.md +37 -2
  2. package/dist/agent-config/model-settings/shared.d.ts +2 -1
  3. package/dist/agent-config/model-settings/shared.js +1 -1
  4. package/dist/agent-config/model-settings/shared.js.map +1 -1
  5. package/dist/ci-wait/client.d.ts +4 -0
  6. package/dist/ci-wait/client.js +67 -0
  7. package/dist/ci-wait/client.js.map +1 -0
  8. package/dist/ci-wait/controller.d.ts +78 -0
  9. package/dist/ci-wait/controller.js +148 -0
  10. package/dist/ci-wait/controller.js.map +1 -0
  11. package/dist/ci-wait/github.d.ts +61 -0
  12. package/dist/ci-wait/github.js +209 -0
  13. package/dist/ci-wait/github.js.map +1 -0
  14. package/dist/ci-wait/injection.d.ts +3 -0
  15. package/dist/ci-wait/injection.js +26 -0
  16. package/dist/ci-wait/injection.js.map +1 -0
  17. package/dist/ci-wait/mcp.d.ts +97 -0
  18. package/dist/ci-wait/mcp.js +35 -0
  19. package/dist/ci-wait/mcp.js.map +1 -0
  20. package/dist/ci-wait/resources.d.ts +7 -0
  21. package/dist/ci-wait/resources.js +32 -0
  22. package/dist/ci-wait/resources.js.map +1 -0
  23. package/dist/ci-wait/supervisor.d.ts +21 -0
  24. package/dist/ci-wait/supervisor.js +163 -0
  25. package/dist/ci-wait/supervisor.js.map +1 -0
  26. package/dist/contract/ci-wait.d.ts +151 -0
  27. package/dist/contract/conversations.d.ts +105 -0
  28. package/dist/contract/delegation.d.ts +17 -0
  29. package/dist/contract/events.d.ts +10 -0
  30. package/dist/contract/index.d.ts +1 -0
  31. package/dist/contract/index.js +1046 -936
  32. package/dist/contract/runs.d.ts +496 -0
  33. package/dist/contract/skills.d.ts +99 -0
  34. package/dist/core/agent-env.js +2 -0
  35. package/dist/core/agent-env.js.map +1 -1
  36. package/dist/core/agent-runner.d.ts +6 -0
  37. package/dist/core/agent-runner.js +1 -0
  38. package/dist/core/agent-runner.js.map +1 -1
  39. package/dist/core/claude-cli-runner.js +10 -0
  40. package/dist/core/claude-cli-runner.js.map +1 -1
  41. package/dist/core/codex-app-server-runner.js +5 -1
  42. package/dist/core/codex-app-server-runner.js.map +1 -1
  43. package/dist/core/codex-app-server-transport.js +3 -1
  44. package/dist/core/codex-app-server-transport.js.map +1 -1
  45. package/dist/core/cursor-acp-runner.js +9 -1
  46. package/dist/core/cursor-acp-runner.js.map +1 -1
  47. package/dist/core/opencode-server-runner.js +6 -2
  48. package/dist/core/opencode-server-runner.js.map +1 -1
  49. package/dist/core/pi-runner.js +7 -1
  50. package/dist/core/pi-runner.js.map +1 -1
  51. package/dist/delegation/cli.js +110 -10
  52. package/dist/delegation/cli.js.map +1 -1
  53. package/dist/delegation/conversations.js +2 -1
  54. package/dist/delegation/conversations.js.map +1 -1
  55. package/dist/delegation/input.d.ts +7 -0
  56. package/dist/delegation/input.js +27 -0
  57. package/dist/delegation/input.js.map +1 -1
  58. package/dist/delegation/provision.js +4 -1
  59. package/dist/delegation/provision.js.map +1 -1
  60. package/dist/delegation/routes.d.ts +78 -0
  61. package/dist/delegation/routes.js +4 -1
  62. package/dist/delegation/routes.js.map +1 -1
  63. package/dist/delegation/service.d.ts +6 -2
  64. package/dist/delegation/service.js +113 -9
  65. package/dist/delegation/service.js.map +1 -1
  66. package/dist/delegation/transport.d.ts +78 -0
  67. package/dist/runs/delegation-state.d.ts +2 -0
  68. package/dist/runs/run-index.js +2 -3
  69. package/dist/runs/run-index.js.map +1 -1
  70. package/dist/runs/store.d.ts +534 -3
  71. package/dist/runs/store.js +186 -6
  72. package/dist/runs/store.js.map +1 -1
  73. package/dist/server/server.d.ts +1530 -12
  74. package/dist/workflows/run.d.ts +39 -1
  75. package/dist/workflows/run.js +606 -50
  76. package/dist/workflows/run.js.map +1 -1
  77. package/package.json +4 -3
  78. package/scripts/mock-ci-tool.mjs +53 -0
  79. package/scripts/mock-claude.mjs +8 -0
  80. package/scripts/mock-codex-app-server.mjs +212 -0
  81. package/scripts/mock-cursor-acp.mjs +6 -2
  82. package/scripts/mock-opencode-serve.mjs +392 -0
  83. package/scripts/mock-pi-rpc.mjs +7 -0
  84. package/scripts/pi-ci-wait.mjs +14 -0
  85. package/web/dist/assets/{agent-accounts-lP_xK83o.js → agent-accounts-DveiLHoy.js} +1 -1
  86. package/web/dist/assets/{alert-dialog-CmDuefYh.js → alert-dialog-BRmsCA3M.js} +1 -1
  87. package/web/dist/assets/{collapsible-BqX8REmY.js → collapsible-BWfM2PdZ.js} +1 -1
  88. package/web/dist/assets/{commit-list-BWvv1H7A.js → commit-list-C-rCgcKm.js} +1 -1
  89. package/web/dist/assets/{compare-variants-Bg7eLW3z.js → compare-variants-Ccp9IYp-.js} +1 -1
  90. package/web/dist/assets/{diff-0GBum40Q2.js → diff-BvZErqfg2.js} +2 -2
  91. package/web/dist/assets/{diff-controls-HwWHHait.js → diff-controls-BFI8ngtw.js} +1 -1
  92. package/web/dist/assets/{diff-stat-mNkhAc5m.js → diff-stat-CVFxf2Ar.js} +1 -1
  93. package/web/dist/assets/{diff-view-DW64doDY.js → diff-view-B35r8kQK.js} +1 -1
  94. package/web/dist/assets/{dropdown-menu-sZjYPcLh.js → dropdown-menu-C_fj6kzP.js} +1 -1
  95. package/web/dist/assets/{git-toolbar-DBW5EIcY.js → git-toolbar-BaqAvRC1.js} +1 -1
  96. package/web/dist/assets/{github-CkZ4hWI5.js → github-DIkBazPA.js} +1 -1
  97. package/web/dist/assets/{image-preview-DZicGNkU.js → image-preview-BBqbaKaq.js} +1 -1
  98. package/web/dist/assets/{index-DWWI-B9n.js → index-BIae70yp.js} +3 -3
  99. package/web/dist/assets/index-CXZukB1O.css +1 -0
  100. package/web/dist/assets/{markdown-AY2K3kIV.js → markdown-kouQNPB6.js} +1 -1
  101. package/web/dist/assets/{pill-CcJqA1cL.js → pill-mHX_rKXP.js} +1 -1
  102. package/web/dist/assets/{project-router-SwsXRKXs.js → project-router-Ds9EvxjN.js} +1 -1
  103. package/web/dist/assets/{prompt-templates-iV2WD2jy.js → prompt-templates-AaKKdIiY.js} +1 -1
  104. package/web/dist/assets/{repo-git-BW3TOs3U.js → repo-git-6StCwqhj.js} +1 -1
  105. package/web/dist/assets/{run-diff-DPUNj56q.js → run-diff-fChfUdwr.js} +1 -1
  106. package/web/dist/assets/run-header-B3ZPhDZr.js +1 -0
  107. package/web/dist/assets/{run-header-CSaJIGXl.css → run-header-BJQfFL2l.css} +1 -1
  108. package/web/dist/assets/{skills-Dv8Vwv5D.js → skills-DSWaVvcu.js} +1 -1
  109. package/web/dist/assets/{tab-link-DSftvkZS.js → tab-link-Db6yDTIQ.js} +1 -1
  110. package/web/dist/assets/{task-changes-CTCuVls1.js → task-changes-DdmerESW.js} +1 -1
  111. package/web/dist/assets/{task-commits-weJQ5GSl.js → task-commits-Co-bb1P6.js} +1 -1
  112. package/web/dist/assets/{task-files-B4bUimY8.js → task-files-B2KASfyL.js} +1 -1
  113. package/web/dist/assets/{task-thread-BuXrVB9K.js → task-thread-8kGLJO4Q.js} +4 -4
  114. package/web/dist/assets/task-thread-Dc3wplva.css +1 -0
  115. package/web/dist/assets/{textarea-CxRdTWlq.js → textarea-Qhdzn_oU.js} +1 -1
  116. package/web/dist/assets/thread-loading-C6ENzZYk.js +1 -0
  117. package/web/dist/assets/{token-metrics-Z3UFYbuD.js → token-metrics-BsT6Rqji.js} +1 -1
  118. package/web/dist/assets/utils-VFstALJW.js +64 -0
  119. package/web/dist/assets/{workflows-vA27Yi8W.js → workflows-UKoofNFJ.js} +1 -1
  120. package/web/dist/assets/{zoomable-image-DUE1KFJ0.js → zoomable-image-DpL5gtv4.js} +1 -1
  121. package/web/dist/index.html +14 -14
  122. package/web/dist/assets/index-DK0Mkv2m.css +0 -1
  123. package/web/dist/assets/run-header-DbDluWoV.js +0 -1
  124. package/web/dist/assets/task-thread-DMRD0IVt.css +0 -1
  125. package/web/dist/assets/thread-loading-JlP6dUpX.js +0 -1
  126. package/web/dist/assets/utils-CUnaAifW.js +0 -64
@@ -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
- }).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" });
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 z9 } from "zod";
570
+ import { z as z10 } from "zod";
483
571
 
484
572
  // ../contract/src/github.ts
485
- import { z as z7 } from "zod";
486
- var checksGlyphSchema = z7.enum(["passing", "failing", "pending"]).nullable();
487
- var githubItemSchema = z7.object({
488
- kind: z7.enum(["issue", "pr"]),
489
- number: z7.number(),
490
- title: z7.string(),
491
- author: z7.string(),
492
- createdAt: z7.string(),
493
- labels: z7.array(z7.string()),
494
- body: z7.string(),
495
- url: z7.string(),
496
- comments: z7.number(),
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: z7.array(z7.string()).optional(),
499
- projectIds: z7.array(z7.string()).optional(),
586
+ assignees: z8.array(z8.string()).optional(),
587
+ projectIds: z8.array(z8.string()).optional(),
500
588
  /** PRs only. */
501
- isDraft: z7.boolean().optional(),
502
- additions: z7.number().optional(),
503
- deletions: z7.number().optional(),
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 = z7.object({
507
- id: z7.string(),
508
- title: z7.string(),
509
- url: z7.string()
594
+ var githubProjectSchema = z8.object({
595
+ id: z8.string(),
596
+ title: z8.string(),
597
+ url: z8.string()
510
598
  });
511
- var githubDataSchema = z7.object({
512
- available: z7.boolean(),
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: z7.string().optional(),
602
+ reason: z8.string().optional(),
515
603
  /** owner/name, when known. */
516
- repo: z7.string().optional(),
517
- syncedAt: z7.string().optional(),
518
- issues: z7.array(githubItemSchema),
519
- prs: z7.array(githubItemSchema),
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: z7.record(z7.string(), z7.string()).optional(),
522
- viewerLogin: z7.string().optional(),
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: z7.array(githubProjectSchema).optional(),
525
- projectsReason: z7.string().optional()
612
+ projects: z8.array(githubProjectSchema).optional(),
613
+ projectsReason: z8.string().optional()
526
614
  });
527
- var githubChecksDataSchema = z7.discriminatedUnion("available", [
528
- z7.object({
529
- available: z7.literal(true),
530
- checks: z7.record(z7.number(), checksGlyphSchema)
615
+ var githubChecksDataSchema = z8.discriminatedUnion("available", [
616
+ z8.object({
617
+ available: z8.literal(true),
618
+ checks: z8.record(z8.number(), checksGlyphSchema)
531
619
  }),
532
- z7.object({
533
- available: z7.literal(false),
534
- reason: z7.string()
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 = z7.object({
539
- kind: z7.enum(["issue", "pr"]),
540
- q: z7.string().trim().min(1).max(256),
541
- limit: z7.coerce.number().int().positive().max(GITHUB_SEARCH_MAX).optional()
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 = z7.object({
544
- available: z7.boolean(),
631
+ var githubSearchDataSchema = z8.object({
632
+ available: z8.boolean(),
545
633
  /** Membership is unknown when lookup fails; never substitute empty projectIds. */
546
- projectsReason: z7.string().optional(),
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: z7.string().optional(),
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: z7.array(githubItemSchema),
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: z7.boolean().optional(),
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: z7.record(z7.string(), z7.string()).optional()
644
+ labelColors: z8.record(z8.string(), z8.string()).optional()
557
645
  });
558
- var referenceStatusSchema = z7.enum([
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 = z7.number().nullable();
659
+ var recheckAfterMsSchema = z8.number().nullable();
572
660
  var REFERENCE_STATUS_MAX = 100;
573
- var githubRefStatusDataSchema = z7.discriminatedUnion("available", [
574
- z7.object({
575
- available: z7.literal(true),
576
- prs: z7.record(z7.number(), referenceStatusSchema),
577
- issues: z7.record(z7.number(), referenceStatusSchema),
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: z7.array(z7.number()).optional(),
685
+ conflicts: z8.array(z8.number()).optional(),
598
686
  recheckAfterMs: recheckAfterMsSchema
599
687
  }),
600
- z7.object({
601
- available: z7.literal(false),
602
- reason: z7.string(),
688
+ z8.object({
689
+ available: z8.literal(false),
690
+ reason: z8.string(),
603
691
  recheckAfterMs: recheckAfterMsSchema
604
692
  })
605
693
  ]);
606
- var githubCommentSchema = z7.object({
607
- id: z7.number(),
694
+ var githubCommentSchema = z8.object({
695
+ id: z8.number(),
608
696
  /** Author login, `'?'` fallback when gh omits the user. */
609
- author: z7.string(),
610
- avatarUrl: z7.string().optional(),
611
- createdAt: z7.string(),
612
- body: z7.string(),
613
- kind: z7.enum(["comment", "review"]),
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: z7.enum(["approved", "changes_requested", "commented", "dismissed"]).optional(),
616
- url: z7.string()
703
+ reviewState: z8.enum(["approved", "changes_requested", "commented", "dismissed"]).optional(),
704
+ url: z8.string()
617
705
  });
618
- var githubTimelineEventKindSchema = z7.enum([
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 = z7.object({
632
- id: z7.string(),
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: z7.string(),
723
+ actor: z8.string(),
636
724
  /** Absent for `committed`. */
637
- avatarUrl: z7.string().optional(),
638
- createdAt: z7.string(),
639
- url: z7.string().optional(),
725
+ avatarUrl: z8.string().optional(),
726
+ createdAt: z8.string(),
727
+ url: z8.string().optional(),
640
728
  /** `committed` — full 40-char SHA. */
641
- sha: z7.string().optional(),
729
+ sha: z8.string().optional(),
642
730
  /** `committed` — first line, capped at 120 chars. */
643
- message: z7.string().optional(),
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: z7.object({ name: z7.string(), color: z7.string().optional() }).optional(),
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: z7.string().optional(),
650
- refNumber: z7.number().optional(),
651
- refTitle: z7.string().optional(),
652
- refIsPr: z7.boolean().optional()
653
- });
654
- var githubCommentsDataSchema = z7.object({
655
- available: z7.boolean(),
656
- reason: z7.string().optional(),
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: z7.array(githubCommentSchema),
746
+ comments: z8.array(githubCommentSchema),
659
747
  /** True when either stream hit its cap, or the timeline fetch stopped short. */
660
- truncated: z7.boolean().optional(),
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: z7.array(githubTimelineEventSchema).optional()
664
- });
665
- var githubMergeMethodSchema = z7.enum(["merge", "squash", "rebase"]);
666
- var githubPrCheckSchema = z7.object({
667
- name: z7.string(),
668
- state: z7.enum(["passing", "failing", "pending", "unknown"]),
669
- required: z7.boolean().nullable(),
670
- url: z7.string().optional()
671
- });
672
- var githubPrMergeStateSchema = z7.object({
673
- number: z7.number(),
674
- title: z7.string(),
675
- url: z7.string(),
676
- state: z7.enum(["open", "closed", "merged"]),
677
- isDraft: z7.boolean(),
678
- headRef: z7.string(),
679
- baseRef: z7.string(),
680
- headSha: z7.string(),
681
- mergeable: z7.enum(["mergeable", "conflicting", "unknown"]),
682
- reviewDecision: z7.enum(["approved", "changes-requested", "review-required", "unknown"]),
683
- checks: z7.array(githubPrCheckSchema),
684
- methods: z7.array(githubMergeMethodSchema),
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: z7.enum(["ready", "blocked", "pending", "unauthorized", "terminal", "unknown"]),
687
- blockers: z7.array(z7.object({ code: z7.string(), message: z7.string() })),
688
- canMerge: z7.boolean(),
689
- canOverride: z7.boolean()
690
- });
691
- var githubPrMergeStateResponseSchema = z7.discriminatedUnion("available", [
692
- z7.object({ available: z7.literal(true), mergeState: githubPrMergeStateSchema }),
693
- z7.object({ available: z7.literal(false), reason: z7.string() })
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 = z7.object({
696
- merged: z7.literal(true),
697
- number: z7.number(),
698
- url: z7.string(),
783
+ var githubMergeResponseSchema = z8.object({
784
+ merged: z8.literal(true),
785
+ number: z8.number(),
786
+ url: z8.string(),
699
787
  method: githubMergeMethodSchema,
700
- mergeCommitSha: z7.string().optional()
701
- });
702
- var githubPrChangeSchema = z7.object({
703
- path: z7.string(),
704
- previousPath: z7.string().optional(),
705
- status: z7.enum(["added", "modified", "removed", "renamed", "copied", "changed"]),
706
- additions: z7.number(),
707
- deletions: z7.number(),
708
- patch: z7.string().optional(),
709
- patchUnavailableReason: z7.enum(["binary", "too-large", "not-provided"]).optional(),
710
- truncated: z7.boolean().optional()
711
- });
712
- var githubPrChangesDataSchema = z7.discriminatedUnion("available", [
713
- z7.object({
714
- available: z7.literal(true),
715
- number: z7.number(),
716
- headSha: z7.string(),
717
- files: z7.array(githubPrChangeSchema),
718
- additions: z7.number(),
719
- deletions: z7.number(),
720
- truncated: z7.boolean(),
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: z7.string().optional()
810
+ reason: z8.string().optional()
723
811
  }),
724
- z7.object({ available: z7.literal(false), reason: z7.string() })
812
+ z8.object({ available: z8.literal(false), reason: z8.string() })
725
813
  ]);
726
814
 
727
815
  // ../contract/src/workflows.ts
728
- import { z as z8 } from "zod";
729
- var workflowStepDefSchema = z8.object({
730
- id: z8.string().min(1),
731
- name: z8.string().optional(),
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: z8.string().optional(),
734
- skill: z8.string().optional(),
735
- model: z8.string().optional(),
736
- effort: z8.string().max(32).optional(),
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: z8.string().min(1).max(64).optional(),
741
- allowedTools: z8.array(z8.string()).optional(),
742
- bashAllowlist: z8.array(z8.string()).optional(),
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: z8.string().optional(),
745
- onFail: z8.object({
746
- retry: z8.string().min(1),
747
- max: z8.number().int().positive().default(2)
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 = z8.object({
753
- name: z8.string(),
754
- description: z8.string().optional(),
755
- steps: z8.array(workflowStepDefSchema),
756
- source: z8.enum(["built-in", "file"]),
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: z8.string().optional()
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 = z8.object({
768
- path: z8.string(),
769
- message: z8.string()
770
- });
771
- var workflowsResponseSchema = z8.object({
772
- workflows: z8.array(workflowDefSchema),
773
- issues: z8.array(workflowLoadIssueSchema)
774
- });
775
- var saveWorkflowInputSchema = z8.object({
776
- name: z8.string().trim().min(1).max(80),
777
- description: z8.string().max(2e3, "must be at most 2000 characters").optional(),
778
- steps: z8.array(workflowStepDefSchema).min(1).max(8).optional(),
779
- skills: z8.array(z8.string().trim().min(1)).min(1).max(8).optional(),
780
- overwrite: z8.boolean().optional()
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 = z8.object({
785
- path: z8.string(),
786
- name: z8.string()
872
+ var saveWorkflowResponseSchema = z9.object({
873
+ path: z9.string(),
874
+ name: z9.string()
787
875
  });
788
- var parsedWorkflowSchema = z8.object({
789
- name: z8.string(),
790
- description: z8.string().optional(),
791
- steps: z8.array(workflowStepDefSchema)
876
+ var parsedWorkflowSchema = z9.object({
877
+ name: z9.string(),
878
+ description: z9.string().optional(),
879
+ steps: z9.array(workflowStepDefSchema)
792
880
  });
793
- var deleteWorkflowResponseSchema = z8.object({
794
- ok: z8.literal(true),
795
- path: z8.string()
881
+ var deleteWorkflowResponseSchema = z9.object({
882
+ ok: z9.literal(true),
883
+ path: z9.string()
796
884
  });
797
- var planResponseSchema = z8.object({
885
+ var planResponseSchema = z9.object({
798
886
  /** The kebab-case workflow title the planner proposed. Absent on the degraded fallback. */
799
- name: z8.string().optional(),
800
- steps: z8.array(workflowStepDefSchema),
801
- rationale: z8.string(),
802
- fallback: z8.boolean()
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 = z9.enum([
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 = z9.enum(["monitoring"]);
816
- var stepStatusSchema = z9.enum([
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 = z9.number().finite().nonnegative();
827
- var stepStateSchema = z9.object({
828
- id: z9.string(),
829
- name: z9.string(),
830
- kind: z9.enum(["agent", "check"]),
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: z9.number(),
920
+ iterations: z10.number(),
833
921
  /** Durable count of onFail retry loops consumed by this check. */
834
- retriesUsed: z9.number().int().nonnegative().optional(),
835
- tokensUsed: z9.number(),
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: z9.string().optional(),
844
- finishedAt: z9.string().optional(),
845
- error: z9.string().optional(),
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: z9.string().optional(),
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: z9.string().optional(),
855
- costUsd: z9.number().optional(),
942
+ profileId: z10.string().optional(),
943
+ costUsd: z10.number().optional(),
856
944
  /** Explicit provenance for engine-generated continuation steps. */
857
- synthetic: z9.literal("continuation").optional()
945
+ synthetic: z10.literal("continuation").optional()
858
946
  });
859
- var diffStatSchema = z9.object({
860
- adds: z9.number(),
861
- dels: z9.number(),
862
- files: z9.number(),
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: z9.boolean().optional()
957
+ repointed: z10.boolean().optional()
870
958
  });
871
- var queuedMessageSchema = z9.object({
872
- id: z9.string(),
873
- text: z9.string(),
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: z9.array(z9.string()).optional(),
877
- createdAt: z9.string()
964
+ images: z10.array(z10.string()).optional(),
965
+ createdAt: z10.string()
878
966
  });
879
967
  var continuationMessageSchema = queuedMessageSchema.extend({
880
- origin: z9.enum(["human", "lifecycle"]).optional()
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 = z9.object({
972
+ var processUsageSchema = z10.object({
883
973
  /** Sum of `%cpu` across the tree — can exceed 100 on multi-core work. */
884
- cpuPct: z9.number(),
885
- rssBytes: z9.number(),
886
- procCount: z9.number()
974
+ cpuPct: z10.number(),
975
+ rssBytes: z10.number(),
976
+ procCount: z10.number()
887
977
  });
888
- var runRecordSchema = z9.object({
889
- id: z9.string(),
890
- title: z9.string(),
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: z9.string().optional(),
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: z9.string(),
897
- task: z9.string(),
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: z9.array(queuedMessageSchema).optional(),
990
+ queuedMessages: z10.array(queuedMessageSchema).optional(),
901
991
  /** Stop was accepted; execution termination is still pending. */
902
- stopping: z9.boolean().optional(),
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: z9.boolean().optional(),
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: z9.array(agentInputSchema).optional(),
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: z9.array(z9.string()).optional(),
913
- model: z9.string().optional(),
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: z9.string().max(32).optional(),
1010
+ effort: z10.string().max(32).optional(),
917
1011
  /** Normalized provider/model identity used for attribution and reproducible replay. */
918
- modelIdentity: z9.string().optional(),
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: z9.string().optional(),
1016
+ agentProfile: z10.string().optional(),
923
1017
  /** Echo of the extra system prompt the run used (POST override or config default). */
924
- systemPrompt: z9.string().optional(),
1018
+ systemPrompt: z10.string().optional(),
925
1019
  /** false when the run deliberately disabled follow-up todo generation. Absent means enabled. */
926
- generateFollowups: z9.boolean().optional(),
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: z9.boolean().optional(),
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: z9.object({
940
- automationId: z9.string(),
941
- automationRevision: z9.number(),
942
- receiptId: z9.string(),
943
- event: z9.string(),
944
- githubUrl: z9.string()
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: z9.boolean().optional(),
1046
+ hasPendingHumanAsk: z10.boolean().optional(),
953
1047
  /** Exact ISO-8601 deadline for the next automatic monitoring check. */
954
- monitoringWakeAt: z9.string().optional(),
1048
+ monitoringWakeAt: z10.string().optional(),
955
1049
  /** The current live monitoring epoch exhausted its 40 automatic checks. */
956
- monitoringWakeCapReached: z9.boolean().optional(),
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: z9.string().optional(),
1054
+ autoResumeAt: z10.string().optional(),
961
1055
  /** Consecutive automatic resumes since the last human turn, against the safety cap. */
962
- autoResumeAttempts: z9.number().optional(),
963
- createdAt: z9.string(),
964
- startedAt: z9.string().optional(),
965
- finishedAt: z9.string().optional(),
966
- tokensUsed: z9.number(),
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: z9.number().optional(),
970
- pullRequestUrl: z9.string().optional(),
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: z9.string().optional(),
1067
+ referencedPullRequestUrl: z10.string().optional(),
974
1068
  /** The PR/issue number this task is ABOUT (task auto-naming spec) — display tier only. */
975
- prNumber: z9.number().optional(),
976
- issueNumber: z9.number().optional(),
1069
+ prNumber: z10.number().optional(),
1070
+ issueNumber: z10.number().optional(),
977
1071
  /** Server-side provenance: referenced-issue discovery currently owns `issueNumber`. */
978
- referencedIssueNumberSeeded: z9.boolean().optional(),
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: z9.enum(["user", "auto", "marker"]).optional(),
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: z9.object({ pr: z9.number().optional(), issue: z9.number().optional() }).optional(),
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: z9.array(z9.string()).optional(),
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: z9.string().optional(),
1082
+ referencedIssueUrl: z10.string().optional(),
989
1083
  /** The referenced-issue working set, persisted like `referencedPrCandidates`. Capped. */
990
- referencedIssueCandidates: z9.array(z9.string()).optional(),
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: z9.literal(false).optional(),
1087
+ worktree: z10.literal(false).optional(),
994
1088
  /** Absent for in-place runs and after an isolated worktree is removed. */
995
- worktreePath: z9.string().optional(),
996
- branch: z9.string().optional(),
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: z9.string().optional(),
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: z9.string().optional(),
1095
+ worktreeReclaimedAt: z10.string().optional(),
1002
1096
  /** Parallel variants (spec 010): runs sharing a groupId are one group. */
1003
- groupId: z9.string().optional(),
1097
+ groupId: z10.string().optional(),
1004
1098
  /** Variant letter within the group — 'A' | 'B' | 'C'. */
1005
- variant: z9.string().optional(),
1006
- peakRssBytes: z9.number().optional(),
1007
- peakProcCount: z9.number().optional(),
1008
- archived: z9.boolean(),
1009
- archivedAt: z9.string().optional(),
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: z9.boolean().optional(),
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: z9.string().optional(),
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: z9.string().optional(),
1027
- currentStepId: z9.string().optional(),
1028
- error: z9.string().optional(),
1029
- steps: z9.array(stepStateSchema),
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: z9.string().nullable().optional(),
1141
+ finishBlocked: z10.string().nullable().optional(),
1048
1142
  /** Server-resolved Cursor CLI command, including the configured executable. Never persisted. */
1049
- cliResumeCommand: z9.string().optional(),
1143
+ cliResumeCommand: z10.string().optional(),
1050
1144
  usage: processUsageSchema.optional()
1051
1145
  });
1052
- var runIndexEntrySchema = z9.object({
1146
+ var runIndexEntrySchema = z10.object({
1053
1147
  /** The registered project this run belongs to. Joins against `GET /projects`. */
1054
- projectId: z9.string(),
1055
- id: z9.string(),
1056
- title: z9.string(),
1057
- titleSummary: z9.string().optional(),
1058
- titleOrigin: z9.enum(["user", "auto", "marker"]).optional(),
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: z9.string(),
1065
- finishedAt: z9.string().optional(),
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: z9.string().optional(),
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: z9.boolean(),
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: z9.string().optional(),
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: z9.string(),
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: z9.string().optional(),
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: z9.string().optional(),
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: z9.string().optional(),
1101
- referencedPullRequestUrl: z9.string().optional(),
1102
- prNumber: z9.number().optional(),
1103
- issueNumber: z9.number().optional(),
1104
- referencedIssueUrl: z9.string().optional(),
1105
- markerRefs: z9.object({ pr: z9.number().optional(), issue: z9.number().optional() }).optional(),
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: z9.number().optional(),
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: z9.number().optional(),
1113
- peakProcCount: z9.number().optional(),
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 = z9.record(
1126
- z9.string(),
1127
- z9.object({
1128
- prs: z9.record(z9.number(), referenceStatusSchema),
1129
- issues: z9.record(z9.number(), referenceStatusSchema)
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 = z9.object({
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: z9.array(runIndexEntrySchema),
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: z9.number(),
1234
+ perProjectLimit: z10.number(),
1141
1235
  /** Ids of the projects that had more runs than the cap allowed. */
1142
- truncated: z9.array(z9.string())
1236
+ truncated: z10.array(z10.string())
1143
1237
  });
1144
- var createRunResponseSchema = z9.union([
1238
+ var createRunResponseSchema = z10.union([
1145
1239
  runRecordSchema,
1146
- z9.object({ runs: z9.array(runRecordSchema) })
1240
+ z10.object({ runs: z10.array(runRecordSchema) })
1147
1241
  ]);
1148
- var cancelResponseSchema = z9.object({ cancelled: z9.boolean() });
1149
- var cancelAutoResumeResponseSchema = z9.object({ cancelled: z9.literal(true) });
1150
- var archiveFinishedResponseSchema = z9.object({ archived: z9.number() });
1151
- var markAllReadResponseSchema = z9.object({ read: z9.number() });
1152
- var deleteRunResponseSchema = z9.object({ deleted: z9.literal(true) });
1153
- var finishResponseSchema = z9.object({ finished: z9.literal(true) });
1154
- var continueResponseSchema = z9.object({ continued: z9.literal(true) });
1155
- var createPrResponseSchema = z9.object({
1156
- url: z9.string(),
1157
- dryRun: z9.boolean()
1158
- });
1159
- var messageResponseSchema = z9.union([
1160
- z9.object({ delivered: z9.literal(true) }),
1161
- z9.object({ queued: z9.literal(true), message: queuedMessageSchema }),
1162
- z9.object({ deferred: z9.literal(true) })
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 = z9.object({ message: queuedMessageSchema });
1165
- var removeQueuedMessageResponseSchema = z9.object({ removed: z9.literal(true) });
1166
- var openInCliResponseSchema = z9.object({
1167
- opened: z9.literal(true),
1168
- command: z9.string()
1169
- });
1170
- var removeWorktreeResponseSchema = z9.object({ removed: z9.literal(true) });
1171
- var gitCommitResponseSchema = z9.object({
1172
- committed: z9.literal(true),
1173
- sha: z9.string()
1174
- });
1175
- var gitPushResponseSchema = z9.object({
1176
- pushed: z9.literal(true),
1177
- branch: z9.string(),
1178
- remote: z9.string(),
1179
- upstreamSet: z9.boolean()
1180
- });
1181
- var runCommitSchema = z9.object({
1182
- sha: z9.string(),
1183
- subject: z9.string(),
1184
- author: z9.string(),
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: z9.string()
1280
+ when: z10.string()
1187
1281
  });
1188
- var runCommitsResponseSchema = z9.object({ commits: z9.array(runCommitSchema) });
1189
- var groupVariantSchema = z9.object({
1190
- id: z9.string(),
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: z9.string(),
1193
- title: z9.string(),
1286
+ variant: z10.string(),
1287
+ title: z10.string(),
1194
1288
  status: runStatusSchema,
1195
- archived: z9.boolean(),
1196
- tokensUsed: z9.number(),
1289
+ archived: z10.boolean(),
1290
+ tokensUsed: z10.number(),
1197
1291
  inputTokens: usageCounterSchema.optional(),
1198
1292
  outputTokens: usageCounterSchema.optional(),
1199
- costUsd: z9.number().optional(),
1200
- diffStat: z9.string(),
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: z9.string()
1296
+ handoffExcerpt: z10.string()
1203
1297
  });
1204
- var groupResponseSchema = z9.object({
1205
- groupId: z9.string(),
1206
- runs: z9.array(groupVariantSchema)
1298
+ var groupResponseSchema = z10.object({
1299
+ groupId: z10.string(),
1300
+ runs: z10.array(groupVariantSchema)
1207
1301
  });
1208
- var pickVariantResponseSchema = z9.object({
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 = z9.object({
1232
- id: z9.string().min(1),
1233
- file: z9.string().regex(/^[A-Za-z0-9_-][A-Za-z0-9._-]*$/).refine((name) => !name.includes(".."))
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 = z9.object({
1236
- mediaType: z9.string().refine(isAttachmentMediaType, {
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: z9.string().min(1).max(7e6)
1333
+ data: z10.string().min(1).max(7e6)
1240
1334
  });
1241
1335
  var imageInputSchema = attachmentInputSchema;
1242
- var createRunInputBaseSchema = z9.object({
1243
- workflow: z9.string().min(1).optional(),
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: z9.array(workflowStepDefSchema).min(1).max(8).optional(),
1247
- task: z9.string().min(1).max(1e5, "must be at most 100000 characters"),
1248
- model: z9.string().optional(),
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: z9.string().max(32).optional(),
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: z9.string().max(64).optional(),
1348
+ agentProfile: z10.string().max(64).optional(),
1255
1349
  /** 1–3. Above 1 the response is `{ runs }` rather than a single record. */
1256
- variants: z9.number().int().min(1).max(3).optional(),
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: z9.boolean().optional(),
1353
+ worktree: z10.boolean().optional(),
1260
1354
  /** true → autonomous run: never parks at "waiting"; auto-continues until done. */
1261
- autonomous: z9.boolean().optional(),
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: z9.boolean().optional(),
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: z9.string().trim().max(2e4, "must be at most 20000 characters").optional().transform((s) => s ? s : void 0),
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: z9.array(attachmentInputSchema).max(4).optional(),
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: z9.string().min(1).max(200, "must be at most 200 characters").optional()
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 = z9.object({
1281
- text: z9.string().max(1e5).default(""),
1282
- images: z9.array(attachmentInputSchema).max(4).default([])
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 = z9.object({
1287
- title: z9.string().trim().min(1).max(300).optional(),
1288
- task: z9.string().trim().min(1).max(1e5).optional()
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 = z9.object({ pinned: z9.boolean().optional() });
1384
+ var pinRunInputSchema = z10.object({ pinned: z10.boolean().optional() });
1291
1385
 
1292
1386
  // ../contract/src/repo.ts
1293
- import { z as z10 } from "zod";
1294
- var statusEntrySchema = z10.object({
1295
- status: z10.string(),
1296
- path: z10.string()
1297
- });
1298
- var logEntrySchema = z10.object({
1299
- hash: z10.string(),
1300
- subject: z10.string(),
1301
- author: z10.string(),
1302
- when: z10.string()
1303
- });
1304
- var repoResponseSchema = z10.union([
1305
- z10.object({
1306
- info: z10.null(),
1307
- status: z10.array(z10.never()),
1308
- log: z10.array(z10.never()),
1309
- branches: z10.array(z10.never()),
1310
- baseBranch: z10.null()
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
- z10.object({
1406
+ z11.object({
1313
1407
  info: repoInfoSchema,
1314
- status: z10.array(statusEntrySchema),
1315
- log: z10.array(logEntrySchema),
1316
- branches: z10.array(z10.string()),
1317
- baseBranch: z10.string().nullable()
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 = z10.object({
1321
- branch: z10.string(),
1322
- created: z10.boolean()
1323
- });
1324
- var repoPullBranchesResponseSchema = z10.object({ branches: z10.array(z10.string()) });
1325
- var repoPullInputSchema = z10.object({
1326
- branch: z10.string().trim().min(1).max(200).optional(),
1327
- confirm: z10.boolean().optional()
1328
- });
1329
- var repoPullResponseSchema = z10.object({
1330
- branch: z10.string(),
1331
- pulled: z10.literal(true),
1332
- summary: z10.string()
1333
- });
1334
- var repoPullConfirmationSchema = z10.object({
1335
- error: z10.string(),
1336
- branch: z10.string(),
1337
- risks: z10.array(z10.enum(["active_runs", "dirty_tree"]))
1338
- });
1339
- var repoPullErrorSchema = z10.union([
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
- z10.object({ error: z10.string() })
1435
+ z11.object({ error: z11.string() })
1342
1436
  ]);
1343
- var diffStatSchema2 = z10.object({
1344
- adds: z10.number(),
1345
- dels: z10.number(),
1346
- files: z10.number()
1437
+ var diffStatSchema2 = z11.object({
1438
+ adds: z11.number(),
1439
+ dels: z11.number(),
1440
+ files: z11.number()
1347
1441
  });
1348
- var changedFileSchema = z10.object({
1349
- path: z10.string(),
1442
+ var changedFileSchema = z11.object({
1443
+ path: z11.string(),
1350
1444
  /** Rename/copy source — present only when `status` is renamed/copied. */
1351
- oldPath: z10.string().optional(),
1352
- status: z10.enum(["added", "modified", "deleted", "renamed", "copied"]),
1353
- adds: z10.number(),
1354
- dels: z10.number(),
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: z10.boolean(),
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: z10.boolean().optional(),
1453
+ image: z11.boolean().optional(),
1360
1454
  /** This file's unified-diff section; possibly `… (patch truncated)`, possibly empty. */
1361
- patch: z10.string()
1455
+ patch: z11.string()
1362
1456
  });
1363
- var changesPayloadSchema = z10.object({
1364
- files: z10.array(changedFileSchema),
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: z10.object({ headBranch: z10.string(), taskBranch: z10.string() }).optional()
1461
+ repointedHead: z11.object({ headBranch: z11.string(), taskBranch: z11.string() }).optional()
1368
1462
  });
1369
- var repoCommitPayloadSchema = z10.object({
1370
- sha: z10.string(),
1371
- subject: z10.string(),
1372
- author: z10.string(),
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: z10.string(),
1375
- files: z10.array(changedFileSchema),
1468
+ when: z11.string(),
1469
+ files: z11.array(changedFileSchema),
1376
1470
  stat: diffStatSchema2
1377
1471
  });
1378
- var worktreeDirEntrySchema = z10.object({
1379
- name: z10.string(),
1380
- type: z10.enum(["dir", "file"]),
1381
- size: z10.number().optional()
1382
- });
1383
- var worktreeEntrySchema = z10.discriminatedUnion("type", [
1384
- z10.object({
1385
- type: z10.literal("dir"),
1386
- path: z10.string(),
1387
- entries: z10.array(worktreeDirEntrySchema)
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
- z10.object({
1390
- type: z10.literal("file"),
1391
- path: z10.string(),
1392
- size: z10.number(),
1393
- binary: z10.boolean(),
1394
- tooLarge: z10.boolean(),
1395
- content: z10.string().optional()
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 = z10.enum([
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 = z10.object({
1408
- runId: z10.string(),
1409
- title: z10.string(),
1501
+ var worktreeInfoSchema = z11.object({
1502
+ runId: z11.string(),
1503
+ title: z11.string(),
1410
1504
  status: worktreeRunStatusSchema,
1411
- branch: z10.string().nullable(),
1412
- sizeBytes: z10.number().nullable(),
1413
- finishedAt: z10.string().nullable(),
1414
- reclaimable: z10.boolean()
1505
+ branch: z11.string().nullable(),
1506
+ sizeBytes: z11.number().nullable(),
1507
+ finishedAt: z11.string().nullable(),
1508
+ reclaimable: z11.boolean()
1415
1509
  });
1416
- var worktreesResponseSchema = z10.object({
1417
- worktrees: z10.array(worktreeInfoSchema),
1418
- totalBytes: z10.number().nullable(),
1419
- keep: z10.number()
1510
+ var worktreesResponseSchema = z11.object({
1511
+ worktrees: z11.array(worktreeInfoSchema),
1512
+ totalBytes: z11.number().nullable(),
1513
+ keep: z11.number()
1420
1514
  });
1421
- var reclaimWorktreesResponseSchema = z10.object({
1422
- reclaimed: z10.array(z10.string())
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 z11 } from "zod";
1427
- var projectListEntrySchema = z11.object({
1428
- id: z11.string(),
1429
- name: z11.string(),
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: z11.string(),
1432
- addedAt: z11.string(),
1433
- lastOpenedAt: z11.string(),
1434
- source: z11.enum(["local", "checkout"]),
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: z11.enum(["ok", "missing", "not-git"]),
1530
+ status: z12.enum(["ok", "missing", "not-git"]),
1437
1531
  /** Current branch when cheaply available (omitted e.g. on an unborn HEAD). */
1438
- branch: z11.string().optional(),
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: z11.literal("github").optional(),
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: z11.string().optional(),
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: z11.number().optional(),
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: z11.array(z11.string()).optional()
1560
+ tags: z12.array(z12.string()).optional()
1467
1561
  });
1468
- var projectsResponseSchema = z11.object({
1469
- projects: z11.array(projectListEntrySchema),
1470
- bootProject: z11.string(),
1471
- projectsDir: z11.string()
1562
+ var projectsResponseSchema = z12.object({
1563
+ projects: z12.array(projectListEntrySchema),
1564
+ bootProject: z12.string(),
1565
+ projectsDir: z12.string()
1472
1566
  });
1473
- var registerProjectResponseSchema = z11.object({
1567
+ var registerProjectResponseSchema = z12.object({
1474
1568
  project: projectListEntrySchema,
1475
- error: z11.string().optional()
1569
+ error: z12.string().optional()
1476
1570
  });
1477
- var removeProjectResponseSchema = z11.object({
1478
- removed: z11.literal(true),
1479
- id: z11.string()
1571
+ var removeProjectResponseSchema = z12.object({
1572
+ removed: z12.literal(true),
1573
+ id: z12.string()
1480
1574
  });
1481
- var updateProjectResponseSchema = z11.object({
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 = z11.object({
1487
- maxParallel: z11.number().int().min(1).max(16).nullable().optional(),
1488
- tags: z11.array(z11.string().trim().min(1).max(PROJECT_TAG_MAX_LENGTH)).max(PROJECT_TAGS_MAX).nullable().optional()
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 = z11.object({
1494
- url: z11.string().trim().min(1).max(512),
1495
- name: z11.string().trim().max(128).optional(),
1496
- checkoutId: z11.string().trim().max(128).optional()
1497
- });
1498
- var fsBrowseDirSchema = z11.object({
1499
- name: z11.string(),
1500
- path: z11.string(),
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: z11.boolean()
1596
+ isRepo: z12.boolean()
1503
1597
  });
1504
- var fsBrowseResponseSchema = z11.object({
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: z11.string(),
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: z11.string().nullable(),
1511
- dirs: z11.array(fsBrowseDirSchema),
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: z11.boolean()
1608
+ truncated: z12.boolean()
1515
1609
  });
1516
- var launchKeyResponseSchema = z11.object({
1517
- key: z11.string()
1610
+ var launchKeyResponseSchema = z12.object({
1611
+ key: z12.string()
1518
1612
  });
1519
1613
 
1520
1614
  // ../contract/src/workspace.ts
1521
- import { z as z12 } from "zod";
1522
- var workspaceConfigResponseSchema = z12.object({
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: z12.string(),
1618
+ browseRoot: z13.string(),
1525
1619
  /** Checkout root for GUI-cloned projects — stored as written (`~` kept). */
1526
- projectsDir: z12.string(),
1620
+ projectsDir: z13.string(),
1527
1621
  /** Stored override; `null` means inherit `CEZ_SKILLS_AUTO_UPDATE`, then true. */
1528
- skillsAutoUpdate: z12.boolean().nullable(),
1529
- effectiveSkillsAutoUpdate: z12.boolean(),
1530
- composerDefaults: z12.object({
1531
- autonomous: z12.boolean().nullable(),
1532
- worktree: z12.boolean().nullable(),
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: z12.union([z12.boolean(), z12.literal("source-dependent")]),
1535
- inheritedWorktree: z12.boolean()
1628
+ inheritedAutonomous: z13.union([z13.boolean(), z13.literal("source-dependent")]),
1629
+ inheritedWorktree: z13.boolean()
1536
1630
  }),
1537
- resources: z12.object({
1538
- maxParallel: z12.number(),
1539
- maxMonitoringSessions: z12.number(),
1540
- monitoringWakeIntervalMinutes: z12.number().nullable(),
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: z12.boolean(),
1543
- memoryLimitMb: z12.number().nullable(),
1544
- worktreeRetentionDefault: z12.number()
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: z12.object({
1648
+ agentDefaults: z13.object({
1555
1649
  runner: runnerSchema.optional(),
1556
- models: z12.object({
1557
- claude: z12.string().optional(),
1558
- codex: z12.string().optional(),
1559
- opencode: z12.string().optional(),
1560
- pi: z12.string().optional(),
1561
- cursor: z12.string().optional()
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 = z12.object({
1566
- browseRoot: z12.string().trim().min(1).max(4096).optional(),
1567
- projectsDir: z12.string().trim().min(1).max(4096).optional(),
1568
- skillsAutoUpdate: z12.boolean().nullable().optional(),
1569
- composerDefaults: z12.object({
1570
- autonomous: z12.boolean().nullable().optional(),
1571
- worktree: z12.boolean().nullable().optional()
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: z12.object({
1669
+ agentDefaults: z13.object({
1576
1670
  runner: runnerSchema.nullable().optional(),
1577
- models: z12.object({
1578
- claude: z12.string().trim().min(1).max(200).nullable().optional(),
1579
- codex: z12.string().trim().min(1).max(200).nullable().optional(),
1580
- opencode: z12.string().trim().min(1).max(200).nullable().optional(),
1581
- pi: z12.string().trim().min(1).max(200).nullable().optional(),
1582
- cursor: z12.string().trim().min(1).max(200).nullable().optional()
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: z12.object({
1586
- maxParallel: z12.number().int().min(1).max(16).optional(),
1587
- maxMonitoringSessions: z12.number().int().min(0).max(16).optional(),
1588
- monitoringWakeIntervalMinutes: z12.number().int().min(1).max(60).nullable().optional(),
1589
- autoResumeOnUsageLimit: z12.boolean().optional(),
1590
- memoryLimitMb: z12.number().int().min(0).max(1048576).nullable().optional(),
1591
- worktreeRetentionDefault: z12.number().int().min(0).max(1e3).optional()
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 = z12.object({
1595
- accent: z12.enum(["cezarion", "lime", "violet"]).optional(),
1596
- density: z12.enum(["comfortable", "compact", "ultra"]).optional(),
1597
- width: z12.enum(["narrow", "wide"]).optional()
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 = z12.looseObject({
1693
+ var taskTableUiStateSchema = z13.looseObject({
1600
1694
  /** Explicit user choices only. Missing ids keep the registry-owned default. */
1601
- expandedColumns: z12.record(z12.string(), z12.boolean()).optional()
1695
+ expandedColumns: z13.record(z13.string(), z13.boolean()).optional()
1602
1696
  });
1603
- var uiStateSchema = z12.looseObject({
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: z12.object({ source: z12.enum(["workflow", "skill"]), ref: z12.string() }).nullable().optional(),
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: z12.array(z12.object({ source: z12.enum(["workflow", "skill"]), ref: z12.string() })).optional(),
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: z12.boolean().optional(),
1707
+ lastWorktree: z13.boolean().optional(),
1614
1708
  /** The last autonomous choice — remembered like `lastWorktree`. Absent → off. */
1615
- lastAutonomous: z12.boolean().optional(),
1709
+ lastAutonomous: z13.boolean().optional(),
1616
1710
  /** Whether new runs should ask agents to append follow-up work. Absent → on. */
1617
- lastGenerateFollowups: z12.boolean().optional(),
1711
+ lastGenerateFollowups: z13.boolean().optional(),
1618
1712
  /** Skill selection frequency (#408): name → times chosen, across BOTH composers. */
1619
- skillUsage: z12.record(z12.string(), z12.number()).optional(),
1620
- runsView: z12.enum(["list", "table"]).optional(),
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: z12.enum(["issues", "prs"]).optional(),
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: z12.array(
1629
- z12.object({
1630
- id: z12.string(),
1631
- label: z12.string(),
1632
- text: z12.string(),
1633
- skills: z12.array(z12.string()).optional()
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: z12.boolean().optional()
1732
+ dismissedSkillsBanner: z13.boolean().optional()
1639
1733
  });
1640
- var workspaceLastLocationSchema = z12.strictObject({
1641
- projectId: z12.string().min(1).max(64),
1642
- pathname: z12.string().min(1).max(2048).startsWith("/p/"),
1643
- search: z12.string().max(4096).startsWith("?").optional(),
1644
- hash: z12.string().max(2048).startsWith("#").optional()
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 = z12.looseObject({
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: z12.looseObject({ collapsed: z12.record(z12.string(), z12.boolean()).optional() }).optional(),
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: z12.object({
1657
- claude: z12.string().optional(),
1658
- codex: z12.string().optional(),
1659
- opencode: z12.string().optional(),
1660
- pi: z12.string().optional(),
1661
- cursor: z12.string().optional()
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: z12.looseObject({ enabled: z12.boolean().optional() }).optional(),
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: z12.array(z12.string()).optional()
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 = z12.looseObject({
1777
+ var setWorkspaceUiStateInputSchema = z13.looseObject({
1684
1778
  ...workspaceUiStateSchema.shape,
1685
- sidebar: z12.looseObject({
1686
- collapsed: z12.record(z12.string().min(1).max(64), z12.boolean()).refine((map) => Object.keys(map).length <= WORKSPACE_UI_STATE_MAX_KEYS, {
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: z12.strictObject({
1691
- claude: z12.string().min(1).max(128).optional(),
1692
- codex: z12.string().min(1).max(128).optional(),
1693
- opencode: z12.string().min(1).max(128).optional(),
1694
- pi: z12.string().min(1).max(128).optional(),
1695
- cursor: z12.string().min(1).max(128).optional()
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: z12.array(z12.string().min(1).max(200)).max(WORKSPACE_UI_STATE_MAX_KEYS).optional(),
1791
+ importedSkills: z13.array(z13.string().min(1).max(200)).max(WORKSPACE_UI_STATE_MAX_KEYS).optional(),
1698
1792
  taskTable: taskTableUiStateSchema.extend({
1699
- expandedColumns: z12.record(z12.string().min(1).max(64), z12.boolean()).refine((map) => Object.keys(map).length <= TASK_TABLE_MAX_COLUMNS, {
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 = z12.object({
1712
- claude: z12.string().optional(),
1713
- codex: z12.string().optional(),
1714
- opencode: z12.string().optional(),
1715
- pi: z12.string().optional(),
1716
- cursor: z12.string().optional()
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 = z12.object({
1719
- baseBranch: z12.string().nullable(),
1812
+ var configResponseSchema = z13.object({
1813
+ baseBranch: z13.string().nullable(),
1720
1814
  defaultRunner: runnerSchema,
1721
- systemPrompt: z12.string().nullable(),
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: z12.boolean(),
1818
+ modelsLocked: z13.boolean(),
1725
1819
  /** How many tasks run at once (1–16). */
1726
- maxParallel: z12.number(),
1820
+ maxParallel: z13.number(),
1727
1821
  /** Per-task memory ceiling in MiB (whole process tree); null = no limit. */
1728
- memoryLimitMb: z12.number().nullable(),
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: z12.number(),
1825
+ worktreeRetention: z13.number(),
1732
1826
  /** Live title updates: null = no config key, the `CEZ_TITLE_UPDATES` env default (ON) decides. */
1733
- liveTitleUpdates: z12.boolean().nullable(),
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: z12.boolean().nullable()
1830
+ reviewGate: z13.boolean().nullable()
1737
1831
  });
1738
1832
  var setConfigResponseSchema = configResponseSchema;
1739
- var setConfigInputSchema = z12.object({
1740
- baseBranch: z12.string().trim().min(1).max(200).nullable().optional(),
1833
+ var setConfigInputSchema = z13.object({
1834
+ baseBranch: z13.string().trim().min(1).max(200).nullable().optional(),
1741
1835
  defaultRunner: runnerSchema.optional(),
1742
- systemPrompt: z12.string().trim().max(2e4).nullable().optional(),
1743
- defaultModels: z12.object({
1744
- claude: z12.string().trim().max(200).nullable().optional(),
1745
- codex: z12.string().trim().max(200).nullable().optional(),
1746
- opencode: z12.string().trim().max(200).nullable().optional(),
1747
- pi: z12.string().trim().max(200).nullable().optional(),
1748
- cursor: z12.string().trim().max(200).nullable().optional()
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: z12.number().int().min(1).max(16).optional(),
1844
+ maxParallel: z13.number().int().min(1).max(16).optional(),
1751
1845
  /** null or 0 clears the ceiling back to "no limit". */
1752
- memoryLimitMb: z12.number().int().min(0).max(1048576).nullable().optional(),
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: z12.number().int().min(0).max(1e3).nullable().optional(),
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: z12.boolean().nullable().optional(),
1850
+ liveTitleUpdates: z13.boolean().nullable().optional(),
1757
1851
  /** null clears the key back to the env-default behavior (OFF). */
1758
- reviewGate: z12.boolean().nullable().optional()
1852
+ reviewGate: z13.boolean().nullable().optional()
1759
1853
  });
1760
- var skillsUpdateStatusSchema = z12.enum([
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 = z12.object({
1770
- scope: z12.enum(["project", "global"]),
1863
+ var skillsUpdateScopeStateSchema = z13.object({
1864
+ scope: z13.enum(["project", "global"]),
1771
1865
  status: skillsUpdateStatusSchema,
1772
- available: z12.boolean(),
1773
- skills: z12.array(z12.string()),
1774
- checkedAt: z12.string().nullable(),
1775
- updatedAt: z12.string().nullable(),
1776
- reason: z12.string().optional()
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 = z12.object({
1872
+ var skillsUpdateStateSchema = z13.object({
1779
1873
  status: skillsUpdateStatusSchema,
1780
- available: z12.boolean(),
1781
- autoUpdateEnabled: z12.boolean(),
1782
- inherited: z12.boolean(),
1783
- checkedAt: z12.string().nullable(),
1784
- updatedAt: z12.string().nullable(),
1785
- scopes: z12.array(skillsUpdateScopeStateSchema),
1786
- needsUpgradeNotes: z12.boolean()
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 = z12.enum([
1883
+ var providerConnectionStateSchema = z13.enum([
1790
1884
  "connected",
1791
1885
  "disconnected",
1792
1886
  "not-installed",
1793
1887
  "unknown"
1794
1888
  ]);
1795
- var providerStatusSchema = z12.object({
1889
+ var providerStatusSchema = z13.object({
1796
1890
  provider: providerIdSchema,
1797
1891
  status: providerConnectionStateSchema,
1798
- enabled: z12.boolean().optional(),
1799
- hint: z12.string().optional(),
1800
- authFailureId: z12.string().optional(),
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: z12.string().optional()
1899
+ profileId: z13.string().optional()
1806
1900
  });
1807
- var providerStatusResponseSchema = z12.object({
1808
- providers: z12.array(providerStatusSchema)
1901
+ var providerStatusResponseSchema = z13.object({
1902
+ providers: z13.array(providerStatusSchema)
1809
1903
  });
1810
- var providerConnectResponseSchema = z12.discriminatedUnion("opened", [
1811
- z12.object({ opened: z12.literal(true), command: z12.string() }),
1812
- z12.object({ opened: z12.literal(false), connected: z12.literal(true), command: z12.string() })
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 = z12.enum(["claude", "codex", "opencode", "pi", "cursor"]);
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 = z12.object({
1820
- id: z12.string(),
1821
- label: z12.string(),
1822
- description: z12.string(),
1823
- effortLevels: z12.array(effortLevelSchema).optional()
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 = z12.object({
1919
+ var runnerModelCatalogResponseSchema = z13.object({
1826
1920
  runner: runnerSchema,
1827
- models: z12.array(runnerModelOptionSchema),
1828
- source: z12.enum(["live", "cache", "unavailable"]),
1829
- stale: z12.boolean(),
1830
- reason: z12.string().optional()
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 = z12.object({
1833
- id: z12.string(),
1834
- label: z12.string(),
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: z12.string().optional()
1931
+ icon: z13.string().optional()
1838
1932
  });
1839
- var openTargetsResponseSchema = z12.object({
1840
- targets: z12.array(openTargetSchema)
1933
+ var openTargetsResponseSchema = z13.object({
1934
+ targets: z13.array(openTargetSchema)
1841
1935
  });
1842
- var openProjectInSchema = z12.object({
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: z12.string().trim().min(1, "target required").max(200)
1938
+ target: z13.string().trim().min(1, "target required").max(200)
1845
1939
  });
1846
- var openProjectInResponseSchema = z12.object({
1847
- opened: z12.literal(true),
1848
- path: z12.string()
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 z13 } from "zod";
1853
- var skillSchema = z13.object({
1854
- name: z13.string(),
1855
- description: z13.string().optional(),
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: z13.literal(true).optional(),
1858
- body: z13.string(),
1859
- path: z13.string(),
1860
- source: z13.enum(["ai", "cezar", "agents", "global", "team"]),
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: z13.object({
1863
- repo: z13.string(),
1864
- ref: z13.string(),
1865
- path: z13.string(),
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: z13.boolean(),
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: z13.string().optional()
1968
+ commit: z14.string().optional()
1875
1969
  }).optional()
1876
1970
  });
1877
- var importableSkillSchema = z13.object({
1878
- name: z13.string(),
1879
- description: z13.string().optional()
1971
+ var importableSkillSchema = z14.object({
1972
+ name: z14.string(),
1973
+ description: z14.string().optional()
1880
1974
  });
1881
- var todoItemSchema = z13.object({
1882
- id: z13.string(),
1883
- ts: z13.string().optional(),
1884
- taskId: z13.string().optional(),
1885
- summary: z13.string().min(1),
1886
- action: z13.string().optional(),
1887
- prUrl: z13.string().optional(),
1888
- suggestedSkill: z13.string().optional(),
1889
- suggestedArgs: z13.string().optional(),
1890
- suggestedPrompt: z13.string().optional(),
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: z13.boolean().optional(),
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: z13.string().optional()
1989
+ startedTaskId: z14.string().optional()
1896
1990
  });
1897
- var removeTodoResponseSchema = z13.object({
1898
- removed: z13.literal(true)
1991
+ var removeTodoResponseSchema = z14.object({
1992
+ removed: z14.literal(true)
1899
1993
  });
1900
- var startTodoResponseSchema = z13.object({
1994
+ var startTodoResponseSchema = z14.object({
1901
1995
  run: runRecordSchema
1902
1996
  });
1903
1997
 
1904
1998
  // ../contract/src/agent-config.ts
1905
- import { z as z14 } from "zod";
1906
- var agentConfigFormatSchema = z14.enum(["json", "jsonc", "toml", "markdown"]);
1907
- var agentConfigScopeSchema = z14.enum(["user", "project", "local"]);
1908
- var agentConfigKindSchema = z14.enum(["settings", "memory", "mcp"]);
1909
- var agentConfigTrackedSchema = z14.enum(["tracked", "gitignored", "outside-repo"]);
1910
- var agentConfigFileSchema = z14.object({
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: z14.string(),
2006
+ id: z15.string(),
1913
2007
  /** Every runner that reads this file: `<repo>/AGENTS.md` is one file, two readers. */
1914
- runners: z14.array(runnerSchema),
2008
+ runners: z15.array(runnerSchema),
1915
2009
  kind: agentConfigKindSchema,
1916
2010
  scope: agentConfigScopeSchema,
1917
- label: z14.string(),
1918
- path: z14.string(),
2011
+ label: z15.string(),
2012
+ path: z15.string(),
1919
2013
  format: agentConfigFormatSchema,
1920
2014
  tracked: agentConfigTrackedSchema,
1921
- seeded: z14.boolean(),
1922
- holdsMcp: z14.boolean(),
2015
+ seeded: z15.boolean(),
2016
+ holdsMcp: z15.boolean(),
1923
2017
  /** VERBATIM from the vendor docs. Never computed, never generic. */
1924
- precedence: z14.string(),
2018
+ precedence: z15.string(),
1925
2019
  /** Documented mid-run reload behaviour, or absent when the vendor is silent. */
1926
- hotReload: z14.string().optional(),
1927
- docsUrl: z14.string(),
1928
- exists: z14.boolean(),
1929
- size: z14.number(),
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: z14.string().nullable(),
2025
+ version: z15.string().nullable(),
1932
2026
  /** False in hosted mode (whole feature) — the client renders read-only up front. */
1933
- writable: z14.boolean(),
1934
- readOnlyReason: z14.string().optional()
2027
+ writable: z15.boolean(),
2028
+ readOnlyReason: z15.string().optional()
1935
2029
  });
1936
- var userMcpListingSchema = z14.object({
1937
- path: z14.string(),
1938
- servers: z14.array(z14.string()),
1939
- readable: z14.boolean()
2030
+ var userMcpListingSchema = z15.object({
2031
+ path: z15.string(),
2032
+ servers: z15.array(z15.string()),
2033
+ readable: z15.boolean()
1940
2034
  });
1941
- var agentConfigListingSchema = z14.object({
1942
- editable: z14.boolean(),
1943
- files: z14.array(agentConfigFileSchema),
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 = z14.object({
1948
- id: z14.string(),
1949
- path: z14.string(),
1950
- exists: z14.boolean(),
1951
- content: z14.string(),
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: z14.string().nullable()
2047
+ version: z15.string().nullable()
1954
2048
  });
1955
- var setAgentConfigInputSchema = z14.object({
1956
- content: z14.string().max(2e6),
1957
- version: z14.string().nullable()
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 z15 } from "zod";
2055
+ import { z as z16 } from "zod";
1962
2056
  var DEFAULT_AGENT_ACCOUNT_ID = "default";
1963
- var agentAccountFileSchema = z15.object({
1964
- id: z15.string(),
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: z15.string(),
2060
+ label: z16.string(),
1967
2061
  /** Absolute, resolved inside this account's config folder. */
1968
- path: z15.string(),
1969
- exists: z15.boolean()
2062
+ path: z16.string(),
2063
+ exists: z16.boolean()
1970
2064
  });
1971
- var agentProfileSchema = z15.object({
2065
+ var agentProfileSchema = z16.object({
1972
2066
  /** `default` for the discovered profile, else the stored slug. */
1973
- id: z15.string(),
2067
+ id: z16.string(),
1974
2068
  provider: providerIdSchema,
1975
- label: z15.string(),
2069
+ label: z16.string(),
1976
2070
  /** As the user wrote it — a literal `~` is preserved, matching `browseRoot`/`projectsDir`. */
1977
- configDir: z15.string(),
2071
+ configDir: z16.string(),
1978
2072
  /** Expanded absolute path. Same-origin route, like `ProjectListEntry.root`. */
1979
- path: z15.string(),
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: z15.boolean(),
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: z15.boolean(),
2079
+ looksValid: z16.boolean(),
1986
2080
  /** True for the profile cezar discovers from the environment. Never stored, never deletable. */
1987
- isDefault: z15.boolean(),
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: z15.array(agentAccountFileSchema)
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 = z15.object({
2004
- claude: z15.string().optional(),
2005
- codex: z15.string().optional(),
2006
- opencode: z15.string().optional(),
2007
- pi: z15.string().optional(),
2008
- cursor: z15.string().optional()
2009
- });
2010
- var agentProfilesResponseSchema = z15.object({
2011
- editable: z15.boolean(),
2012
- profiles: z15.array(agentProfileSchema),
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: z15.array(providerIdSchema),
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: z15.record(z15.string(), agentAccountSelectionSchema),
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 = z15.object({
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: z15.string().min(1).max(64).nullable(),
2129
+ projectId: z16.string().min(1).max(64).nullable(),
2036
2130
  provider: providerIdSchema,
2037
- profileId: z15.string().max(64).nullable()
2131
+ profileId: z16.string().max(64).nullable()
2038
2132
  });
2039
- var agentProfileSelectionsResponseSchema = z15.object({
2040
- selections: z15.record(z15.string(), agentAccountSelectionSchema),
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 = z15.object({ status: providerStatusSchema });
2045
- var agentAccountDetailsResponseSchema = z15.object({
2046
- available: z15.boolean(),
2047
- reason: z15.string().optional(),
2048
- fields: z15.array(z15.object({ label: z15.string(), value: z15.string() }))
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 = z15.object({
2051
- file: z15.string().min(1).max(200),
2052
- target: z15.string().min(1).max(64).optional()
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 = z15.object({
2055
- opened: z15.literal(true),
2056
- path: z15.string()
2148
+ var openAgentAccountFileResponseSchema = z16.object({
2149
+ opened: z16.literal(true),
2150
+ path: z16.string()
2057
2151
  });
2058
- var createAgentProfileInputSchema = z15.object({
2152
+ var createAgentProfileInputSchema = z16.object({
2059
2153
  provider: providerIdSchema,
2060
- label: z15.string().trim().max(200).optional(),
2154
+ label: z16.string().trim().max(200).optional(),
2061
2155
  /** Stored as written; validated absolute after `~` expansion, server-side. */
2062
- configDir: z15.string().trim().min(1).max(4096)
2156
+ configDir: z16.string().trim().min(1).max(4096)
2063
2157
  });
2064
- var agentProfileResponseSchema = z15.object({ profile: agentProfileSchema });
2065
- var updateAgentProfileInputSchema = z15.object({
2066
- label: z15.string().trim().max(200).optional(),
2067
- configDir: z15.string().trim().min(1).max(4096).optional()
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 = z15.object({
2070
- removed: z15.literal(true),
2071
- id: z15.string()
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 z16 } from "zod";
2076
- var automationEventSchema = z16.enum([
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 = z16.object({
2083
- authors: z16.array(z16.string()).optional(),
2084
- assignees: z16.array(z16.string()).optional(),
2085
- allLabels: z16.array(z16.string()).optional(),
2086
- anyLabels: z16.array(z16.string()).optional(),
2087
- excludeLabels: z16.array(z16.string()).optional(),
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: z16.array(z16.string()).optional(),
2090
- lookbackDays: z16.number(),
2091
- maxRecords: z16.number()
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: z16.string(),
2098
- variants: z16.union([z16.literal(1), z16.literal(2), z16.literal(3)]).optional(),
2099
- systemPrompt: z16.string().optional()
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 = z16.object({
2102
- id: z16.string(),
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: z16.number(),
2105
- name: z16.string(),
2106
- description: z16.string().optional(),
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: z16.boolean(),
2110
- events: z16.array(automationEventSchema),
2111
- intervalSeconds: z16.number(),
2203
+ enabled: z17.boolean(),
2204
+ events: z17.array(automationEventSchema),
2205
+ intervalSeconds: z17.number(),
2112
2206
  filters: automationFiltersSchema,
2113
2207
  task: automationTaskSchema,
2114
- createdAt: z16.string(),
2115
- updatedAt: z16.string()
2208
+ createdAt: z17.string(),
2209
+ updatedAt: z17.string()
2116
2210
  });
2117
- var automationCursorSchema = z16.object({
2118
- timestamp: z16.string(),
2119
- tieBreaker: z16.string().optional()
2211
+ var automationCursorSchema = z17.object({
2212
+ timestamp: z17.string(),
2213
+ tieBreaker: z17.string().optional()
2120
2214
  });
2121
- var automationRuntimeStateSchema = z16.object({
2215
+ var automationRuntimeStateSchema = z17.object({
2122
2216
  /** The definition revision this state belongs to; a bumped revision re-baselines. */
2123
- revision: z16.number().optional(),
2217
+ revision: z17.number().optional(),
2124
2218
  /** Enabling establishes a CURRENT-TIME baseline: records older than this never launch. */
2125
- baselineAt: z16.string().optional(),
2219
+ baselineAt: z17.string().optional(),
2126
2220
  cursor: automationCursorSchema.optional(),
2127
- frozenHighWatermark: automationCursorSchema.extend({ tieBreaker: z16.string() }).optional(),
2128
- backlogAfter: automationCursorSchema.extend({ tieBreaker: z16.string() }).optional(),
2129
- nextCheckAt: z16.string().optional(),
2130
- lastSuccessAt: z16.string().optional(),
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: z16.record(z16.string(), z16.string()).optional(),
2133
- backoffUntil: z16.string().optional(),
2134
- consecutiveFailures: z16.number().optional()
2226
+ etags: z17.record(z17.string(), z17.string()).optional(),
2227
+ backoffUntil: z17.string().optional(),
2228
+ consecutiveFailures: z17.number().optional()
2135
2229
  });
2136
- var automationLogResultSchema = z16.enum([
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 = z16.object({
2146
- seq: z16.number(),
2147
- ts: z16.string(),
2148
- automationId: z16.string(),
2149
- revision: z16.number(),
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: z16.string().optional(),
2153
- durationMs: z16.number().optional(),
2154
- receiptId: z16.string().optional(),
2155
- runId: z16.string().optional(),
2156
- githubNumber: z16.number().optional(),
2157
- githubTitle: z16.string().optional(),
2158
- githubUrl: z16.string().optional(),
2159
- rateLimit: z16.object({
2160
- bucket: z16.enum(["core", "search"]),
2161
- remaining: z16.number().optional(),
2162
- resetAt: z16.string().optional()
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 = z16.object({
2166
- matches: z16.number(),
2167
- launched: z16.number(),
2168
- duplicates: z16.number(),
2169
- errors: z16.number()
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 = z16.object({
2177
- available: z16.boolean(),
2178
- reason: z16.string().optional(),
2179
- scheduler: z16.object({
2180
- state: z16.enum(["scheduled", "idle"]),
2181
- nextDue: z16.string().optional()
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: z16.array(automationListEntrySchema)
2277
+ automations: z17.array(automationListEntrySchema)
2184
2278
  });
2185
- var automationResponseSchema = z16.object({ automation: automationDefinitionSchema });
2186
- var automationDetailResponseSchema = z16.object({
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 = z16.object({
2192
- id: z16.string(),
2193
- automationId: z16.string(),
2194
- mode: z16.enum(["preview", "execute"]),
2195
- status: z16.enum(["queued", "running", "complete", "error"]),
2196
- createdAt: z16.string(),
2197
- completedAt: z16.string().optional(),
2198
- matches: z16.number().optional(),
2199
- truncated: z16.boolean().optional(),
2200
- error: z16.string().optional()
2201
- });
2202
- var automationCheckQueuedResponseSchema = z16.object({ checkId: z16.string() });
2203
- var automationLogResponseSchema = z16.object({
2204
- records: z16.array(automationLogRecordSchema)
2205
- });
2206
- var automationRetryResponseSchema = z16.object({
2207
- receiptId: z16.string(),
2208
- runId: z16.string()
2209
- });
2210
- var createAutomationInputSchema = automationDefinitionSchema.omit({ id: true, revision: true, createdAt: true, updatedAt: true, enabled: true }).extend({ enable: z16.boolean().optional() });
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: z16.boolean().optional(),
2213
- expectedRevision: z16.number()
2306
+ enabled: z17.boolean().optional(),
2307
+ expectedRevision: z17.number()
2214
2308
  });
2215
- var automationCheckInputSchema = z16.object({
2216
- mode: z16.enum(["preview", "execute"])
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,