@rallycry/conveyor-mcp 5.0.1 → 5.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  ConveyorConnection
4
- } from "./chunk-7VH3ULLT.js";
4
+ } from "./chunk-XLDG5QEX.js";
5
5
 
6
6
  // src/cli.ts
7
7
  import { createRequire } from "module";
@@ -67,12 +67,84 @@ function registerProjectTools(server2, conn2) {
67
67
  }
68
68
 
69
69
  // src/tools/connection.ts
70
- import { z as z3 } from "zod";
70
+ import { z as z4 } from "zod";
71
71
 
72
- // ../shared/dist/chunk-OKJPFFQI.js
72
+ // ../shared/dist/chunk-42BS7Y35.js
73
+ import { z as z2 } from "zod";
74
+ var DEFAULT_SONNET_MODEL = "claude-sonnet-5";
75
+ var DEFAULT_OPUS_MODEL = "claude-opus-5";
76
+ var DEFAULT_HAIKU_MODEL = "claude-haiku-4-5-20251001";
77
+ var FABLE_MODEL = "claude-fable-5-1";
78
+ var PREVIOUS_SONNET_MODEL = "claude-sonnet-4-6";
79
+ var PREVIOUS_OPUS_MODEL = "claude-opus-4-8";
80
+ var PTY_STREAM_PORT_BASE = 7420;
81
+ var PTY_STREAM_PORT_ATTEMPTS = 8;
82
+ var PREVIEW_PORT_DENY_LIST = [
83
+ 5432,
84
+ 6379,
85
+ 9200,
86
+ ...Array.from({ length: PTY_STREAM_PORT_ATTEMPTS }, (_, i) => PTY_STREAM_PORT_BASE + i)
87
+ ];
88
+ function normalizeCheckpointPath(value) {
89
+ let normalized = value.trim().replace(/\/{2,}/g, "/");
90
+ normalized = normalized.split("/").filter((segment) => segment !== ".").join("/");
91
+ while (normalized.endsWith("/")) normalized = normalized.slice(0, -1);
92
+ return normalized;
93
+ }
94
+ var checkpointPathSchema = z2.string().transform(normalizeCheckpointPath).pipe(
95
+ z2.string().min(1).refine((value) => value !== ".", "Checkpoint paths must name a repository entry").refine((value) => !value.startsWith("/"), "Checkpoint paths must be repository-relative").refine(
96
+ (value) => !/^[A-Za-z]:[\\/]/.test(value) && !value.includes("\\"),
97
+ "Checkpoint paths must use repository-relative POSIX syntax"
98
+ ).refine(
99
+ (value) => !value.split("/").includes(".."),
100
+ "Checkpoint paths must not traverse a parent directory"
101
+ )
102
+ );
103
+ var secretNameSchema = z2.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/);
104
+ var checkpointKeySchema = z2.string().regex(/^[0-9a-f]{64}$/);
105
+ var checkpointDigestRefSchema = z2.string().regex(/^[^\s@]+@sha256:[0-9a-f]{64}$/);
106
+ var ACTIONS_PREBAKE_REGISTRY_PATTERN = /^[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?(?::(?:[1-9][0-9]{0,4}))?(?:\/[a-z0-9]+(?:[._-][a-z0-9]+)*)*$/;
107
+ var actionsPrebakeRegistrySchema = z2.string().trim().min(1).regex(
108
+ ACTIONS_PREBAKE_REGISTRY_PATTERN,
109
+ "Actions prebake registry must be a lowercase host[:port] with an optional path prefix"
110
+ ).refine((value) => {
111
+ const port = /:([0-9]+)(?:\/|$)/.exec(value)?.[1];
112
+ return !port || Number(port) <= 65535;
113
+ }, "Actions prebake registry port must be between 1 and 65535");
114
+ function uniqueSortedArray(item, minimum = 0) {
115
+ return z2.array(item).min(minimum).superRefine((values, ctx) => {
116
+ if (new Set(values).size !== values.length) {
117
+ ctx.addIssue({ code: z2.ZodIssueCode.custom, message: "Duplicate values are not allowed" });
118
+ }
119
+ }).transform((values) => [...values].sort());
120
+ }
121
+ var projectCheckpointSettingsSchema = z2.object({
122
+ enabled: z2.literal(true),
123
+ cacheCommand: z2.string().trim().min(1),
124
+ cacheInputPaths: uniqueSortedArray(checkpointPathSchema, 1),
125
+ reusableArtifactPaths: uniqueSortedArray(checkpointPathSchema, 1),
126
+ finalizeCommand: z2.string().trim().min(1),
127
+ credentialEpoch: z2.string().trim().min(1),
128
+ requiredSecretNames: uniqueSortedArray(secretNameSchema).optional(),
129
+ optionalSecretNames: uniqueSortedArray(secretNameSchema).optional(),
130
+ bakeWebAppBuild: z2.boolean().optional()
131
+ }).superRefine((checkpoint, ctx) => {
132
+ const required = new Set(checkpoint.requiredSecretNames ?? []);
133
+ for (const name of checkpoint.optionalSecretNames ?? []) {
134
+ if (required.has(name)) {
135
+ ctx.addIssue({
136
+ code: z2.ZodIssueCode.custom,
137
+ path: ["optionalSecretNames"],
138
+ message: "A secret cannot be both required and optional"
139
+ });
140
+ }
141
+ }
142
+ });
73
143
  var CARD_DESCRIPTION_MAX = 255;
74
144
  var CARD_DESCRIPTION_LIMIT_MESSAGE = `Card descriptions are capped at ${CARD_DESCRIPTION_MAX} characters \u2014 write 1-2 plain sentences a non-engineer can read; put technical detail in the plan or card chat.`;
75
145
  var CARD_DESCRIPTION_FIELD_HINT = `max ${CARD_DESCRIPTION_MAX} chars, 1-2 plain sentences a non-engineer can read \u2014 put technical detail in the plan`;
146
+ var DEFAULT_CI_WAIT_TIMEOUT_MINUTES = 45;
147
+ var MAX_CI_WAIT_TIMEOUT_MINUTES = 180;
76
148
  var SEVERITY_ENUM = [
77
149
  "DEBUG",
78
150
  "INFO",
@@ -231,14 +303,14 @@ var f = {
231
303
  return { kind: "nullable", inner };
232
304
  }
233
305
  };
234
- function compileString(z10, spec) {
235
- let schema = z10.string();
306
+ function compileString(z11, spec) {
307
+ let schema = z11.string();
236
308
  if (spec.min !== void 0) schema = schema.min(spec.min);
237
309
  if (spec.max !== void 0) schema = schema.max(spec.max);
238
310
  return schema;
239
311
  }
240
- function compileNumber(z10, spec) {
241
- let schema = z10.number();
312
+ function compileNumber(z11, spec) {
313
+ let schema = z11.number();
242
314
  if (spec.int) schema = schema.int();
243
315
  if (spec.positive) schema = schema.positive();
244
316
  if (spec.nonnegative) schema = schema.nonnegative();
@@ -246,49 +318,49 @@ function compileNumber(z10, spec) {
246
318
  if (spec.max !== void 0) schema = schema.max(spec.max);
247
319
  return schema;
248
320
  }
249
- function compileArray(z10, spec) {
250
- let schema = z10.array(compileField(z10, spec.item));
321
+ function compileArray(z11, spec) {
322
+ let schema = z11.array(compileField(z11, spec.item));
251
323
  if (spec.min !== void 0) schema = schema.min(spec.min);
252
324
  return schema;
253
325
  }
254
- function compileBase(z10, spec) {
326
+ function compileBase(z11, spec) {
255
327
  switch (spec.kind) {
256
328
  case "string":
257
- return compileString(z10, spec);
329
+ return compileString(z11, spec);
258
330
  case "number":
259
- return compileNumber(z10, spec);
331
+ return compileNumber(z11, spec);
260
332
  case "boolean":
261
- return z10.boolean();
333
+ return z11.boolean();
262
334
  case "enum":
263
- return z10.enum([...spec.values]);
335
+ return z11.enum([...spec.values]);
264
336
  case "array":
265
- return compileArray(z10, spec);
337
+ return compileArray(z11, spec);
266
338
  case "object":
267
- return z10.object(compileShape(z10, spec.fields));
339
+ return z11.object(compileShape(z11, spec.fields));
268
340
  }
269
341
  }
270
342
  function descriptionOf(spec) {
271
343
  if (spec.kind === "optional" || spec.kind === "nullable") return descriptionOf(spec.inner);
272
344
  return spec.desc;
273
345
  }
274
- function compileUndescribed(z10, spec) {
346
+ function compileUndescribed(z11, spec) {
275
347
  if (spec.kind === "optional") {
276
- return compileUndescribed(z10, spec.inner).optional();
348
+ return compileUndescribed(z11, spec.inner).optional();
277
349
  }
278
350
  if (spec.kind === "nullable") {
279
- return compileUndescribed(z10, spec.inner).nullable();
351
+ return compileUndescribed(z11, spec.inner).nullable();
280
352
  }
281
- return compileBase(z10, spec);
353
+ return compileBase(z11, spec);
282
354
  }
283
- function compileField(z10, spec) {
284
- const schema = compileUndescribed(z10, spec);
355
+ function compileField(z11, spec) {
356
+ const schema = compileUndescribed(z11, spec);
285
357
  const desc = descriptionOf(spec);
286
358
  return desc === void 0 ? schema : schema.describe(desc);
287
359
  }
288
- function compileShape(z10, fields) {
360
+ function compileShape(z11, fields) {
289
361
  const shape = {};
290
362
  for (const [key, spec] of Object.entries(fields)) {
291
- shape[key] = compileField(z10, spec);
363
+ shape[key] = compileField(z11, spec);
292
364
  }
293
365
  return shape;
294
366
  }
@@ -337,7 +409,7 @@ var postToChatContract = defineToolContract({
337
409
  ),
338
410
  milestone: f.optional(
339
411
  f.enum(["plan_ready", "implementation_complete", "blocked"], {
340
- desc: "Declare a narrative milestone instead of a routine update. Use SPARINGLY \u2014 only when the plan is ready, implementation is complete, or you are blocked. Milestones appear on the card's activity timeline and in Slack."
412
+ desc: "Declare a narrative milestone instead of a routine update. Use SPARINGLY \u2014 only when the plan is ready (plan_ready), implementation is complete (implementation_complete), or you are parked and cannot continue until a human acts (blocked). `blocked` posts a note and enables reply delivery but pages nobody; to page a person, ask them with AskUserQuestion. Never use `blocked` for a finished plan, finished work, or a tool error you can retry. Milestones appear on the card's activity timeline and in Slack."
341
413
  })
342
414
  )
343
415
  }
@@ -457,25 +529,6 @@ var searchTasksContract = defineToolContract({
457
529
  }
458
530
  }
459
531
  });
460
- var childTaskIdForMerge = f.string({
461
- desc: "The child task ID whose PR should be approved and merged"
462
- });
463
- var approveAndMergePrContract = defineToolContract({
464
- name: "approve_and_merge_pr",
465
- agent: {
466
- description: "Approve and merge a child task's PR. Preconditions: child in ReviewPR. Returns { merged }: true = merged (status\u2192ReviewDev); false = automerge queued, wait for ReviewDev. Requires project Admin, or a sub-project merge grant covering every changed file; release PRs require Admin.",
467
- fields: {
468
- childTaskId: childTaskIdForMerge
469
- }
470
- },
471
- mcp: {
472
- description: "Approve a child task's pull request and QUEUE it for merge \u2014 the merge lands asynchronously (~30s sweep) once the CI and code-review gates pass; the response says whether it merged or was queued, so verify PR state before depending on it. Pass projectId to target a specific project; otherwise the configured default project is used. The child task must be in ReviewPR status with a PR. Requires project Admin, or a sub-project merge grant covering every changed file; release PRs require Admin.",
473
- fields: {
474
- projectId: mcpProjectId,
475
- childTaskId: childTaskIdForMerge
476
- }
477
- }
478
- });
479
532
  var getConnectionContextContract = defineToolContract({
480
533
  name: "get_connection_context",
481
534
  agent: {
@@ -495,7 +548,6 @@ var tasksContracts = [
495
548
  readTaskChatContract,
496
549
  listTagsContract,
497
550
  searchTasksContract,
498
- approveAndMergePrContract,
499
551
  getConnectionContextContract
500
552
  ];
501
553
  var STATUS_ENUM = [
@@ -869,7 +921,7 @@ var createSubtaskContract = defineToolContract({
869
921
  ),
870
922
  tags: f.optional(
871
923
  f.array(f.string(), {
872
- desc: 'Tag names to assign to the subtask (e.g. ["refactor"]). Unknown names are rejected \u2014 create the tag first with manage_tags. Use list_tags to see available tags.'
924
+ desc: 'Tag names to assign to the subtask (e.g. ["refactor"]). Unknown names are rejected before the subtask is created, so nothing is written and a corrected retry creates exactly one subtask. Create the tag first with manage_tags. Use list_tags to see available tags.'
873
925
  })
874
926
  )
875
927
  }
@@ -886,12 +938,12 @@ var updateSubtaskContract = defineToolContract({
886
938
  plan: f.optional(f.string()),
887
939
  status: f.optional(
888
940
  f.enum(["Planning", "Open"], {
889
- desc: 'Move the child between "Planning" and "Open". "Open" marks it ready to execute \u2014 required before start_child_cloud_build. Execution statuses transition automatically.'
941
+ desc: 'Move the child between "Planning" and "Open". "Open" marks it ready to execute \u2014 the pack runner takes Open children in dependency order. Execution statuses transition automatically.'
890
942
  })
891
943
  ),
892
944
  agentIdOrName: f.optional(
893
945
  f.string({
894
- desc: "Assign a project agent to the child (agent id or exact name from the Project Agents list). Required before start_child_cloud_build."
946
+ desc: "Assign a project agent to the child (agent id or exact name from the Project Agents list)."
895
947
  })
896
948
  ),
897
949
  ordinal: f.optional(f.number()),
@@ -943,7 +995,7 @@ var deleteSubtaskContract = defineToolContract({
943
995
  var listSubtasksContract = defineToolContract({
944
996
  name: "list_subtasks",
945
997
  agent: {
946
- description: "List all subtasks under the current parent task. Default compact view returns per child: status, agent, story points, PR number/state, and dependencies. On a FAN-OUT pack it also returns holdsBuildSlot per child plus a packSlots summary (in-flight environments vs the PACK_CHILD_LIMIT cap, and which children hold the slots); both are omitted on the default single-pod path, where one pod implements every child and nothing holds a slot. Use to coordinate child work; pass verbose:true only when you need full description/plan text (large). For non-child tasks use get_task.",
998
+ description: "List all subtasks under the current parent task. Default compact view returns per child: status, agent, story points, PR number/state, and dependencies (dependsOn + allDependenciesMet). Use to pick the next ready child and record progress; pass verbose:true only when you need full description/plan text (large). For non-child tasks use get_task.",
947
999
  fields: {
948
1000
  verbose: f.optional(
949
1001
  f.boolean({
@@ -1462,10 +1514,149 @@ var readMeetingTranscriptContract = defineToolContract({
1462
1514
  }
1463
1515
  }
1464
1516
  });
1517
+ var RAW_TEXT_DESC = "The transcript itself. Plain text with `Speaker: line` labels, or a WebVTT/SRT file's contents \u2014 the format is detected, and the speaker labels become the participant list. Paste the whole thing; it is stored as the meeting's record.";
1518
+ var OCCURRED_AT_DESC = "When the meeting happened, ISO 8601 (e.g. 2026-09-02T15:00:00Z). Defaults to now. Must be a real date \u2014 no earlier than 2000, and no more than 48 hours ahead.";
1519
+ var TITLE_DESC = "Meeting title. Defaults to `Meeting <date>` when you do not name one.";
1520
+ var createMeetingContract = defineToolContract({
1521
+ name: "create_meeting",
1522
+ agent: {
1523
+ description: `File a transcript as a project meeting. Use this when you have the text of a call \u2014 a paste, an export, notes captured elsewhere \u2014 and it belongs in the project's record. The transcript is parsed into speaker segments and an AI summary is written straight after, so the meeting reads "processing" for a few seconds before its overview appears. This creates a MEETING, not cards: turning what was decided into work is still create_task's job.`,
1524
+ fields: {
1525
+ rawText: f.string({ desc: RAW_TEXT_DESC, min: 1 }),
1526
+ title: f.optional(f.string({ desc: TITLE_DESC, max: 200 })),
1527
+ occurredAt: f.optional(f.string({ desc: OCCURRED_AT_DESC }))
1528
+ }
1529
+ },
1530
+ mcp: {
1531
+ description: `File a transcript as a project meeting. The text is parsed into speaker segments and summarized automatically, so the meeting reports status "processing" briefly before its overview lands. Creates a meeting only \u2014 use the card tools to turn decisions into work. ${MCP_TAIL}`,
1532
+ fields: {
1533
+ projectId: mcpProjectId,
1534
+ rawText: f.string({ desc: RAW_TEXT_DESC, min: 1 }),
1535
+ title: f.optional(f.string({ desc: TITLE_DESC, max: 200 })),
1536
+ occurredAt: f.optional(f.string({ desc: OCCURRED_AT_DESC }))
1537
+ }
1538
+ }
1539
+ });
1540
+ var SUMMARY_DESC = "Replace the meeting's overview with this text. Markdown, and it is what every reader sees from then on \u2014 write the whole overview, not a note about it. Writing a summary marks the meeting ready, so a later regenerate is the only thing that overwrites it.";
1541
+ var updateMeetingContract = defineToolContract({
1542
+ name: "update_meeting",
1543
+ agent: {
1544
+ description: `Correct a meeting's title or date, or replace its AI summary with a better one. This is how a rewritten overview actually persists \u2014 read the transcript, write the summary you want, and pass it here. Pass at least one field; the ones you leave out are untouched.`,
1545
+ fields: {
1546
+ meetingId: f.string({ desc: MEETING_ID }),
1547
+ title: f.optional(f.string({ desc: TITLE_DESC, max: 200 })),
1548
+ occurredAt: f.optional(f.string({ desc: OCCURRED_AT_DESC })),
1549
+ summary: f.optional(f.string({ desc: SUMMARY_DESC, min: 1 }))
1550
+ }
1551
+ },
1552
+ mcp: {
1553
+ description: `Correct a meeting's title or date, or replace its AI summary with a rewritten one. Pass at least one field; omitted fields are left alone. ${MCP_TAIL}`,
1554
+ fields: {
1555
+ projectId: mcpProjectId,
1556
+ meetingId: f.string({ desc: MEETING_ID }),
1557
+ title: f.optional(f.string({ desc: TITLE_DESC, max: 200 })),
1558
+ occurredAt: f.optional(f.string({ desc: OCCURRED_AT_DESC })),
1559
+ summary: f.optional(f.string({ desc: SUMMARY_DESC, min: 1 }))
1560
+ }
1561
+ }
1562
+ });
1563
+ var CHECKLIST_ITEM_TITLE = "The item's exact title, as get_meeting lists it. Matched case-insensitively.";
1564
+ var CHECKLIST_INTRO = "A meeting's checklist is its follow-ups: one line each, ticked when done, optionally pointing at the Conveyor card that carries the work. The AI summary's proposed next steps are seeded here automatically.";
1565
+ var addMeetingChecklistItemsContract = defineToolContract({
1566
+ name: "add_meeting_checklist_items",
1567
+ agent: {
1568
+ description: `Add follow-up items to a meeting's checklist. ${CHECKLIST_INTRO} Use this for a step the summary missed, or one that came out of a later conversation. Items whose title already exists are skipped, so re-running this is safe.`,
1569
+ fields: {
1570
+ meetingId: f.string({ desc: MEETING_ID }),
1571
+ items: f.array(
1572
+ f.object({ title: f.string({ desc: "One follow-up, as a single line.", min: 1 }) }),
1573
+ { desc: "The items to add, in the order they should appear." }
1574
+ )
1575
+ }
1576
+ },
1577
+ mcp: {
1578
+ description: `Add follow-up items to a meeting's checklist. ${CHECKLIST_INTRO} Existing titles are skipped, so re-running is safe. ${MCP_TAIL}`,
1579
+ fields: {
1580
+ projectId: mcpProjectId,
1581
+ meetingId: f.string({ desc: MEETING_ID }),
1582
+ items: f.array(
1583
+ f.object({ title: f.string({ desc: "One follow-up, as a single line.", min: 1 }) }),
1584
+ { desc: "The items to add, in the order they should appear." }
1585
+ )
1586
+ }
1587
+ }
1588
+ });
1589
+ var LINKED_TASK_DESC = "Card id or slug to attach to this item \u2014 the card that carries the work. Must be in the same project. Pass it in the same call that ticks the item when you just filed the card.";
1590
+ var checkMeetingChecklistItemContract = defineToolContract({
1591
+ name: "check_meeting_checklist_item",
1592
+ agent: {
1593
+ description: `Tick or untick one of a meeting's checklist items, and optionally attach the card that carries it. This is how a next step becomes tracked work: file the card with create_task, then call this with the item's title and the new card's slug. Ticking records YOU as the person who did it. Unticking clears that, but keeps the linked card.`,
1594
+ fields: {
1595
+ meetingId: f.string({ desc: MEETING_ID }),
1596
+ title: f.string({ desc: CHECKLIST_ITEM_TITLE }),
1597
+ checked: f.boolean({ desc: "true to tick the item, false to untick it." }),
1598
+ linkedTask: f.optional(f.string({ desc: LINKED_TASK_DESC }))
1599
+ }
1600
+ },
1601
+ mcp: {
1602
+ description: `Tick or untick a meeting checklist item, optionally attaching the card that carries it. Ticking records the acting user. Unticking clears that but keeps the link. ${MCP_TAIL}`,
1603
+ fields: {
1604
+ projectId: mcpProjectId,
1605
+ meetingId: f.string({ desc: MEETING_ID }),
1606
+ title: f.string({ desc: CHECKLIST_ITEM_TITLE }),
1607
+ checked: f.boolean({ desc: "true to tick the item, false to untick it." }),
1608
+ linkedTask: f.optional(f.string({ desc: LINKED_TASK_DESC }))
1609
+ }
1610
+ }
1611
+ });
1612
+ var editMeetingChecklistItemContract = defineToolContract({
1613
+ name: "edit_meeting_checklist_item",
1614
+ agent: {
1615
+ description: `Reword one of a meeting's checklist items. Use it to sharpen a vague next step into something someone can act on; to mark it done use check_meeting_checklist_item instead.`,
1616
+ fields: {
1617
+ meetingId: f.string({ desc: MEETING_ID }),
1618
+ title: f.string({ desc: CHECKLIST_ITEM_TITLE }),
1619
+ newTitle: f.string({ desc: "The replacement text, as a single line.", min: 1 })
1620
+ }
1621
+ },
1622
+ mcp: {
1623
+ description: `Reword a meeting checklist item. To mark it done use check_meeting_checklist_item. ${MCP_TAIL}`,
1624
+ fields: {
1625
+ projectId: mcpProjectId,
1626
+ meetingId: f.string({ desc: MEETING_ID }),
1627
+ title: f.string({ desc: CHECKLIST_ITEM_TITLE }),
1628
+ newTitle: f.string({ desc: "The replacement text, as a single line.", min: 1 })
1629
+ }
1630
+ }
1631
+ });
1632
+ var removeMeetingChecklistItemContract = defineToolContract({
1633
+ name: "remove_meeting_checklist_item",
1634
+ agent: {
1635
+ description: `Delete one of a meeting's checklist items. For a step that turned out not to be needed. An item someone already ticked is a record that work happened \u2014 untick it or leave it rather than deleting it.`,
1636
+ fields: {
1637
+ meetingId: f.string({ desc: MEETING_ID }),
1638
+ title: f.string({ desc: CHECKLIST_ITEM_TITLE })
1639
+ }
1640
+ },
1641
+ mcp: {
1642
+ description: `Delete a meeting checklist item. Prefer unticking over deleting an item someone already completed. ${MCP_TAIL}`,
1643
+ fields: {
1644
+ projectId: mcpProjectId,
1645
+ meetingId: f.string({ desc: MEETING_ID }),
1646
+ title: f.string({ desc: CHECKLIST_ITEM_TITLE })
1647
+ }
1648
+ }
1649
+ });
1465
1650
  var meetingsContracts = [
1466
1651
  listMeetingsContract,
1467
1652
  getMeetingContract,
1468
- readMeetingTranscriptContract
1653
+ readMeetingTranscriptContract,
1654
+ createMeetingContract,
1655
+ updateMeetingContract,
1656
+ addMeetingChecklistItemsContract,
1657
+ checkMeetingChecklistItemContract,
1658
+ editMeetingChecklistItemContract,
1659
+ removeMeetingChecklistItemContract
1469
1660
  ];
1470
1661
  var SINCE_MINUTES = f.optional(
1471
1662
  f.number({
@@ -1581,6 +1772,50 @@ var logsContracts = [
1581
1772
  queryGcpLogsContract,
1582
1773
  queryGrafanaLogsContract
1583
1774
  ];
1775
+ var SHA = f.optional(
1776
+ f.string({
1777
+ desc: "Commit sha to watch, full or abbreviated. Defaults to the head of prNumber, else this card's PR, else the tip of this card's branch.",
1778
+ min: 7,
1779
+ max: 40
1780
+ })
1781
+ );
1782
+ var PR_NUMBER = f.optional(
1783
+ f.number({
1784
+ desc: "PR number whose current head to watch. Use this for a child's PR when orchestrating a pack.",
1785
+ int: true,
1786
+ positive: true
1787
+ })
1788
+ );
1789
+ var TIMEOUT_MINUTES = f.optional(
1790
+ f.number({
1791
+ desc: `Give up after this many minutes (default ${DEFAULT_CI_WAIT_TIMEOUT_MINUTES}, max ${MAX_CI_WAIT_TIMEOUT_MINUTES}); you are woken with timed_out.`,
1792
+ int: true,
1793
+ min: 1,
1794
+ max: MAX_CI_WAIT_TIMEOUT_MINUTES
1795
+ })
1796
+ );
1797
+ var waitForChecksContract = defineToolContract({
1798
+ name: "wait_for_checks",
1799
+ agent: {
1800
+ description: "Wait for CI without holding the pod. Records the commit to watch on this session and returns immediately: if CI already finished you get the result now; otherwise the reply says `parked` and you must END YOUR TURN with no further tool calls. The pod idles out during the wait and Conveyor wakes this session with the result (success or failure with the failing job names and run URL, head_moved when the PR gets a new commit, timed_out at the deadline). Never poll `gh pr checks`, pr-wait scripts, or a sleep loop for CI. If something else wakes you before the result arrives, handle it and call this again.",
1801
+ fields: {
1802
+ sha: SHA,
1803
+ prNumber: PR_NUMBER,
1804
+ timeoutMinutes: TIMEOUT_MINUTES
1805
+ }
1806
+ },
1807
+ mcp: {
1808
+ description: "Park a task's agent session until GitHub reports the CI result for a commit. Pass projectId to target a specific project; otherwise the configured default project is used.",
1809
+ fields: {
1810
+ projectId: mcpProjectId,
1811
+ taskId: f.string({ desc: "The task whose agent session should wait" }),
1812
+ sha: SHA,
1813
+ prNumber: PR_NUMBER,
1814
+ timeoutMinutes: TIMEOUT_MINUTES
1815
+ }
1816
+ }
1817
+ });
1818
+ var ciWaitContracts = [waitForChecksContract];
1584
1819
  var TOOL_CONTRACTS = Object.fromEntries(
1585
1820
  [
1586
1821
  ...tasksContracts,
@@ -1595,14 +1830,15 @@ var TOOL_CONTRACTS = Object.fromEntries(
1595
1830
  ...integrationsContracts,
1596
1831
  ...driveContracts,
1597
1832
  ...meetingsContracts,
1598
- ...logsContracts
1833
+ ...logsContracts,
1834
+ ...ciWaitContracts
1599
1835
  ].map((contract) => [contract.name, contract])
1600
1836
  );
1601
1837
 
1602
1838
  // src/tools/contract-tool.ts
1603
- import { z as z2 } from "zod";
1839
+ import { z as z3 } from "zod";
1604
1840
  function mcpShape(surface) {
1605
- return compileShape(z2, surface.fields);
1841
+ return compileShape(z3, surface.fields);
1606
1842
  }
1607
1843
  function registerContractTool(server2, contract, handler, options) {
1608
1844
  if (options?.alwaysLoad) {
@@ -1645,8 +1881,8 @@ function registerConnectionTools(server2, conn2) {
1645
1881
  "verify_connection",
1646
1882
  "Prove the connection is correct AND that you can actually write to the intended board \u2014 not just that auth works. Runs layered checks (auth \u2192 account \u2192 project \u2192 target board \u2192 capabilities \u2192 read) and returns a plain pass/fail with, on failure, the exact failing layer and ONE next action. Use this instead of get_project_summary to confirm setup: a summary that returns data proves auth, not scope. Pass intendedActions to verify specific capabilities (defaults to read+create+update). Pass projectId to target a specific project; otherwise the configured default project is used. The board scope comes from CONVEYOR_SUBPROJECT_ID.",
1647
1883
  {
1648
- projectId: z3.string().optional().describe("Target Conveyor project ID"),
1649
- intendedActions: z3.array(z3.enum(CAPABILITY_ENUM)).optional().describe(
1884
+ projectId: z4.string().optional().describe("Target Conveyor project ID"),
1885
+ intendedActions: z4.array(z4.enum(CAPABILITY_ENUM)).optional().describe(
1650
1886
  "Capabilities to verify the connection can perform (default: read, create, update)."
1651
1887
  )
1652
1888
  },
@@ -1659,7 +1895,7 @@ function registerConnectionTools(server2, conn2) {
1659
1895
  "list_accessible_subprojects",
1660
1896
  "List the boards (sub-projects) under the connected project \u2014 each with its ID, name, slug, board URL, owned root path, and the role/capabilities this token has on it. Use this to discover which board to create or list cards on (pass a returned id as subProjectId, or set CONVEYOR_SUBPROJECT_ID) instead of asking the human for one. Pass projectId to target a specific project; otherwise the configured default project is used.",
1661
1897
  {
1662
- projectId: z3.string().optional().describe("Target Conveyor project ID")
1898
+ projectId: z4.string().optional().describe("Target Conveyor project ID")
1663
1899
  },
1664
1900
  async (params) => {
1665
1901
  const subprojects = await conn2.listAccessibleSubprojects(params.projectId);
@@ -1669,7 +1905,7 @@ function registerConnectionTools(server2, conn2) {
1669
1905
  }
1670
1906
 
1671
1907
  // src/tools/project-config.ts
1672
- import { z as z4 } from "zod";
1908
+ import { z as z5 } from "zod";
1673
1909
  var CONTEXT_LINK_LOCATOR_MAX = 300;
1674
1910
  function jsonResult(data) {
1675
1911
  return { content: [{ type: "text", text: JSON.stringify(data, null, 2) }] };
@@ -1688,7 +1924,7 @@ function registerGetConnectUrls(server2, conn2) {
1688
1924
  "get_connect_urls",
1689
1925
  "Get browser-only setup URLs to hand to the user: the Google Cloud OAuth connect link (gcpConnect) plus Settings deep links (gcpSettings, memberSettings, projectSettings, setupWizard). Use these for setup steps an agent cannot perform (OAuth grants, secret entry). Pass projectId to target a specific project; otherwise the configured default project is used.",
1690
1926
  {
1691
- projectId: z4.string().optional().describe("Target Conveyor project ID")
1927
+ projectId: z5.string().optional().describe("Target Conveyor project ID")
1692
1928
  },
1693
1929
  async (params) => jsonResult(await conn2.getConnectUrls(params.projectId))
1694
1930
  );
@@ -1698,16 +1934,16 @@ function registerUpdateProjectSettings(server2, conn2) {
1698
1934
  "update_project_settings",
1699
1935
  "Update project configuration: name, description, default agent assignments, or a deep-merged patch of the project settings JSON (JSON Merge Patch: nested objects merge recursively, null deletes a key, arrays replace \u2014 a partial patch never wipes sibling keys). Requires a Moderate project role. Does NOT touch repositories or branches \u2014 those are configured in the Conveyor UI.",
1700
1936
  {
1701
- projectId: z4.string().optional().describe("Target Conveyor project ID"),
1702
- name: z4.string().optional().describe("New project name"),
1703
- description: z4.string().optional().describe("New project description"),
1704
- settings: z4.record(z4.string(), z4.unknown()).optional().describe(
1937
+ projectId: z5.string().optional().describe("Target Conveyor project ID"),
1938
+ name: z5.string().optional().describe("New project name"),
1939
+ description: z5.string().optional().describe("New project description"),
1940
+ settings: z5.record(z5.string(), z5.unknown()).optional().describe(
1705
1941
  "Deep-merged patch of the project settings JSON (JSON Merge Patch semantics: null deletes a key; advanced)"
1706
1942
  ),
1707
- defaultPmAgentId: z4.string().nullable().optional().describe("Default PM agent ID"),
1708
- defaultTaskAgentId: z4.string().nullable().optional().describe("Default task agent ID"),
1709
- defaultReviewerAgentId: z4.string().nullable().optional().describe("Default reviewer agent ID"),
1710
- helperAgentId: z4.string().nullable().optional().describe("Helper agent ID")
1943
+ defaultPmAgentId: z5.string().nullable().optional().describe("Default PM agent ID"),
1944
+ defaultTaskAgentId: z5.string().nullable().optional().describe("Default task agent ID"),
1945
+ defaultReviewerAgentId: z5.string().nullable().optional().describe("Default reviewer agent ID"),
1946
+ helperAgentId: z5.string().nullable().optional().describe("Helper agent ID")
1711
1947
  },
1712
1948
  async (params) => {
1713
1949
  const { projectId: projectId2, name, description, settings, ...agents } = params;
@@ -1731,16 +1967,16 @@ function registerUpdateProjectSettings(server2, conn2) {
1731
1967
  }
1732
1968
  );
1733
1969
  }
1734
- var contextPathSchema = z4.object({
1735
- type: z4.enum(["rule", "doc", "file", "folder"]).describe(
1970
+ var contextPathSchema = z5.object({
1971
+ type: z5.enum(["rule", "doc", "file", "folder"]).describe(
1736
1972
  "Kind of context link \u2014 a rule/doc file, a source file, or a folder. All paths are repo-relative; doc marks a synced project doc, which resolves from the workspace like rule/file"
1737
1973
  ),
1738
- path: z4.string().describe("Repo-relative path, e.g. '.claude/rules/refactor-verification.md'"),
1739
- label: z4.string().optional().describe("Optional human-readable label for the link"),
1740
- locator: z4.string().min(1).max(CONTEXT_LINK_LOCATOR_MAX).regex(/^[^\r\n]*$/, "Locator cannot contain line breaks").optional().describe(
1974
+ path: z5.string().describe("Repo-relative path, e.g. '.claude/rules/refactor-verification.md'"),
1975
+ label: z5.string().optional().describe("Optional human-readable label for the link"),
1976
+ locator: z5.string().min(1).max(CONTEXT_LINK_LOCATOR_MAX).regex(/^[^\r\n]*$/, "Locator cannot contain line breaks").optional().describe(
1741
1977
  'Verified-link tether: text that must keep existing in the file for the link to stay live. With locatorType "test" it must appear inside a real it/test/describe TITLE (a renamed test flags the link stale even if its words survive in a comment); with "code" anywhere in the file. Conveyor re-validates links periodically and exposes per-link status in get_tag / manage_tags list. Locators containing <> are documentation placeholders and stay unchecked.'
1742
1978
  ),
1743
- locatorType: z4.enum(["test", "code"]).optional().describe(
1979
+ locatorType: z5.enum(["test", "code"]).optional().describe(
1744
1980
  "How the locator must match \u2014 required iff locator is set; not valid on folder links"
1745
1981
  )
1746
1982
  }).refine((link) => link.locator === void 0 === (link.locatorType === void 0), {
@@ -1750,24 +1986,24 @@ var contextPathSchema = z4.object({
1750
1986
  });
1751
1987
  var MANAGE_TAGS_DESCRIPTION = "List, create, update, delete, or merge project tags \u2014 the project glossary. create requires name (optional color/description/overview/overviewPath/parentTagIds/contextPaths); update/delete/merge require the tag id. A tag with overviewPath serves its overview from that repo file at the base branch (overview edits are rejected \u2014 edit the file via PR instead; setting/clearing the path is the tag mutation). description (\u2264255) is the summary; overview is the full markdown spec (read with get_tag); parentTagIds is the multi-parent hierarchy \u2014 set it on create, or replace the full set on update; contextPaths wire files/rules/docs into the agent context of any card carrying the tag (replace-set \u2014 pass the full list, [] clears), and a contextPath with a locator becomes a VERIFIED repo link whose status (ok/stale/unchecked) Conveyor tracks against the repo. merge absorbs the tag in id into targetTagId: cards and hierarchy edges move to the target, the target keeps its own description/overview/links, and the absorbed tag is deleted. Use mergePreview first to see the counts. Pass reason on updates and merges \u2014 it lands in the tag's revision history. Mutations require a Moderate project role.";
1752
1988
  var MANAGE_TAGS_SHAPE = {
1753
- action: z4.enum(["list", "create", "update", "delete", "mergePreview", "merge"]).describe("Operation to perform"),
1754
- projectId: z4.string().optional().describe("Target Conveyor project ID (list/create)"),
1755
- id: z4.string().optional().describe("Tag ID (update/delete/mergePreview/merge)"),
1756
- targetTagId: z4.string().optional().describe("Surviving tag ID for mergePreview/merge \u2014 the tag in id is absorbed into this one"),
1757
- name: z4.string().optional().describe("Tag name"),
1758
- color: z4.string().optional().describe("Hex color, e.g. #ff0000"),
1759
- description: z4.string().optional().describe("Tag description \u2014 the \u2264255-char summary"),
1760
- overview: z4.string().nullable().optional().describe(
1989
+ action: z5.enum(["list", "create", "update", "delete", "mergePreview", "merge"]).describe("Operation to perform"),
1990
+ projectId: z5.string().optional().describe("Target Conveyor project ID (list/create)"),
1991
+ id: z5.string().optional().describe("Tag ID (update/delete/mergePreview/merge)"),
1992
+ targetTagId: z5.string().optional().describe("Surviving tag ID for mergePreview/merge \u2014 the tag in id is absorbed into this one"),
1993
+ name: z5.string().optional().describe("Tag name"),
1994
+ color: z5.string().optional().describe("Hex color, e.g. #ff0000"),
1995
+ description: z5.string().optional().describe("Tag description \u2014 the \u2264255-char summary"),
1996
+ overview: z5.string().nullable().optional().describe(
1761
1997
  "Full markdown glossary body (update: null clears). Only used on create/update. REJECTED while the tag has an overviewPath \u2014 edit the sourced repo file instead."
1762
1998
  ),
1763
- overviewPath: z4.string().min(1).max(500).nullable().optional().describe(
1999
+ overviewPath: z5.string().min(1).max(500).nullable().optional().describe(
1764
2000
  "Repo file to source the overview from \u2014 the base-branch content is served everywhere and the stored overview is hidden (update: null clears back to it). A not-yet-merged path is fine: the stored overview serves as fallback (state 'pending') until the file lands. Only used on create/update."
1765
2001
  ),
1766
- parentTagIds: z4.array(z4.string()).max(25).optional().describe(
2002
+ parentTagIds: z5.array(z5.string()).max(25).optional().describe(
1767
2003
  "Parent tag ids (multi-parent hierarchy). Honored on create; replace-set on update: pass the full list, [] clears."
1768
2004
  ),
1769
- reason: z4.string().optional().describe("One line on why (update/merge) \u2014 recorded in the tag's revision history"),
1770
- contextPaths: z4.array(contextPathSchema).max(20).optional().describe(
2005
+ reason: z5.string().optional().describe("One line on why (update/merge) \u2014 recorded in the tag's revision history"),
2006
+ contextPaths: z5.array(contextPathSchema).max(20).optional().describe(
1771
2007
  "Context links (rules/docs/files/folders) auto-loaded into the agent context of cards with this tag. Replace-set: the full list replaces the tag's existing links; pass [] to clear. Only used on create/update."
1772
2008
  )
1773
2009
  };
@@ -1842,13 +2078,13 @@ function registerManagePriorities(server2, conn2) {
1842
2078
  "manage_priorities",
1843
2079
  "List, create, update, or delete project priorities. create requires value (1-100), name, and color; update/delete require the priority id. create/update require a Moderate role; delete requires Admin.",
1844
2080
  {
1845
- action: z4.enum(["list", "create", "update", "delete"]).describe("Operation to perform"),
1846
- projectId: z4.string().optional().describe("Target Conveyor project ID (list/create)"),
1847
- id: z4.string().optional().describe("Priority ID (update/delete)"),
1848
- value: z4.number().int().min(1).max(100).optional().describe("Priority value (1 = highest urgency scale point)"),
1849
- name: z4.string().optional().describe("Priority name"),
1850
- color: z4.string().optional().describe("Hex color, e.g. #ff0000"),
1851
- description: z4.string().optional().describe("Priority description")
2081
+ action: z5.enum(["list", "create", "update", "delete"]).describe("Operation to perform"),
2082
+ projectId: z5.string().optional().describe("Target Conveyor project ID (list/create)"),
2083
+ id: z5.string().optional().describe("Priority ID (update/delete)"),
2084
+ value: z5.number().int().min(1).max(100).optional().describe("Priority value (1 = highest urgency scale point)"),
2085
+ name: z5.string().optional().describe("Priority name"),
2086
+ color: z5.string().optional().describe("Hex color, e.g. #ff0000"),
2087
+ description: z5.string().optional().describe("Priority description")
1852
2088
  },
1853
2089
  async (params) => {
1854
2090
  const { action, projectId: projectId2, id, value, name, color, description } = params;
@@ -1886,10 +2122,10 @@ function registerListTagAttachments(server2, conn2) {
1886
2122
  "list_tag_attachments",
1887
2123
  "List the files labelled as examples of one tag \u2014 the tag page's Attachments gallery, newest label first. Each tile carries the file's name, mime type, size, a downloadUrl, the card it came from, and the tag's other labels on that file. Only uploaded files appear. The page returns `hasMore` instead of a total: pass offset to read the next page. Tag names come from list_tags, which reports each tag's attachmentCount. Pass projectId to target a specific project; otherwise the configured default project is used.",
1888
2124
  {
1889
- projectId: z4.string().optional().describe("Target Conveyor project ID"),
1890
- tag: z4.string().min(1).max(100).describe("Tag id, or the exact tag name (case-insensitive)"),
1891
- limit: z4.number().int().min(1).max(60).optional().describe("Tiles per page (default 24)"),
1892
- offset: z4.number().int().min(0).optional().describe("Tiles to skip (paging). Default 0.")
2125
+ projectId: z5.string().optional().describe("Target Conveyor project ID"),
2126
+ tag: z5.string().min(1).max(100).describe("Tag id, or the exact tag name (case-insensitive)"),
2127
+ limit: z5.number().int().min(1).max(60).optional().describe("Tiles per page (default 24)"),
2128
+ offset: z5.number().int().min(0).optional().describe("Tiles to skip (paging). Default 0.")
1893
2129
  },
1894
2130
  async (params) => jsonResult(await conn2.listTagAttachments(params))
1895
2131
  );
@@ -1904,7 +2140,7 @@ function registerProjectConfigTools(server2, conn2) {
1904
2140
  }
1905
2141
 
1906
2142
  // src/tools/tasks.ts
1907
- import { z as z5 } from "zod";
2143
+ import { z as z6 } from "zod";
1908
2144
 
1909
2145
  // src/tools/tasks-format.ts
1910
2146
  var CLI_EVENT_FORMATTERS = {
@@ -2004,10 +2240,10 @@ var STATUS_ENUM2 = [
2004
2240
  ];
2005
2241
  var CARD_TYPE_ENUM = ["task", "incident", "suggestion"];
2006
2242
  var RISK_ENUM2 = ["critical", "high", "medium", "low"];
2007
- var BOARD_FILTER = z5.string().nullable().optional().describe(
2243
+ var BOARD_FILTER = z6.string().nullable().optional().describe(
2008
2244
  "Filter to a sub-project board. Omit to use the connection's default board (CONVEYOR_SUBPROJECT_ID) when set, else the whole project; pass null to force the whole project. Use list_accessible_subprojects to find board IDs."
2009
2245
  );
2010
- var BOARD_ASSIGN = z5.string().nullable().optional().describe(
2246
+ var BOARD_ASSIGN = z6.string().nullable().optional().describe(
2011
2247
  "Assign the card to a sub-project board. Omit to use the connection's default board (CONVEYOR_SUBPROJECT_ID) when set, else the parent project; pass null to force the parent project. Use list_accessible_subprojects to find board IDs."
2012
2248
  );
2013
2249
  function registerListTasks(server2, conn2) {
@@ -2016,15 +2252,15 @@ function registerListTasks(server2, conn2) {
2016
2252
  "list_tasks",
2017
2253
  "List project cards, optionally filtered by card type, status, or assignment (a specific assignee, or unassigned tasks). Defaults to type=task \u2014 pass typeFilters to list incidents/suggestions. Results are relevance-ordered: highest priority first then newest; suggestions-only queries rank by upvote score. Pass projectId to target a specific project; otherwise the configured default project is used. Returns summaries \u2014 plan omitted, description truncated; use get_task for full details.",
2018
2254
  {
2019
- projectId: z5.string().optional().describe("Target Conveyor project ID"),
2020
- status: z5.enum(STATUS_ENUM2).optional().describe("Filter by task status"),
2021
- typeFilters: z5.array(z5.enum(CARD_TYPE_ENUM)).optional().describe(
2255
+ projectId: z6.string().optional().describe("Target Conveyor project ID"),
2256
+ status: z6.enum(STATUS_ENUM2).optional().describe("Filter by task status"),
2257
+ typeFilters: z6.array(z6.enum(CARD_TYPE_ENUM)).optional().describe(
2022
2258
  'Card types to include, e.g. ["incident"] or ["task", "incident"]. Omit for tasks only.'
2023
2259
  ),
2024
- assigneeId: z5.string().optional().describe("Filter by assigned user ID"),
2025
- unassigned: z5.boolean().optional().describe("Only return tasks with no assignee (mutually exclusive with assigneeId)"),
2260
+ assigneeId: z6.string().optional().describe("Filter by assigned user ID"),
2261
+ unassigned: z6.boolean().optional().describe("Only return tasks with no assignee (mutually exclusive with assigneeId)"),
2026
2262
  subProjectId: BOARD_FILTER,
2027
- limit: z5.number().optional().describe("Max tasks to return (default 50)")
2263
+ limit: z6.number().optional().describe("Max tasks to return (default 50)")
2028
2264
  },
2029
2265
  async (params) => {
2030
2266
  const tasks = await conn2.listTasks(params);
@@ -2064,8 +2300,8 @@ function registerGetCardBySlug(server2, conn2) {
2064
2300
  "get_card_by_slug",
2065
2301
  'Get full card details by the slug from a card URL (/cards/<slug>) instead of a task ID. Also accepts the board\'s "Copy path" form, `<project-slug>/<card-slug>` \u2014 an embedded project slug wins over projectId and over the configured default. Pass projectId to target a specific project; otherwise the configured default project is used.',
2066
2302
  {
2067
- projectId: z5.string().optional().describe("Target Conveyor project ID"),
2068
- slug: z5.string().describe(
2303
+ projectId: z6.string().optional().describe("Target Conveyor project ID"),
2304
+ slug: z6.string().describe(
2069
2305
  "The card slug from a Conveyor card URL, e.g. 'ship-it', or a path-form reference 'my-project/ship-it' (the board's Copy path action)"
2070
2306
  )
2071
2307
  },
@@ -2081,14 +2317,14 @@ function registerCreateTask(server2, conn2) {
2081
2317
  "create_task",
2082
2318
  "Create a new task with title, description, and optional plan. Pass projectId to target a specific project; otherwise the configured default project is used. Icon, story points, and agent assignment are auto-filled when a task is created in (or later moved to) a status beyond Planning \u2014 don't spend turns on them.",
2083
2319
  {
2084
- projectId: z5.string().optional().describe("Target Conveyor project ID"),
2085
- title: z5.string().describe("Task title"),
2086
- description: z5.string().optional().describe(cardDescriptionDesc("Task description")),
2087
- plan: z5.string().optional().describe("Task implementation plan (markdown)"),
2088
- status: z5.enum(["Planning", "Open"]).optional().describe("Initial status (default: Planning)"),
2320
+ projectId: z6.string().optional().describe("Target Conveyor project ID"),
2321
+ title: z6.string().describe("Task title"),
2322
+ description: z6.string().optional().describe(cardDescriptionDesc("Task description")),
2323
+ plan: z6.string().optional().describe("Task implementation plan (markdown)"),
2324
+ status: z6.enum(["Planning", "Open"]).optional().describe("Initial status (default: Planning)"),
2089
2325
  subProjectId: BOARD_ASSIGN,
2090
- tags: z5.array(z5.string()).optional().describe(
2091
- 'Tag names to assign to the new card (e.g. ["refactor"]). Unknown names are rejected \u2014 create the tag first with manage_tags. Use list_tags to see available tags.'
2326
+ tags: z6.array(z6.string()).optional().describe(
2327
+ 'Tag names to assign to the new card (e.g. ["refactor"]). Unknown names are rejected before the card is created, so nothing is written and a corrected retry creates exactly one card. Create the tag first with manage_tags. Use list_tags to see available tags.'
2092
2328
  )
2093
2329
  },
2094
2330
  async (params) => {
@@ -2125,9 +2361,9 @@ function registerMoveCard(server2, conn2) {
2125
2361
  "move_card",
2126
2362
  "Move an eligible Planning or Open task, incident, or suggestion card to another project. Cards with identification or automation in progress, active compute, pull requests, deployments, releases, reviews, or delivered reporter email cannot move. Project-specific metadata is cleared instead of mapped by name. Pass projectId for the source project; otherwise the configured default project is used.",
2127
2363
  {
2128
- projectId: z5.string().optional().describe("Source Conveyor project ID"),
2129
- taskId: z5.string().describe("Card ID or slug"),
2130
- destinationProjectId: z5.string().describe("Destination Conveyor project ID")
2364
+ projectId: z6.string().optional().describe("Source Conveyor project ID"),
2365
+ taskId: z6.string().describe("Card ID or slug"),
2366
+ destinationProjectId: z6.string().describe("Destination Conveyor project ID")
2131
2367
  },
2132
2368
  async (params) => {
2133
2369
  const result = await conn2.moveCard(params);
@@ -2176,12 +2412,12 @@ function registerGetTaskCli(server2, conn2) {
2176
2412
  "get_task_logs",
2177
2413
  "Read CLI execution logs from a task. Pass projectId to target a specific project; otherwise the configured default project is used. Returns agent reasoning, tool calls, setup output, and other execution events. For human chat use read_task_chat.",
2178
2414
  {
2179
- projectId: z5.string().optional().describe("Target Conveyor project ID"),
2180
- taskId: z5.string().describe("The task ID or slug"),
2181
- source: z5.enum(["agent", "application"]).optional().describe(
2415
+ projectId: z6.string().optional().describe("Target Conveyor project ID"),
2416
+ taskId: z6.string().describe("The task ID or slug"),
2417
+ source: z6.enum(["agent", "application"]).optional().describe(
2182
2418
  "Filter by log source: 'agent' for reasoning/tool calls, 'application' for setup/dev-server output"
2183
2419
  ),
2184
- limit: z5.number().optional().describe("Max entries to return (default 50, max 500)")
2420
+ limit: z6.number().optional().describe("Max entries to return (default 50, max 500)")
2185
2421
  },
2186
2422
  async ({ taskId, source, limit, projectId: projectId2 }) => {
2187
2423
  const effectiveLimit = Math.min(limit ?? 50, 500);
@@ -2200,9 +2436,9 @@ function registerGetTaskSessions(server2, conn2) {
2200
2436
  "get_task_sessions",
2201
2437
  "Read compute-session state for a task: legacy CodespaceSession rows plus v3 workspaces, including purpose=review review workspaces. Shows pod identity, liveness, lifecycle, and code-review claim state. Use to diagnose stalled/dead agents or code-review runs. Pass projectId to target a specific project; otherwise the configured default project is used.",
2202
2438
  {
2203
- projectId: z5.string().optional().describe("Target Conveyor project ID"),
2204
- taskId: z5.string().describe("The task ID or slug"),
2205
- limit: z5.number().int().min(1).max(200).optional().describe("Max sessions/workspaces listed per task, newest first (default 20)")
2439
+ projectId: z6.string().optional().describe("Target Conveyor project ID"),
2440
+ taskId: z6.string().describe("The task ID or slug"),
2441
+ limit: z6.number().int().min(1).max(200).optional().describe("Max sessions/workspaces listed per task, newest first (default 20)")
2206
2442
  },
2207
2443
  async ({ taskId, projectId: projectId2, limit }) => {
2208
2444
  const tasks = await conn2.getTaskSessions(taskId, projectId2);
@@ -2239,9 +2475,9 @@ function registerReviewTools(server2, conn2) {
2239
2475
  "approve_task",
2240
2476
  "Move a task forward in the review flow (ReviewPR -> ReviewDev, or -> Complete). Pass projectId to target a specific project; otherwise the configured default project is used.",
2241
2477
  {
2242
- projectId: z5.string().optional().describe("Target Conveyor project ID"),
2243
- taskId: z5.string().describe("The task ID"),
2244
- risk: z5.enum(RISK_ENUM2).optional().describe("Optional risk level to record; defaults to a raise-only 'low' on approval.")
2478
+ projectId: z6.string().optional().describe("Target Conveyor project ID"),
2479
+ taskId: z6.string().describe("The task ID"),
2480
+ risk: z6.enum(RISK_ENUM2).optional().describe("Optional risk level to record; defaults to a raise-only 'low' on approval.")
2245
2481
  },
2246
2482
  async (params) => {
2247
2483
  const result = await conn2.approveTask(params.taskId, params.projectId, params.risk);
@@ -2250,19 +2486,27 @@ function registerReviewTools(server2, conn2) {
2250
2486
  };
2251
2487
  }
2252
2488
  );
2253
- registerContractTool(server2, approveAndMergePrContract, async (params) => {
2254
- const result = await conn2.approveAndMergePR(params.childTaskId, params.projectId);
2255
- const text = result.merged ? `PR #${result.prNumber} approved and merged for task ${result.childTaskId}` : `PR #${result.prNumber} approved and QUEUED for merge for task ${result.childTaskId} \u2014 it merges when the CI and code-review gates pass (checked every ~30s). This call did NOT merge it; verify completion via the PR state before depending on it.`;
2256
- return { content: [{ type: "text", text }] };
2257
- });
2489
+ server2.tool(
2490
+ "approve_and_merge_pr",
2491
+ "Approve a child task's pull request and QUEUE it for merge \u2014 the merge lands asynchronously (~30s sweep) once the CI and code-review gates pass; the response says whether it merged or was queued, so verify PR state before depending on it. Pass projectId to target a specific project; otherwise the configured default project is used. The child task must be in ReviewPR status with a PR. Requires project Admin, or a sub-project merge grant covering every changed file; release PRs require Admin.",
2492
+ {
2493
+ projectId: z6.string().optional().describe("Target Conveyor project ID"),
2494
+ childTaskId: z6.string().describe("The child task ID whose PR should be approved and merged")
2495
+ },
2496
+ async (params) => {
2497
+ const result = await conn2.approveAndMergePR(params.childTaskId, params.projectId);
2498
+ const text = result.merged ? `PR #${result.prNumber} approved and merged for task ${result.childTaskId}` : `PR #${result.prNumber} approved and QUEUED for merge for task ${result.childTaskId} \u2014 it merges when the CI and code-review gates pass (checked every ~30s). This call did NOT merge it; verify completion via the PR state before depending on it.`;
2499
+ return { content: [{ type: "text", text }] };
2500
+ }
2501
+ );
2258
2502
  server2.tool(
2259
2503
  "request_changes",
2260
2504
  "Post feedback and send task back to InProgress for more work. Pass projectId to target a specific project; otherwise the configured default project is used.",
2261
2505
  {
2262
- projectId: z5.string().optional().describe("Target Conveyor project ID"),
2263
- taskId: z5.string().describe("The task ID"),
2264
- feedback: z5.string().describe("Feedback message describing requested changes"),
2265
- risk: z5.enum(RISK_ENUM2).optional().describe("Optional risk level to record; defaults to a raise-only 'medium' on changes.")
2506
+ projectId: z6.string().optional().describe("Target Conveyor project ID"),
2507
+ taskId: z6.string().describe("The task ID"),
2508
+ feedback: z6.string().describe("Feedback message describing requested changes"),
2509
+ risk: z6.enum(RISK_ENUM2).optional().describe("Optional risk level to record; defaults to a raise-only 'medium' on changes.")
2266
2510
  },
2267
2511
  async (params) => {
2268
2512
  await conn2.requestChanges(params.taskId, params.feedback, params.projectId, params.risk);
@@ -2279,9 +2523,9 @@ function registerReviewerTools(server2, conn2) {
2279
2523
  "add_reviewer",
2280
2524
  "Add a project member as a reviewer on a task. Pass projectId to target a specific project; otherwise the configured default project is used. Idempotent \u2014 adding an existing reviewer is a no-op.",
2281
2525
  {
2282
- projectId: z5.string().optional().describe("Target Conveyor project ID"),
2283
- taskId: z5.string().describe("The task ID or slug"),
2284
- userId: z5.string().describe("User ID of the reviewer (use list_project_members to resolve a name or email)")
2526
+ projectId: z6.string().optional().describe("Target Conveyor project ID"),
2527
+ taskId: z6.string().describe("The task ID or slug"),
2528
+ userId: z6.string().describe("User ID of the reviewer (use list_project_members to resolve a name or email)")
2285
2529
  },
2286
2530
  async (params) => {
2287
2531
  const result = await conn2.addReviewer(params);
@@ -2299,9 +2543,9 @@ function registerReviewerTools(server2, conn2) {
2299
2543
  "remove_reviewer",
2300
2544
  "Remove a reviewer from a task. Pass projectId to target a specific project; otherwise the configured default project is used. Idempotent \u2014 removing a non-reviewer is a no-op.",
2301
2545
  {
2302
- projectId: z5.string().optional().describe("Target Conveyor project ID"),
2303
- taskId: z5.string().describe("The task ID or slug"),
2304
- userId: z5.string().describe("User ID of the reviewer to remove")
2546
+ projectId: z6.string().optional().describe("Target Conveyor project ID"),
2547
+ taskId: z6.string().describe("The task ID or slug"),
2548
+ userId: z6.string().describe("User ID of the reviewer to remove")
2305
2549
  },
2306
2550
  async (params) => {
2307
2551
  const result = await conn2.removeReviewer(params);
@@ -2333,7 +2577,7 @@ function registerTaskTools(server2, conn2) {
2333
2577
  }
2334
2578
 
2335
2579
  // src/tools/builds.ts
2336
- import { z as z6 } from "zod";
2580
+ import { z as z7 } from "zod";
2337
2581
  function textResult2(result) {
2338
2582
  return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] };
2339
2583
  }
@@ -2342,8 +2586,8 @@ function registerTaskLifecycleTools(server2, conn2) {
2342
2586
  "stop_task",
2343
2587
  "Compatibility alias for the legacy stop path. stop_task now performs the same durable sleep behavior as sleep_task, preserving task Claudespace state while stopping compute. Pass projectId to target a specific project; otherwise the configured default project is used.",
2344
2588
  {
2345
- projectId: z6.string().optional().describe("Target Conveyor project ID"),
2346
- taskId: z6.string().describe("The task ID")
2589
+ projectId: z7.string().optional().describe("Target Conveyor project ID"),
2590
+ taskId: z7.string().describe("The task ID")
2347
2591
  },
2348
2592
  async (params) => textResult2(await conn2.sleepTask(params.taskId, params.projectId))
2349
2593
  );
@@ -2351,8 +2595,8 @@ function registerTaskLifecycleTools(server2, conn2) {
2351
2595
  "sleep_task",
2352
2596
  "Sleep a task Claudespace, stopping compute while preserving durable state. Pass projectId to target a specific project; otherwise the configured default project is used.",
2353
2597
  {
2354
- projectId: z6.string().optional().describe("Target Conveyor project ID"),
2355
- taskId: z6.string().describe("The task ID")
2598
+ projectId: z7.string().optional().describe("Target Conveyor project ID"),
2599
+ taskId: z7.string().describe("The task ID")
2356
2600
  },
2357
2601
  async (params) => textResult2(await conn2.sleepTask(params.taskId, params.projectId))
2358
2602
  );
@@ -2360,8 +2604,8 @@ function registerTaskLifecycleTools(server2, conn2) {
2360
2604
  "resume_task",
2361
2605
  "Resume a sleeping task Claudespace. Pass projectId to target a specific project; otherwise the configured default project is used.",
2362
2606
  {
2363
- projectId: z6.string().optional().describe("Target Conveyor project ID"),
2364
- taskId: z6.string().describe("The task ID")
2607
+ projectId: z7.string().optional().describe("Target Conveyor project ID"),
2608
+ taskId: z7.string().describe("The task ID")
2365
2609
  },
2366
2610
  async (params) => textResult2(await conn2.resumeTask(params.taskId, params.projectId))
2367
2611
  );
@@ -2369,8 +2613,8 @@ function registerTaskLifecycleTools(server2, conn2) {
2369
2613
  "delete_task_environment",
2370
2614
  "Delete a task environment, including durable Claudespace state. Pass projectId to target a specific project; otherwise the configured default project is used.",
2371
2615
  {
2372
- projectId: z6.string().optional().describe("Target Conveyor project ID"),
2373
- taskId: z6.string().describe("The task ID")
2616
+ projectId: z7.string().optional().describe("Target Conveyor project ID"),
2617
+ taskId: z7.string().describe("The task ID")
2374
2618
  },
2375
2619
  async (params) => textResult2(await conn2.deleteTaskEnvironment(params.taskId, params.projectId))
2376
2620
  );
@@ -2380,8 +2624,8 @@ function registerBuildTools(server2, conn2) {
2380
2624
  "start_task",
2381
2625
  "Start a cloud build (codespace) for a task. Pass projectId to target a specific project; otherwise the configured default project is used.",
2382
2626
  {
2383
- projectId: z6.string().optional().describe("Target Conveyor project ID"),
2384
- taskId: z6.string().describe("The task ID")
2627
+ projectId: z7.string().optional().describe("Target Conveyor project ID"),
2628
+ taskId: z7.string().describe("The task ID")
2385
2629
  },
2386
2630
  async (params) => {
2387
2631
  const result = await conn2.startBuild(params.taskId, params.projectId);
@@ -2393,8 +2637,8 @@ function registerBuildTools(server2, conn2) {
2393
2637
  "create_release",
2394
2638
  "Create a release for the project \u2014 the same flow as the Release button in the web UI. Pass projectId to target a specific project; otherwise the configured default project is used. Creates a release task with a release/YYYY.MM.N branch and a PR from the dev branch to the default branch. Omit taskIds to release ALL cards currently in Review (Dev); pass a subset to cherry-pick \u2014 a cloud build agent then cherry-picks those changes and resolves conflicts. Fails if a release is already in progress or no cards are in Review (Dev).",
2395
2639
  {
2396
- projectId: z6.string().optional().describe("Target Conveyor project ID"),
2397
- taskIds: z6.array(z6.string()).optional().describe(
2640
+ projectId: z7.string().optional().describe("Target Conveyor project ID"),
2641
+ taskIds: z7.array(z7.string()).optional().describe(
2398
2642
  "Task IDs in Review (Dev) to cherry-pick into the release. Omit to release all of them."
2399
2643
  )
2400
2644
  },
@@ -2407,8 +2651,8 @@ function registerBuildTools(server2, conn2) {
2407
2651
  "add_to_release",
2408
2652
  "Add Review (Dev) cards to the project's pending release \u2014 the same flow as the 'Add to Release' button in the web UI. Pass projectId to target a specific project; otherwise the configured default project is used. Cards must be in Review (Dev) and not already part of another release; the release branch is updated with the latest dev changes. Fails if no release is pending (use create_release instead).",
2409
2653
  {
2410
- projectId: z6.string().optional().describe("Target Conveyor project ID"),
2411
- taskIds: z6.array(z6.string()).min(1).describe("Task IDs (not slugs) in Review (Dev) to add to the pending release.")
2654
+ projectId: z7.string().optional().describe("Target Conveyor project ID"),
2655
+ taskIds: z7.array(z7.string()).min(1).describe("Task IDs (not slugs) in Review (Dev) to add to the pending release.")
2412
2656
  },
2413
2657
  async (params) => {
2414
2658
  const result = await conn2.addTasksToRelease(params.taskIds, params.projectId);
@@ -2419,8 +2663,8 @@ function registerBuildTools(server2, conn2) {
2419
2663
  "get_build_status",
2420
2664
  "Check codespace and agent status for a task. Pass projectId to target a specific project; otherwise the configured default project is used.",
2421
2665
  {
2422
- projectId: z6.string().optional().describe("Target Conveyor project ID"),
2423
- taskId: z6.string().describe("The task ID")
2666
+ projectId: z7.string().optional().describe("Target Conveyor project ID"),
2667
+ taskId: z7.string().describe("The task ID")
2424
2668
  },
2425
2669
  async (params) => {
2426
2670
  const status = await conn2.getBuildStatus(params.taskId, params.projectId);
@@ -2432,7 +2676,7 @@ function registerBuildTools(server2, conn2) {
2432
2676
  // src/tools/attachments.ts
2433
2677
  import { readFile, stat } from "fs/promises";
2434
2678
  import { basename, extname } from "path";
2435
- import { z as z7 } from "zod";
2679
+ import { z as z8 } from "zod";
2436
2680
  var MAX_FILE_SIZE_BYTES = 25 * 1024 * 1024;
2437
2681
  var MAX_FILE_TAGS = 5;
2438
2682
  var MIME_BY_EXT = {
@@ -2578,10 +2822,10 @@ function registerSetFileTags(server2, conn2) {
2578
2822
  "set_file_tags",
2579
2823
  "Replace the glossary tags on a file that is already uploaded \u2014 the labelling upload_attachment does at upload time, applied to an existing file. Use it to add older attachments to a tag's Attachments gallery, which is what makes a file a visible example of that tagged entity. `tags` is the FULL replacement set: the names you pass become the file's tags and any others are removed, so pass [] to clear every tag. Names are matched case-insensitively within the project; a name that matches no tag is reported back and never fails the tags that did match. Max 5. Call list_task_files for file IDs and list_tags for tag names. Pass projectId to target a specific project; otherwise the configured default project is used.",
2580
2824
  {
2581
- projectId: z7.string().optional().describe("Target Conveyor project ID"),
2582
- taskId: z7.string().describe("The task ID or slug the file is attached to"),
2583
- fileId: z7.string().describe("The file ID to label \u2014 from list_task_files"),
2584
- tags: z7.array(z7.string().min(1).max(100)).max(MAX_FILE_TAGS).describe(
2825
+ projectId: z8.string().optional().describe("Target Conveyor project ID"),
2826
+ taskId: z8.string().describe("The task ID or slug the file is attached to"),
2827
+ fileId: z8.string().describe("The file ID to label \u2014 from list_task_files"),
2828
+ tags: z8.array(z8.string().min(1).max(100)).max(MAX_FILE_TAGS).describe(
2585
2829
  "Glossary tag names (or ids) the file is an example of. Replaces the file's current tags \u2014 [] clears them. Max 5."
2586
2830
  )
2587
2831
  },
@@ -2810,7 +3054,7 @@ function registerChecklistTools(server2, conn2) {
2810
3054
  }
2811
3055
 
2812
3056
  // src/tools/workspace.ts
2813
- import { z as z8 } from "zod";
3057
+ import { z as z9 } from "zod";
2814
3058
 
2815
3059
  // src/workspace-ssh-tunnel.ts
2816
3060
  import net from "net";
@@ -2930,8 +3174,8 @@ function registerAttachInfoTool(server2, conn2) {
2930
3174
  "workspace_attach_info",
2931
3175
  "Return SSH/SFTP attach metadata for a running task Claudespace, plus hosted preview URLs and configured preview ports. Optionally installs an OpenSSH public key for this attach session.",
2932
3176
  {
2933
- taskId: z8.string().describe("The task ID"),
2934
- sshPublicKey: z8.string().optional().describe("Optional OpenSSH public key to install into the workspace")
3177
+ taskId: z9.string().describe("The task ID"),
3178
+ sshPublicKey: z9.string().optional().describe("Optional OpenSSH public key to install into the workspace")
2935
3179
  },
2936
3180
  async ({ taskId, sshPublicKey }) => {
2937
3181
  const info = await conn2.getWorkspaceAttachInfo(taskId, sshPublicKey);
@@ -2944,7 +3188,7 @@ function registerPreviewUrlsTool(server2, conn2) {
2944
3188
  "workspace_preview_urls",
2945
3189
  "Return the hosted preview URLs and preview ports for a running task Claudespace. This mirrors the web UI preview link metadata.",
2946
3190
  {
2947
- taskId: z8.string().describe("The task ID")
3191
+ taskId: z9.string().describe("The task ID")
2948
3192
  },
2949
3193
  async ({ taskId }) => {
2950
3194
  const info = await conn2.getWorkspaceAttachInfo(taskId);
@@ -2973,10 +3217,10 @@ function registerStartTunnelTool(server2, conn2, startTunnel) {
2973
3217
  "workspace_start_tunnel",
2974
3218
  "Start a local loopback tunnel through the MCP server to a running task Claudespace port. Use port 2222 for SSH/SFTP, or one of previewPorts for app access.",
2975
3219
  {
2976
- taskId: z8.string().describe("The task ID"),
2977
- port: z8.number().optional().describe("Remote Claudespace port. Defaults to SSH port 2222."),
2978
- preferredLocalPort: z8.number().optional().describe("Preferred local loopback port. If omitted, the OS chooses one."),
2979
- sshPublicKey: z8.string().optional().describe("Optional OpenSSH public key to install before opening the tunnel")
3220
+ taskId: z9.string().describe("The task ID"),
3221
+ port: z9.number().optional().describe("Remote Claudespace port. Defaults to SSH port 2222."),
3222
+ preferredLocalPort: z9.number().optional().describe("Preferred local loopback port. If omitted, the OS chooses one."),
3223
+ sshPublicKey: z9.string().optional().describe("Optional OpenSSH public key to install before opening the tunnel")
2980
3224
  },
2981
3225
  async ({ taskId, port, preferredLocalPort, sshPublicKey }) => {
2982
3226
  const info = await conn2.getWorkspaceAttachInfo(taskId, sshPublicKey);
@@ -3036,7 +3280,7 @@ function registerStopTunnelTool(server2) {
3036
3280
  "workspace_stop_tunnel",
3037
3281
  "Stop a local workspace tunnel previously opened by workspace_start_tunnel.",
3038
3282
  {
3039
- tunnelId: z8.string().describe("Tunnel id returned by workspace_start_tunnel")
3283
+ tunnelId: z9.string().describe("Tunnel id returned by workspace_start_tunnel")
3040
3284
  },
3041
3285
  async ({ tunnelId }) => {
3042
3286
  const tunnel = activeTunnels.get(tunnelId);
@@ -3055,7 +3299,7 @@ function registerWorkspaceTools(server2, conn2, deps = {}) {
3055
3299
  }
3056
3300
 
3057
3301
  // ../shared/dist/index.js
3058
- import { z as z9 } from "zod";
3302
+ import { z as z10 } from "zod";
3059
3303
  import { z as z22 } from "zod";
3060
3304
  import { z as z32 } from "zod";
3061
3305
  import { z as z42 } from "zod";
@@ -3064,75 +3308,7 @@ import { z as z62 } from "zod";
3064
3308
  import { z as z72 } from "zod";
3065
3309
  import { z as z82 } from "zod";
3066
3310
  import { z as z92 } from "zod";
3067
- var DEFAULT_SONNET_MODEL = "claude-sonnet-5";
3068
- var DEFAULT_OPUS_MODEL = "claude-opus-5";
3069
- var DEFAULT_HAIKU_MODEL = "claude-haiku-4-5-20251001";
3070
- var FABLE_MODEL = "claude-fable-5";
3071
- var PREVIOUS_SONNET_MODEL = "claude-sonnet-4-6";
3072
- var PREVIOUS_OPUS_MODEL = "claude-opus-4-8";
3073
- var PTY_STREAM_PORT_BASE = 7420;
3074
- var PTY_STREAM_PORT_ATTEMPTS = 8;
3075
- var PREVIEW_PORT_DENY_LIST = [
3076
- 5432,
3077
- 6379,
3078
- 9200,
3079
- ...Array.from({ length: PTY_STREAM_PORT_ATTEMPTS }, (_, i) => PTY_STREAM_PORT_BASE + i)
3080
- ];
3081
- function normalizeCheckpointPath(value) {
3082
- let normalized = value.trim().replace(/\/{2,}/g, "/");
3083
- normalized = normalized.split("/").filter((segment) => segment !== ".").join("/");
3084
- while (normalized.endsWith("/")) normalized = normalized.slice(0, -1);
3085
- return normalized;
3086
- }
3087
- var checkpointPathSchema = z9.string().transform(normalizeCheckpointPath).pipe(
3088
- z9.string().min(1).refine((value) => value !== ".", "Checkpoint paths must name a repository entry").refine((value) => !value.startsWith("/"), "Checkpoint paths must be repository-relative").refine(
3089
- (value) => !/^[A-Za-z]:[\\/]/.test(value) && !value.includes("\\"),
3090
- "Checkpoint paths must use repository-relative POSIX syntax"
3091
- ).refine(
3092
- (value) => !value.split("/").includes(".."),
3093
- "Checkpoint paths must not traverse a parent directory"
3094
- )
3095
- );
3096
- var secretNameSchema = z9.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/);
3097
- var checkpointKeySchema = z9.string().regex(/^[0-9a-f]{64}$/);
3098
- var checkpointDigestRefSchema = z9.string().regex(/^[^\s@]+@sha256:[0-9a-f]{64}$/);
3099
- var ACTIONS_PREBAKE_REGISTRY_PATTERN = /^[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?(?::(?:[1-9][0-9]{0,4}))?(?:\/[a-z0-9]+(?:[._-][a-z0-9]+)*)*$/;
3100
- var actionsPrebakeRegistrySchema = z9.string().trim().min(1).regex(
3101
- ACTIONS_PREBAKE_REGISTRY_PATTERN,
3102
- "Actions prebake registry must be a lowercase host[:port] with an optional path prefix"
3103
- ).refine((value) => {
3104
- const port = /:([0-9]+)(?:\/|$)/.exec(value)?.[1];
3105
- return !port || Number(port) <= 65535;
3106
- }, "Actions prebake registry port must be between 1 and 65535");
3107
- function uniqueSortedArray(item, minimum = 0) {
3108
- return z9.array(item).min(minimum).superRefine((values, ctx) => {
3109
- if (new Set(values).size !== values.length) {
3110
- ctx.addIssue({ code: z9.ZodIssueCode.custom, message: "Duplicate values are not allowed" });
3111
- }
3112
- }).transform((values) => [...values].sort());
3113
- }
3114
- var projectCheckpointSettingsSchema = z9.object({
3115
- enabled: z9.literal(true),
3116
- cacheCommand: z9.string().trim().min(1),
3117
- cacheInputPaths: uniqueSortedArray(checkpointPathSchema, 1),
3118
- reusableArtifactPaths: uniqueSortedArray(checkpointPathSchema, 1),
3119
- finalizeCommand: z9.string().trim().min(1),
3120
- credentialEpoch: z9.string().trim().min(1),
3121
- requiredSecretNames: uniqueSortedArray(secretNameSchema).optional(),
3122
- optionalSecretNames: uniqueSortedArray(secretNameSchema).optional(),
3123
- bakeWebAppBuild: z9.boolean().optional()
3124
- }).superRefine((checkpoint, ctx) => {
3125
- const required = new Set(checkpoint.requiredSecretNames ?? []);
3126
- for (const name of checkpoint.optionalSecretNames ?? []) {
3127
- if (required.has(name)) {
3128
- ctx.addIssue({
3129
- code: z9.ZodIssueCode.custom,
3130
- path: ["optionalSecretNames"],
3131
- message: "A secret cannot be both required and optional"
3132
- });
3133
- }
3134
- }
3135
- });
3311
+ import { z as z102 } from "zod";
3136
3312
  var ACHIEVEMENT_RARITIES = [
3137
3313
  {
3138
3314
  key: "common",
@@ -3156,7 +3332,7 @@ var ACHIEVEMENT_RARITIES = [
3156
3332
  { key: "pack", name: "Pack", color: "#9c27b0", iconPath: "/storypoints/pack.svg" }
3157
3333
  ];
3158
3334
  var RISK_LEVELS = ["critical", "high", "medium", "low"];
3159
- var riskLevelSchema = z22.enum(RISK_LEVELS);
3335
+ var riskLevelSchema = z10.enum(RISK_LEVELS);
3160
3336
  var DEFAULT_RISK_LEVELS = [
3161
3337
  {
3162
3338
  level: "critical",
@@ -3210,168 +3386,168 @@ var MAX_FILE_TAG_LENGTH = 100;
3210
3386
  var EMBED_THRESHOLD_IMAGES = 5 * 1024 * 1024;
3211
3387
  var EMBED_THRESHOLD_TEXT = 2 * 1024 * 1024;
3212
3388
  var IDLE_HEARTBEAT_MS = 90 * 1e3;
3213
- var TurnEndToolCallSchema = z32.object({
3214
- tool: z32.string(),
3215
- input: z32.string().optional(),
3216
- output: z32.string().optional(),
3217
- timestamp: z32.string().optional()
3389
+ var TurnEndToolCallSchema = z22.object({
3390
+ tool: z22.string(),
3391
+ input: z22.string().optional(),
3392
+ output: z22.string().optional(),
3393
+ timestamp: z22.string().optional()
3218
3394
  }).passthrough();
3219
- var KnownAgentEventSchema = z32.discriminatedUnion("type", [
3395
+ var KnownAgentEventSchema = z22.discriminatedUnion("type", [
3220
3396
  // ── Lifecycle / connection ────────────────────────────────────────────
3221
- z32.object({
3222
- type: z32.literal("connected"),
3223
- sessionId: z32.string(),
3224
- projectId: z32.string().optional()
3397
+ z22.object({
3398
+ type: z22.literal("connected"),
3399
+ sessionId: z22.string(),
3400
+ projectId: z22.string().optional()
3225
3401
  }).passthrough(),
3226
3402
  // Open-ended context snapshot spread from buildInitializationContext().
3227
- z32.object({ type: z32.literal("session_manifest") }).passthrough(),
3228
- z32.object({
3229
- type: z32.literal("agent_runner_status"),
3230
- reason: z32.string(),
3231
- attempt: z32.number().optional(),
3232
- attempts: z32.number().optional()
3403
+ z22.object({ type: z22.literal("session_manifest") }).passthrough(),
3404
+ z22.object({
3405
+ type: z22.literal("agent_runner_status"),
3406
+ reason: z22.string(),
3407
+ attempt: z22.number().optional(),
3408
+ attempts: z22.number().optional()
3233
3409
  }).passthrough(),
3234
- z32.object({ type: z32.literal("shutdown"), reason: z32.string().optional() }).passthrough(),
3235
- z32.object({ type: z32.literal("mode_changed"), agentMode: z32.string() }).passthrough(),
3236
- z32.object({ type: z32.literal("mode_transition"), from: z32.string(), to: z32.string() }).passthrough(),
3410
+ z22.object({ type: z22.literal("shutdown"), reason: z22.string().optional() }).passthrough(),
3411
+ z22.object({ type: z22.literal("mode_changed"), agentMode: z22.string() }).passthrough(),
3412
+ z22.object({ type: z22.literal("mode_transition"), from: z22.string(), to: z22.string() }).passthrough(),
3237
3413
  // ── Turn stream ───────────────────────────────────────────────────────
3238
- z32.object({ type: z32.literal("message"), content: z32.string() }).passthrough(),
3239
- z32.object({ type: z32.literal("thinking"), message: z32.string() }).passthrough(),
3240
- z32.object({
3241
- type: z32.literal("tool_use"),
3242
- tool: z32.string(),
3414
+ z22.object({ type: z22.literal("message"), content: z22.string() }).passthrough(),
3415
+ z22.object({ type: z22.literal("thinking"), message: z22.string() }).passthrough(),
3416
+ z22.object({
3417
+ type: z22.literal("tool_use"),
3418
+ tool: z22.string(),
3243
3419
  // Producers send JSON.stringify(input); consumers defend against
3244
3420
  // object inputs from older agents, so the wire stays permissive here.
3245
- input: z32.unknown().optional()
3421
+ input: z22.unknown().optional()
3246
3422
  }).passthrough(),
3247
- z32.object({
3248
- type: z32.literal("tool_result"),
3249
- tool: z32.string(),
3250
- output: z32.unknown().optional(),
3251
- isError: z32.boolean().optional(),
3252
- redactedCount: z32.number().optional()
3423
+ z22.object({
3424
+ type: z22.literal("tool_result"),
3425
+ tool: z22.string(),
3426
+ output: z22.unknown().optional(),
3427
+ isError: z22.boolean().optional(),
3428
+ redactedCount: z22.number().optional()
3253
3429
  }).passthrough(),
3254
- z32.object({ type: z32.literal("turn_end"), toolCalls: z32.array(TurnEndToolCallSchema) }).passthrough(),
3255
- z32.object({
3256
- type: z32.literal("completed"),
3257
- summary: z32.string().optional(),
3258
- durationMs: z32.number().optional()
3430
+ z22.object({ type: z22.literal("turn_end"), toolCalls: z22.array(TurnEndToolCallSchema) }).passthrough(),
3431
+ z22.object({
3432
+ type: z22.literal("completed"),
3433
+ summary: z22.string().optional(),
3434
+ durationMs: z22.number().optional()
3259
3435
  }).passthrough(),
3260
- z32.object({ type: z32.literal("error"), message: z32.string() }).passthrough(),
3261
- z32.object({ type: z32.literal("agent_typing_start") }).passthrough(),
3262
- z32.object({ type: z32.literal("agent_typing_stop") }).passthrough(),
3436
+ z22.object({ type: z22.literal("error"), message: z22.string() }).passthrough(),
3437
+ z22.object({ type: z22.literal("agent_typing_start") }).passthrough(),
3438
+ z22.object({ type: z22.literal("agent_typing_stop") }).passthrough(),
3263
3439
  // ── Telemetry ─────────────────────────────────────────────────────────
3264
3440
  // heartbeat/typing: legacy telemetry the server still classifies as
3265
3441
  // transient (TRANSIENT_EVENT_TYPES) — kept in the vocabulary.
3266
- z32.object({ type: z32.literal("heartbeat") }).passthrough(),
3267
- z32.object({ type: z32.literal("typing") }).passthrough(),
3268
- z32.object({
3269
- type: z32.literal("context_update"),
3270
- contextTokens: z32.number(),
3271
- contextWindow: z32.number(),
3272
- inputTokens: z32.number().optional(),
3273
- cacheReadInputTokens: z32.number().optional(),
3274
- cacheCreationInputTokens: z32.number().optional(),
3275
- totalTokensUsed: z32.number().optional()
3442
+ z22.object({ type: z22.literal("heartbeat") }).passthrough(),
3443
+ z22.object({ type: z22.literal("typing") }).passthrough(),
3444
+ z22.object({
3445
+ type: z22.literal("context_update"),
3446
+ contextTokens: z22.number(),
3447
+ contextWindow: z22.number(),
3448
+ inputTokens: z22.number().optional(),
3449
+ cacheReadInputTokens: z22.number().optional(),
3450
+ cacheCreationInputTokens: z22.number().optional(),
3451
+ totalTokensUsed: z22.number().optional()
3276
3452
  }).passthrough(),
3277
3453
  // Four producer shapes share this type: {rateLimitType, utilization, status}
3278
3454
  // (SDK rate_limit_event), {resetsAt} (agent-connection resume notice), the
3279
3455
  // usage-sampler ({rateLimitType, utilization, status, resetsAt, gauges}
3280
3456
  // — resetsAt matches rateLimitType; gauges survives via .passthrough()), and
3281
3457
  // {unmeasurable, reason} (the sampler reporting it cannot read this key).
3282
- z32.object({
3283
- type: z32.literal("rate_limit_update"),
3284
- rateLimitType: z32.string().optional(),
3285
- utilization: z32.number().optional(),
3286
- status: z32.string().optional(),
3287
- resetsAt: z32.string().optional(),
3288
- unmeasurable: z32.boolean().optional(),
3289
- reason: z32.string().optional()
3458
+ z22.object({
3459
+ type: z22.literal("rate_limit_update"),
3460
+ rateLimitType: z22.string().optional(),
3461
+ utilization: z22.number().optional(),
3462
+ status: z22.string().optional(),
3463
+ resetsAt: z22.string().optional(),
3464
+ unmeasurable: z22.boolean().optional(),
3465
+ reason: z22.string().optional()
3290
3466
  }).passthrough(),
3291
- z32.object({
3292
- type: z32.literal("context_compacted"),
3293
- trigger: z32.string().optional(),
3294
- preTokens: z32.number().optional()
3467
+ z22.object({
3468
+ type: z22.literal("context_compacted"),
3469
+ trigger: z22.string().optional(),
3470
+ preTokens: z22.number().optional()
3295
3471
  }).passthrough(),
3296
- z32.object({
3297
- type: z32.literal("tool_progress"),
3298
- toolName: z32.string().optional(),
3299
- elapsedSeconds: z32.number().optional()
3472
+ z22.object({
3473
+ type: z22.literal("tool_progress"),
3474
+ toolName: z22.string().optional(),
3475
+ elapsedSeconds: z22.number().optional()
3300
3476
  }).passthrough(),
3301
- z32.object({
3302
- type: z32.literal("subagent_started"),
3303
- sdkTaskId: z32.string().optional(),
3304
- description: z32.string().optional()
3477
+ z22.object({
3478
+ type: z22.literal("subagent_started"),
3479
+ sdkTaskId: z22.string().optional(),
3480
+ description: z22.string().optional()
3305
3481
  }).passthrough(),
3306
- z32.object({
3307
- type: z32.literal("subagent_progress"),
3308
- sdkTaskId: z32.string().optional(),
3309
- description: z32.string().optional(),
3310
- toolUses: z32.number().optional(),
3311
- durationMs: z32.number().optional()
3482
+ z22.object({
3483
+ type: z22.literal("subagent_progress"),
3484
+ sdkTaskId: z22.string().optional(),
3485
+ description: z22.string().optional(),
3486
+ toolUses: z22.number().optional(),
3487
+ durationMs: z22.number().optional()
3312
3488
  }).passthrough(),
3313
3489
  // ── Work products ─────────────────────────────────────────────────────
3314
- z32.object({ type: z32.literal("pr_created"), url: z32.string(), number: z32.number() }).passthrough(),
3315
- z32.object({
3316
- type: z32.literal("code_review_complete"),
3317
- result: z32.enum(["approved", "changes_requested"]),
3318
- summary: z32.string().optional(),
3319
- issues: z32.array(
3320
- z32.object({
3321
- file: z32.string(),
3322
- line: z32.number().optional(),
3323
- severity: z32.string().optional(),
3324
- description: z32.string().optional()
3490
+ z22.object({ type: z22.literal("pr_created"), url: z22.string(), number: z22.number() }).passthrough(),
3491
+ z22.object({
3492
+ type: z22.literal("code_review_complete"),
3493
+ result: z22.enum(["approved", "changes_requested"]),
3494
+ summary: z22.string().optional(),
3495
+ issues: z22.array(
3496
+ z22.object({
3497
+ file: z22.string(),
3498
+ line: z22.number().optional(),
3499
+ severity: z22.string().optional(),
3500
+ description: z22.string().optional()
3325
3501
  }).passthrough()
3326
3502
  ).optional()
3327
3503
  }).passthrough(),
3328
3504
  // ── Environment setup / start command ─────────────────────────────────
3329
- z32.object({ type: z32.literal("setup_output"), stream: z32.string(), data: z32.string() }).passthrough(),
3330
- z32.object({
3331
- type: z32.literal("setup_complete"),
3332
- startCommandRunning: z32.boolean().optional(),
3333
- startCommandConfigured: z32.boolean().optional(),
3505
+ z22.object({ type: z22.literal("setup_output"), stream: z22.string(), data: z22.string() }).passthrough(),
3506
+ z22.object({
3507
+ type: z22.literal("setup_complete"),
3508
+ startCommandRunning: z22.boolean().optional(),
3509
+ startCommandConfigured: z22.boolean().optional(),
3334
3510
  // Sanitized server-side by sanitizeSessionPreviewPorts — stays unknown.
3335
- previewPorts: z32.unknown().optional()
3511
+ previewPorts: z22.unknown().optional()
3336
3512
  }).passthrough(),
3337
- z32.object({ type: z32.literal("setup_error"), message: z32.string() }).passthrough(),
3338
- z32.object({ type: z32.literal("start_command_started") }).passthrough(),
3339
- z32.object({ type: z32.literal("start_command_output"), stream: z32.string(), data: z32.string() }).passthrough(),
3340
- z32.object({
3341
- type: z32.literal("start_command_exited"),
3342
- code: z32.number().nullable().optional(),
3343
- signal: z32.string().nullable().optional(),
3344
- message: z32.string().optional()
3513
+ z22.object({ type: z22.literal("setup_error"), message: z22.string() }).passthrough(),
3514
+ z22.object({ type: z22.literal("start_command_started") }).passthrough(),
3515
+ z22.object({ type: z22.literal("start_command_output"), stream: z22.string(), data: z22.string() }).passthrough(),
3516
+ z22.object({
3517
+ type: z22.literal("start_command_exited"),
3518
+ code: z22.number().nullable().optional(),
3519
+ signal: z22.string().nullable().optional(),
3520
+ message: z22.string().optional()
3345
3521
  }).passthrough(),
3346
- z32.object({ type: z32.literal("start_command_error"), message: z32.string() }).passthrough()
3522
+ z22.object({ type: z22.literal("start_command_error"), message: z22.string() }).passthrough()
3347
3523
  ]);
3348
- var AgentEventSchema = z32.union([
3524
+ var AgentEventSchema = z22.union([
3349
3525
  KnownAgentEventSchema,
3350
- z32.object({ type: z32.string().min(1) }).catchall(z32.unknown())
3526
+ z22.object({ type: z22.string().min(1) }).catchall(z22.unknown())
3351
3527
  ]);
3352
- var cardDescription = z42.string().max(CARD_DESCRIPTION_MAX, CARD_DESCRIPTION_LIMIT_MESSAGE).optional();
3353
- var AgentHeartbeatSchema = z42.object({
3354
- sessionId: z42.string().optional(),
3355
- timestamp: z42.string(),
3356
- status: z42.enum(["active", "idle", "building"]),
3357
- currentAction: z42.string().optional(),
3528
+ var cardDescription = z32.string().max(CARD_DESCRIPTION_MAX, CARD_DESCRIPTION_LIMIT_MESSAGE).optional();
3529
+ var AgentHeartbeatSchema = z32.object({
3530
+ sessionId: z32.string().optional(),
3531
+ timestamp: z32.string(),
3532
+ status: z32.enum(["active", "idle", "building"]),
3533
+ currentAction: z32.string().optional(),
3358
3534
  /** Sender-observed main event-loop lag (ms) — see AgentHeartbeat.loopLagMs. */
3359
- loopLagMs: z42.number().nonnegative().optional()
3360
- });
3361
- var CreatePRInputSchema = z42.object({
3362
- title: z42.string().min(1),
3363
- body: z42.string(),
3364
- head: z42.string().optional(),
3365
- base: z42.string().optional()
3366
- });
3367
- var PostToChatInputSchema = z42.object({
3368
- message: z42.string().min(1),
3369
- type: z42.enum(["message", "question", "update"]).optional().default("message"),
3370
- milestone: z42.enum(["plan_ready", "implementation_complete", "blocked"]).optional()
3371
- });
3372
- var GetTaskContextRequestSchema = z42.object({
3373
- sessionId: z42.string(),
3374
- includeHistory: z42.boolean().optional().default(false),
3535
+ loopLagMs: z32.number().nonnegative().optional()
3536
+ });
3537
+ var CreatePRInputSchema = z32.object({
3538
+ title: z32.string().min(1),
3539
+ body: z32.string(),
3540
+ head: z32.string().optional(),
3541
+ base: z32.string().optional()
3542
+ });
3543
+ var PostToChatInputSchema = z32.object({
3544
+ message: z32.string().min(1),
3545
+ type: z32.enum(["message", "question", "update"]).optional().default("message"),
3546
+ milestone: z32.enum(["plan_ready", "implementation_complete", "blocked"]).optional()
3547
+ });
3548
+ var GetTaskContextRequestSchema = z32.object({
3549
+ sessionId: z32.string(),
3550
+ includeHistory: z32.boolean().optional().default(false),
3375
3551
  /**
3376
3552
  * Read the plan-revised marker WITHOUT consuming it. Bookkeeping fetches
3377
3553
  * (the session-identity check, the branch refresh) pass true so they cannot
@@ -3379,277 +3555,277 @@ var GetTaskContextRequestSchema = z42.object({
3379
3555
  * Defaults to false — consuming — so a pod running an older agent build still
3380
3556
  * clears the marker instead of showing the notice on every boot forever.
3381
3557
  */
3382
- peekPlanRevision: z42.boolean().optional().default(false)
3558
+ peekPlanRevision: z32.boolean().optional().default(false)
3383
3559
  });
3384
- var GetChatMessagesRequestSchema = z42.object({
3385
- sessionId: z42.string(),
3386
- limit: z42.number().int().positive().optional().default(50),
3387
- offset: z42.number().int().nonnegative().optional().default(0),
3560
+ var GetChatMessagesRequestSchema = z32.object({
3561
+ sessionId: z32.string(),
3562
+ limit: z32.number().int().positive().optional().default(50),
3563
+ offset: z32.number().int().nonnegative().optional().default(0),
3388
3564
  /** Task id or slug to read chat from. Omit for the session's own task. Only
3389
3565
  * the session's own task or one of its children resolves — anything else is
3390
3566
  * an error, never a silent fallback to the caller's own chat. */
3391
- taskId: z42.string().optional()
3567
+ taskId: z32.string().optional()
3392
3568
  });
3393
- var GetTaskFilesRequestSchema = z42.object({
3394
- sessionId: z42.string()
3569
+ var GetTaskFilesRequestSchema = z32.object({
3570
+ sessionId: z32.string()
3395
3571
  });
3396
- var GetTaskFileRequestSchema = z42.object({
3397
- sessionId: z42.string(),
3398
- fileId: z42.string()
3572
+ var GetTaskFileRequestSchema = z32.object({
3573
+ sessionId: z32.string(),
3574
+ fileId: z32.string()
3399
3575
  });
3400
- var GetTaskRequestSchema = z42.object({
3401
- sessionId: z42.string(),
3402
- taskSlugOrId: z42.string()
3576
+ var GetTaskRequestSchema = z32.object({
3577
+ sessionId: z32.string(),
3578
+ taskSlugOrId: z32.string()
3403
3579
  });
3404
- var GetCliHistoryRequestSchema = z42.object({
3405
- sessionId: z42.string(),
3406
- limit: z42.number().int().positive().optional().default(100),
3407
- source: z42.enum(["agent", "application"]).optional(),
3580
+ var GetCliHistoryRequestSchema = z32.object({
3581
+ sessionId: z32.string(),
3582
+ limit: z32.number().int().positive().optional().default(100),
3583
+ source: z32.enum(["agent", "application"]).optional(),
3408
3584
  /** Task id or slug to read logs from. Omit for the session's own task. Only
3409
3585
  * the session's own task or one of its children resolves — anything else is
3410
3586
  * an error, never a silent fallback to the caller's own logs. */
3411
- taskId: z42.string().optional()
3587
+ taskId: z32.string().optional()
3412
3588
  });
3413
- var ListSubtasksRequestSchema = z42.object({
3414
- sessionId: z42.string(),
3415
- /** "compact" returns the slim orchestration view (ListSubtasksCompactResponse)
3416
- * with the pack build-slot picture; "full" (default — wire-compat with older
3589
+ var ListSubtasksRequestSchema = z32.object({
3590
+ sessionId: z32.string(),
3591
+ /** "compact" returns the slim orchestration view (ListSubtasksCompactResponse:
3592
+ * per-child status, agent, story points, PR state, dependencies); "full" (default — wire-compat with older
3417
3593
  * agents) returns the verbose SubtaskSummaryDTO[] including description/plan. */
3418
- view: z42.enum(["compact", "full"]).optional()
3419
- });
3420
- var GetDependenciesRequestSchema = z42.object({
3421
- sessionId: z42.string()
3422
- });
3423
- var GetSuggestionsRequestSchema = z42.object({
3424
- sessionId: z42.string(),
3425
- status: z42.string().optional(),
3426
- limit: z42.number().int().min(1).max(100).optional()
3427
- });
3428
- var ListManualTestsRequestSchema = z42.object({
3429
- sessionId: z42.string()
3430
- });
3431
- var QueryManualTestsRequestSchema = z42.object({
3432
- sessionId: z42.string(),
3433
- cardStatuses: z42.array(z42.string()).optional(),
3434
- testStatuses: z42.array(z42.enum(["open", "approved", "rejected"])).optional()
3435
- });
3436
- var CreatePullRequestRequestSchema = CreatePRInputSchema.extend({ sessionId: z42.string() });
3437
- var RequestFileUploadRequestSchema = z42.object({
3438
- sessionId: z42.string(),
3439
- fileName: z42.string().min(1).max(255),
3440
- mimeType: z42.string().min(1).max(128),
3441
- fileSize: z42.number().int().positive().max(MAX_FILE_SIZE_BYTES2)
3442
- });
3443
- var ConfirmFileUploadRequestSchema = z42.object({
3444
- sessionId: z42.string(),
3445
- fileId: z42.string(),
3446
- title: z42.string().max(500).optional(),
3594
+ view: z32.enum(["compact", "full"]).optional()
3595
+ });
3596
+ var GetDependenciesRequestSchema = z32.object({
3597
+ sessionId: z32.string()
3598
+ });
3599
+ var GetSuggestionsRequestSchema = z32.object({
3600
+ sessionId: z32.string(),
3601
+ status: z32.string().optional(),
3602
+ limit: z32.number().int().min(1).max(100).optional()
3603
+ });
3604
+ var ListManualTestsRequestSchema = z32.object({
3605
+ sessionId: z32.string()
3606
+ });
3607
+ var QueryManualTestsRequestSchema = z32.object({
3608
+ sessionId: z32.string(),
3609
+ cardStatuses: z32.array(z32.string()).optional(),
3610
+ testStatuses: z32.array(z32.enum(["open", "approved", "rejected"])).optional()
3611
+ });
3612
+ var CreatePullRequestRequestSchema = CreatePRInputSchema.extend({ sessionId: z32.string() });
3613
+ var RequestFileUploadRequestSchema = z32.object({
3614
+ sessionId: z32.string(),
3615
+ fileName: z32.string().min(1).max(255),
3616
+ mimeType: z32.string().min(1).max(128),
3617
+ fileSize: z32.number().int().positive().max(MAX_FILE_SIZE_BYTES2)
3618
+ });
3619
+ var ConfirmFileUploadRequestSchema = z32.object({
3620
+ sessionId: z32.string(),
3621
+ fileId: z32.string(),
3622
+ title: z32.string().max(500).optional(),
3447
3623
  /** Glossary tag names (or ids) this file is an example of. */
3448
- tags: z42.array(z42.string().min(1).max(MAX_FILE_TAG_LENGTH)).max(MAX_FILE_TAGS2).optional()
3449
- });
3450
- var UpdateTaskStatusRequestSchema = z42.object({
3451
- sessionId: z42.string(),
3452
- status: z42.string(),
3453
- force: z42.boolean().optional().default(false)
3454
- });
3455
- var StoreSessionIdRequestSchema = z42.object({
3456
- sessionId: z42.string(),
3457
- sdkSessionId: z42.string()
3458
- });
3459
- var SetManualTestsRequestSchema = z42.object({
3460
- sessionId: z42.string(),
3461
- items: z42.array(z42.object({ title: z42.string().min(1) })).min(1)
3462
- });
3463
- var EditManualTestRequestSchema = z42.object({
3464
- sessionId: z42.string(),
3465
- title: z42.string().min(1),
3466
- newTitle: z42.string().min(1)
3467
- });
3468
- var RemoveManualTestRequestSchema = z42.object({
3469
- sessionId: z42.string(),
3470
- title: z42.string().min(1)
3471
- });
3472
- var ApproveManualTestRequestSchema = z42.object({
3473
- sessionId: z42.string(),
3474
- title: z42.string().min(1)
3475
- });
3476
- var RejectManualTestRequestSchema = z42.object({
3477
- sessionId: z42.string(),
3478
- title: z42.string().min(1),
3479
- reason: z42.string().min(1).max(2e3)
3480
- });
3481
- var SessionStartRequestSchema = z42.object({
3482
- sessionId: z42.string(),
3483
- agentVersion: z42.string(),
3484
- capabilities: z42.array(z42.string())
3485
- });
3486
- var SessionStopRequestSchema = z42.object({
3487
- sessionId: z42.string(),
3488
- reason: z42.string().optional()
3489
- });
3490
- var EndReviewSessionRequestSchema = z42.object({
3491
- sessionId: z42.string(),
3492
- reason: z42.enum(["approved", "changes_requested", "finished"]).optional()
3493
- });
3494
- var ConnectAgentRequestSchema = z42.object({
3495
- sessionId: z42.string()
3496
- });
3497
- var ReportAgentStatusRequestSchema = z42.object({
3498
- sessionId: z42.string(),
3499
- status: z42.string(),
3624
+ tags: z32.array(z32.string().min(1).max(MAX_FILE_TAG_LENGTH)).max(MAX_FILE_TAGS2).optional()
3625
+ });
3626
+ var UpdateTaskStatusRequestSchema = z32.object({
3627
+ sessionId: z32.string(),
3628
+ status: z32.string(),
3629
+ force: z32.boolean().optional().default(false)
3630
+ });
3631
+ var StoreSessionIdRequestSchema = z32.object({
3632
+ sessionId: z32.string(),
3633
+ sdkSessionId: z32.string()
3634
+ });
3635
+ var SetManualTestsRequestSchema = z32.object({
3636
+ sessionId: z32.string(),
3637
+ items: z32.array(z32.object({ title: z32.string().min(1) })).min(1)
3638
+ });
3639
+ var EditManualTestRequestSchema = z32.object({
3640
+ sessionId: z32.string(),
3641
+ title: z32.string().min(1),
3642
+ newTitle: z32.string().min(1)
3643
+ });
3644
+ var RemoveManualTestRequestSchema = z32.object({
3645
+ sessionId: z32.string(),
3646
+ title: z32.string().min(1)
3647
+ });
3648
+ var ApproveManualTestRequestSchema = z32.object({
3649
+ sessionId: z32.string(),
3650
+ title: z32.string().min(1)
3651
+ });
3652
+ var RejectManualTestRequestSchema = z32.object({
3653
+ sessionId: z32.string(),
3654
+ title: z32.string().min(1),
3655
+ reason: z32.string().min(1).max(2e3)
3656
+ });
3657
+ var SessionStartRequestSchema = z32.object({
3658
+ sessionId: z32.string(),
3659
+ agentVersion: z32.string(),
3660
+ capabilities: z32.array(z32.string())
3661
+ });
3662
+ var SessionStopRequestSchema = z32.object({
3663
+ sessionId: z32.string(),
3664
+ reason: z32.string().optional()
3665
+ });
3666
+ var EndReviewSessionRequestSchema = z32.object({
3667
+ sessionId: z32.string(),
3668
+ reason: z32.enum(["approved", "changes_requested", "finished"]).optional()
3669
+ });
3670
+ var ConnectAgentRequestSchema = z32.object({
3671
+ sessionId: z32.string()
3672
+ });
3673
+ var ReportAgentStatusRequestSchema = z32.object({
3674
+ sessionId: z32.string(),
3675
+ status: z32.string(),
3500
3676
  /** Why the agent reports this status (e.g. "user_question" while an AskUserQuestion questionnaire is pending in the TUI). */
3501
- reason: z42.string().optional(),
3677
+ reason: z32.string().optional(),
3502
3678
  /**
3503
3679
  * The pending question text, sent only alongside `reason: "user_question"`
3504
3680
  * so the server can surface it in the user-question notification body (and
3505
3681
  * thus the Attention feed) instead of a generic string. Optional: older
3506
3682
  * agents omit it and the server falls back to the generic wording.
3507
3683
  */
3508
- questionText: z42.string().optional()
3684
+ questionText: z32.string().optional()
3509
3685
  });
3510
- var NotifyAgentVersionRequestSchema = z42.object({
3511
- sessionId: z42.string(),
3512
- agentVersion: z42.string()
3686
+ var NotifyAgentVersionRequestSchema = z32.object({
3687
+ sessionId: z32.string(),
3688
+ agentVersion: z32.string()
3513
3689
  });
3514
- var DiscoveredPortSchema = z42.object({
3515
- port: z42.number().int().min(1).max(65535),
3516
- label: z42.string().min(1).max(64).optional(),
3517
- protocol: z42.enum(["http", "tcp"]).optional(),
3518
- detectedAt: z42.string()
3690
+ var DiscoveredPortSchema = z32.object({
3691
+ port: z32.number().int().min(1).max(65535),
3692
+ label: z32.string().min(1).max(64).optional(),
3693
+ protocol: z32.enum(["http", "tcp"]).optional(),
3694
+ detectedAt: z32.string()
3519
3695
  });
3520
- var ReportDiscoveredPortsRequestSchema = z42.object({
3521
- sessionId: z42.string(),
3522
- ports: z42.array(DiscoveredPortSchema).max(64)
3696
+ var ReportDiscoveredPortsRequestSchema = z32.object({
3697
+ sessionId: z32.string(),
3698
+ ports: z32.array(DiscoveredPortSchema).max(64)
3523
3699
  });
3524
- var ReportBootMilestoneRequestSchema = z42.object({
3525
- sessionId: z42.string(),
3526
- key: z42.string().max(64)
3700
+ var ReportBootMilestoneRequestSchema = z32.object({
3701
+ sessionId: z32.string(),
3702
+ key: z32.string().max(64)
3527
3703
  });
3528
- var CreateSubtaskRequestSchema = z42.object({
3529
- sessionId: z42.string(),
3530
- title: z42.string().min(1),
3704
+ var CreateSubtaskRequestSchema = z32.object({
3705
+ sessionId: z32.string(),
3706
+ title: z32.string().min(1),
3531
3707
  description: cardDescription,
3532
- plan: z42.string().optional(),
3533
- storyPointValue: z42.number().int().positive().optional(),
3534
- ordinal: z42.number().int().nonnegative().optional(),
3535
- followParentStatus: z42.boolean().optional(),
3708
+ plan: z32.string().optional(),
3709
+ storyPointValue: z32.number().int().positive().optional(),
3710
+ ordinal: z32.number().int().nonnegative().optional(),
3711
+ followParentStatus: z32.boolean().optional(),
3536
3712
  /** Sibling subtask ids or slugs this subtask blocks on (explicit dependency
3537
3713
  * metadata — preferred over encoding order in plan text / ordinal). */
3538
- dependsOn: z42.array(z42.string().min(1)).max(32).optional(),
3714
+ dependsOn: z32.array(z32.string().min(1)).max(32).optional(),
3539
3715
  /** Glossary tag names to assign to the child. Unmatched names come back in
3540
3716
  * the response rather than failing the create. */
3541
- tags: z42.array(z42.string().min(1)).max(10).optional()
3717
+ tags: z32.array(z32.string().min(1)).max(10).optional()
3542
3718
  });
3543
- var UpdateSubtaskRequestSchema = z42.object({
3544
- sessionId: z42.string(),
3545
- subtaskId: z42.string(),
3546
- title: z42.string().min(1).optional(),
3719
+ var UpdateSubtaskRequestSchema = z32.object({
3720
+ sessionId: z32.string(),
3721
+ subtaskId: z32.string(),
3722
+ title: z32.string().min(1).optional(),
3547
3723
  description: cardDescription,
3548
- plan: z42.string().optional(),
3724
+ plan: z32.string().optional(),
3549
3725
  /** Orchestration statuses only ("Planning" | "Open") — the pack parent's
3550
3726
  * sanctioned promotion path. Execution statuses stay with the build
3551
3727
  * pipeline / force_update_task_status. Enforced server-side. */
3552
- status: z42.string().optional(),
3728
+ status: z32.string().optional(),
3553
3729
  /** Assign a project agent to the child — accepts the agent's id or exact
3554
3730
  * name; resolved against the parent task's project server-side. */
3555
- agentIdOrName: z42.string().min(1).optional(),
3556
- storyPointValue: z42.number().int().positive().optional(),
3557
- followParentStatus: z42.boolean().optional(),
3731
+ agentIdOrName: z32.string().min(1).optional(),
3732
+ storyPointValue: z32.number().int().positive().optional(),
3733
+ followParentStatus: z32.boolean().optional(),
3558
3734
  /** Replace this subtask's dependency edges with these sibling ids/slugs.
3559
3735
  * Empty array clears all. Omit to leave dependencies unchanged. */
3560
- dependsOn: z42.array(z42.string().min(1)).max(32).optional()
3736
+ dependsOn: z32.array(z32.string().min(1)).max(32).optional()
3561
3737
  });
3562
- var DeleteSubtaskRequestSchema = z42.object({
3563
- sessionId: z42.string(),
3564
- subtaskId: z42.string()
3738
+ var DeleteSubtaskRequestSchema = z32.object({
3739
+ sessionId: z32.string(),
3740
+ subtaskId: z32.string()
3565
3741
  });
3566
- var SetSubtaskParentRequestSchema = z42.object({
3567
- sessionId: z42.string(),
3568
- taskId: z42.string().min(1),
3569
- detach: z42.boolean().optional(),
3570
- ordinal: z42.number().int().nonnegative().optional(),
3571
- followParentStatus: z42.boolean().optional()
3742
+ var SetSubtaskParentRequestSchema = z32.object({
3743
+ sessionId: z32.string(),
3744
+ taskId: z32.string().min(1),
3745
+ detach: z32.boolean().optional(),
3746
+ ordinal: z32.number().int().nonnegative().optional(),
3747
+ followParentStatus: z32.boolean().optional()
3572
3748
  });
3573
- var GetTaskPropertiesRequestSchema = z42.object({
3574
- sessionId: z42.string()
3749
+ var GetTaskPropertiesRequestSchema = z32.object({
3750
+ sessionId: z32.string()
3575
3751
  });
3576
- var UpdateTaskFieldsRequestSchema = z42.object({
3577
- sessionId: z42.string(),
3578
- plan: z42.string().optional(),
3752
+ var UpdateTaskFieldsRequestSchema = z32.object({
3753
+ sessionId: z32.string(),
3754
+ plan: z32.string().optional(),
3579
3755
  description: cardDescription
3580
3756
  });
3581
- var UpdateTaskPropertiesRequestSchema = z42.object({
3582
- sessionId: z42.string(),
3583
- title: z42.string().optional(),
3584
- storyPointValue: z42.number().int().positive().optional(),
3585
- tagIds: z42.array(z42.string()).optional(),
3586
- tagNames: z42.array(z42.string()).optional(),
3587
- githubPRUrl: z42.string().url().optional(),
3588
- githubBranch: z42.string().optional(),
3757
+ var UpdateTaskPropertiesRequestSchema = z32.object({
3758
+ sessionId: z32.string(),
3759
+ title: z32.string().optional(),
3760
+ storyPointValue: z32.number().int().positive().optional(),
3761
+ tagIds: z32.array(z32.string()).optional(),
3762
+ tagNames: z32.array(z32.string()).optional(),
3763
+ githubPRUrl: z32.string().url().optional(),
3764
+ githubBranch: z32.string().optional(),
3589
3765
  // Canonical risk level, or null to clear — same semantics as the headless
3590
3766
  // update_task boundary (resolved to the project's Risk row in the handler).
3591
3767
  risk: riskLevelSchema.nullable().optional()
3592
3768
  });
3593
- var ListIconsRequestSchema = z42.object({
3594
- sessionId: z42.string()
3769
+ var ListIconsRequestSchema = z32.object({
3770
+ sessionId: z32.string()
3595
3771
  });
3596
- var GenerateTaskIconRequestSchema = z42.object({
3597
- sessionId: z42.string(),
3598
- prompt: z42.string().min(1),
3599
- aspectRatio: z42.string().optional()
3772
+ var GenerateTaskIconRequestSchema = z32.object({
3773
+ sessionId: z32.string(),
3774
+ prompt: z32.string().min(1),
3775
+ aspectRatio: z32.string().optional()
3600
3776
  });
3601
- var SearchFaIconsRequestSchema = z42.object({
3602
- sessionId: z42.string(),
3603
- query: z42.string().min(1),
3604
- first: z42.number().int().positive().optional()
3777
+ var SearchFaIconsRequestSchema = z32.object({
3778
+ sessionId: z32.string(),
3779
+ query: z32.string().min(1),
3780
+ first: z32.number().int().positive().optional()
3605
3781
  });
3606
- var PickFaIconRequestSchema = z42.object({
3607
- sessionId: z42.string(),
3608
- fontAwesomeId: z42.string().min(1),
3609
- fontAwesomeStyle: z42.string().optional()
3782
+ var PickFaIconRequestSchema = z32.object({
3783
+ sessionId: z32.string(),
3784
+ fontAwesomeId: z32.string().min(1),
3785
+ fontAwesomeStyle: z32.string().optional()
3610
3786
  });
3611
- var CreateFollowUpTaskRequestSchema = z42.object({
3612
- sessionId: z42.string(),
3613
- title: z42.string().min(1),
3787
+ var CreateFollowUpTaskRequestSchema = z32.object({
3788
+ sessionId: z32.string(),
3789
+ title: z32.string().min(1),
3614
3790
  description: cardDescription,
3615
- plan: z42.string().optional(),
3616
- storyPointValue: z42.number().int().positive().optional()
3791
+ plan: z32.string().optional(),
3792
+ storyPointValue: z32.number().int().positive().optional()
3617
3793
  });
3618
- var AddDependencyRequestSchema = z42.object({
3619
- sessionId: z42.string(),
3620
- dependsOnSlugOrId: z42.string()
3794
+ var AddDependencyRequestSchema = z32.object({
3795
+ sessionId: z32.string(),
3796
+ dependsOnSlugOrId: z32.string()
3621
3797
  });
3622
- var RemoveDependencyRequestSchema = z42.object({
3623
- sessionId: z42.string(),
3624
- dependsOnSlugOrId: z42.string()
3798
+ var RemoveDependencyRequestSchema = z32.object({
3799
+ sessionId: z32.string(),
3800
+ dependsOnSlugOrId: z32.string()
3625
3801
  });
3626
- var CreateSuggestionRequestSchema = z42.object({
3627
- sessionId: z42.string(),
3628
- title: z42.string().min(1),
3802
+ var CreateSuggestionRequestSchema = z32.object({
3803
+ sessionId: z32.string(),
3804
+ title: z32.string().min(1),
3629
3805
  description: cardDescription,
3630
- tagNames: z42.array(z42.string()).optional()
3806
+ tagNames: z32.array(z32.string()).optional()
3631
3807
  });
3632
- var VoteSuggestionRequestSchema = z42.object({
3633
- sessionId: z42.string(),
3634
- suggestionId: z42.string(),
3635
- value: z42.union([z42.literal(1), z42.literal(-1)])
3808
+ var VoteSuggestionRequestSchema = z32.object({
3809
+ sessionId: z32.string(),
3810
+ suggestionId: z32.string(),
3811
+ value: z32.union([z32.literal(1), z32.literal(-1)])
3636
3812
  });
3637
- var TriggerIdentificationRequestSchema = z42.object({
3638
- sessionId: z42.string()
3813
+ var TriggerIdentificationRequestSchema = z32.object({
3814
+ sessionId: z32.string()
3639
3815
  });
3640
- var HandoffToImplementerRequestSchema = z42.object({
3641
- sessionId: z42.string(),
3816
+ var HandoffToImplementerRequestSchema = z32.object({
3817
+ sessionId: z32.string(),
3642
3818
  // Optional difficulty sizing — sets the task's story points before resolving
3643
3819
  // the matched implementer agent. Omit to hand off using the task's current
3644
3820
  // story points (or the project's default task agent when unsized).
3645
- storyPoints: z42.number().int().positive().optional(),
3821
+ storyPoints: z32.number().int().positive().optional(),
3646
3822
  // Optional kickoff note posted to the task chat alongside the handoff notice.
3647
- message: z42.string().optional()
3823
+ message: z32.string().optional()
3648
3824
  });
3649
- var SubmitCodeReviewResultRequestSchema = z42.object({
3650
- sessionId: z42.string(),
3651
- approved: z42.boolean(),
3652
- content: z42.string(),
3825
+ var SubmitCodeReviewResultRequestSchema = z32.object({
3826
+ sessionId: z32.string(),
3827
+ approved: z32.boolean(),
3828
+ content: z32.string(),
3653
3829
  // Canonical risk level the reviewer assigned to this change. Required on every
3654
3830
  // verdict — the reviewer must judge it. Applied authoritatively server-side
3655
3831
  // (may raise OR lower an already-set value; the reviewer has that authority).
@@ -3657,181 +3833,165 @@ var SubmitCodeReviewResultRequestSchema = z42.object({
3657
3833
  // The commit SHA the reviewer actually reviewed. When present, the verdict is
3658
3834
  // rejected unless the task is still at this SHA (guards against a late
3659
3835
  // old-SHA verdict overwriting a newer review cycle).
3660
- reviewedSha: z42.string().optional()
3661
- });
3662
- var CycleCodingAgentKeyRequestSchema = z42.object({
3663
- sessionId: z42.string(),
3664
- rateLimitType: z42.string(),
3665
- resetsAt: z42.string().optional()
3666
- });
3667
- var StartChildCloudBuildRequestSchema = z42.object({
3668
- sessionId: z42.string(),
3669
- childTaskId: z42.string()
3670
- });
3671
- var StopChildBuildRequestSchema = z42.object({
3672
- sessionId: z42.string(),
3673
- childTaskId: z42.string()
3674
- });
3675
- var ApproveAndMergePRRequestSchema = z42.object({
3676
- sessionId: z42.string(),
3677
- childTaskId: z42.string()
3678
- });
3679
- var PostChildChatMessageRequestSchema = z42.object({
3680
- sessionId: z42.string(),
3681
- childTaskId: z42.string(),
3682
- message: z42.string().min(1)
3683
- });
3684
- var UpdateChildStatusRequestSchema = z42.object({
3685
- sessionId: z42.string(),
3686
- childTaskId: z42.string(),
3687
- status: z42.string()
3688
- });
3689
- var GetAgentStatusRequestSchema = z42.object({
3690
- taskId: z42.string()
3691
- });
3692
- var GetUiCliHistoryRequestSchema = z42.object({
3693
- taskId: z42.string()
3694
- });
3695
- var GetActivePtySessionRequestSchema = z42.object({
3696
- taskId: z42.string()
3697
- });
3698
- var ListActivePtySessionsRequestSchema = z42.object({
3699
- taskId: z42.string()
3700
- });
3701
- var SendSoftStopRequestSchema = z42.object({
3702
- taskId: z42.string()
3703
- });
3704
- var StopTaskSessionRequestSchema = z42.object({
3705
- taskId: z42.string(),
3706
- sessionId: z42.string()
3707
- });
3708
- var FlushTaskQueueRequestSchema = z42.object({
3709
- taskId: z42.string(),
3710
- softStop: z42.boolean().optional()
3711
- });
3712
- var CancelTaskQueuedMessageRequestSchema = z42.object({
3713
- taskId: z42.string(),
3714
- messageId: z42.string()
3715
- });
3716
- var FlushSingleQueuedMessageRequestSchema = z42.object({
3717
- taskId: z42.string(),
3718
- messageId: z42.string(),
3719
- softStop: z42.boolean().optional()
3720
- });
3721
- var AnswerAgentQuestionRequestSchema = z42.object({
3722
- taskId: z42.string(),
3723
- requestId: z42.string(),
3724
- answers: z42.record(z42.string(), z42.string())
3725
- });
3726
- var ClearAgentTodosRequestSchema = z42.object({
3727
- taskId: z42.string()
3728
- });
3729
- var AgentQuestionOptionSchema = z42.object({
3730
- label: z42.string(),
3731
- description: z42.string(),
3732
- preview: z42.string().optional()
3733
- });
3734
- var AgentQuestionSchema = z42.object({
3735
- question: z42.string(),
3736
- header: z42.string(),
3737
- options: z42.array(AgentQuestionOptionSchema),
3738
- multiSelect: z42.boolean().optional()
3739
- });
3740
- var AskUserQuestionRequestSchema = z42.object({
3741
- sessionId: z42.string(),
3742
- question: z42.string().min(1),
3743
- requestId: z42.string().min(1),
3744
- questions: z42.array(AgentQuestionSchema).min(1)
3745
- });
3746
- var PostAgentMessageRequestSchema = z42.object({
3747
- sessionId: z42.string().min(1),
3748
- content: z42.string(),
3749
- milestone: z42.enum(["plan_ready", "implementation_complete", "blocked"]).optional()
3750
- });
3751
- var EmitAgentEventRequestSchema = z42.object({
3752
- sessionId: z42.string(),
3753
- events: z42.array(AgentEventSchema).max(500)
3754
- });
3755
- var RefreshGithubTokenRequestSchema = z42.object({
3756
- sessionId: z42.string(),
3757
- forceFresh: z42.boolean().optional()
3758
- });
3759
- var ReportCredentialFailureRequestSchema = z42.object({
3760
- sessionId: z42.string(),
3761
- error: z42.string().max(2e3).optional(),
3762
- tokenShape: z42.string().max(500).optional(),
3763
- healed: z42.boolean().optional()
3764
- });
3765
- var ReportReviewSpawnFailureRequestSchema = z42.object({
3766
- sessionId: z42.string(),
3767
- reviewSessionId: z42.string(),
3768
- error: z42.string().max(2e3).optional()
3836
+ reviewedSha: z32.string().optional()
3837
+ });
3838
+ var CycleCodingAgentKeyRequestSchema = z32.object({
3839
+ sessionId: z32.string(),
3840
+ rateLimitType: z32.string(),
3841
+ resetsAt: z32.string().optional()
3842
+ });
3843
+ var PostChildChatMessageRequestSchema = z32.object({
3844
+ sessionId: z32.string(),
3845
+ childTaskId: z32.string(),
3846
+ message: z32.string().min(1)
3847
+ });
3848
+ var UpdateChildStatusRequestSchema = z32.object({
3849
+ sessionId: z32.string(),
3850
+ childTaskId: z32.string(),
3851
+ status: z32.string()
3852
+ });
3853
+ var GetAgentStatusRequestSchema = z32.object({
3854
+ taskId: z32.string()
3855
+ });
3856
+ var GetUiCliHistoryRequestSchema = z32.object({
3857
+ taskId: z32.string()
3858
+ });
3859
+ var GetActivePtySessionRequestSchema = z32.object({
3860
+ taskId: z32.string()
3861
+ });
3862
+ var ListActivePtySessionsRequestSchema = z32.object({
3863
+ taskId: z32.string()
3864
+ });
3865
+ var SendSoftStopRequestSchema = z32.object({
3866
+ taskId: z32.string()
3867
+ });
3868
+ var StopTaskSessionRequestSchema = z32.object({
3869
+ taskId: z32.string(),
3870
+ sessionId: z32.string()
3871
+ });
3872
+ var FlushTaskQueueRequestSchema = z32.object({
3873
+ taskId: z32.string(),
3874
+ softStop: z32.boolean().optional()
3875
+ });
3876
+ var CancelTaskQueuedMessageRequestSchema = z32.object({
3877
+ taskId: z32.string(),
3878
+ messageId: z32.string()
3879
+ });
3880
+ var FlushSingleQueuedMessageRequestSchema = z32.object({
3881
+ taskId: z32.string(),
3882
+ messageId: z32.string(),
3883
+ softStop: z32.boolean().optional()
3884
+ });
3885
+ var AnswerAgentQuestionRequestSchema = z32.object({
3886
+ taskId: z32.string(),
3887
+ requestId: z32.string(),
3888
+ answers: z32.record(z32.string(), z32.string())
3889
+ });
3890
+ var ClearAgentTodosRequestSchema = z32.object({
3891
+ taskId: z32.string()
3892
+ });
3893
+ var AgentQuestionOptionSchema = z32.object({
3894
+ label: z32.string(),
3895
+ description: z32.string(),
3896
+ preview: z32.string().optional()
3897
+ });
3898
+ var AgentQuestionSchema = z32.object({
3899
+ question: z32.string(),
3900
+ header: z32.string(),
3901
+ options: z32.array(AgentQuestionOptionSchema),
3902
+ multiSelect: z32.boolean().optional()
3903
+ });
3904
+ var AskUserQuestionRequestSchema = z32.object({
3905
+ sessionId: z32.string(),
3906
+ question: z32.string().min(1),
3907
+ requestId: z32.string().min(1),
3908
+ questions: z32.array(AgentQuestionSchema).min(1)
3909
+ });
3910
+ var PostAgentMessageRequestSchema = z32.object({
3911
+ sessionId: z32.string().min(1),
3912
+ content: z32.string(),
3913
+ milestone: z32.enum(["plan_ready", "implementation_complete", "blocked"]).optional()
3914
+ });
3915
+ var EmitAgentEventRequestSchema = z32.object({
3916
+ sessionId: z32.string(),
3917
+ events: z32.array(AgentEventSchema).max(500)
3918
+ });
3919
+ var RefreshGithubTokenRequestSchema = z32.object({
3920
+ sessionId: z32.string(),
3921
+ forceFresh: z32.boolean().optional()
3922
+ });
3923
+ var ReportCredentialFailureRequestSchema = z32.object({
3924
+ sessionId: z32.string(),
3925
+ error: z32.string().max(2e3).optional(),
3926
+ tokenShape: z32.string().max(500).optional(),
3927
+ healed: z32.boolean().optional()
3928
+ });
3929
+ var ReportReviewSpawnFailureRequestSchema = z32.object({
3930
+ sessionId: z32.string(),
3931
+ reviewSessionId: z32.string(),
3932
+ error: z32.string().max(2e3).optional()
3769
3933
  });
3770
3934
  var ReportBuilderSpawnFailureRequestSchema = ReportReviewSpawnFailureRequestSchema.omit({
3771
3935
  reviewSessionId: true
3772
- }).extend({ buildSessionId: z42.string() });
3773
- var RequestWorkspaceRecycleRequestSchema = z42.object({
3774
- sessionId: z42.string(),
3775
- reason: z42.string().max(2e3)
3936
+ }).extend({ buildSessionId: z32.string() });
3937
+ var SpawnTaskSessionRequestSchema = z32.object({
3938
+ taskId: z32.string(),
3939
+ kind: z32.enum(["tui", "shell"])
3776
3940
  });
3777
- var SpawnTaskSessionRequestSchema = z42.object({
3778
- taskId: z42.string(),
3779
- kind: z42.enum(["tui", "shell"])
3941
+ var StartCodeReviewRequestSchema = z32.object({
3942
+ taskId: z32.string(),
3943
+ force: z32.boolean().optional()
3780
3944
  });
3781
- var StartCodeReviewRequestSchema = z42.object({
3782
- taskId: z42.string(),
3783
- force: z42.boolean().optional()
3945
+ var StopCodeReviewRequestSchema = z32.object({
3946
+ taskId: z32.string()
3784
3947
  });
3785
- var StopCodeReviewRequestSchema = z42.object({
3786
- taskId: z42.string()
3948
+ var ReportSessionSpawnFailureRequestSchema = z32.object({
3949
+ sessionId: z32.string(),
3950
+ spawnedSessionId: z32.string(),
3951
+ error: z32.string().max(2e3).optional()
3787
3952
  });
3788
- var ReportSessionSpawnFailureRequestSchema = z42.object({
3789
- sessionId: z42.string(),
3790
- spawnedSessionId: z42.string(),
3791
- error: z42.string().max(2e3).optional()
3792
- });
3793
- var RefreshGithubTokenResponseSchema = z42.object({
3794
- token: z42.string()
3953
+ var RefreshGithubTokenResponseSchema = z32.object({
3954
+ token: z32.string()
3795
3955
  });
3796
3956
  var PTY_FRAME_MAX_CHARS = 256 * 1024;
3797
3957
  var PTY_MAX_DIMENSION = 1e3;
3798
- var PtyOutputRequestSchema = z42.object({
3799
- sessionId: z42.string(),
3800
- data: z42.string().max(PTY_FRAME_MAX_CHARS),
3801
- cols: z42.number().int().positive().max(PTY_MAX_DIMENSION).optional(),
3802
- rows: z42.number().int().positive().max(PTY_MAX_DIMENSION).optional()
3958
+ var PtyOutputRequestSchema = z32.object({
3959
+ sessionId: z32.string(),
3960
+ data: z32.string().max(PTY_FRAME_MAX_CHARS),
3961
+ cols: z32.number().int().positive().max(PTY_MAX_DIMENSION).optional(),
3962
+ rows: z32.number().int().positive().max(PTY_MAX_DIMENSION).optional()
3803
3963
  });
3804
- var PtyEndedRequestSchema = z42.object({
3805
- sessionId: z42.string()
3964
+ var PtyEndedRequestSchema = z32.object({
3965
+ sessionId: z32.string()
3806
3966
  });
3807
- var PtyInputRequestSchema = z42.object({
3808
- sessionId: z42.string(),
3809
- data: z42.string().max(PTY_FRAME_MAX_CHARS)
3967
+ var PtyInputRequestSchema = z32.object({
3968
+ sessionId: z32.string(),
3969
+ data: z32.string().max(PTY_FRAME_MAX_CHARS)
3810
3970
  });
3811
- var PtyResizeRequestSchema = z42.object({
3812
- sessionId: z42.string(),
3813
- cols: z42.number().int().positive().max(PTY_MAX_DIMENSION),
3814
- rows: z42.number().int().positive().max(PTY_MAX_DIMENSION)
3971
+ var PtyResizeRequestSchema = z32.object({
3972
+ sessionId: z32.string(),
3973
+ cols: z32.number().int().positive().max(PTY_MAX_DIMENSION),
3974
+ rows: z32.number().int().positive().max(PTY_MAX_DIMENSION)
3815
3975
  });
3816
- var PtyAttachRequestSchema = z42.object({
3817
- sessionId: z42.string()
3976
+ var PtyAttachRequestSchema = z32.object({
3977
+ sessionId: z32.string()
3818
3978
  });
3819
- var ReportPtyStreamRequestSchema = z42.object({
3820
- sessionId: z42.string(),
3821
- port: z42.number().int().positive().max(65535).nullable()
3979
+ var ReportPtyStreamRequestSchema = z32.object({
3980
+ sessionId: z32.string(),
3981
+ port: z32.number().int().positive().max(65535).nullable()
3822
3982
  });
3823
- var GetPtyStreamEndpointRequestSchema = z42.object({
3824
- sessionId: z42.string()
3983
+ var GetPtyStreamEndpointRequestSchema = z32.object({
3984
+ sessionId: z32.string()
3825
3985
  });
3826
- var PtyChatEventPayloadSchema = z42.discriminatedUnion("kind", [
3827
- z42.object({
3828
- kind: z42.literal("init"),
3829
- model: z42.string().max(200),
3830
- claudeSessionId: z42.string().max(100).optional()
3986
+ var PtyChatEventPayloadSchema = z32.discriminatedUnion("kind", [
3987
+ z32.object({
3988
+ kind: z32.literal("init"),
3989
+ model: z32.string().max(200),
3990
+ claudeSessionId: z32.string().max(100).optional()
3831
3991
  }),
3832
- z42.object({
3833
- kind: z42.literal("user_text"),
3834
- text: z42.string().max(16384),
3992
+ z32.object({
3993
+ kind: z32.literal("user_text"),
3994
+ text: z32.string().max(16384),
3835
3995
  // Set by the SERVER (never the agent) when this prompt was injected by
3836
3996
  // Conveyor rather than typed by a human — the routed message's `source`
3837
3997
  // (`ci_success`, `review_trigger`, `automated_feedback`, …). The agent
@@ -3839,69 +3999,75 @@ var PtyChatEventPayloadSchema = z42.discriminatedUnion("kind", [
3839
3999
  // CLI records both as plain transcript `user` records; without this the
3840
4000
  // builder chat renders "All CI checks passed on your PR." as the human's
3841
4001
  // own bubble. Absent ⇒ a genuine human prompt.
3842
- source: z42.string().max(60).optional()
4002
+ source: z32.string().max(60).optional()
3843
4003
  }),
3844
- z42.object({ kind: z42.literal("assistant_text"), text: z42.string().max(16384) }),
3845
- z42.object({
3846
- kind: z42.literal("tool_use"),
3847
- name: z42.string().max(200),
4004
+ z32.object({ kind: z32.literal("assistant_text"), text: z32.string().max(16384) }),
4005
+ z32.object({
4006
+ kind: z32.literal("tool_use"),
4007
+ name: z32.string().max(200),
3848
4008
  // Compact preview: JSON.stringify(input) truncated agent-side. The cap
3849
4009
  // matches the text events because AskUserQuestion payloads ride this field
3850
4010
  // and the web lifts them into an interactive card — a tight cap forced
3851
4011
  // option descriptions down to 80 chars, making them unreadable. Every
3852
4012
  // other tool keeps a far smaller agent-side budget (`TOOL_INPUT_MAX` in
3853
4013
  // `chat-record-mapper.ts`), so the ring does not grow for normal calls.
3854
- input: z42.string().max(16384),
4014
+ input: z32.string().max(16384),
3855
4015
  // Transcript tool_use block id — lets the client pair the tool_result.
3856
- id: z42.string().max(100).optional()
4016
+ id: z32.string().max(100).optional()
3857
4017
  }),
3858
- z42.object({
3859
- kind: z42.literal("tool_result"),
4018
+ z32.object({
4019
+ kind: z32.literal("tool_result"),
3860
4020
  // tool_use block id this result answers (absent on malformed records).
3861
- toolUseId: z42.string().max(100).optional(),
4021
+ toolUseId: z32.string().max(100).optional(),
3862
4022
  // Compact output preview, truncated agent-side.
3863
- output: z42.string().max(2e3),
3864
- isError: z42.boolean().optional()
4023
+ output: z32.string().max(2e3),
4024
+ isError: z32.boolean().optional()
3865
4025
  }),
3866
- z42.object({ kind: z42.literal("turn_end") })
4026
+ z32.object({ kind: z32.literal("turn_end") })
3867
4027
  ]);
3868
- var PtyChatEventRequestSchema = z42.object({
3869
- sessionId: z42.string(),
4028
+ var PtyChatEventRequestSchema = z32.object({
4029
+ sessionId: z32.string(),
3870
4030
  event: PtyChatEventPayloadSchema
3871
4031
  });
3872
- var PtyChatAttachRequestSchema = z42.object({
3873
- sessionId: z42.string()
4032
+ var PtyChatAttachRequestSchema = z32.object({
4033
+ sessionId: z32.string()
3874
4034
  });
3875
- var CreatePRResponseSchema = z42.object({
3876
- prNumber: z42.number().int().positive(),
3877
- prUrl: z42.string().url(),
4035
+ var CreatePRResponseSchema = z32.object({
4036
+ prNumber: z32.number().int().positive(),
4037
+ prUrl: z32.string().url(),
3878
4038
  /** Advisory glossary-upkeep note derived from the PR's changed files matched
3879
4039
  * against tag contextPaths — rendered into the tool result, never stored. */
3880
- glossaryNote: z42.string().optional()
4040
+ glossaryNote: z32.string().optional()
3881
4041
  });
3882
- var PostToChatResponseSchema = z42.object({
3883
- messageId: z42.string()
4042
+ var PostToChatResponseSchema = z32.object({
4043
+ messageId: z32.string()
3884
4044
  });
3885
- var UpdateTaskStatusResponseSchema = z42.object({
3886
- taskId: z42.string(),
3887
- status: z42.string()
4045
+ var UpdateTaskStatusResponseSchema = z32.object({
4046
+ taskId: z32.string(),
4047
+ status: z32.string()
3888
4048
  });
3889
- var StoreSessionIdResponseSchema = z42.object({
3890
- success: z42.boolean()
4049
+ var StoreSessionIdResponseSchema = z32.object({
4050
+ success: z32.boolean()
3891
4051
  });
3892
- var HeartbeatResponseSchema = z42.object({
3893
- acknowledged: z42.boolean()
4052
+ var HeartbeatResponseSchema = z32.object({
4053
+ acknowledged: z32.boolean()
3894
4054
  });
3895
- var SessionStartResponseSchema = z42.object({
3896
- sessionId: z42.string(),
3897
- startedAt: z42.string()
4055
+ var SessionStartResponseSchema = z32.object({
4056
+ sessionId: z32.string(),
4057
+ startedAt: z32.string()
3898
4058
  });
3899
- var SessionStopResponseSchema = z42.object({
3900
- sessionId: z42.string(),
3901
- stoppedAt: z42.string()
4059
+ var SessionStopResponseSchema = z32.object({
4060
+ sessionId: z32.string(),
4061
+ stoppedAt: z32.string()
3902
4062
  });
3903
- var DeleteSubtaskResponseSchema = z42.object({
3904
- deleted: z42.boolean()
4063
+ var DeleteSubtaskResponseSchema = z32.object({
4064
+ deleted: z32.boolean()
4065
+ });
4066
+ var ParkOnCheckResultRequestSchema = z42.object({
4067
+ sessionId: z42.string(),
4068
+ sha: z42.string().regex(/^[0-9a-f]{7,40}$/i).optional(),
4069
+ prNumber: z42.number().int().positive().optional(),
4070
+ timeoutMinutes: z42.number().int().min(1).max(MAX_CI_WAIT_TIMEOUT_MINUTES).optional()
3905
4071
  });
3906
4072
  var GIT_BRANCH_NAME_MAX = 255;
3907
4073
  var GIT_BRANCH_NAME_MESSAGE = "Invalid git branch name \u2014 use only letters, numbers, '.', '_', '/' and '-', starting with a letter or number, with no '..', '@{' or '//', and no trailing '/', '-', '.' or '.lock'";
@@ -4194,6 +4360,7 @@ var ListProjectSessionGroupsRequestSchema = z52.object({
4194
4360
  projectId: z52.string()
4195
4361
  });
4196
4362
  var ListMyLiveSessionsAcrossProjectsRequestSchema = z52.object({});
4363
+ var ListSessionGroupsAcrossProjectsRequestSchema = z52.object({});
4197
4364
  var GetProjectAvailableTuisRequestSchema = z52.object({
4198
4365
  projectId: z52.string()
4199
4366
  });
@@ -4456,12 +4623,21 @@ var GetProjectAnalyticsSummaryRequestSchema = z62.object({
4456
4623
  rangeDays: z62.number().int().min(1).max(GET_ANALYTICS_SUMMARY_MAX_RANGE_DAYS).optional(),
4457
4624
  campaign: z62.string().max(200).optional()
4458
4625
  });
4626
+ var RequestWorkspaceRecycleRequestSchema = z72.object({
4627
+ sessionId: z72.string(),
4628
+ reason: z72.string().max(2e3)
4629
+ });
4630
+ var ReportApiOutageRequestSchema = z72.object({
4631
+ sessionId: z72.string(),
4632
+ detail: z72.string().max(2e3),
4633
+ attempts: z72.number().int().min(0).max(100)
4634
+ });
4459
4635
  var SHA_PATTERN = /^[0-9a-f]{40}$/i;
4460
- var ReviewGuideFileReferenceSchema = z72.object({
4461
- path: z72.string().min(1).max(500),
4462
- startLine: z72.number().int().positive().max(1e6).optional(),
4463
- endLine: z72.number().int().positive().max(1e6).optional(),
4464
- hunkHeader: z72.string().min(1).max(300).optional()
4636
+ var ReviewGuideFileReferenceSchema = z82.object({
4637
+ path: z82.string().min(1).max(500),
4638
+ startLine: z82.number().int().positive().max(1e6).optional(),
4639
+ endLine: z82.number().int().positive().max(1e6).optional(),
4640
+ hunkHeader: z82.string().min(1).max(300).optional()
4465
4641
  }).strict().superRefine((value, ctx) => {
4466
4642
  if (value.endLine !== void 0 && value.startLine === void 0) {
4467
4643
  ctx.addIssue({
@@ -4478,190 +4654,282 @@ var ReviewGuideFileReferenceSchema = z72.object({
4478
4654
  });
4479
4655
  }
4480
4656
  });
4481
- var ReviewGuideSectionSchema = z72.object({
4482
- title: z72.string().min(1).max(160),
4483
- explanation: z72.string().min(1).max(2e3),
4484
- classification: z72.enum(["core", "supporting"]).optional(),
4485
- files: z72.array(ReviewGuideFileReferenceSchema).min(1).max(20)
4657
+ var ReviewGuideSectionSchema = z82.object({
4658
+ title: z82.string().min(1).max(160),
4659
+ explanation: z82.string().min(1).max(2e3),
4660
+ classification: z82.enum(["core", "supporting"]).optional(),
4661
+ files: z82.array(ReviewGuideFileReferenceSchema).min(1).max(20)
4486
4662
  }).strict();
4487
- var ReviewGuideContentSchema = z72.object({
4488
- overview: z72.string().min(1).max(3e3),
4489
- sections: z72.array(ReviewGuideSectionSchema).min(1).max(12)
4663
+ var ReviewGuideContentSchema = z82.object({
4664
+ overview: z82.string().min(1).max(3e3),
4665
+ sections: z82.array(ReviewGuideSectionSchema).min(1).max(12)
4490
4666
  }).strict();
4491
4667
  var PublishReviewGuideRequestSchema = ReviewGuideContentSchema.extend({
4492
- sessionId: z72.string().min(1),
4493
- reviewedSha: z72.string().regex(SHA_PATTERN, "reviewedSha must be a 40-character commit SHA")
4668
+ sessionId: z82.string().min(1),
4669
+ reviewedSha: z82.string().regex(SHA_PATTERN, "reviewedSha must be a 40-character commit SHA")
4494
4670
  }).strict();
4495
4671
  var CONTEXT_LINK_LOCATOR_MAX2 = 300;
4496
4672
  var TAG_DESCRIPTION_MAX = CARD_DESCRIPTION_MAX;
4497
4673
  var TAG_OVERVIEW_MAX = 32e3;
4498
4674
  var TAG_REASON_MAX = 500;
4499
- var ProjectTagContextPathSchema = z82.object({
4500
- type: z82.enum(["rule", "doc", "file", "folder"]),
4501
- path: z82.string().min(1).max(500),
4502
- label: z82.string().max(100).optional(),
4675
+ var ProjectTagContextPathSchema = z92.object({
4676
+ type: z92.enum(["rule", "doc", "file", "folder"]),
4677
+ path: z92.string().min(1).max(500),
4678
+ label: z92.string().max(100).optional(),
4503
4679
  /** Verified-link tether — text that must keep existing in the file. */
4504
- locator: z82.string().min(1).max(CONTEXT_LINK_LOCATOR_MAX2).regex(/^[^\r\n]*$/, "Locator cannot contain line breaks").optional(),
4680
+ locator: z92.string().min(1).max(CONTEXT_LINK_LOCATOR_MAX2).regex(/^[^\r\n]*$/, "Locator cannot contain line breaks").optional(),
4505
4681
  /** test = must appear in a real test/describe title; code = any substring. */
4506
- locatorType: z82.enum(["test", "code"]).optional()
4682
+ locatorType: z92.enum(["test", "code"]).optional()
4507
4683
  }).refine((link) => link.locator === void 0 === (link.locatorType === void 0), {
4508
4684
  message: "locator and locatorType must be provided together"
4509
4685
  }).refine((link) => link.locator === void 0 || link.type !== "folder", {
4510
4686
  message: "folder links cannot carry a locator"
4511
4687
  });
4512
- var hexColor = z82.string().regex(/^#[0-9a-fA-F]{6}$/, "Expected #RRGGBB hex color");
4513
- var overviewPathSchema = z82.string().min(1).max(500).regex(/^[^\r\n]*$/, "Overview path cannot contain line breaks");
4514
- var CreateProjectTagRequestSchema = z82.object({
4515
- projectId: z82.string(),
4516
- name: z82.string().min(1).max(50),
4688
+ var hexColor = z92.string().regex(/^#[0-9a-fA-F]{6}$/, "Expected #RRGGBB hex color");
4689
+ var overviewPathSchema = z92.string().min(1).max(500).regex(/^[^\r\n]*$/, "Overview path cannot contain line breaks");
4690
+ var CreateProjectTagRequestSchema = z92.object({
4691
+ projectId: z92.string(),
4692
+ name: z92.string().min(1).max(50),
4517
4693
  color: hexColor.optional(),
4518
- description: z82.string().max(TAG_DESCRIPTION_MAX).optional(),
4519
- overview: z82.string().max(TAG_OVERVIEW_MAX).optional(),
4694
+ description: z92.string().max(TAG_DESCRIPTION_MAX).optional(),
4695
+ overview: z92.string().max(TAG_OVERVIEW_MAX).optional(),
4520
4696
  /** Source the overview from this repo file (stored overview stays as the pending fallback). */
4521
4697
  overviewPath: overviewPathSchema.optional(),
4522
- contextPaths: z82.array(ProjectTagContextPathSchema).max(20).optional(),
4698
+ contextPaths: z92.array(ProjectTagContextPathSchema).max(20).optional(),
4523
4699
  /** Parents to link at create time (multi-parent DAG). */
4524
- parentTagIds: z82.array(z82.string()).max(25).optional(),
4525
- requestingUserId: z82.string().optional()
4700
+ parentTagIds: z92.array(z92.string()).max(25).optional(),
4701
+ requestingUserId: z92.string().optional()
4526
4702
  });
4527
- var UpdateProjectTagRequestSchema = z82.object({
4528
- projectId: z82.string(),
4529
- tagId: z82.string(),
4530
- name: z82.string().min(1).max(50).optional(),
4703
+ var UpdateProjectTagRequestSchema = z92.object({
4704
+ projectId: z92.string(),
4705
+ tagId: z92.string(),
4706
+ name: z92.string().min(1).max(50).optional(),
4531
4707
  color: hexColor.optional(),
4532
- description: z82.string().max(TAG_DESCRIPTION_MAX).optional(),
4708
+ description: z92.string().max(TAG_DESCRIPTION_MAX).optional(),
4533
4709
  /** Full markdown glossary body; null clears it. Rejected while overviewPath is set. */
4534
- overview: z82.string().max(TAG_OVERVIEW_MAX).nullable().optional(),
4710
+ overview: z92.string().max(TAG_OVERVIEW_MAX).nullable().optional(),
4535
4711
  /** Repo file to source the overview from; null clears back to the stored overview. */
4536
4712
  overviewPath: overviewPathSchema.nullable().optional(),
4537
4713
  /** Full replacement of the tag's context links when provided. */
4538
- contextPaths: z82.array(ProjectTagContextPathSchema).max(20).optional(),
4714
+ contextPaths: z92.array(ProjectTagContextPathSchema).max(20).optional(),
4539
4715
  /** Full-set replacement of the tag's parent tags (multi-parent DAG). */
4540
- parentTagIds: z82.array(z82.string()).max(25).optional(),
4716
+ parentTagIds: z92.array(z92.string()).max(25).optional(),
4541
4717
  /** One-line revision provenance, recorded in the tag's history. */
4542
- reason: z82.string().max(TAG_REASON_MAX).optional(),
4718
+ reason: z92.string().max(TAG_REASON_MAX).optional(),
4543
4719
  /** Card the caller was working in — stamped into the revision history. */
4544
- taskId: z82.string().optional(),
4545
- requestingUserId: z82.string().optional()
4720
+ taskId: z92.string().optional(),
4721
+ requestingUserId: z92.string().optional()
4546
4722
  });
4547
- var PostToProjectChatRequestSchema = z82.object({
4548
- projectId: z82.string(),
4549
- content: z82.string().min(1).max(2e4),
4550
- requestingUserId: z82.string().optional(),
4723
+ var PostToProjectChatRequestSchema = z92.object({
4724
+ projectId: z92.string(),
4725
+ content: z92.string().min(1).max(2e4),
4726
+ requestingUserId: z92.string().optional(),
4551
4727
  /** Marks the post so the server can persist it beyond chat (tag-audit summaries land in tag history). */
4552
- kind: z82.enum(["tag_audit_summary"]).optional()
4553
- });
4554
- var StartTagAuditRequestSchema = z82.object({
4555
- projectId: z82.string(),
4556
- requestingUserId: z82.string().optional()
4557
- });
4558
- var StartTaskAuditRequestSchema = z82.object({
4559
- projectId: z82.string(),
4560
- taskIds: z82.array(z82.string()).min(1).max(20),
4561
- requestingUserId: z82.string().optional()
4562
- });
4563
- var GetActiveAuditSessionsRequestSchema = z82.object({
4564
- projectId: z82.string()
4565
- });
4566
- var ReportTaskAuditResultRequestSchema = z82.object({
4567
- projectId: z82.string(),
4568
- taskId: z82.string(),
4569
- summary: z82.string(),
4570
- turnGrades: z82.array(
4571
- z82.object({
4572
- turnIndex: z82.number(),
4573
- phase: z82.enum(["planning", "building", "human"]),
4574
- grade: z82.enum(["correct", "neutral", "blunder"]),
4575
- reasoning: z82.string(),
4576
- eventType: z82.string(),
4577
- eventSummary: z82.string()
4728
+ kind: z92.enum(["tag_audit_summary"]).optional()
4729
+ });
4730
+ var StartTagAuditRequestSchema = z92.object({
4731
+ projectId: z92.string(),
4732
+ requestingUserId: z92.string().optional()
4733
+ });
4734
+ var StartTaskAuditRequestSchema = z92.object({
4735
+ projectId: z92.string(),
4736
+ taskIds: z92.array(z92.string()).min(1).max(20),
4737
+ requestingUserId: z92.string().optional()
4738
+ });
4739
+ var GetActiveAuditSessionsRequestSchema = z92.object({
4740
+ projectId: z92.string()
4741
+ });
4742
+ var ReportTaskAuditResultRequestSchema = z92.object({
4743
+ projectId: z92.string(),
4744
+ taskId: z92.string(),
4745
+ summary: z92.string(),
4746
+ turnGrades: z92.array(
4747
+ z92.object({
4748
+ turnIndex: z92.number(),
4749
+ phase: z92.enum(["planning", "building", "human"]),
4750
+ grade: z92.enum(["correct", "neutral", "blunder"]),
4751
+ reasoning: z92.string(),
4752
+ eventType: z92.string(),
4753
+ eventSummary: z92.string()
4578
4754
  })
4579
4755
  ),
4580
- planningAccuracy: z82.number().nullable(),
4581
- buildingAccuracy: z82.number().nullable(),
4582
- humanAccuracy: z82.number().nullable(),
4583
- planningCorrect: z82.number(),
4584
- planningNeutral: z82.number(),
4585
- planningBlunder: z82.number(),
4586
- buildingCorrect: z82.number(),
4587
- buildingNeutral: z82.number(),
4588
- buildingBlunder: z82.number(),
4589
- humanCorrect: z82.number(),
4590
- humanNeutral: z82.number(),
4591
- humanBlunder: z82.number(),
4592
- humanEvaluations: z82.array(
4593
- z82.object({
4594
- messageIndex: z82.number(),
4595
- rating: z82.union([z82.literal(-1), z82.literal(0), z82.literal(1)]),
4596
- reasoning: z82.string()
4756
+ planningAccuracy: z92.number().nullable(),
4757
+ buildingAccuracy: z92.number().nullable(),
4758
+ humanAccuracy: z92.number().nullable(),
4759
+ planningCorrect: z92.number(),
4760
+ planningNeutral: z92.number(),
4761
+ planningBlunder: z92.number(),
4762
+ buildingCorrect: z92.number(),
4763
+ buildingNeutral: z92.number(),
4764
+ buildingBlunder: z92.number(),
4765
+ humanCorrect: z92.number(),
4766
+ humanNeutral: z92.number(),
4767
+ humanBlunder: z92.number(),
4768
+ humanEvaluations: z92.array(
4769
+ z92.object({
4770
+ messageIndex: z92.number(),
4771
+ rating: z92.union([z92.literal(-1), z92.literal(0), z92.literal(1)]),
4772
+ reasoning: z92.string()
4597
4773
  })
4598
4774
  ).optional(),
4599
- suggestionIds: z82.array(z82.string()),
4600
- auditCostUsd: z82.number().nullable(),
4601
- model: z82.string().nullable(),
4775
+ suggestionIds: z92.array(z92.string()),
4776
+ auditCostUsd: z92.number().nullable(),
4777
+ model: z92.string().nullable(),
4602
4778
  /** When set, the audit is marked failed with this message instead. */
4603
- error: z82.string().optional()
4779
+ error: z92.string().optional()
4604
4780
  });
4605
- var GetTaskAuditsRequestSchema = z82.object({
4606
- projectId: z82.string(),
4607
- limit: z82.number().int().positive().max(200).optional().default(50)
4781
+ var GetTaskAuditsRequestSchema = z92.object({
4782
+ projectId: z92.string(),
4783
+ limit: z92.number().int().positive().max(200).optional().default(50)
4608
4784
  });
4609
- var GetTaskAuditRequestSchema = z82.object({
4610
- projectId: z82.string(),
4611
- auditId: z82.string()
4785
+ var GetTaskAuditRequestSchema = z92.object({
4786
+ projectId: z92.string(),
4787
+ auditId: z92.string()
4612
4788
  });
4613
- var GetTaskAuditAggregatesRequestSchema = z82.object({
4614
- projectId: z82.string()
4789
+ var GetTaskAuditAggregatesRequestSchema = z92.object({
4790
+ projectId: z92.string()
4615
4791
  });
4616
- var DeleteTaskAuditRequestSchema = z82.object({
4617
- projectId: z82.string(),
4618
- auditId: z82.string(),
4619
- requestingUserId: z82.string().optional()
4792
+ var DeleteTaskAuditRequestSchema = z92.object({
4793
+ projectId: z92.string(),
4794
+ auditId: z92.string(),
4795
+ requestingUserId: z92.string().optional()
4620
4796
  });
4621
- var MarkInitialPromptSubmittedRequestSchema = z82.object({
4622
- sessionId: z82.string()
4797
+ var MarkInitialPromptSubmittedRequestSchema = z92.object({
4798
+ sessionId: z92.string()
4623
4799
  });
4800
+ var MEETING_CHECKLIST_TITLE_MAX = 300;
4624
4801
  var MEETING_TRANSCRIPT_MAX_CHARS = 2e6;
4625
4802
  var MEETING_TITLE_MAX = 200;
4626
- var CreateMeetingFromTranscriptRequestSchema = z92.object({
4627
- projectId: z92.string().cuid(),
4628
- rawText: z92.string().min(1).max(MEETING_TRANSCRIPT_MAX_CHARS),
4629
- title: z92.string().min(1).max(MEETING_TITLE_MAX).optional(),
4803
+ var MEETING_OCCURRED_AT_MIN_YEAR = 2e3;
4804
+ var MEETING_OCCURRED_AT_MAX_FUTURE_MS = 48 * 60 * 60 * 1e3;
4805
+ var OCCURRED_AT_RANGE_MESSAGE = `occurredAt must be a real date: no earlier than ${MEETING_OCCURRED_AT_MIN_YEAR}, and no more than 48 hours in the future.`;
4806
+ var MeetingOccurredAtSchema = z102.string().datetime().refine((value) => {
4807
+ const ms = Date.parse(value);
4808
+ if (Number.isNaN(ms)) return false;
4809
+ if (ms > Date.now() + MEETING_OCCURRED_AT_MAX_FUTURE_MS) return false;
4810
+ return new Date(ms).getUTCFullYear() >= MEETING_OCCURRED_AT_MIN_YEAR;
4811
+ }, OCCURRED_AT_RANGE_MESSAGE);
4812
+ var CreateMeetingFromTranscriptRequestSchema = z102.object({
4813
+ projectId: z102.string().cuid(),
4814
+ rawText: z102.string().min(1).max(MEETING_TRANSCRIPT_MAX_CHARS),
4815
+ title: z102.string().min(1).max(MEETING_TITLE_MAX).optional(),
4630
4816
  /** ISO 8601. Defaults to now when the source carries no date. */
4631
- occurredAt: z92.string().datetime().optional(),
4817
+ occurredAt: MeetingOccurredAtSchema.optional(),
4632
4818
  /** Override auto-detection. Rarely needed; detection handles the three formats. */
4633
- format: z92.enum(["text", "vtt", "srt"]).optional(),
4634
- source: z92.enum(["manual", "slack"]).optional()
4635
- });
4636
- var GetMeetingRequestSchema = z92.object({
4637
- projectId: z92.string().cuid(),
4638
- meetingId: z92.string().cuid()
4639
- });
4640
- var UpdateMeetingRequestSchema = z92.object({
4641
- projectId: z92.string().cuid(),
4642
- meetingId: z92.string().cuid(),
4643
- title: z92.string().min(1).max(MEETING_TITLE_MAX).optional(),
4644
- occurredAt: z92.string().datetime().optional()
4645
- });
4646
- var RegenerateMeetingSummaryRequestSchema = z92.object({
4647
- projectId: z92.string().cuid(),
4648
- meetingId: z92.string().cuid()
4649
- });
4650
- var DeleteMeetingRequestSchema = z92.object({
4651
- projectId: z92.string().cuid(),
4652
- meetingId: z92.string().cuid()
4653
- });
4654
- var ListMeetingsRequestSchema = z92.object({
4655
- projectId: z92.string().cuid(),
4656
- limit: z92.number().int().min(1).max(50).optional(),
4657
- search: z92.string().max(200).optional()
4658
- });
4659
- var ReadMeetingTranscriptRequestSchema = z92.object({
4660
- projectId: z92.string().cuid(),
4661
- meetingId: z92.string().cuid(),
4662
- offset: z92.number().int().min(0).optional(),
4663
- limit: z92.number().int().min(1).max(500).optional()
4664
- });
4819
+ format: z102.enum(["text", "vtt", "srt"]).optional(),
4820
+ source: z102.enum(["manual", "slack"]).optional()
4821
+ });
4822
+ var GetMeetingRequestSchema = z102.object({
4823
+ projectId: z102.string().cuid(),
4824
+ meetingId: z102.string().cuid()
4825
+ });
4826
+ var UpdateMeetingRequestSchema = z102.object({
4827
+ projectId: z102.string().cuid(),
4828
+ meetingId: z102.string().cuid(),
4829
+ title: z102.string().min(1).max(MEETING_TITLE_MAX).optional(),
4830
+ occurredAt: MeetingOccurredAtSchema.optional()
4831
+ });
4832
+ var RegenerateMeetingSummaryRequestSchema = z102.object({
4833
+ projectId: z102.string().cuid(),
4834
+ meetingId: z102.string().cuid()
4835
+ });
4836
+ var DeleteMeetingRequestSchema = z102.object({
4837
+ projectId: z102.string().cuid(),
4838
+ meetingId: z102.string().cuid()
4839
+ });
4840
+ var checklistTitle = z102.string().min(1).max(MEETING_CHECKLIST_TITLE_MAX);
4841
+ var ListMeetingChecklistRequestSchema = z102.object({
4842
+ projectId: z102.string().cuid(),
4843
+ meetingId: z102.string().cuid()
4844
+ });
4845
+ var AddMeetingChecklistItemsRequestSchema = z102.object({
4846
+ projectId: z102.string().cuid(),
4847
+ meetingId: z102.string().cuid(),
4848
+ items: z102.array(z102.object({ title: checklistTitle })).min(1).max(50)
4849
+ });
4850
+ var UpdateMeetingChecklistItemRequestSchema = z102.object({
4851
+ projectId: z102.string().cuid(),
4852
+ meetingId: z102.string().cuid(),
4853
+ itemId: z102.string().cuid(),
4854
+ title: checklistTitle.optional(),
4855
+ ordinal: z102.number().int().min(0).optional(),
4856
+ /** Explicit null clears the link; undefined leaves it alone. */
4857
+ linkedTaskId: z102.string().cuid().nullable().optional()
4858
+ }).refine(
4859
+ (v) => v.title !== void 0 || v.ordinal !== void 0 || v.linkedTaskId !== void 0,
4860
+ "Pass at least one of title, ordinal, or linkedTaskId."
4861
+ );
4862
+ var DeleteMeetingChecklistItemRequestSchema = z102.object({
4863
+ projectId: z102.string().cuid(),
4864
+ meetingId: z102.string().cuid(),
4865
+ itemId: z102.string().cuid()
4866
+ });
4867
+ var SetMeetingChecklistItemCheckedRequestSchema = z102.object({
4868
+ projectId: z102.string().cuid(),
4869
+ meetingId: z102.string().cuid(),
4870
+ itemId: z102.string().cuid(),
4871
+ checked: z102.boolean(),
4872
+ /** Attach the card in the same call that ticks the item. */
4873
+ linkedTaskId: z102.string().cuid().nullable().optional()
4874
+ });
4875
+ var ListMeetingsRequestSchema = z102.object({
4876
+ projectId: z102.string().cuid(),
4877
+ limit: z102.number().int().min(1).max(50).optional(),
4878
+ search: z102.string().max(200).optional()
4879
+ });
4880
+ var ReadMeetingTranscriptRequestSchema = z102.object({
4881
+ projectId: z102.string().cuid(),
4882
+ meetingId: z102.string().cuid(),
4883
+ offset: z102.number().int().min(0).optional(),
4884
+ limit: z102.number().int().min(1).max(500).optional()
4885
+ });
4886
+ var MEETING_SUMMARY_MAX_CHARS = 5e4;
4887
+ var AddProjectMeetingChecklistItemsRequestSchema = z102.object({
4888
+ projectId: z102.string().cuid(),
4889
+ meetingId: z102.string().cuid(),
4890
+ items: z102.array(z102.object({ title: z102.string().min(1).max(MEETING_CHECKLIST_TITLE_MAX) })).min(1).max(50),
4891
+ requestingUserId: z102.string().optional()
4892
+ });
4893
+ var CheckProjectMeetingChecklistItemRequestSchema = z102.object({
4894
+ projectId: z102.string().cuid(),
4895
+ meetingId: z102.string().cuid(),
4896
+ title: z102.string().min(1).max(MEETING_CHECKLIST_TITLE_MAX),
4897
+ checked: z102.boolean(),
4898
+ /** Card id or slug. Resolved server-side and required to be in the project. */
4899
+ linkedTask: z102.string().min(1).optional(),
4900
+ requestingUserId: z102.string().optional()
4901
+ });
4902
+ var EditProjectMeetingChecklistItemRequestSchema = z102.object({
4903
+ projectId: z102.string().cuid(),
4904
+ meetingId: z102.string().cuid(),
4905
+ title: z102.string().min(1).max(MEETING_CHECKLIST_TITLE_MAX),
4906
+ newTitle: z102.string().min(1).max(MEETING_CHECKLIST_TITLE_MAX),
4907
+ requestingUserId: z102.string().optional()
4908
+ });
4909
+ var RemoveProjectMeetingChecklistItemRequestSchema = z102.object({
4910
+ projectId: z102.string().cuid(),
4911
+ meetingId: z102.string().cuid(),
4912
+ title: z102.string().min(1).max(MEETING_CHECKLIST_TITLE_MAX),
4913
+ requestingUserId: z102.string().optional()
4914
+ });
4915
+ var CreateProjectMeetingRequestSchema = z102.object({
4916
+ projectId: z102.string().cuid(),
4917
+ rawText: z102.string().min(1).max(MEETING_TRANSCRIPT_MAX_CHARS),
4918
+ title: z102.string().min(1).max(MEETING_TITLE_MAX).optional(),
4919
+ occurredAt: MeetingOccurredAtSchema.optional(),
4920
+ requestingUserId: z102.string().optional()
4921
+ });
4922
+ var UpdateProjectMeetingRequestSchema = z102.object({
4923
+ projectId: z102.string().cuid(),
4924
+ meetingId: z102.string().cuid(),
4925
+ title: z102.string().min(1).max(MEETING_TITLE_MAX).optional(),
4926
+ occurredAt: MeetingOccurredAtSchema.optional(),
4927
+ summary: z102.string().min(1).max(MEETING_SUMMARY_MAX_CHARS).optional(),
4928
+ requestingUserId: z102.string().optional()
4929
+ }).refine(
4930
+ (v) => v.title !== void 0 || v.occurredAt !== void 0 || v.summary !== void 0,
4931
+ "Pass at least one of title, occurredAt, or summary."
4932
+ );
4665
4933
  var TASK_CHAT_HISTORY_LIMIT = 20;
4666
4934
  var PM_CHAT_HISTORY_LIMIT = 40;
4667
4935
  var AGENT_CHAT_HISTORY_FETCH_LIMIT = Math.max(TASK_CHAT_HISTORY_LIMIT, PM_CHAT_HISTORY_LIMIT) + 10;
@@ -4689,8 +4957,11 @@ var ANTHROPIC_CATALOG = [
4689
4957
  anthropicEntry(PREVIOUS_SONNET_MODEL, "Sonnet 4.6", 3, 15),
4690
4958
  // The Haiku line (4.5 and older) predates the tuning surface and 400s on it.
4691
4959
  anthropicEntry(DEFAULT_HAIKU_MODEL, "Haiku 4.5", 1, 5, { supportsEffort: false }),
4692
- anthropicEntry(FABLE_MODEL, "Fable 5 (experimental)", 10, 50, { experimental: true })
4960
+ anthropicEntry(FABLE_MODEL, "Fable 5.1", 10, 50)
4693
4961
  ];
4962
+ var CLAUDESPACE_WORKLOAD_LABEL = "rc-workload";
4963
+ var CLAUDESPACE_WORKLOAD_VALUE = "claudespace";
4964
+ var CONVEYOR_POD_SELECTOR = `${CLAUDESPACE_WORKLOAD_LABEL}=${CLAUDESPACE_WORKLOAD_VALUE}`;
4694
4965
  var MS_PER_DAY = 24 * 60 * 60 * 1e3;
4695
4966
  var POSTGRES_ENV = {
4696
4967
  POSTGRES_HOST_AUTH_METHOD: "trust",
@@ -4751,11 +5022,13 @@ var CATALOG = {
4751
5022
  // CPU: the request is the CFS floor; the old 50m starved postgres to 5ms
4752
5023
  // of CPU per 100ms period — every query burst hit throttle stalls, which
4753
5024
  // showed up as ~100ms floors on trivial statements and dominated the API
4754
- // int suite even after the fsync flags above. 500m is paid for out of the
4755
- // agent's derived share (resource-tiers.ts). The limit bursts to 2 for
4756
- // spiky work the first-boot pod-data seed copy and int-suite query
4757
- // storms borrowing idle node CPU without moving the request.
4758
- requests: { cpuMillicores: 500, memoryMi: 512, ephemeralMi: 3 * 1024 },
5025
+ // int suite even after the fsync flags above. 250m is paid for out of the
5026
+ // workbench's derived share (resource-tiers.ts); measured across the fleet
5027
+ // postgres peaks at 0.66 cores and idles far below 250m, and the limit
5028
+ // (unchanged at 2) is what serves the peaks: the first-boot pod-data seed
5029
+ // copy and int-suite query storms borrow idle node CPU without moving the
5030
+ // request.
5031
+ requests: { cpuMillicores: 250, memoryMi: 512, ephemeralMi: 3 * 1024 },
4759
5032
  limits: { cpuMillicores: 2e3, memoryMi: 512, ephemeralMi: 3 * 1024 }
4760
5033
  },
4761
5034
  connectionEnv: {
@@ -4809,6 +5082,10 @@ var CATALOG = {
4809
5082
  // rejects (media_type_header_exception), breaking search/audit indexing
4810
5083
  // in pods. 512m heap matches the project compose sizing.
4811
5084
  image: "docker.elastic.co/elasticsearch/elasticsearch:9.4.0",
5085
+ mirror: {
5086
+ src: "docker.elastic.co/elasticsearch/elasticsearch:9.4.0",
5087
+ dest: "mirror-elasticsearch:9.4.0"
5088
+ },
4812
5089
  ports: [9200],
4813
5090
  // Baked service images are `docker commit`s of a recently-running ES, so
4814
5091
  // they carry a stale data-dir node.lock; ES 9 hard-fails on it at boot
@@ -4832,14 +5109,16 @@ var CATALOG = {
4832
5109
  ES_JAVA_OPTS: "-Xms512m -Xmx512m"
4833
5110
  },
4834
5111
  resources: {
4835
- // CPU limit 4x the request: ES cold-start is a CPU-bound JVM boot
5112
+ // CPU limit 8x the request: ES cold-start is a CPU-bound JVM boot
4836
5113
  // (class loading + JIT + recovery of the docker-commit'ed data dir),
4837
- // and the 500m hard cap put it at ~135s to yellow past the sidecar
5114
+ // and a 500m hard cap put it at ~135s to yellow, past the sidecar
4838
5115
  // wait script's original 90s budget. Bursting to 2 cut it to ~40s on
4839
5116
  // the real cluster (A/B on identical nodes, 2 rounds). The burst only
4840
5117
  // borrows idle node CPU at boot; under contention CFS still floors ES
4841
- // at its 500m request.
4842
- requests: { cpuMillicores: 500, memoryMi: 1024, ephemeralMi: 256 },
5118
+ // at its request. That request is 250m: the fleet-wide peak is 1.6
5119
+ // cores (served by the limit) and steady state is far below 250m, so
5120
+ // the old 500m only inflated the billed pod total.
5121
+ requests: { cpuMillicores: 250, memoryMi: 1024, ephemeralMi: 256 },
4843
5122
  limits: { cpuMillicores: 2e3, memoryMi: 1024, ephemeralMi: 256 }
4844
5123
  },
4845
5124
  connectionEnv: {
@@ -4891,6 +5170,10 @@ var CATALOG = {
4891
5170
  resources: {
4892
5171
  // Autopilot caps the ephemeral-storage limit to the request (see the
4893
5172
  // postgresql note), so the 1Gi headroom must be on the request too.
5173
+ // CPU: the collector draws ~0.3 cores at idle fleet-wide, so the request
5174
+ // stays at 250m to cover that draw under node contention (a request
5175
+ // below usage is a container CFS throttles continuously); the 1-core
5176
+ // limit covers ingest bursts.
4894
5177
  requests: { cpuMillicores: 250, memoryMi: 1024, ephemeralMi: 1024 },
4895
5178
  limits: { cpuMillicores: 1e3, memoryMi: 2048, ephemeralMi: 1024 }
4896
5179
  },
@@ -5090,7 +5373,34 @@ ${content}` }] };
5090
5373
  }
5091
5374
 
5092
5375
  // src/tools/meetings.ts
5376
+ function describeItem(item) {
5377
+ const box = item.checked ? "[x]" : "[ ]";
5378
+ const who = item.checked && item.checkedBy ? ` \u2014 ${item.checkedBy}` : "";
5379
+ const card = item.linkedTaskSlug ? ` (${item.linkedTaskSlug})` : "";
5380
+ return `${box} ${item.title}${who}${card}`;
5381
+ }
5382
+ function registerChecklistTools2(server2, conn2) {
5383
+ registerContractTool(server2, addMeetingChecklistItemsContract, async (params) => {
5384
+ const res = await conn2.addMeetingChecklistItems(params);
5385
+ const text = res.length === 0 ? "No items added \u2014 every title is already on this checklist." : `Added ${res.length}:
5386
+ ${res.map(describeItem).join("\n")}`;
5387
+ return { content: [{ type: "text", text }] };
5388
+ });
5389
+ registerContractTool(server2, checkMeetingChecklistItemContract, async (params) => {
5390
+ const res = await conn2.checkMeetingChecklistItem(params);
5391
+ return { content: [{ type: "text", text: describeItem(res) }] };
5392
+ });
5393
+ registerContractTool(server2, editMeetingChecklistItemContract, async (params) => {
5394
+ const res = await conn2.editMeetingChecklistItem(params);
5395
+ return { content: [{ type: "text", text: describeItem(res) }] };
5396
+ });
5397
+ registerContractTool(server2, removeMeetingChecklistItemContract, async (params) => {
5398
+ const res = await conn2.removeMeetingChecklistItem(params);
5399
+ return { content: [{ type: "text", text: `Removed "${res.title}".` }] };
5400
+ });
5401
+ }
5093
5402
  function registerMeetingTools(server2, conn2) {
5403
+ registerChecklistTools2(server2, conn2);
5094
5404
  registerContractTool(server2, listMeetingsContract, async (params) => {
5095
5405
  const res = await conn2.listMeetings(params);
5096
5406
  if (res.meetings.length === 0) {
@@ -5109,6 +5419,24 @@ function registerMeetingTools(server2, conn2) {
5109
5419
  const res = await conn2.getMeeting(params);
5110
5420
  return { content: [{ type: "text", text: JSON.stringify(res, null, 2) }] };
5111
5421
  });
5422
+ registerContractTool(server2, createMeetingContract, async (params) => {
5423
+ const res = await conn2.createMeeting(params);
5424
+ return {
5425
+ content: [
5426
+ {
5427
+ type: "text",
5428
+ text: `Created "${res.title}" (${res.segmentCount} segments, ${res.participants.length} participants).
5429
+ The AI summary is being written now; read it back with get_meeting in a few seconds.
5430
+ ${res.url}`
5431
+ }
5432
+ ]
5433
+ };
5434
+ });
5435
+ registerContractTool(server2, updateMeetingContract, async (params) => {
5436
+ const res = await conn2.updateMeeting(params);
5437
+ return { content: [{ type: "text", text: `Updated "${res.title}".
5438
+ ${res.url}` }] };
5439
+ });
5112
5440
  registerContractTool(server2, readMeetingTranscriptContract, async (params) => {
5113
5441
  const res = await conn2.readMeetingTranscript(params);
5114
5442
  const header = `${res.title} \u2014 segments ${res.offset + 1}-${res.offset + res.lines.length} of ${res.segmentCount}`;