replicas-engine 0.1.1668 → 0.1.1670

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.
@@ -1116,17 +1116,17 @@ var require_luxon = __commonJS({
1116
1116
  constructor(dt, intl, opts) {
1117
1117
  this.opts = opts;
1118
1118
  this.originalZone = void 0;
1119
- let z46 = void 0;
1119
+ let z47 = void 0;
1120
1120
  if (this.opts.timeZone) {
1121
1121
  this.dt = dt;
1122
1122
  } else if (dt.zone.type === "fixed") {
1123
1123
  const gmtOffset = -1 * (dt.offset / 60);
1124
1124
  const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;
1125
1125
  if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {
1126
- z46 = offsetZ;
1126
+ z47 = offsetZ;
1127
1127
  this.dt = dt;
1128
1128
  } else {
1129
- z46 = "UTC";
1129
+ z47 = "UTC";
1130
1130
  this.dt = dt.offset === 0 ? dt : dt.setZone("UTC").plus({
1131
1131
  minutes: dt.offset
1132
1132
  });
@@ -1136,9 +1136,9 @@ var require_luxon = __commonJS({
1136
1136
  this.dt = dt;
1137
1137
  } else if (dt.zone.type === "iana") {
1138
1138
  this.dt = dt;
1139
- z46 = dt.zone.name;
1139
+ z47 = dt.zone.name;
1140
1140
  } else {
1141
- z46 = "UTC";
1141
+ z47 = "UTC";
1142
1142
  this.dt = dt.setZone("UTC").plus({
1143
1143
  minutes: dt.offset
1144
1144
  });
@@ -1147,7 +1147,7 @@ var require_luxon = __commonJS({
1147
1147
  const intlOpts = {
1148
1148
  ...this.opts
1149
1149
  };
1150
- intlOpts.timeZone = intlOpts.timeZone || z46;
1150
+ intlOpts.timeZone = intlOpts.timeZone || z47;
1151
1151
  this.dtf = getCachedDTF(intl, intlOpts);
1152
1152
  }
1153
1153
  format() {
@@ -9325,6 +9325,7 @@ var WEB_APP_PATHS = {
9325
9325
  environment: "/environment",
9326
9326
  analytics: "/analytics",
9327
9327
  review: "/review",
9328
+ issues: "/issues",
9328
9329
  dashboard: DASHBOARD_PATH,
9329
9330
  agents: `${DASHBOARD_PATH}/agents`,
9330
9331
  integrations: `${DASHBOARD_PATH}/integrations`,
@@ -12526,7 +12527,7 @@ var reorderCredentialPoolSchema = z21.object({
12526
12527
  });
12527
12528
 
12528
12529
  // ../shared/src/manager-events.ts
12529
- import { z as z28 } from "zod";
12530
+ import { z as z30 } from "zod";
12530
12531
 
12531
12532
  // ../shared/src/provider-icons.ts
12532
12533
  var PROVIDER_ICON_DEFINITIONS = {
@@ -13525,7 +13526,7 @@ var GPU_ABILITY = {
13525
13526
 
13526
13527
  // ../shared/src/default-skills/replicas-agent/abilities/issues.ts
13527
13528
  var SECTION7 = `### Issues
13528
- Track work in Replicas Issues (\`REP-42\`), the shared to-do list of the people and agents in this organization, with \`replicas issue\` or the \`issue_*\` MCP tools.
13529
+ Track work in Replicas Issues (\`REP-42\`), the shared to-do list of the people and agents in this organization, with \`replicas issue\`.
13529
13530
 
13530
13531
  **Reference:** \`references/ISSUES.md\`
13531
13532
 
@@ -13538,7 +13539,7 @@ var REFERENCE7 = `# Replicas Issues
13538
13539
 
13539
13540
  Issues are how people and agents in this organization track work. Each has an identifier like \`REP-42\`, a title, a markdown description, a status, a priority, assignees (people and workspaces), subscribers, comments, linked pull requests, and an activity log. Pass the identifier everywhere an issue is asked for.
13540
13541
 
13541
- Use the CLI, or the matching \`issue_*\` MCP tools when you have them; both act as this workspace. Add \`--json\` to any command for machine-readable output.
13542
+ The CLI acts as this workspace. Add \`--json\` to any command for machine-readable output.
13542
13543
 
13543
13544
  \`\`\`bash
13544
13545
  replicas issue view REP-42 # description, comments, activity, pull requests
@@ -13551,6 +13552,7 @@ replicas issue update REP-42 --title "..." --description-file /tmp/desc.md
13551
13552
  replicas issue comment REP-42 "Ready for review: https://github.com/acme/app/pull/12"
13552
13553
  replicas issue comment REP-42 "Before and after" --attach /tmp/after.png
13553
13554
  replicas issue assign REP-42 alice@acme.com # a member's email, user ID, or a workspace ID; \`me\` is this workspace
13555
+ replicas issue unassign REP-42 alice@acme.com # they stay subscribed
13554
13556
  replicas issue subscribe REP-42 | unsubscribe REP-42
13555
13557
  replicas issue link-pr REP-42 https://github.com/acme/app/pull/12
13556
13558
  replicas issue relate REP-42 blocks REP-43 | duplicate_of REP-40
@@ -13577,7 +13579,7 @@ Read the event and act only when it asks something of you: a person's question o
13577
13579
 
13578
13580
  **Keep the description current**, the way a good PM does: when the scope or the plan changes, edit it rather than burying the change in comment 14. Comments are for progress, questions, and decisions.
13579
13581
 
13580
- **Ask a person** by assigning them and commenting with exactly what you need decided; mention them as \`@email\` in the comment. Their reply arrives as an \`<issue_event>\`.
13582
+ **Ask a person** by assigning them and commenting with exactly what you need decided; mention them as \`@email\` in the comment. Their reply arrives as an \`<issue_event>\`. Once they've answered, unassign them so the issue only shows as theirs while it needs them; they stay subscribed.
13581
13583
 
13582
13584
  **Split big work:** create sub-issues with \`--parent REP-42\`, one per pull request or separable piece, and link blockers with \`relate\`.
13583
13585
 
@@ -16132,15 +16134,28 @@ function stripAgentInstructionBlocks(text4) {
16132
16134
  else spans(prose, text4.length);
16133
16135
  return stripInstructionBlocksOutside(text4, quoted);
16134
16136
  }
16135
- var MANAGER_EVENT_CHAT_NOTE = `If a message the user typed in this turn is still unanswered, your final reply answers it and they see it. Otherwise they don't see text you write in this turn: if it brings something they asked for, or a blocker that needs them, send it with ${REPLICAS_MCP_TOOLS.sendToChat}; then update the board if its order, notes or overview changed, and end with a one-line note.`;
16137
+ var managerEventChatNote = (then) => `If a message the user typed in this turn is still unanswered, your final reply answers it and they see it. Otherwise they don't see text you write in this turn: if it brings something they asked for, or a blocker that needs them, send it with ${REPLICAS_MCP_TOOLS.sendToChat}; then ${then}end with a one-line note.`;
16138
+ var MANAGER_EVENT_CHAT_NOTE = managerEventChatNote("update the board if its order, notes or overview changed, and ");
16136
16139
  var BOARD_ANSWER_NOTE = "The user answered on the board.";
16140
+ var MANAGER_ISSUE_EVENT_CHAT_NOTE = managerEventChatNote("");
16141
+ var MERGE_RULE = `- When a pull request should merge once it's approved and CI passes, call \`${REPLICAS_MCP_TOOLS.mergeWhenReady}\`: Replicas merges it and sends \`merged\`, or \`needs_attention\` saying why it can't. Never watch CI or pull requests with \`gh\`, sleep loops or wait scripts, and merge one yourself only when the user wants it merged right away.`;
16142
+ var chatRule = (view, news) => `- The chat is like texting an assistant. In a turn the user typed, they see the text you write between tool calls as it streams, your final reply, what you send with \`${REPLICAS_MCP_TOOLS.sendToChat}\`, and your \`${REPLICAS_MCP_TOOLS.setStatus}\` line, never your tool calls. Unless you can answer right away, open with one line on what you'll do first and roughly how long it takes. Then call \`${REPLICAS_MCP_TOOLS.setStatus}\` with a few words on your current step, such as "Reading the billing webhook", and again each time you move to a new step. Before your final reply, write only what they'd want to know now: ${news}. Never narrate tool calls or say you're still working. When they message you mid-turn, reply in one line before anything else, then fold it into your work. Write in a line or two with links and any media inline, and never restate ${view} in chat.`;
16137
16143
  var BOARD_RULES = `- The board in the Ships pane beside this chat is the user's one view of the work: one ticket per task they ask for, holding only that task's pull requests. Replicas fills in each ticket's title, summaries, section and pull requests from the task, the ship's reports and its pull requests, so never restate what a ticket shows, and correct one with \`${REPLICAS_MCP_TOOLS.updateBoard}\` only when it's wrong.
16138
16144
  - Keep the board organized with \`${REPLICAS_MCP_TOOLS.updateBoard}\`: tickets in order, most important first; one short note per ticket only when it adds something, such as "Merge after #12"; and one overview line on where the work as a whole stands. Archive tickets the user no longer needs.
16139
16145
  - Ask the user only for decisions you truly can't make. Make routine calls yourself, such as retries, small scope choices or test cleanup. For a question of your own, create a ticket with it; the user's answer comes to you here, marked "${BOARD_ANSWER_NOTE}". Answers to a ship's questions go straight to that ship.
16140
16146
  - A ship with open pull requests is not done when it sends \`finished\`: Replicas fixes their CI failures and review comments automatically, then sends \`ready\` or \`needs_attention\`. On \`needs_attention\`, direct the ship, or ask the user only if you can't decide.
16141
- - When a pull request should merge once it's approved and CI passes, call \`${REPLICAS_MCP_TOOLS.mergeWhenReady}\`: Replicas merges it and sends \`merged\`, or \`needs_attention\` saying why it can't. Never watch CI or pull requests with \`gh\`, sleep loops or wait scripts, and merge one yourself only when the user wants it merged right away.
16147
+ ${MERGE_RULE}
16142
16148
  - On every ship event and board answer, act with tools on whatever it unblocks, such as starting the next task once a pull request merges, and update the board if it changed. The user sees nothing you write in these turns unless a message they typed is still unanswered; otherwise reach them only with \`${REPLICAS_MCP_TOOLS.sendToChat}\`, and only for what they'd want right now: a deliverable they asked for, with its media, links or answer; a blocker that needs them, also on the board; or a request of theirs being done. Never for status, such as "PR #12 merged" or "I asked the ship to\u2026". End the turn with a one-line note of what you did.
16143
- - The chat is like texting an assistant. In a turn the user typed, they see the text you write between tool calls as it streams, your final reply, what you send with \`${REPLICAS_MCP_TOOLS.sendToChat}\`, and your \`${REPLICAS_MCP_TOOLS.setStatus}\` line, never your tool calls. Unless you can answer right away, open with one line on what you'll do first and roughly how long it takes. Then call \`${REPLICAS_MCP_TOOLS.setStatus}\` with a few words on your current step, such as "Reading the billing webhook", and again each time you move to a new step. Before your final reply, write only what they'd want to know now: a finding that changes the answer, a ship you started, or a decision you need. Never narrate tool calls or say you're still working. When they message you mid-turn, reply in one line before anything else, then fold it into your work. Write in a line or two with links and any media inline, and never restate the board in chat.
16149
+ ${chatRule("the board", "a finding that changes the answer, a ship you started, or a decision you need")}
16150
+ `;
16151
+ var ISSUE_RULES = `- Your work lives in issues in your slice of the organization's Issues, which the Issues tab beside this chat shows the user. Before delegating, turn a request into issues with \`replicas issue create\`: one per independent task, so five small bugs are five issues, and a parent with sub-issues for a big project. Reuse an issue the request is about; find it with \`replicas issue list\`. A title says what the task is about, never a ship, branch or pull request name.
16152
+ - Spawn ships with \`issue\`, and pass \`issue\` to \`${REPLICAS_MCP_TOOLS.messageSubagent}\` to point a ship at another one: it is assigned, subscribed and told. Several ships can share an issue. Replicas moves an issue to In progress when a ship starts it, In review when its pull request opens and Done when they merge, and ships comment their progress, so never restate what an issue shows. Order, reprioritize or cancel issues with \`replicas issue update\`.
16153
+ - You are subscribed to every issue in your slice: comments and changes by ships and people arrive as \`<issue_event>\` blocks. Act on them like ship events. Ships assigned to an issue get its comments too, so never relay a comment to them; pass it only to a ship that isn't on the issue.
16154
+ - Ask the user only for decisions you truly can't make. Make routine calls yourself, such as retries, small scope choices or test cleanup. For a decision or merge only they can give, assign them to the issue with \`replicas issue assign\` and comment the question with \`replicas issue comment\`; their reply comes back as an \`<issue_event>\`. Once they answer a question you asked, unassign them with \`replicas issue unassign\` so the issue leaves their "Assigned to you"; they stay subscribed. Ships ask and unassign for their own questions, so leave those to them.
16155
+ - A ship with open pull requests is not done when it sends \`finished\`: Replicas fixes their CI failures and review comments automatically, then sends \`ready\` or \`needs_attention\`. On \`needs_attention\`, direct the ship, or assign the user only if you can't decide. On \`ready\` for a pull request that needs a person's review, assign the user with a one-line comment.
16156
+ ${MERGE_RULE}
16157
+ - On every ship and issue event, act with tools on whatever it unblocks, such as starting the next task once a pull request merges. The user sees nothing you write in these turns unless a message they typed is still unanswered; otherwise reach them only with \`${REPLICAS_MCP_TOOLS.sendToChat}\`, and only for what they'd want right now: a deliverable they asked for, with its media, links or answer; a blocker that needs them, also assigned to them on its issue; or a request of theirs being done. Never for status, such as "PR #12 merged" or "I asked the ship to\u2026". End the turn with a one-line note of what you did, or only \`No action needed.\` when an issue event needs nothing from you.
16158
+ ${chatRule("the Issues tab", "the issues you created, a ship you started, a finding that changes the answer, or a decision you need")}
16144
16159
  `;
16145
16160
  function splitTaggedBlock(text4, tag) {
16146
16161
  const match = text4?.match(new RegExp(`\\s*<${tag}>\\n([\\s\\S]*?)\\n</${tag}>`));
@@ -16208,31 +16223,310 @@ function parseMessageOrigin(raw) {
16208
16223
  return automation ? { kind: "automation", id: automation[2], name: automation[1].trim(), body: stripReplicasInstructionBlock(raw.slice(automation[0].length)) } : null;
16209
16224
  }
16210
16225
 
16226
+ // ../shared/src/tag-blocks.ts
16227
+ var ATTRIBUTE = /(\w+)="([^"]*)"/g;
16228
+ var MULTITASK_EVENT_TAG = "multitask_event";
16229
+ var tagBlockPattern = (tag) => new RegExp(`<${tag}((?:\\s+\\w+="[^"]*")*)>\\n?([\\s\\S]*?)\\n?</${tag}>`, "g");
16230
+ var escapeTagAttribute = (value) => value.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;");
16231
+ var parseTagAttributes = (raw) => Object.fromEntries([...raw.matchAll(ATTRIBUTE)].map(([, key, value]) => [key, value.replace(/&lt;/g, "<").replace(/&quot;/g, '"').replace(/&amp;/g, "&")]));
16232
+
16233
+ // ../shared/src/issue-events.ts
16234
+ import { z as z29 } from "zod";
16235
+
16236
+ // ../shared/src/routes/issues.ts
16237
+ import { z as z28 } from "zod";
16238
+ var ISSUE_STATUSES = ["backlog", "todo", "in_progress", "in_review", "done", "canceled", "duplicate"];
16239
+ var ISSUE_PRIORITIES = ["none", "urgent", "high", "medium", "low"];
16240
+ var ISSUE_ACTOR_TYPES = ["user", "workspace"];
16241
+ var ISSUE_SUBSCRIBER_ROLES = ["assignee", "creator", "mentioned", "manual"];
16242
+ var ISSUE_RELATION_TYPES = ["blocks", "duplicate_of"];
16243
+ var ISSUE_PULL_REQUEST_STATES = ["draft", "open", "merged", "closed"];
16244
+ var issueStatusSchema = z28.enum(ISSUE_STATUSES);
16245
+ var issuePrioritySchema = z28.enum(ISSUE_PRIORITIES);
16246
+ var issueSubscriberRoleSchema = z28.enum(ISSUE_SUBSCRIBER_ROLES);
16247
+ var issueRelationTypeSchema = z28.enum(ISSUE_RELATION_TYPES);
16248
+ var issuePullRequestStateSchema = z28.enum(ISSUE_PULL_REQUEST_STATES);
16249
+ var ISSUE_STATUS_LABELS = { backlog: "Backlog", todo: "Todo", in_progress: "In Progress", in_review: "In Review", done: "Done", canceled: "Canceled", duplicate: "Duplicate" };
16250
+ var ISSUE_PRIORITY_LABELS = { none: "No priority", urgent: "Urgent", high: "High", medium: "Medium", low: "Low" };
16251
+ var issueActorSchema = z28.object({
16252
+ type: z28.enum(ISSUE_ACTOR_TYPES),
16253
+ id: z28.string().toLowerCase().uuid()
16254
+ });
16255
+ var ISSUE_KEY_RE = /^[A-Z][A-Z0-9]{0,9}$/;
16256
+ var timestamp = z28.string();
16257
+ var nullableTimestamp = timestamp.nullable();
16258
+ var issueSchema = z28.object({
16259
+ id: z28.string().uuid(),
16260
+ organization_id: z28.string().uuid(),
16261
+ number: z28.number().int(),
16262
+ identifier: z28.string(),
16263
+ title: z28.string(),
16264
+ description: z28.string(),
16265
+ status: issueStatusSchema,
16266
+ priority: issuePrioritySchema,
16267
+ parent_id: z28.string().uuid().nullable(),
16268
+ manager_id: z28.string().uuid().nullable(),
16269
+ creator: issueActorSchema,
16270
+ /** Fractional: to move an issue between two others, send the midpoint of their sort orders. */
16271
+ sort_order: z28.number(),
16272
+ created_at: timestamp,
16273
+ updated_at: timestamp,
16274
+ completed_at: nullableTimestamp,
16275
+ canceled_at: nullableTimestamp,
16276
+ archived_at: nullableTimestamp
16277
+ });
16278
+ var issueSubscriberSchema = z28.object({
16279
+ issue_id: z28.string().uuid(),
16280
+ subscriber: issueActorSchema,
16281
+ role: issueSubscriberRoleSchema,
16282
+ created_at: timestamp
16283
+ });
16284
+ var issueRelationSchema = z28.object({
16285
+ id: z28.string().uuid(),
16286
+ type: issueRelationTypeSchema,
16287
+ issue_id: z28.string().uuid(),
16288
+ related_issue_id: z28.string().uuid(),
16289
+ created_at: timestamp
16290
+ });
16291
+ var issuePullRequestSchema = z28.object({
16292
+ id: z28.string().uuid(),
16293
+ issue_id: z28.string().uuid(),
16294
+ url: z28.string(),
16295
+ pull_request_id: z28.string().uuid().nullable(),
16296
+ title: z28.string().nullable(),
16297
+ state: issuePullRequestStateSchema,
16298
+ created_at: timestamp,
16299
+ updated_at: timestamp
16300
+ });
16301
+ var issueCommentSchema = z28.object({
16302
+ id: z28.string().uuid(),
16303
+ issue_id: z28.string().uuid(),
16304
+ author: issueActorSchema,
16305
+ body: z28.string(),
16306
+ created_at: timestamp,
16307
+ updated_at: timestamp
16308
+ });
16309
+ var change = (value) => z28.object({ from: value, to: value });
16310
+ var nullableId = z28.string().uuid().nullable();
16311
+ var ISSUE_EVENT_TYPES = [
16312
+ "created",
16313
+ "title_changed",
16314
+ "description_changed",
16315
+ "status_changed",
16316
+ "priority_changed",
16317
+ "parent_changed",
16318
+ "manager_changed",
16319
+ "sort_order_changed",
16320
+ "assignee_added",
16321
+ "assignee_removed",
16322
+ "subscriber_added",
16323
+ "subscriber_removed",
16324
+ "relation_added",
16325
+ "relation_removed",
16326
+ "pr_linked",
16327
+ "pr_unlinked",
16328
+ "pr_state_changed",
16329
+ "comment_added",
16330
+ "comment_edited",
16331
+ "comment_deleted",
16332
+ "archived",
16333
+ "restored"
16334
+ ];
16335
+ var issueEventDataSchemas = {
16336
+ created: z28.object({ issue: issueSchema }),
16337
+ title_changed: change(z28.string()),
16338
+ description_changed: change(z28.string()),
16339
+ status_changed: change(issueStatusSchema).extend({ completed_at: nullableTimestamp, canceled_at: nullableTimestamp }),
16340
+ priority_changed: change(issuePrioritySchema),
16341
+ parent_changed: change(nullableId),
16342
+ manager_changed: change(nullableId),
16343
+ sort_order_changed: change(z28.number()),
16344
+ /** `subscriber` is the row after the change: an unassigned principal stays subscribed with role `manual`. */
16345
+ assignee_added: z28.object({ subscriber: issueSubscriberSchema }),
16346
+ assignee_removed: z28.object({ subscriber: issueSubscriberSchema }),
16347
+ subscriber_added: z28.object({ subscriber: issueSubscriberSchema }),
16348
+ subscriber_removed: z28.object({ subscriber: issueSubscriberSchema }),
16349
+ relation_added: z28.object({ relation: issueRelationSchema }),
16350
+ relation_removed: z28.object({ relation: issueRelationSchema }),
16351
+ pr_linked: z28.object({ pull_request: issuePullRequestSchema }),
16352
+ pr_unlinked: z28.object({ pull_request: issuePullRequestSchema }),
16353
+ pr_state_changed: z28.object({ pull_request: issuePullRequestSchema, from: issuePullRequestStateSchema }),
16354
+ comment_added: z28.object({ comment: issueCommentSchema }),
16355
+ comment_edited: z28.object({ comment: issueCommentSchema, from: z28.string() }),
16356
+ comment_deleted: z28.object({ comment: issueCommentSchema }),
16357
+ archived: z28.object({ archived_at: timestamp }),
16358
+ restored: z28.object({
16359
+ issue: issueSchema,
16360
+ subscribers: z28.array(issueSubscriberSchema),
16361
+ relations: z28.array(issueRelationSchema),
16362
+ pull_requests: z28.array(issuePullRequestSchema)
16363
+ })
16364
+ };
16365
+ var issueEventBase = z28.object({
16366
+ sync_id: z28.number().int(),
16367
+ issue_id: z28.string().uuid(),
16368
+ actor: issueActorSchema,
16369
+ /** Echo of the `client_mutation_id` sent with the write, so the writer can settle its optimistic change. */
16370
+ client_mutation_id: z28.string().nullable(),
16371
+ created_at: timestamp
16372
+ });
16373
+ var issueEventVariant = (type) => issueEventBase.extend({ type: z28.literal(type), data: issueEventDataSchemas[type] });
16374
+ var issueEventSchema = z28.discriminatedUnion("type", [issueEventVariant(ISSUE_EVENT_TYPES[0]), ...ISSUE_EVENT_TYPES.slice(1).map(issueEventVariant)]);
16375
+ var clientMutationId = z28.string().min(1).max(128).optional();
16376
+ var title2 = z28.string().trim().min(1).max(500);
16377
+ var description = z28.string().max(1e5);
16378
+ var body = z28.string().trim().min(1).max(1e5);
16379
+ var createIssueRequestSchema = z28.object({
16380
+ /** Client-generated id, so an optimistic create can be referenced before the server answers. */
16381
+ id: z28.string().uuid().optional(),
16382
+ title: title2,
16383
+ description: description.optional(),
16384
+ status: issueStatusSchema.optional(),
16385
+ priority: issuePrioritySchema.optional(),
16386
+ parent_id: z28.string().uuid().optional(),
16387
+ manager_id: z28.string().uuid().optional(),
16388
+ sort_order: z28.number().finite().optional(),
16389
+ assignees: z28.array(issueActorSchema).max(20).optional(),
16390
+ subscribers: z28.array(issueActorSchema).max(50).optional(),
16391
+ client_mutation_id: clientMutationId
16392
+ });
16393
+ var updateIssueRequestSchema = z28.object({
16394
+ title: title2.optional(),
16395
+ description: description.optional(),
16396
+ status: issueStatusSchema.optional(),
16397
+ priority: issuePrioritySchema.optional(),
16398
+ // PATCH semantics: null clears the parent or Manager, omitting it leaves it unchanged.
16399
+ parent_id: nullableId.optional(),
16400
+ manager_id: nullableId.optional(),
16401
+ sort_order: z28.number().finite().optional(),
16402
+ client_mutation_id: clientMutationId
16403
+ });
16404
+ var issueActorRequestSchema = issueActorSchema.partial().extend({ client_mutation_id: clientMutationId });
16405
+ var createIssueCommentRequestSchema = z28.object({
16406
+ id: z28.string().uuid().optional(),
16407
+ body,
16408
+ client_mutation_id: clientMutationId
16409
+ });
16410
+ var updateIssueCommentRequestSchema = z28.object({ body, client_mutation_id: clientMutationId });
16411
+ var createIssueRelationRequestSchema = z28.object({
16412
+ id: z28.string().uuid().optional(),
16413
+ type: issueRelationTypeSchema,
16414
+ related_issue: z28.string().min(1),
16415
+ client_mutation_id: clientMutationId
16416
+ });
16417
+ var linkIssuePullRequestRequestSchema = z28.object({
16418
+ id: z28.string().uuid().optional(),
16419
+ url: z28.string().url().max(2e3),
16420
+ title: z28.string().max(500).optional(),
16421
+ state: issuePullRequestStateSchema.optional(),
16422
+ pull_request_id: z28.string().uuid().optional(),
16423
+ client_mutation_id: clientMutationId
16424
+ });
16425
+ var updateIssuePullRequestRequestSchema = z28.object({
16426
+ state: issuePullRequestStateSchema,
16427
+ client_mutation_id: clientMutationId
16428
+ });
16429
+ var issueMutationRequestSchema = z28.object({ client_mutation_id: clientMutationId });
16430
+ var updateIssueSettingsRequestSchema = z28.object({ issue_key: z28.string().trim().toUpperCase().regex(ISSUE_KEY_RE) });
16431
+ var listIssuesQuerySchema = z28.object({
16432
+ status: z28.string().optional(),
16433
+ priority: z28.string().optional(),
16434
+ assignee: z28.string().optional(),
16435
+ subscriber: z28.string().optional(),
16436
+ creator: z28.string().optional(),
16437
+ manager_id: z28.string().optional(),
16438
+ parent_id: z28.string().optional(),
16439
+ q: z28.string().max(200).optional(),
16440
+ include_archived: z28.enum(["true", "false"]).optional(),
16441
+ limit: z28.coerce.number().int().min(1).max(200).optional(),
16442
+ cursor: z28.coerce.number().int().min(0).max(2147483647).optional()
16443
+ });
16444
+ var issueDetailResponseSchema = z28.object({
16445
+ issue: issueSchema,
16446
+ subscribers: z28.array(issueSubscriberSchema),
16447
+ relations: z28.array(issueRelationSchema),
16448
+ pull_requests: z28.array(issuePullRequestSchema),
16449
+ comments: z28.array(issueCommentSchema),
16450
+ events: z28.array(issueEventSchema),
16451
+ sub_issues: z28.array(issueSchema)
16452
+ });
16453
+ var listIssuesResponseSchema = z28.object({ issues: z28.array(issueSchema), next_cursor: z28.number().nullable() });
16454
+ var issuesDeltaQuerySchema = z28.object({
16455
+ after: z28.coerce.number().int().min(0).max(Number.MAX_SAFE_INTEGER),
16456
+ limit: z28.coerce.number().int().min(1).max(1e3).optional()
16457
+ });
16458
+ var issueInboxQuerySchema = z28.object({
16459
+ limit: z28.coerce.number().int().min(1).max(100).optional(),
16460
+ before: z28.coerce.number().int().min(1).optional()
16461
+ });
16462
+ var markIssueInboxReadRequestSchema = z28.object({ sync_id: z28.number().int().min(0).optional() });
16463
+
16464
+ // ../shared/src/issue-events.ts
16465
+ var ISSUE_EVENT_TAG = "issue_event";
16466
+ var transitionSchema = z29.discriminatedUnion("field", [
16467
+ z29.object({ field: z29.literal("status"), from: issueStatusSchema, to: issueStatusSchema }),
16468
+ z29.object({ field: z29.literal("priority"), from: issuePrioritySchema, to: issuePrioritySchema })
16469
+ ]);
16470
+ var issueEventChangeSchema = z29.object({ actor: z29.string(), agent: z29.boolean(), text: z29.string(), transition: transitionSchema.optional() });
16471
+ var CHANGE_LINE = /^(.+?)( \(agent\))? (created it|renamed it|edited |changed the |made it|moved it|removed |assigned |unassigned |marked |linked |unlinked |pull request |commented|deleted a comment|archived it|restored it)(.*)$/;
16472
+ var TRANSITION = /^changed the (status|priority): (\w+) → (\w+)$/;
16473
+ function parseChange(line, excerpt) {
16474
+ const match = line.match(CHANGE_LINE);
16475
+ const rest = (match ? match[3] + match[4] : line).replaceAll(" (agent)", "").replace(/(?:\. Now)?:$/, "");
16476
+ const [, field, from, to] = rest.match(TRANSITION) ?? [];
16477
+ const transition = transitionSchema.safeParse({ field, from, to }).data;
16478
+ const labels = !transition ? [] : transition.field === "status" ? [ISSUE_STATUS_LABELS[transition.from], ISSUE_STATUS_LABELS[transition.to]] : [ISSUE_PRIORITY_LABELS[transition.from], ISSUE_PRIORITY_LABELS[transition.to]];
16479
+ const text4 = transition ? `changed the ${transition.field}: ${labels.join(" \u2192 ")}` : rest;
16480
+ return { actor: match?.[1] ?? "", agent: Boolean(match?.[2]), text: excerpt ? `${text4}: ${excerpt}` : text4, ...transition ? { transition } : {} };
16481
+ }
16482
+ var issueChangeSentence = (change2) => [change2.actor, change2.text].filter(Boolean).join(" ");
16483
+ function extractIssueEvents(text4) {
16484
+ return [...text4.matchAll(tagBlockPattern(ISSUE_EVENT_TAG))].flatMap((match) => {
16485
+ const attributes = parseTagAttributes(match[1]);
16486
+ if (!attributes.issue) return [];
16487
+ const detail = match[2].replaceAll(`<\\/${ISSUE_EVENT_TAG}`, `</${ISSUE_EVENT_TAG}`).trim();
16488
+ const changes = detail.split("\n\n").flatMap((paragraph) => {
16489
+ const [line, ...quoted] = paragraph.split("\n");
16490
+ if (!line.trim() || line.startsWith(">")) return [];
16491
+ return [parseChange(line, line.endsWith(". Now:") ? void 0 : quoted.map((quote) => quote.replace(/^>\s?/, "").trim()).find(Boolean))];
16492
+ });
16493
+ return [{
16494
+ id: `${attributes.issue}:${attributes.sync_id ?? ""}`,
16495
+ at: "",
16496
+ kind: "issue",
16497
+ agentId: attributes.issue,
16498
+ agentName: attributes.issue,
16499
+ summary: changes.map(issueChangeSentence).join(" \xB7 "),
16500
+ ...detail ? { detail } : {},
16501
+ issue: { title: attributes.title ?? "", url: attributes.url ?? "", changes }
16502
+ }];
16503
+ });
16504
+ }
16505
+
16211
16506
  // ../shared/src/manager-events.ts
16212
16507
  var MANAGER_EVENT_KINDS = ["finished", "ready", "needs_attention", "approved", "merged", "closed", "archived", "replied"];
16213
16508
  var UNKNOWN_EVENT_KIND = "update";
16214
16509
  var MANAGER_TURN_ERROR_SUMMARY = "Turn ended with an error.";
16215
16510
  var MANAGER_EVENT_TYPE = "multitask-event";
16216
16511
  var MANAGER_EVENT_MESSAGE_TYPE = "multitask_event";
16217
- var managerEventSchema = z28.object({
16218
- id: z28.string(),
16219
- at: z28.string(),
16220
- kind: z28.enum([...MANAGER_EVENT_KINDS, UNKNOWN_EVENT_KIND]),
16221
- agentId: z28.string(),
16222
- agentName: z28.string(),
16223
- summary: z28.string(),
16224
- detail: z28.string().optional(),
16512
+ var managerEventSchema = z30.object({
16513
+ id: z30.string(),
16514
+ at: z30.string(),
16515
+ kind: z30.enum([...MANAGER_EVENT_KINDS, UNKNOWN_EVENT_KIND, "issue"]),
16516
+ agentId: z30.string(),
16517
+ agentName: z30.string(),
16518
+ summary: z30.string(),
16519
+ detail: z30.string().optional(),
16225
16520
  // Set when the subagent is a chat in this workspace rather than a ship; agentId is then that chat's id.
16226
- chatId: z28.string().optional(),
16227
- ticket: z28.object({ id: z28.string(), title: z28.string() }).optional(),
16521
+ chatId: z30.string().optional(),
16522
+ ticket: z30.object({ id: z30.string(), title: z30.string() }).optional(),
16523
+ issue: z30.object({ title: z30.string(), url: z30.string(), changes: z30.array(issueEventChangeSchema) }).optional(),
16228
16524
  // Set on events recorded before every kind woke the orchestrator, which were shown as a row when they happened.
16229
- noticed: z28.boolean().optional()
16525
+ noticed: z30.boolean().optional()
16230
16526
  });
16231
- var TAG = "multitask_event";
16232
- var BLOCK = new RegExp(`<${TAG}((?:\\s+\\w+="[^"]*")*)>\\n?([\\s\\S]*?)\\n?</${TAG}>`, "g");
16233
- var ATTRIBUTE = /(\w+)="([^"]*)"/g;
16234
- var escapeAttribute = (value) => value.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;");
16235
- var unescapeAttribute = (value) => value.replace(/&lt;/g, "<").replace(/&quot;/g, '"').replace(/&amp;/g, "&");
16527
+ var TAG = MULTITASK_EVENT_TAG;
16528
+ var BLOCK = tagBlockPattern(TAG);
16529
+ var ISSUE_BLOCK = tagBlockPattern(ISSUE_EVENT_TAG);
16236
16530
  var EVENT_RESPONSE_MAX_CHARS = 8e3;
16237
16531
  function truncateManagerEventResponse(response, readTool) {
16238
16532
  return response.length > EVENT_RESPONSE_MAX_CHARS ? `${response.slice(0, EVENT_RESPONSE_MAX_CHARS)}\u2026
@@ -16243,14 +16537,14 @@ function formatManagerEvents(events) {
16243
16537
  return events.map((event) => {
16244
16538
  const attributes = { id: event.id, at: event.at, kind: event.kind, agent: event.agentName, agent_id: event.agentId, ...event.chatId ? { chat_id: event.chatId } : {}, ...event.ticket ? { ticket_id: event.ticket.id, ticket: event.ticket.title } : {}, ...event.noticed ? { noticed: "true" } : {} };
16245
16539
  const body2 = [event.summary, event.detail].filter(Boolean).join("\n\n").replaceAll(`</${TAG}`, `<\\/${TAG}`);
16246
- return `<${TAG}${Object.entries(attributes).map(([key, value]) => ` ${key}="${escapeAttribute(value)}"`).join("")}>
16540
+ return `<${TAG}${Object.entries(attributes).map(([key, value]) => ` ${key}="${escapeTagAttribute(value)}"`).join("")}>
16247
16541
  ${body2}
16248
16542
  </${TAG}>`;
16249
16543
  }).join("\n\n");
16250
16544
  }
16251
16545
  function extractManagerEvents(text4) {
16252
16546
  return [...text4.matchAll(BLOCK)].flatMap((match) => {
16253
- const attributes = Object.fromEntries([...match[1].matchAll(ATTRIBUTE)].map(([, key, value]) => [key, unescapeAttribute(value)]));
16547
+ const attributes = parseTagAttributes(match[1]);
16254
16548
  if (!attributes.kind || !attributes.id || !attributes.agent_id) return [];
16255
16549
  const kind = MANAGER_EVENT_KINDS.find((candidate) => candidate === attributes.kind) ?? UNKNOWN_EVENT_KIND;
16256
16550
  const [summary, ...rest] = match[2].replaceAll(`<\\/${TAG}`, `</${TAG}`).split("\n\n");
@@ -16270,14 +16564,15 @@ function extractManagerEvents(text4) {
16270
16564
  });
16271
16565
  }
16272
16566
  function parseManagerEvents(text4) {
16273
- const events = extractManagerEvents(text4);
16274
- return events.length > 0 && text4.replace(BLOCK, "").replaceAll(MERGED_MESSAGE_SEPARATOR.trim(), "").trim() === "" ? events : null;
16567
+ const events = [...extractManagerEvents(text4), ...extractIssueEvents(text4)];
16568
+ return events.length > 0 && text4.replace(BLOCK, "").replace(ISSUE_BLOCK, "").replaceAll(MERGED_MESSAGE_SEPARATOR.trim(), "").trim() === "" ? events : null;
16275
16569
  }
16276
16570
  function isManagerEventMessage(text4) {
16277
- return text4.trimStart().startsWith(`<${TAG} `);
16571
+ const start = text4.trimStart();
16572
+ return start.startsWith(`<${TAG} `) || start.startsWith(`<${ISSUE_EVENT_TAG} `);
16278
16573
  }
16279
16574
  function stripManagerEventNotes(content) {
16280
- return stripInstructionBlocksOutside(content, [...content.matchAll(BLOCK)].map((block) => [block.index, block.index + block[0].length]));
16575
+ return stripInstructionBlocksOutside(content, [...content.matchAll(BLOCK), ...content.matchAll(ISSUE_BLOCK)].map((block) => [block.index, block.index + block[0].length]));
16281
16576
  }
16282
16577
 
16283
16578
  // ../shared/src/display-message/types.ts
@@ -17271,7 +17566,7 @@ function subagentReport(output) {
17271
17566
  }
17272
17567
 
17273
17568
  // ../shared/src/learned-skills.ts
17274
- import { z as z29 } from "zod";
17569
+ import { z as z31 } from "zod";
17275
17570
 
17276
17571
  // ../shared/src/frontmatter.ts
17277
17572
  import { parse as parseYaml } from "yaml";
@@ -17294,20 +17589,20 @@ function parseFrontmatter(content) {
17294
17589
  var LEARNED_SKILLS_ROOT = `${SANDBOX_PATHS.REPLICAS_DIR}/learned-skills`;
17295
17590
  var LEARNED_SKILLS_MANIFEST_PATH = `${LEARNED_SKILLS_ROOT}/manifest.json`;
17296
17591
  var LEARNED_SKILL_DIR_PREFIX = "replicas-learned__";
17297
- var learnedSkillsManifestSchema = z29.object({
17298
- skills: z29.array(z29.object({ name: z29.string(), sha256: z29.string() }))
17592
+ var learnedSkillsManifestSchema = z31.object({
17593
+ skills: z31.array(z31.object({ name: z31.string(), sha256: z31.string() }))
17299
17594
  });
17300
- var dreamVerdictChecksSchema = z29.object({
17301
- repeatable: z29.boolean(),
17302
- realInstruction: z29.boolean(),
17303
- noContradiction: z29.boolean(),
17304
- formatExact: z29.boolean(),
17305
- humanOnly: z29.boolean(),
17306
- actionable: z29.boolean(),
17307
- durable: z29.boolean()
17595
+ var dreamVerdictChecksSchema = z31.object({
17596
+ repeatable: z31.boolean(),
17597
+ realInstruction: z31.boolean(),
17598
+ noContradiction: z31.boolean(),
17599
+ formatExact: z31.boolean(),
17600
+ humanOnly: z31.boolean(),
17601
+ actionable: z31.boolean(),
17602
+ durable: z31.boolean()
17308
17603
  });
17309
17604
  var DREAM_VERDICT_CHECKS = dreamVerdictChecksSchema.keyof().options;
17310
- var dreamVerdictSchema = dreamVerdictChecksSchema.extend({ approve: z29.boolean(), reason: z29.string() });
17605
+ var dreamVerdictSchema = dreamVerdictChecksSchema.extend({ approve: z31.boolean(), reason: z31.string() });
17311
17606
  var learnedSkillFormatInstruction = (speaker) => `Write a SKILL.md whose frontmatter has a kebab-case \`name\` and a short \`description\` that starts with "Use when" and names the situations it applies to; the body records only what ${speaker} actually said, restated as a direct instruction, usually one to three lines. Every line of a learning is loaded into future sessions, so leave out anything an agent could infer on its own: no headings, explanations, rules, or examples unless ${speaker} stated those specifics themselves. For "from now on, use Conventional Commits", the body is just "Use Conventional Commits for every commit message and PR title."`;
17312
17607
 
17313
17608
  // ../shared/src/terminal.ts
@@ -17338,7 +17633,7 @@ function workspaceTargetFromToolOutput(output) {
17338
17633
  }
17339
17634
 
17340
17635
  // ../shared/src/manager-board.ts
17341
- import { z as z30 } from "zod";
17636
+ import { z as z32 } from "zod";
17342
17637
  var MANAGER_TICKET_LIMITS = {
17343
17638
  title: 80,
17344
17639
  task: 1e3,
@@ -17358,78 +17653,78 @@ var MANAGER_TICKET_LIMITS = {
17358
17653
  };
17359
17654
  var L = MANAGER_TICKET_LIMITS;
17360
17655
  var tooLong = (max) => `At most ${max} characters. Keep it short; the user should take it in at a glance`;
17361
- var text3 = (max) => z30.string().trim().min(1).max(max, tooLong(max));
17362
- var clearable = (schema) => z30.union([schema, z30.literal("")]).optional();
17363
- var httpsUrl = z30.url({ protocol: /^https$/, error: "Must be an https URL" });
17656
+ var text3 = (max) => z32.string().trim().min(1).max(max, tooLong(max));
17657
+ var clearable = (schema) => z32.union([schema, z32.literal("")]).optional();
17658
+ var httpsUrl = z32.url({ protocol: /^https$/, error: "Must be an https URL" });
17364
17659
  var inlineMarkdown = "Markdown: **bold**, *italics*, `code`, [links](https://... or an absolute file path)";
17365
17660
  var markdown = `${inlineMarkdown} and line breaks.`;
17366
- var linearIdentifier = z30.string().regex(/^[A-Za-z][A-Za-z0-9]{0,9}-\d{1,7}$/, "Use a Linear identifier such as REP-123");
17367
- var mediaSchema = z30.object({
17661
+ var linearIdentifier = z32.string().regex(/^[A-Za-z][A-Za-z0-9]{0,9}-\d{1,7}$/, "Use a Linear identifier such as REP-123");
17662
+ var mediaSchema = z32.object({
17368
17663
  url: httpsUrl.describe("The URL `replicas media upload` printed."),
17369
17664
  caption: text3(L.caption).describe('What it shows, such as "After: the list stays pinned".'),
17370
- kind: z30.enum(["image", "video"]).describe("video for recordings, image for screenshots and GIFs.")
17665
+ kind: z32.enum(["image", "video"]).describe("video for recordings, image for screenshots and GIFs.")
17371
17666
  });
17372
- var questionSchema = z30.object({
17667
+ var questionSchema = z32.object({
17373
17668
  question: text3(L.question).describe("One question, with the context needed to answer it."),
17374
- options: z30.array(text3(L.option)).max(L.options).optional().describe("Up to three answers to pick from, recommended first. The user can always write their own.")
17669
+ options: z32.array(text3(L.option)).max(L.options).optional().describe("Up to three answers to pick from, recommended first. The user can always write their own.")
17375
17670
  });
17376
17671
  var managerTicketTitleSchema = text3(L.title).describe(`What the task is about, in a few plain words, such as "Slack replies in Manager channels get dropped" or "Add CSV export to Analytics". Never a ship, branch or pull request name. At most ${L.title} characters.`);
17377
17672
  var managerTicketTaskSchema = text3(L.task);
17378
- var managerTicketMediaSchema = z30.array(mediaSchema);
17379
- var managerTicketQuestionsSchema = z30.array(questionSchema.extend({ id: z30.string() }));
17380
- var issueSchema = clearable(text3(L.issue)).describe(`What was wrong or what was asked, in a few plain sentences a busy reader understands: the problem, not the fix. Carry the evidence: Slack and Linear threads as links, customer quotes in quotation marks, and screenshots in \`media\`. ${markdown} At most ${L.issue} characters.`);
17673
+ var managerTicketMediaSchema = z32.array(mediaSchema);
17674
+ var managerTicketQuestionsSchema = z32.array(questionSchema.extend({ id: z32.string() }));
17675
+ var issueSchema2 = clearable(text3(L.issue)).describe(`What was wrong or what was asked, in a few plain sentences a busy reader understands: the problem, not the fix. Carry the evidence: Slack and Linear threads as links, customer quotes in quotation marks, and screenshots in \`media\`. ${markdown} At most ${L.issue} characters.`);
17381
17676
  var fixSchema = clearable(text3(L.fix)).describe(`What was done or is being done about it, with pull requests as #number. Keep it current as the work goes on, and say how it ended once the pull requests land. ${markdown} At most ${L.fix} characters.`);
17382
- var updateManagerTicketRequestSchema = z30.object({
17677
+ var updateManagerTicketRequestSchema = z32.object({
17383
17678
  title: managerTicketTitleSchema.optional(),
17384
- issue: issueSchema,
17679
+ issue: issueSchema2,
17385
17680
  fix: fixSchema,
17386
- media: z30.array(mediaSchema).max(L.media).optional().describe(`Screenshots and recordings that show the result, uploaded with \`replicas media upload\`, at most ${L.media}. Replaces the ticket's media.`),
17387
- questions: z30.array(questionSchema).max(L.questions).optional().describe(`Questions only the user can answer, at most ${L.questions}. Replaces the open ones; pass [] once they are answered. Their answer comes back to you in this chat.`),
17681
+ media: z32.array(mediaSchema).max(L.media).optional().describe(`Screenshots and recordings that show the result, uploaded with \`replicas media upload\`, at most ${L.media}. Replaces the ticket's media.`),
17682
+ questions: z32.array(questionSchema).max(L.questions).optional().describe(`Questions only the user can answer, at most ${L.questions}. Replaces the open ones; pass [] once they are answered. Their answer comes back to you in this chat.`),
17388
17683
  blocked: clearable(text3(L.blocked)).describe('Why you cannot go on without the user, such as missing access. "" once unblocked.')
17389
17684
  });
17390
- var updateManagerBoardRequestSchema = z30.object({
17685
+ var updateManagerBoardRequestSchema = z32.object({
17391
17686
  overview: clearable(text3(L.overview)).describe(`One line at the top of the board on where the work as a whole stands. "" removes it. At most ${L.overview} characters.`),
17392
- tickets: z30.array(z30.object({
17393
- id: z30.uuid(),
17687
+ tickets: z32.array(z32.object({
17688
+ id: z32.uuid(),
17394
17689
  title: managerTicketTitleSchema.optional(),
17395
- issue: issueSchema,
17690
+ issue: issueSchema2,
17396
17691
  fix: fixSchema,
17397
- pull_requests: z30.array(httpsUrl).max(20).optional().describe("Pull request URLs that came out of this ticket's task. They move here from any other ticket. Each pull request is filed under the ticket its ship was working on when it opened it, so pass this only to correct that."),
17692
+ pull_requests: z32.array(httpsUrl).max(20).optional().describe("Pull request URLs that came out of this ticket's task. They move here from any other ticket. Each pull request is filed under the ticket its ship was working on when it opened it, so pass this only to correct that."),
17398
17693
  note: clearable(text3(L.note)).describe(`Your one short comment on the ticket, shown under its row, replacing the last. ${inlineMarkdown}. "" removes it. At most ${L.note} characters.`),
17399
17694
  linear: clearable(linearIdentifier).describe('The Linear issue this ticket is for, such as REP-123. "" removes it.'),
17400
- archived: z30.boolean().optional().describe("true takes it off the board for good: closes its open pull requests without merging, stops their automatic fixes, and archives its ships unless they still have other tickets. false puts it back on the board.")
17695
+ archived: z32.boolean().optional().describe("true takes it off the board for good: closes its open pull requests without merging, stops their automatic fixes, and archives its ships unless they still have other tickets. false puts it back on the board.")
17401
17696
  })).max(50).optional().describe("Changes to existing tickets."),
17402
- order: z30.array(z30.uuid()).optional().describe("Ticket ids, most important first. Tickets left out keep their order after these."),
17403
- create: z30.array(z30.object({
17697
+ order: z32.array(z32.uuid()).optional().describe("Ticket ids, most important first. Tickets left out keep their order after these."),
17698
+ create: z32.array(z32.object({
17404
17699
  title: managerTicketTitleSchema,
17405
17700
  task: managerTicketTaskSchema.optional(),
17406
17701
  issue: text3(L.issue).optional(),
17407
- questions: z30.array(questionSchema).max(L.questions).optional(),
17702
+ questions: z32.array(questionSchema).max(L.questions).optional(),
17408
17703
  note: text3(L.note).optional()
17409
17704
  })).max(5).optional().describe("Tickets with no ship, for your own questions to the user or work no ship does. Their answers come to you.")
17410
17705
  });
17411
- var answerManagerTicketRequestSchema = z30.object({
17412
- questionId: z30.string().min(1),
17706
+ var answerManagerTicketRequestSchema = z32.object({
17707
+ questionId: z32.string().min(1),
17413
17708
  answer: text3(L.answer)
17414
17709
  });
17415
- var managerTicketAnswerRefSchema = z30.object({ managerId: z30.uuid(), ticketId: z30.uuid(), questionId: z30.string().min(1) });
17416
- var replyOnManagerTicketRequestSchema = z30.object({
17710
+ var managerTicketAnswerRefSchema = z32.object({ managerId: z32.uuid(), ticketId: z32.uuid(), questionId: z32.string().min(1) });
17711
+ var replyOnManagerTicketRequestSchema = z32.object({
17417
17712
  reply: text3(L.reply).describe(`Your answer to the user's latest message on the ticket, in a few sentences. ${markdown} Link a screenshot or recording uploaded with \`replicas media upload\` if it helps. At most ${L.reply} characters; keep longer detail in your chat.`),
17418
17713
  question: questionSchema.optional().describe("A follow-up question only if you need the user to decide something. It shows on the ticket with its options, and their answer comes back to you.")
17419
17714
  });
17420
- var managerTicketReplyRefSchema = z30.object({ ticketId: z30.uuid(), text: text3(L.answer) });
17421
- var managerTicketThreadSchema = z30.array(z30.object({
17422
- id: z30.string(),
17423
- from: z30.enum(["user", "ship"]),
17424
- name: z30.string(),
17425
- ship_id: z30.string(),
17426
- chat_id: z30.string(),
17427
- text: z30.string(),
17428
- at: z30.string(),
17429
- nudge: z30.enum(["sent", "missed"]).optional()
17715
+ var managerTicketReplyRefSchema = z32.object({ ticketId: z32.uuid(), text: text3(L.answer) });
17716
+ var managerTicketThreadSchema = z32.array(z32.object({
17717
+ id: z32.string(),
17718
+ from: z32.enum(["user", "ship"]),
17719
+ name: z32.string(),
17720
+ ship_id: z32.string(),
17721
+ chat_id: z32.string(),
17722
+ text: z32.string(),
17723
+ at: z32.string(),
17724
+ nudge: z32.enum(["sent", "missed"]).optional()
17430
17725
  }));
17431
17726
  var LINEAR_ISSUE_SUMMARIES_MAX = 50;
17432
- var linearIssueSummariesRequestSchema = z30.object({ identifiers: z30.array(linearIdentifier).min(1).max(LINEAR_ISSUE_SUMMARIES_MAX) });
17727
+ var linearIssueSummariesRequestSchema = z32.object({ identifiers: z32.array(linearIdentifier).min(1).max(LINEAR_ISSUE_SUMMARIES_MAX) });
17433
17728
 
17434
17729
  // ../shared/src/user-message-matching.ts
17435
17730
  var parsedTimestamps = /* @__PURE__ */ new Map();
@@ -17800,19 +18095,19 @@ function currentStepLabel(messages, earlierPlainStep) {
17800
18095
  }
17801
18096
 
17802
18097
  // ../shared/src/user-message-attachments.ts
17803
- import { z as z31 } from "zod";
18098
+ import { z as z33 } from "zod";
17804
18099
  var ATTACHMENT_PLACEHOLDER_REGEX = /^\[\d+ (?:(?:images?|files?)(?: and \d+ files?)? attached|(?:image )?attachments?)\]$/;
17805
18100
  var withoutAttachmentPlaceholder = (content, attached) => attached && ATTACHMENT_PLACEHOLDER_REGEX.test(content) ? "" : content;
17806
- var annotationLinesSchema = z31.object({ path: z31.string(), start: z31.number(), end: z31.number() });
17807
- var messageAnnotationSchema = z31.object({
17808
- text: z31.string(),
17809
- comment: z31.string().optional(),
18101
+ var annotationLinesSchema = z33.object({ path: z33.string(), start: z33.number(), end: z33.number() });
18102
+ var messageAnnotationSchema = z33.object({
18103
+ text: z33.string(),
18104
+ comment: z33.string().optional(),
17810
18105
  lines: annotationLinesSchema.optional(),
17811
18106
  /** Which match of `text` in its message was quoted, from 0, when the same words appear more than once. */
17812
- occurrence: z31.number().int().nonnegative().optional(),
18107
+ occurrence: z33.number().int().nonnegative().optional(),
17813
18108
  /** The rendered message the quote was selected in, and its last one when it spans several, so clients find it without searching. */
17814
- messageId: z31.string().optional(),
17815
- endMessageId: z31.string().optional()
18109
+ messageId: z33.string().optional(),
18110
+ endMessageId: z33.string().optional()
17816
18111
  });
17817
18112
  var ANNOTATIONS_NOTE_OPENING = '<replicas_annotations>\nThe user quoted these passages, some with a comment. Address each annotation, and when you do, refer to it as "Annotation N".';
17818
18113
  var ANNOTATIONS_NOTE_REGEX = /(?:^|\n\n)<replicas_annotations>\n([\s\S]*?)\n<\/replicas_annotations>$/;
@@ -21267,7 +21562,7 @@ async function withRetry(label, fn, options) {
21267
21562
  }
21268
21563
 
21269
21564
  // ../shared/src/tensorlake.ts
21270
- var TENSORLAKE_IMAGE_NAME = "replicas-sandbox-2026-11-20-v16";
21565
+ var TENSORLAKE_IMAGE_NAME = "replicas-sandbox-2026-11-20-v18";
21271
21566
  var TENSORLAKE_DISK_MB = 100 * 1024;
21272
21567
 
21273
21568
  // ../shared/src/egress.ts
@@ -21597,7 +21892,19 @@ var KEYBOARD_SHORTCUTS = {
21597
21892
  copyPullRequestGitHubLink: { label: "Copy GitHub link", group: "Review", prefix: "c", keys: { key: "g" } },
21598
21893
  copyPullRequest: { label: "Copy PR", group: "Review", prefix: "c", keys: { key: "p" } },
21599
21894
  openReviewChat: { label: "Start chat", group: "Review", keys: { key: ";", mod: true } },
21600
- mergePullRequest: { label: "Merge", group: "Review", keys: { key: "m" } }
21895
+ mergePullRequest: { label: "Merge", group: "Review", keys: { key: "m" } },
21896
+ createIssue: { label: "Create issue", group: "Issues", keys: { key: "c" } },
21897
+ setIssueStatus: { label: "Change status", group: "Issues", keys: { key: "s" } },
21898
+ setIssuePriority: { label: "Change priority", group: "Issues", keys: { key: "p" } },
21899
+ setIssueAssignees: { label: "Assign", group: "Issues", keys: { key: "a" } },
21900
+ nextIssue: { label: "Next issue", group: "Issues", keys: { key: "j" } },
21901
+ previousIssue: { label: "Previous issue", group: "Issues", keys: { key: "k" } },
21902
+ openIssue: { label: "Open issue", group: "Issues", keys: { key: "Enter" } },
21903
+ peekIssue: { label: "Peek issue", group: "Issues", keys: { key: " " } },
21904
+ selectIssue: { label: "Select issue", group: "Issues", keys: { key: "x" } },
21905
+ toggleIssueLayout: { label: "Switch list / board", group: "Issues", keys: { key: "b", mod: true, shift: true } },
21906
+ copyIssueIdentifier: { label: "Copy issue ID", group: "Issues", keys: { key: ".", mod: true } },
21907
+ copyIssueLink: { label: "Copy issue link", group: "Issues", keys: { key: ",", mod: true, shift: true } }
21601
21908
  };
21602
21909
  var COMPOSER_SEND_SHORTCUTS = {
21603
21910
  enter: { send: KEYBOARD_SHORTCUTS.send, sendAlternate: KEYBOARD_SHORTCUTS.sendAlternate, newLine: KEYBOARD_SHORTCUTS.newLine },
@@ -21807,135 +22114,135 @@ function parseProxyRouteCheck(output) {
21807
22114
  }
21808
22115
 
21809
22116
  // ../shared/src/harness/types.ts
21810
- import { z as z32 } from "zod";
22117
+ import { z as z34 } from "zod";
21811
22118
  var HARNESS_THREAD_STATUSES = ["idle", "working", "error"];
21812
- var textSchema = z32.looseObject({ type: z32.literal("text"), text: z32.string() });
21813
- var imageSchema = z32.looseObject({ type: z32.literal("image"), data: z32.string(), mimeType: z32.string() });
21814
- var userMessageSchema = z32.looseObject({
21815
- role: z32.literal("user"),
21816
- content: z32.union([z32.string(), z32.array(z32.discriminatedUnion("type", [textSchema, imageSchema]))]),
21817
- timestamp: z32.number()
22119
+ var textSchema = z34.looseObject({ type: z34.literal("text"), text: z34.string() });
22120
+ var imageSchema = z34.looseObject({ type: z34.literal("image"), data: z34.string(), mimeType: z34.string() });
22121
+ var userMessageSchema = z34.looseObject({
22122
+ role: z34.literal("user"),
22123
+ content: z34.union([z34.string(), z34.array(z34.discriminatedUnion("type", [textSchema, imageSchema]))]),
22124
+ timestamp: z34.number()
21818
22125
  });
21819
- var assistantMessageSchema = z32.looseObject({
21820
- role: z32.literal("assistant"),
21821
- content: z32.array(z32.discriminatedUnion("type", [
22126
+ var assistantMessageSchema = z34.looseObject({
22127
+ role: z34.literal("assistant"),
22128
+ content: z34.array(z34.discriminatedUnion("type", [
21822
22129
  textSchema,
21823
- z32.looseObject({ type: z32.literal("thinking"), thinking: z32.string() }),
21824
- z32.looseObject({ type: z32.literal("toolCall"), id: z32.string(), name: z32.string(), arguments: z32.record(z32.string(), z32.json()) })
22130
+ z34.looseObject({ type: z34.literal("thinking"), thinking: z34.string() }),
22131
+ z34.looseObject({ type: z34.literal("toolCall"), id: z34.string(), name: z34.string(), arguments: z34.record(z34.string(), z34.json()) })
21825
22132
  ])),
21826
- api: z32.string(),
21827
- provider: z32.string(),
21828
- model: z32.string(),
21829
- usage: z32.looseObject({
21830
- input: z32.number(),
21831
- output: z32.number(),
21832
- cacheRead: z32.number(),
21833
- cacheWrite: z32.number(),
21834
- totalTokens: z32.number(),
21835
- cost: z32.looseObject({ input: z32.number(), output: z32.number(), cacheRead: z32.number(), cacheWrite: z32.number(), total: z32.number() })
22133
+ api: z34.string(),
22134
+ provider: z34.string(),
22135
+ model: z34.string(),
22136
+ usage: z34.looseObject({
22137
+ input: z34.number(),
22138
+ output: z34.number(),
22139
+ cacheRead: z34.number(),
22140
+ cacheWrite: z34.number(),
22141
+ totalTokens: z34.number(),
22142
+ cost: z34.looseObject({ input: z34.number(), output: z34.number(), cacheRead: z34.number(), cacheWrite: z34.number(), total: z34.number() })
21836
22143
  }),
21837
- stopReason: z32.enum(["pending", "stop", "length", "toolUse", "error", "aborted", "deferred"]),
21838
- timestamp: z32.number()
22144
+ stopReason: z34.enum(["pending", "stop", "length", "toolUse", "error", "aborted", "deferred"]),
22145
+ timestamp: z34.number()
21839
22146
  });
21840
- var toolResultMessageSchema = z32.looseObject({
21841
- role: z32.literal("toolResult"),
21842
- toolCallId: z32.string(),
21843
- toolName: z32.string(),
21844
- content: z32.array(z32.discriminatedUnion("type", [textSchema, imageSchema])),
21845
- isError: z32.boolean(),
21846
- timestamp: z32.number()
22147
+ var toolResultMessageSchema = z34.looseObject({
22148
+ role: z34.literal("toolResult"),
22149
+ toolCallId: z34.string(),
22150
+ toolName: z34.string(),
22151
+ content: z34.array(z34.discriminatedUnion("type", [textSchema, imageSchema])),
22152
+ isError: z34.boolean(),
22153
+ timestamp: z34.number()
21847
22154
  });
21848
- var harnessAgentOutcomeSchema = z32.object({
21849
- agentId: z32.string().uuid(),
21850
- assignmentId: z32.string(),
21851
- status: z32.enum(["completed", "cancelled", "error", "help"]),
21852
- response: z32.string()
22155
+ var harnessAgentOutcomeSchema = z34.object({
22156
+ agentId: z34.string().uuid(),
22157
+ assignmentId: z34.string(),
22158
+ status: z34.enum(["completed", "cancelled", "error", "help"]),
22159
+ response: z34.string()
21853
22160
  });
21854
22161
  var HARNESS_AGENT_TYPES = ["general", "explore", "execute"];
21855
- var harnessThreadOriginSchema = z32.object({
21856
- kind: z32.enum(["side_chat", "subagent"]),
21857
- agentType: z32.enum(HARNESS_AGENT_TYPES).optional(),
21858
- parentThreadId: z32.string().uuid(),
21859
- depth: z32.number().int().nonnegative(),
22162
+ var harnessThreadOriginSchema = z34.object({
22163
+ kind: z34.enum(["side_chat", "subagent"]),
22164
+ agentType: z34.enum(HARNESS_AGENT_TYPES).optional(),
22165
+ parentThreadId: z34.string().uuid(),
22166
+ depth: z34.number().int().nonnegative(),
21860
22167
  message: userMessageSchema
21861
22168
  });
21862
22169
  var harnessInboxPayloadSchemas = {
21863
- message: z32.looseObject({
22170
+ message: z34.looseObject({
21864
22171
  message: userMessageSchema,
21865
- userId: z32.string().nullable(),
21866
- messageId: z32.string().optional(),
22172
+ userId: z34.string().nullable(),
22173
+ messageId: z34.string().optional(),
21867
22174
  agentOutcome: harnessAgentOutcomeSchema.optional(),
21868
- model: z32.string().optional(),
21869
- thinkingLevel: z32.enum(VALID_THINKING_LEVELS).optional(),
21870
- instructionsHash: z32.string().optional(),
21871
- queued: z32.boolean().optional(),
22175
+ model: z34.string().optional(),
22176
+ thinkingLevel: z34.enum(VALID_THINKING_LEVELS).optional(),
22177
+ instructionsHash: z34.string().optional(),
22178
+ queued: z34.boolean().optional(),
21872
22179
  /** Stored only on a message whose `instructionsHash` differs from the message before it; later ones find it by hash. */
21873
- instructions: z32.object({ environmentSystemPrompt: z32.string().optional(), customInstructions: z32.string().optional() }).optional(),
22180
+ instructions: z34.object({ environmentSystemPrompt: z34.string().optional(), customInstructions: z34.string().optional() }).optional(),
21874
22181
  errorNotificationTarget: integrationErrorNotificationTargetSchema.optional()
21875
22182
  }),
21876
- interrupt: z32.looseObject({ userId: z32.string().nullable(), messageId: z32.string().optional(), cancelQueued: z32.boolean().optional() })
22183
+ interrupt: z34.looseObject({ userId: z34.string().nullable(), messageId: z34.string().optional(), cancelQueued: z34.boolean().optional() })
21877
22184
  };
21878
- var harnessEventBodySchema = z32.discriminatedUnion("type", [
21879
- z32.object({ type: z32.literal("thread_origin"), payload: harnessThreadOriginSchema }),
21880
- z32.object({ type: z32.literal("agent_outcome"), payload: harnessAgentOutcomeSchema }),
21881
- z32.object({ type: z32.literal("user_message"), payload: harnessInboxPayloadSchemas.message }),
21882
- z32.object({ type: z32.literal("cancelled_message"), payload: harnessInboxPayloadSchemas.message }),
21883
- z32.object({ type: z32.literal("interrupt"), payload: harnessInboxPayloadSchemas.interrupt }),
22185
+ var harnessEventBodySchema = z34.discriminatedUnion("type", [
22186
+ z34.object({ type: z34.literal("thread_origin"), payload: harnessThreadOriginSchema }),
22187
+ z34.object({ type: z34.literal("agent_outcome"), payload: harnessAgentOutcomeSchema }),
22188
+ z34.object({ type: z34.literal("user_message"), payload: harnessInboxPayloadSchemas.message }),
22189
+ z34.object({ type: z34.literal("cancelled_message"), payload: harnessInboxPayloadSchemas.message }),
22190
+ z34.object({ type: z34.literal("interrupt"), payload: harnessInboxPayloadSchemas.interrupt }),
21884
22191
  /** Saved before its tool calls run. */
21885
- z32.object({ type: z32.literal("assistant_message"), payload: z32.looseObject({ message: assistantMessageSchema }) }),
21886
- z32.object({ type: z32.literal("tool_result"), payload: z32.looseObject({ message: toolResultMessageSchema }) }),
21887
- z32.object({
21888
- type: z32.literal("status"),
22192
+ z34.object({ type: z34.literal("assistant_message"), payload: z34.looseObject({ message: assistantMessageSchema }) }),
22193
+ z34.object({ type: z34.literal("tool_result"), payload: z34.looseObject({ message: toolResultMessageSchema }) }),
22194
+ z34.object({
22195
+ type: z34.literal("status"),
21889
22196
  /** `cost`: what calls since the last status that saved no step of their own cost at API prices, in USD. */
21890
- payload: z32.looseObject({ status: z32.enum(HARNESS_THREAD_STATUSES), cost: z32.number().optional() })
22197
+ payload: z34.looseObject({ status: z34.enum(HARNESS_THREAD_STATUSES), cost: z34.number().optional() })
21891
22198
  }),
21892
- z32.object({ type: z32.literal("error"), payload: z32.looseObject({ message: z32.string() }) }),
22199
+ z34.object({ type: z34.literal("error"), payload: z34.looseObject({ message: z34.string() }) }),
21893
22200
  /** The model's context is this summary followed by the events from `firstKeptSeq` on; nothing before it is deleted. */
21894
- z32.object({
21895
- type: z32.literal("compaction"),
21896
- payload: z32.looseObject({
21897
- summary: z32.string(),
21898
- firstKeptSeq: z32.number(),
21899
- tokensBefore: z32.number(),
21900
- readFiles: z32.array(z32.string()),
21901
- modifiedFiles: z32.array(z32.string()),
22201
+ z34.object({
22202
+ type: z34.literal("compaction"),
22203
+ payload: z34.looseObject({
22204
+ summary: z34.string(),
22205
+ firstKeptSeq: z34.number(),
22206
+ tokensBefore: z34.number(),
22207
+ readFiles: z34.array(z34.string()),
22208
+ modifiedFiles: z34.array(z34.string()),
21902
22209
  /** The summary call's cost at API prices, in USD; absent on compactions saved before it was recorded. */
21903
- cost: z32.number().optional()
22210
+ cost: z34.number().optional()
21904
22211
  })
21905
22212
  })
21906
22213
  ]);
21907
- var harnessLiveMessageSchema = z32.union([
21908
- z32.object({ type: z32.literal("delta"), streamId: z32.string(), text: z32.string() }),
21909
- z32.object({ type: z32.literal("delta"), streamId: z32.string(), thinking: z32.string() }),
21910
- z32.object({ type: z32.literal("delta"), streamId: z32.string(), toolCall: z32.object({ id: z32.string(), name: z32.string(), argumentsDelta: z32.string() }) }),
21911
- z32.object({ type: z32.literal("step_saved"), seq: z32.number() }),
21912
- z32.object({ type: z32.literal("status"), status: z32.enum(HARNESS_THREAD_STATUSES) })
22214
+ var harnessLiveMessageSchema = z34.union([
22215
+ z34.object({ type: z34.literal("delta"), streamId: z34.string(), text: z34.string() }),
22216
+ z34.object({ type: z34.literal("delta"), streamId: z34.string(), thinking: z34.string() }),
22217
+ z34.object({ type: z34.literal("delta"), streamId: z34.string(), toolCall: z34.object({ id: z34.string(), name: z34.string(), argumentsDelta: z34.string() }) }),
22218
+ z34.object({ type: z34.literal("step_saved"), seq: z34.number() }),
22219
+ z34.object({ type: z34.literal("status"), status: z34.enum(HARNESS_THREAD_STATUSES) })
21913
22220
  ]);
21914
22221
 
21915
22222
  // ../shared/src/harness/context.ts
21916
22223
  var MAX_REFERENCE_IMAGE_BYTES = 8 * 1024 * 1024;
21917
22224
 
21918
22225
  // ../shared/src/harness/worker-routes.ts
21919
- import { z as z33 } from "zod";
21920
- var harnessWorkerEngineRequestSchema = z33.object({
22226
+ import { z as z35 } from "zod";
22227
+ var harnessWorkerEngineRequestSchema = z35.object({
21921
22228
  /** The engine we were given didn't answer, so the monolith checks the provider instead of trusting the workspace's status. */
21922
- unreachable: z33.boolean().optional()
22229
+ unreachable: z35.boolean().optional()
21923
22230
  });
21924
- var harnessWorkerEngineResponseSchema = z33.discriminatedUnion("status", [
21925
- z33.object({ status: z33.literal("ready"), engineUrl: z33.string(), headers: z33.record(z33.string(), z33.string()) }),
21926
- z33.object({ status: z33.literal("waking") })
22231
+ var harnessWorkerEngineResponseSchema = z35.discriminatedUnion("status", [
22232
+ z35.object({ status: z35.literal("ready"), engineUrl: z35.string(), headers: z35.record(z35.string(), z35.string()) }),
22233
+ z35.object({ status: z35.literal("waking") })
21927
22234
  ]);
21928
- var harnessWorkerCredentialRequestSchema = z33.object({
22235
+ var harnessWorkerCredentialRequestSchema = z35.object({
21929
22236
  /** The credential the model rejected, so the monolith refreshes it or moves to the next one instead of handing it back. */
21930
22237
  failedCredential: agentCredentialSnapshotSchema.optional(),
21931
22238
  // A worker from before Claude models sends none, and only ever calls OpenAI.
21932
- modelProvider: z33.enum(REPLICAS_MODEL_PROVIDERS).default("openai")
22239
+ modelProvider: z35.enum(REPLICAS_MODEL_PROVIDERS).default("openai")
21933
22240
  });
21934
- var harnessWorkerCredentialResponseSchema = z33.discriminatedUnion("method", [
21935
- z33.object({ method: z33.literal("oauth"), accessToken: z33.string(), expiresAt: z33.string(), credential: agentCredentialSnapshotSchema }),
21936
- z33.object({ method: z33.literal("api_key"), apiKey: z33.string(), credential: agentCredentialSnapshotSchema })
22241
+ var harnessWorkerCredentialResponseSchema = z35.discriminatedUnion("method", [
22242
+ z35.object({ method: z35.literal("oauth"), accessToken: z35.string(), expiresAt: z35.string(), credential: agentCredentialSnapshotSchema }),
22243
+ z35.object({ method: z35.literal("api_key"), apiKey: z35.string(), credential: agentCredentialSnapshotSchema })
21937
22244
  ]);
21938
- var harnessWorkerTurnCompleteRequestSchema = z33.object({ errors: z33.array(z33.string()) });
22245
+ var harnessWorkerTurnCompleteRequestSchema = z35.object({ errors: z35.array(z35.string()) });
21939
22246
 
21940
22247
  // ../shared/src/auth-errors.ts
21941
22248
  var AUTHENTICATION_ERROR_PATTERNS = [
@@ -21999,10 +22306,10 @@ var RECONNECT_GIVE_UP_MS = 2 * 6e4;
21999
22306
  var encoder3 = new TextEncoder();
22000
22307
 
22001
22308
  // ../shared/src/routes/billing.ts
22002
- import { z as z34 } from "zod";
22309
+ import { z as z36 } from "zod";
22003
22310
  var SOURCE_LIMIT_SOURCES = ["limrun", "modal", "revyl"];
22004
- var usageLimitCentsSchema = z34.number().int().min(100).max(1e8);
22005
- var sourceLimitsCentsSchema = z34.partialRecord(z34.enum(SOURCE_LIMIT_SOURCES), usageLimitCentsSchema);
22311
+ var usageLimitCentsSchema = z36.number().int().min(100).max(1e8);
22312
+ var sourceLimitsCentsSchema = z36.partialRecord(z36.enum(SOURCE_LIMIT_SOURCES), usageLimitCentsSchema);
22006
22313
 
22007
22314
  // ../shared/src/routes/codex.ts
22008
22315
  var CODEX_AUTH_ENV_KEYS = [
@@ -22156,7 +22463,7 @@ var CLAUDE_AUTH_ENV_KEYS_BY_METHOD = {
22156
22463
  };
22157
22464
 
22158
22465
  // ../shared/src/routes/command-protection.ts
22159
- import { z as z35 } from "zod";
22466
+ import { z as z37 } from "zod";
22160
22467
 
22161
22468
  // ../shared/src/git-invocations.ts
22162
22469
  var COMMIT_VALUE_OPTIONS = /* @__PURE__ */ new Set(["message", "file", "trailer", "reuse-message", "reedit-message", "fixup", "squash", "template", "author", "date", "cleanup", "pathspec-from-file"]);
@@ -22247,34 +22554,34 @@ function findCheckoutTarget(args) {
22247
22554
  }
22248
22555
 
22249
22556
  // ../shared/src/routes/command-protection.ts
22250
- var commandProtectionRepoStateSchema = z35.object({
22251
- branch: z35.string().nullable(),
22252
- defaultBranch: z35.string().nullable(),
22253
- pushBranch: z35.string().nullable(),
22254
- pushConfig: z35.string().nullable(),
22255
- headMessage: z35.string().nullable(),
22256
- mergeInProgress: z35.boolean().optional()
22557
+ var commandProtectionRepoStateSchema = z37.object({
22558
+ branch: z37.string().nullable(),
22559
+ defaultBranch: z37.string().nullable(),
22560
+ pushBranch: z37.string().nullable(),
22561
+ pushConfig: z37.string().nullable(),
22562
+ headMessage: z37.string().nullable(),
22563
+ mergeInProgress: z37.boolean().optional()
22257
22564
  });
22258
- var commandProtectionEvaluateRequestSchema = z35.object({
22259
- provider: z35.enum(["claude", "codex", "cursor", "opencode", "pi", "harness"]),
22260
- source: z35.enum(["claude_pre_tool_use", "codex_approval_request", "cursor_pre_tool_use", "opencode_pre_tool_use", "pi_tool_call", "harness_tool_call"]),
22261
- toolName: z35.string(),
22262
- toolInput: z35.unknown(),
22263
- command: z35.string().nullish(),
22264
- cwd: z35.string().nullish(),
22265
- toolUseId: z35.string().nullish(),
22565
+ var commandProtectionEvaluateRequestSchema = z37.object({
22566
+ provider: z37.enum(["claude", "codex", "cursor", "opencode", "pi", "harness"]),
22567
+ source: z37.enum(["claude_pre_tool_use", "codex_approval_request", "cursor_pre_tool_use", "opencode_pre_tool_use", "pi_tool_call", "harness_tool_call"]),
22568
+ toolName: z37.string(),
22569
+ toolInput: z37.unknown(),
22570
+ command: z37.string().nullish(),
22571
+ cwd: z37.string().nullish(),
22572
+ toolUseId: z37.string().nullish(),
22266
22573
  // Read by the engine before the command runs, keyed by absolute path, so the
22267
22574
  // policy can see branches and commit messages the command text only references.
22268
- gitContext: z35.object({
22269
- repos: z35.record(z35.string(), commandProtectionRepoStateSchema),
22270
- messageFiles: z35.record(z35.string(), z35.string())
22575
+ gitContext: z37.object({
22576
+ repos: z37.record(z37.string(), commandProtectionRepoStateSchema),
22577
+ messageFiles: z37.record(z37.string(), z37.string())
22271
22578
  }).optional()
22272
22579
  });
22273
- var commandProtectionEvaluateResponseSchema = z35.object({
22274
- allowed: z35.boolean(),
22275
- enabled: z35.boolean(),
22276
- reason: z35.string().optional(),
22277
- matchedSignals: z35.array(z35.string()).optional()
22580
+ var commandProtectionEvaluateResponseSchema = z37.object({
22581
+ allowed: z37.boolean(),
22582
+ enabled: z37.boolean(),
22583
+ reason: z37.string().optional(),
22584
+ matchedSignals: z37.array(z37.string()).optional()
22278
22585
  });
22279
22586
  var COMMAND_PROTECTION_COMMAND_KEYS = ["command", "cmd", "script", "query", "endpoint", "path", "url", "mutation"];
22280
22587
  function stringifyCommandProtectionInput(value) {
@@ -22514,153 +22821,153 @@ function shouldRefreshPullRequests(toolName, toolInput) {
22514
22821
  }
22515
22822
 
22516
22823
  // ../shared/src/routes/scout.ts
22517
- import { z as z36 } from "zod";
22824
+ import { z as z38 } from "zod";
22518
22825
  var SCOUT_LINEAR_ACTIONS = ["ask", "start"];
22519
- var scoutLinearSessionIntentRequestSchema = z36.object({
22520
- comment_id: z36.string().trim().min(1).describe("Id of the Linear comment the session will be created on."),
22521
- action: z36.enum(SCOUT_LINEAR_ACTIONS).describe("`ask` when the comment is a clarifying question, `start` when it hands off the task.")
22826
+ var scoutLinearSessionIntentRequestSchema = z38.object({
22827
+ comment_id: z38.string().trim().min(1).describe("Id of the Linear comment the session will be created on."),
22828
+ action: z38.enum(SCOUT_LINEAR_ACTIONS).describe("`ask` when the comment is a clarifying question, `start` when it hands off the task.")
22522
22829
  });
22523
- var scoutLinearStartRequestSchema = z36.object({
22524
- issue_id: z36.string().describe("Linear issue id from the envelope's `issue_id`."),
22525
- agent_session_id: z36.string().describe("Existing Linear agent session id from the envelope's `agent_session_id`."),
22526
- prompt: z36.string().trim().min(1).describe("The latest request, in its author's words. The workspace already receives the issue and its comments.")
22830
+ var scoutLinearStartRequestSchema = z38.object({
22831
+ issue_id: z38.string().describe("Linear issue id from the envelope's `issue_id`."),
22832
+ agent_session_id: z38.string().describe("Existing Linear agent session id from the envelope's `agent_session_id`."),
22833
+ prompt: z38.string().trim().min(1).describe("The latest request, in its author's words. The workspace already receives the issue and its comments.")
22527
22834
  });
22528
- var scoutRouteLinearTicketRequestSchema = z36.object({
22529
- agent_session_id: z36.string().trim().min(1).describe("The ticket's `agent_session_id` from the envelope."),
22530
- environment_id: z36.string().trim().min(1).optional().describe("Start the ticket in this environment."),
22531
- manager_id: z36.string().trim().min(1).optional().describe("Hand the ticket to this Manager instead."),
22532
- mothership_id: z36.string().trim().min(1).optional().describe("Old name of `manager_id`.")
22835
+ var scoutRouteLinearTicketRequestSchema = z38.object({
22836
+ agent_session_id: z38.string().trim().min(1).describe("The ticket's `agent_session_id` from the envelope."),
22837
+ environment_id: z38.string().trim().min(1).optional().describe("Start the ticket in this environment."),
22838
+ manager_id: z38.string().trim().min(1).optional().describe("Hand the ticket to this Manager instead."),
22839
+ mothership_id: z38.string().trim().min(1).optional().describe("Old name of `manager_id`.")
22533
22840
  }).refine((args) => !(args.environment_id && (args.manager_id || args.mothership_id)), "Pass environment_id or manager_id, not both.");
22534
- var slackChannelIdSchema = z36.string().describe("Slack channel id from the envelope's `channel_id`.");
22535
- var slackThreadTsSchema = z36.string().describe("Slack thread timestamp from the envelope's `thread_ts`.");
22536
- var scoutSlackMessageReferenceSchema = z36.object({
22841
+ var slackChannelIdSchema = z38.string().describe("Slack channel id from the envelope's `channel_id`.");
22842
+ var slackThreadTsSchema = z38.string().describe("Slack thread timestamp from the envelope's `thread_ts`.");
22843
+ var scoutSlackMessageReferenceSchema = z38.object({
22537
22844
  channel_id: slackChannelIdSchema,
22538
22845
  thread_ts: slackThreadTsSchema,
22539
- message_ts: z36.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
22540
- user_id: z36.string().describe("Slack user id of that message's author (the envelope's `user_id`).")
22846
+ message_ts: z38.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
22847
+ user_id: z38.string().describe("Slack user id of that message's author (the envelope's `user_id`).")
22541
22848
  });
22542
- var scoutSlackSpawnRequestSchema = z36.object({
22849
+ var scoutSlackSpawnRequestSchema = z38.object({
22543
22850
  channel_id: slackChannelIdSchema,
22544
22851
  thread_ts: slackThreadTsSchema,
22545
- message_ts: z36.string().describe("Timestamp of the Slack message that asked for the work (the envelope's `message_ts`). The server verifies this message and its author."),
22546
- user_id: z36.string().describe("Slack user id of that message's author (the envelope's `user_id`). The workspace is attributed to them."),
22547
- prompt: z36.string().describe("The person's request in their own words, quoting earlier messages only when it points to them. The workspace already receives the Slack thread, so add no research, plan, or guesses."),
22548
- acknowledgement_ts: z36.string().optional().describe("`ts` of the one-line reply you posted in this thread before spawning. The server appends the workspace link to it and tells the workspace not to acknowledge again."),
22549
- environment_id: z36.string().optional().describe(`Environment id from \`${REPLICAS_MCP_TOOLS.listEnvironments}\`. Pass it only when clearly confident it fits; omit it to let routing choose. If routing cannot choose, the call fails and nothing is posted, so pick one or ask the person.`)
22852
+ message_ts: z38.string().describe("Timestamp of the Slack message that asked for the work (the envelope's `message_ts`). The server verifies this message and its author."),
22853
+ user_id: z38.string().describe("Slack user id of that message's author (the envelope's `user_id`). The workspace is attributed to them."),
22854
+ prompt: z38.string().describe("The person's request in their own words, quoting earlier messages only when it points to them. The workspace already receives the Slack thread, so add no research, plan, or guesses."),
22855
+ acknowledgement_ts: z38.string().optional().describe("`ts` of the one-line reply you posted in this thread before spawning. The server appends the workspace link to it and tells the workspace not to acknowledge again."),
22856
+ environment_id: z38.string().optional().describe(`Environment id from \`${REPLICAS_MCP_TOOLS.listEnvironments}\`. Pass it only when clearly confident it fits; omit it to let routing choose. If routing cannot choose, the call fails and nothing is posted, so pick one or ask the person.`)
22550
22857
  });
22551
22858
  var scoutSlackSpawnInNewThreadRequestSchema = scoutSlackSpawnRequestSchema.extend({
22552
- title: z36.string().trim().min(1).max(500).describe("One or two sentences stating the task, posted as the new top-level message."),
22553
- prompt: z36.string().describe("The person's request in their own words. The full source thread is attached as background, so add no summary, research, plan, or guesses."),
22554
- acknowledgement_ts: z36.string().optional().describe("`ts` of the one-line reply you posted in this thread before spawning. The server appends the new thread's link to it.")
22859
+ title: z38.string().trim().min(1).max(500).describe("One or two sentences stating the task, posted as the new top-level message."),
22860
+ prompt: z38.string().describe("The person's request in their own words. The full source thread is attached as background, so add no summary, research, plan, or guesses."),
22861
+ acknowledgement_ts: z38.string().optional().describe("`ts` of the one-line reply you posted in this thread before spawning. The server appends the new thread's link to it.")
22555
22862
  });
22556
- var scoutSlackRelayRequestSchema = z36.object({
22863
+ var scoutSlackRelayRequestSchema = z38.object({
22557
22864
  channel_id: slackChannelIdSchema,
22558
22865
  thread_ts: slackThreadTsSchema,
22559
- message: z36.string().describe("The follow-up to deliver: every fresh message that belongs to this update, in its author's words, with no research, plan, or guesses added. When forwarding to a `workspace_id` other than the thread's own workspace, also quote exactly the thread messages the request points to (\"forward this\"), since that workspace gets only this message."),
22560
- user_id: z36.string().optional().describe("Slack user id of the follow-up's author (the envelope's `user_id`), so it is attributed to them. Defaults to the thread's original requester. Required with `workspace_id`."),
22561
- queue: z36.boolean().optional().describe("Set true only when the person explicitly asked for this to happen after the current task finishes. Delivers behind the active turn instead of interrupting it."),
22562
- workspace_id: z36.string().optional().describe(`Existing workspace id, from \`${REPLICAS_MCP_TOOLS.listWorkspaces}\` or a workspace link in the thread, to bind a thread without a workspace to before relaying. The author must be able to see it. Binding a Manager gives it the person's own Slack message and the thread instead of \`message\`. In a thread already bound to a different workspace, or in a Manager's channel, nothing is bound: the workspace or Manager gets only \`message\`, once, with a link back to Slack, and the thread stays where it is. Omit to relay into the thread's own workspace.`),
22563
- message_ts: z36.string().optional().describe("Timestamp of the Slack message that led to this relay (the envelope's `message_ts`). Required with `workspace_id`; the server verifies this message and its author.")
22866
+ message: z38.string().describe("The follow-up to deliver: every fresh message that belongs to this update, in its author's words, with no research, plan, or guesses added. When forwarding to a `workspace_id` other than the thread's own workspace, also quote exactly the thread messages the request points to (\"forward this\"), since that workspace gets only this message."),
22867
+ user_id: z38.string().optional().describe("Slack user id of the follow-up's author (the envelope's `user_id`), so it is attributed to them. Defaults to the thread's original requester. Required with `workspace_id`."),
22868
+ queue: z38.boolean().optional().describe("Set true only when the person explicitly asked for this to happen after the current task finishes. Delivers behind the active turn instead of interrupting it."),
22869
+ workspace_id: z38.string().optional().describe(`Existing workspace id, from \`${REPLICAS_MCP_TOOLS.listWorkspaces}\` or a workspace link in the thread, to bind a thread without a workspace to before relaying. The author must be able to see it. Binding a Manager gives it the person's own Slack message and the thread instead of \`message\`. In a thread already bound to a different workspace, or in a Manager's channel, nothing is bound: the workspace or Manager gets only \`message\`, once, with a link back to Slack, and the thread stays where it is. Omit to relay into the thread's own workspace.`),
22870
+ message_ts: z38.string().optional().describe("Timestamp of the Slack message that led to this relay (the envelope's `message_ts`). Required with `workspace_id`; the server verifies this message and its author.")
22564
22871
  });
22565
- var scoutSlackSetThreadMutedRequestSchema = z36.object({
22872
+ var scoutSlackSetThreadMutedRequestSchema = z38.object({
22566
22873
  channel_id: slackChannelIdSchema,
22567
22874
  thread_ts: slackThreadTsSchema,
22568
- muted: z36.boolean().describe("true to mute Replicas in this thread, false to unmute it.")
22875
+ muted: z38.boolean().describe("true to mute Replicas in this thread, false to unmute it.")
22569
22876
  });
22570
22877
  var scoutSlackStopWorkspaceRequestSchema = scoutSlackMessageReferenceSchema.extend({
22571
- archive: z36.boolean().describe("true only when the person also asked to close or archive the workspace.")
22878
+ archive: z38.boolean().describe("true only when the person also asked to close or archive the workspace.")
22572
22879
  });
22573
- var scoutListWorkspacesRequestSchema = z36.object({
22880
+ var scoutListWorkspacesRequestSchema = z38.object({
22574
22881
  channel_id: slackChannelIdSchema,
22575
22882
  thread_ts: slackThreadTsSchema,
22576
- message_ts: z36.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
22577
- user_id: z36.string().describe("Slack user id of that message's author (the envelope's `user_id`). Only workspaces they can see are listed."),
22578
- query: z36.string().trim().min(1).optional().describe("Case-insensitive text to match against workspace and Manager names and pull request URLs.")
22883
+ message_ts: z38.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
22884
+ user_id: z38.string().describe("Slack user id of that message's author (the envelope's `user_id`). Only workspaces they can see are listed."),
22885
+ query: z38.string().trim().min(1).optional().describe("Case-insensitive text to match against workspace and Manager names and pull request URLs.")
22579
22886
  });
22580
- var scoutSlackConfirmationSchema = z36.object({
22581
- confirmation_channel_id: z36.string().describe("`channel_id` from the envelope of the Slack message that asked for or accepted this."),
22582
- confirmation_thread_ts: z36.string().describe("`thread_ts` from that message's envelope."),
22583
- confirmation_message_ts: z36.string().describe("`message_ts` from that message's envelope."),
22584
- confirmation_user_id: z36.string().describe("`user_id` from that message's envelope.")
22887
+ var scoutSlackConfirmationSchema = z38.object({
22888
+ confirmation_channel_id: z38.string().describe("`channel_id` from the envelope of the Slack message that asked for or accepted this."),
22889
+ confirmation_thread_ts: z38.string().describe("`thread_ts` from that message's envelope."),
22890
+ confirmation_message_ts: z38.string().describe("`message_ts` from that message's envelope."),
22891
+ confirmation_user_id: z38.string().describe("`user_id` from that message's envelope.")
22585
22892
  });
22586
22893
  var scoutAutomationToolInputSchema = automationToolInputSchema.extend(scoutSlackConfirmationSchema.shape);
22587
22894
  var scoutSettingsConfirmationSchema = scoutSlackConfirmationSchema.partial().extend({
22588
- confirmation_dashboard_token: z36.string().optional().describe("For a request from a person in the Replicas dashboard: the `confirmation_dashboard_token` given in that message. Pass it instead of the Slack `confirmation_*` fields; the server authorizes the person who sent it, while it is still the latest message in its chat.")
22895
+ confirmation_dashboard_token: z38.string().optional().describe("For a request from a person in the Replicas dashboard: the `confirmation_dashboard_token` given in that message. Pass it instead of the Slack `confirmation_*` fields; the server authorizes the person who sent it, while it is still the latest message in its chat.")
22589
22896
  });
22590
22897
  var scoutSaveChannelPresetToolInputSchema = scoutSettingsConfirmationSchema.extend({
22591
- preset_id: z36.string().optional().describe(`Id of the preset to update, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`. Omit to create a new preset.`),
22592
- name: z36.string().trim().min(1).max(SCOUT_PRESET_NAME_MAX_LENGTH).optional().describe("Preset name. Required when creating."),
22593
- description: z36.string().optional().describe("One-line summary of what the preset is for."),
22594
- icon: z36.enum(SCOUT_PRESET_ICONS).optional(),
22595
- instructions: z36.string().optional().describe("Complete preset instructions; replaces the existing text. Required when creating.")
22898
+ preset_id: z38.string().optional().describe(`Id of the preset to update, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`. Omit to create a new preset.`),
22899
+ name: z38.string().trim().min(1).max(SCOUT_PRESET_NAME_MAX_LENGTH).optional().describe("Preset name. Required when creating."),
22900
+ description: z38.string().optional().describe("One-line summary of what the preset is for."),
22901
+ icon: z38.enum(SCOUT_PRESET_ICONS).optional(),
22902
+ instructions: z38.string().optional().describe("Complete preset instructions; replaces the existing text. Required when creating.")
22596
22903
  });
22597
22904
  var scoutUpdateChannelSettingsToolInputSchema = scoutSettingsConfirmationSchema.extend({
22598
- source: z36.enum(SCOUT_SOURCE_TYPES).optional().describe("Defaults to `slack`."),
22599
- external_id: z36.string().describe("Slack channel id or Linear team id."),
22600
- monitored: z36.boolean().optional().describe("Linear: `true` starts monitoring the team (organization admins only), `false` stops. Slack: kept for older callers; prefer `proactivity`. `false` means `tagged`, and `true` lifts a `tagged` channel back to the organization's level. Omit to keep it."),
22601
- preset_id: z36.string().nullable().optional().describe("Preset to assign; `null` removes the preset. Omit to keep it."),
22602
- instructions: z36.string().nullable().optional().describe("Complete channel-specific instructions, applied after the preset; replaces the existing text. `null` clears them. Omit to keep them."),
22603
- proactivity: z36.enum([...SCOUT_PROACTIVITY_LEVELS, "organization"]).optional().describe("Slack only: this channel's or group DM's own level, overriding the organization's here alone. `organization` makes it follow the organization's level again. Omit to keep it. 1:1 DMs are always addressed to Replicas, so they take no level."),
22604
- silent: z36.enum(["on", "off", "default"]).optional().describe(`Slack only, organization admins only: \`on\` puts this channel in silent mode, where Replicas reads it and follows its instructions but never posts, reacts, or starts work there. \`off\` turns silent mode off here, \`default\` follows the Slack Connect default from \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\`. Omit to keep it.`),
22605
- muted: z36.enum(["on", "off", "default"]).optional().describe("Kept for older callers; prefer `silent`.")
22905
+ source: z38.enum(SCOUT_SOURCE_TYPES).optional().describe("Defaults to `slack`."),
22906
+ external_id: z38.string().describe("Slack channel id or Linear team id."),
22907
+ monitored: z38.boolean().optional().describe("Linear: `true` starts monitoring the team (organization admins only), `false` stops. Slack: kept for older callers; prefer `proactivity`. `false` means `tagged`, and `true` lifts a `tagged` channel back to the organization's level. Omit to keep it."),
22908
+ preset_id: z38.string().nullable().optional().describe("Preset to assign; `null` removes the preset. Omit to keep it."),
22909
+ instructions: z38.string().nullable().optional().describe("Complete channel-specific instructions, applied after the preset; replaces the existing text. `null` clears them. Omit to keep them."),
22910
+ proactivity: z38.enum([...SCOUT_PROACTIVITY_LEVELS, "organization"]).optional().describe("Slack only: this channel's or group DM's own level, overriding the organization's here alone. `organization` makes it follow the organization's level again. Omit to keep it. 1:1 DMs are always addressed to Replicas, so they take no level."),
22911
+ silent: z38.enum(["on", "off", "default"]).optional().describe(`Slack only, organization admins only: \`on\` puts this channel in silent mode, where Replicas reads it and follows its instructions but never posts, reacts, or starts work there. \`off\` turns silent mode off here, \`default\` follows the Slack Connect default from \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\`. Omit to keep it.`),
22912
+ muted: z38.enum(["on", "off", "default"]).optional().describe("Kept for older callers; prefer `silent`.")
22606
22913
  });
22607
22914
  var managerSlackChannelLevelToolInputSchema = scoutSlackConfirmationSchema.extend({
22608
22915
  proactivity: scoutUpdateChannelSettingsToolInputSchema.shape.proactivity.unwrap().describe("This channel's own level. `organization` makes it follow the organization's level again, which a Manager's channel raises to at least `balanced`.")
22609
22916
  });
22610
22917
  var scoutSetSlackConnectMutedToolInputSchema = scoutSettingsConfirmationSchema.extend({
22611
- muted: z36.boolean().describe("`true` puts every Slack Connect channel without its own setting in silent mode; `false` lets them follow their levels again.")
22918
+ muted: z38.boolean().describe("`true` puts every Slack Connect channel without its own setting in silent mode; `false` lets them follow their levels again.")
22612
22919
  });
22613
22920
  var scoutSetSlackConnectDefaultsToolInputSchema = scoutSettingsConfirmationSchema.extend({
22614
- silent: z36.boolean().optional().describe("`true` puts every Slack Connect channel without its own setting in silent mode; `false` lets them follow their levels again. Omit to keep it."),
22615
- muted: z36.boolean().optional().describe("Kept for older callers; prefer `silent`."),
22616
- preset_id: z36.string().optional().describe("Preset for every Slack Connect channel without its own preset or instructions; an empty string removes it. Omit to keep it."),
22617
- instructions: z36.string().optional().describe("Complete default instructions, applied after that preset; replaces the existing text. An empty string clears them. Omit to keep them."),
22618
- proactivity: z36.enum([...SCOUT_PROACTIVITY_LEVELS, "default"]).optional().describe("Level for every Slack Connect channel without its own level. `default` returns them to `tagged`. Omit to keep it.")
22921
+ silent: z38.boolean().optional().describe("`true` puts every Slack Connect channel without its own setting in silent mode; `false` lets them follow their levels again. Omit to keep it."),
22922
+ muted: z38.boolean().optional().describe("Kept for older callers; prefer `silent`."),
22923
+ preset_id: z38.string().optional().describe("Preset for every Slack Connect channel without its own preset or instructions; an empty string removes it. Omit to keep it."),
22924
+ instructions: z38.string().optional().describe("Complete default instructions, applied after that preset; replaces the existing text. An empty string clears them. Omit to keep them."),
22925
+ proactivity: z38.enum([...SCOUT_PROACTIVITY_LEVELS, "default"]).optional().describe("Level for every Slack Connect channel without its own level. `default` returns them to `tagged`. Omit to keep it.")
22619
22926
  });
22620
22927
  var scoutSetOrganizationProactivityToolInputSchema = scoutSettingsConfirmationSchema.extend({
22621
- proactivity: z36.enum(SCOUT_PROACTIVITY_LEVELS).describe(`The level every Slack channel and group DM follows unless it has its own. Slack Connect channels without their own level follow the shared-channel default from \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\` instead.`)
22928
+ proactivity: z38.enum(SCOUT_PROACTIVITY_LEVELS).describe(`The level every Slack channel and group DM follows unless it has its own. Slack Connect channels without their own level follow the shared-channel default from \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\` instead.`)
22622
22929
  });
22623
22930
  var scoutDeleteChannelPresetToolInputSchema = scoutSettingsConfirmationSchema.extend({
22624
- preset_id: z36.string().describe(`Id of the preset to delete, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`.`)
22931
+ preset_id: z38.string().describe(`Id of the preset to delete, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`.`)
22625
22932
  });
22626
22933
  var RESET_TO_DEFAULT = "default";
22627
- var resettable = (schema, description2) => z36.union([schema, z36.literal(RESET_TO_DEFAULT)]).optional().describe(`${description2} \`${RESET_TO_DEFAULT}\` falls back to the organization default. Omit to keep it.`);
22934
+ var resettable = (schema, description2) => z38.union([schema, z38.literal(RESET_TO_DEFAULT)]).optional().describe(`${description2} \`${RESET_TO_DEFAULT}\` falls back to the organization default. Omit to keep it.`);
22628
22935
  var scoutSetSlackAgentDefaultsToolInputSchema = scoutSettingsConfirmationSchema.extend({
22629
- agent_provider: resettable(z36.enum(VALID_AGENT_PROVIDERS), "Agent for Slack-triggered workspaces. Changing it without `model` resets the model to that agent's default."),
22630
- model: resettable(z36.string(), "Model id for that agent; the default is the agent's own."),
22631
- thinking_level: resettable(z36.enum(VALID_THINKING_LEVELS), "Thinking level."),
22632
- goal_mode: resettable(z36.boolean(), "Goal mode."),
22633
- fast_mode: resettable(z36.boolean(), "Fast mode.")
22936
+ agent_provider: resettable(z38.enum(VALID_AGENT_PROVIDERS), "Agent for Slack-triggered workspaces. Changing it without `model` resets the model to that agent's default."),
22937
+ model: resettable(z38.string(), "Model id for that agent; the default is the agent's own."),
22938
+ thinking_level: resettable(z38.enum(VALID_THINKING_LEVELS), "Thinking level."),
22939
+ goal_mode: resettable(z38.boolean(), "Goal mode."),
22940
+ fast_mode: resettable(z38.boolean(), "Fast mode.")
22634
22941
  });
22635
- var scoutClaimSettingsOfferToolInputSchema = z36.object({
22942
+ var scoutClaimSettingsOfferToolInputSchema = z38.object({
22636
22943
  channel_id: slackChannelIdSchema,
22637
- kind: z36.enum(SCOUT_SETTINGS_OFFERS).describe("`proactivity`: offering a lower level after frustration. `raise_proactivity`: offering a higher level after someone had to @mention you. `instructions`: offering channel instructions or a preset. `organization_proactivity` and `raise_organization_proactivity`: offering to lower or raise the workspace default; only decline them, the server claims them for you."),
22638
- user_id: z36.string().optional().describe("The envelope's `user_id`. Required for `proactivity` and `raise_proactivity`, so the server can say whether they are an organization admin."),
22639
- declined: z36.boolean().optional().describe("true when the person declined an offer you already made, so it is not made again.")
22944
+ kind: z38.enum(SCOUT_SETTINGS_OFFERS).describe("`proactivity`: offering a lower level after frustration. `raise_proactivity`: offering a higher level after someone had to @mention you. `instructions`: offering channel instructions or a preset. `organization_proactivity` and `raise_organization_proactivity`: offering to lower or raise the workspace default; only decline them, the server claims them for you."),
22945
+ user_id: z38.string().optional().describe("The envelope's `user_id`. Required for `proactivity` and `raise_proactivity`, so the server can say whether they are an organization admin."),
22946
+ declined: z38.boolean().optional().describe("true when the person declined an offer you already made, so it is not made again.")
22640
22947
  });
22641
22948
 
22642
22949
  // ../shared/src/routes/sentry.ts
22643
- import { z as z37 } from "zod";
22644
- var sentrySelfHostedConnectRequestSchema = z37.object({
22645
- baseUrl: z37.string().min(1),
22646
- token: z37.string().trim().min(1),
22647
- webhookSecret: z37.string().trim().optional()
22950
+ import { z as z39 } from "zod";
22951
+ var sentrySelfHostedConnectRequestSchema = z39.object({
22952
+ baseUrl: z39.string().min(1),
22953
+ token: z39.string().trim().min(1),
22954
+ webhookSecret: z39.string().trim().optional()
22648
22955
  });
22649
22956
 
22650
22957
  // ../shared/src/routes/user.ts
22651
22958
  var PROFILE_AVATAR_MAX_SIZE_BYTES = 5 * 1024 * 1024;
22652
22959
 
22653
22960
  // ../shared/src/routes/web-auth.ts
22654
- import { z as z38 } from "zod";
22655
- var webAuthRedeemResponseSchema = z38.object({
22656
- path: z38.string(),
22657
- organizationId: z38.string().nullable(),
22658
- session: z38.object({ access_token: z38.string(), refresh_token: z38.string(), user: z38.object({ id: z38.string(), email: z38.string() }) }).nullable()
22961
+ import { z as z40 } from "zod";
22962
+ var webAuthRedeemResponseSchema = z40.object({
22963
+ path: z40.string(),
22964
+ organizationId: z40.string().nullable(),
22965
+ session: z40.object({ access_token: z40.string(), refresh_token: z40.string(), user: z40.object({ id: z40.string(), email: z40.string() }) }).nullable()
22659
22966
  });
22660
22967
 
22661
22968
  // ../shared/src/routes/themes.ts
22662
- import { z as z39 } from "zod";
22663
- var updateThemeRequestSchema = z39.object({ theme: z39.string(), palette: z39.string(), accent: z39.string(), code: z39.string() }).partial();
22969
+ import { z as z41 } from "zod";
22970
+ var updateThemeRequestSchema = z41.object({ theme: z41.string(), palette: z41.string(), accent: z41.string(), code: z41.string() }).partial();
22664
22971
 
22665
22972
  // ../shared/src/routes/client-state.ts
22666
22973
  var MAX_CLIENT_STATE_REQUEST_BYTES = 5 * 1024 * 1024;
@@ -22686,106 +22993,106 @@ var promptHistoryClientStateKey = orgUserClientStateKey(PROMPT_HISTORY_CLIENT_ST
22686
22993
  var workspaceSearchOpensClientStateKey = orgUserClientStateKey(WORKSPACE_SEARCH_OPENS_CLIENT_STATE_KEY_PREFIX);
22687
22994
 
22688
22995
  // ../shared/src/routes/workspace-events.ts
22689
- import { z as z41 } from "zod";
22996
+ import { z as z43 } from "zod";
22690
22997
 
22691
22998
  // ../shared/src/routes/presence.ts
22692
- import { z as z40 } from "zod";
22693
- var presenceStatusSchema = z40.enum(["online", "typing"]);
22694
- var presenceLocationSchema = z40.object({
22695
- workspaceId: z40.string().optional()
22999
+ import { z as z42 } from "zod";
23000
+ var presenceStatusSchema = z42.enum(["online", "typing"]);
23001
+ var presenceLocationSchema = z42.object({
23002
+ workspaceId: z42.string().optional()
22696
23003
  });
22697
- var presenceEntrySchema = z40.object({
22698
- userId: z40.string(),
23004
+ var presenceEntrySchema = z42.object({
23005
+ userId: z42.string(),
22699
23006
  status: presenceStatusSchema,
22700
23007
  location: presenceLocationSchema,
22701
- ts: z40.string()
23008
+ ts: z42.string()
22702
23009
  });
22703
- var updatePresenceRequestSchema = z40.object({
23010
+ var updatePresenceRequestSchema = z42.object({
22704
23011
  status: presenceStatusSchema,
22705
23012
  location: presenceLocationSchema.optional()
22706
23013
  });
22707
23014
 
22708
23015
  // ../shared/src/routes/workspace-events.ts
22709
- var workspaceTurnCompletionSchema = z41.object({
22710
- workspaceName: z41.string(),
22711
- completedAt: z41.string(),
22712
- processing: z41.boolean().optional(),
22713
- pullRequestFeedback: z41.boolean().optional(),
22714
- attention: z41.object({ reason: z41.enum(CHAT_ATTENTION_REASONS), userId: z41.string() }).optional()
23016
+ var workspaceTurnCompletionSchema = z43.object({
23017
+ workspaceName: z43.string(),
23018
+ completedAt: z43.string(),
23019
+ processing: z43.boolean().optional(),
23020
+ pullRequestFeedback: z43.boolean().optional(),
23021
+ attention: z43.object({ reason: z43.enum(CHAT_ATTENTION_REASONS), userId: z43.string() }).optional()
22715
23022
  });
22716
- var workspaceEventSchemaByType = z41.discriminatedUnion("type", [
22717
- z41.object({
22718
- type: z41.literal("workspace.changed"),
22719
- workspaceId: z41.string(),
22720
- accessChangedFor: z41.string().optional(),
22721
- accessChangedForOrg: z41.literal(true).optional(),
22722
- workspace: z41.object({ status: z41.enum(WORKSPACE_STATUSES), last_activity_at: z41.string().nullable() }).optional(),
22723
- name: z41.string().optional(),
23023
+ var workspaceEventSchemaByType = z43.discriminatedUnion("type", [
23024
+ z43.object({
23025
+ type: z43.literal("workspace.changed"),
23026
+ workspaceId: z43.string(),
23027
+ accessChangedFor: z43.string().optional(),
23028
+ accessChangedForOrg: z43.literal(true).optional(),
23029
+ workspace: z43.object({ status: z43.enum(WORKSPACE_STATUSES), last_activity_at: z43.string().nullable() }).optional(),
23030
+ name: z43.string().optional(),
22724
23031
  completion: workspaceTurnCompletionSchema.optional(),
22725
- ts: z41.string()
23032
+ ts: z43.string()
22726
23033
  }),
22727
- z41.object({
22728
- type: z41.literal("workspace.chat.changed"),
22729
- workspaceId: z41.string(),
22730
- chatId: z41.string(),
22731
- ts: z41.string()
23034
+ z43.object({
23035
+ type: z43.literal("workspace.chat.changed"),
23036
+ workspaceId: z43.string(),
23037
+ chatId: z43.string(),
23038
+ ts: z43.string()
22732
23039
  }),
22733
- z41.object({
22734
- type: z41.literal("workspace.chat.advanced"),
22735
- workspaceId: z41.string(),
22736
- chatId: z41.string(),
22737
- afterCursor: z41.string().optional(),
22738
- processing: z41.boolean(),
22739
- ts: z41.string()
23040
+ z43.object({
23041
+ type: z43.literal("workspace.chat.advanced"),
23042
+ workspaceId: z43.string(),
23043
+ chatId: z43.string(),
23044
+ afterCursor: z43.string().optional(),
23045
+ processing: z43.boolean(),
23046
+ ts: z43.string()
22740
23047
  }),
22741
- z41.object({
22742
- type: z41.literal("mobile-testing.changed"),
22743
- workspaceId: z41.string(),
22744
- ts: z41.string()
23048
+ z43.object({
23049
+ type: z43.literal("mobile-testing.changed"),
23050
+ workspaceId: z43.string(),
23051
+ ts: z43.string()
22745
23052
  }),
22746
- z41.object({
22747
- type: z41.literal("variable-request.changed"),
22748
- workspaceId: z41.string(),
22749
- ts: z41.string()
23053
+ z43.object({
23054
+ type: z43.literal("variable-request.changed"),
23055
+ workspaceId: z43.string(),
23056
+ ts: z43.string()
22750
23057
  }),
22751
- z41.object({
22752
- type: z41.literal("local-control-request.changed"),
22753
- workspaceId: z41.string(),
22754
- ts: z41.string()
23058
+ z43.object({
23059
+ type: z43.literal("local-control-request.changed"),
23060
+ workspaceId: z43.string(),
23061
+ ts: z43.string()
22755
23062
  }),
22756
- z41.object({
22757
- type: z41.literal("pull-request.changed"),
22758
- prUrl: z41.string(),
22759
- ts: z41.string()
23063
+ z43.object({
23064
+ type: z43.literal("pull-request.changed"),
23065
+ prUrl: z43.string(),
23066
+ ts: z43.string()
22760
23067
  }),
22761
- z41.object({
22762
- type: z41.enum(["manager.subagent.changed", "mothership.subagent.changed"]),
22763
- workspaceId: z41.string(),
22764
- subagent: z41.object({ id: z41.string(), name: z41.string(), prUrl: z41.string().nullable() }),
22765
- ts: z41.string()
23068
+ z43.object({
23069
+ type: z43.enum(["manager.subagent.changed", "mothership.subagent.changed"]),
23070
+ workspaceId: z43.string(),
23071
+ subagent: z43.object({ id: z43.string(), name: z43.string(), prUrl: z43.string().nullable() }),
23072
+ ts: z43.string()
22766
23073
  }),
22767
- z41.object({ type: z41.enum(["manager.board.changed", "mothership.board.changed"]), workspaceId: z41.string(), ts: z41.string() }),
22768
- z41.object({ type: z41.literal("issues.synced"), syncId: z41.number(), ts: z41.string() }),
22769
- z41.object({ type: z41.literal("needs-you.changed"), workspaceId: z41.string().nullable(), userId: z41.string().optional(), ts: z41.string() }),
22770
- z41.object({
22771
- type: z41.literal("workspace.shared"),
22772
- workspaceId: z41.string(),
22773
- workspaceName: z41.string(),
22774
- sharedWithUserId: z41.string(),
22775
- sharedByName: z41.string(),
22776
- ts: z41.string()
23074
+ z43.object({ type: z43.enum(["manager.board.changed", "mothership.board.changed"]), workspaceId: z43.string(), ts: z43.string() }),
23075
+ z43.object({ type: z43.literal("issues.synced"), syncId: z43.number(), ts: z43.string() }),
23076
+ z43.object({ type: z43.literal("needs-you.changed"), workspaceId: z43.string().nullable(), userId: z43.string().optional(), ts: z43.string() }),
23077
+ z43.object({
23078
+ type: z43.literal("workspace.shared"),
23079
+ workspaceId: z43.string(),
23080
+ workspaceName: z43.string(),
23081
+ sharedWithUserId: z43.string(),
23082
+ sharedByName: z43.string(),
23083
+ ts: z43.string()
22777
23084
  }),
22778
- z41.object({ type: z41.literal("client-state.changed"), userId: z41.string(), keys: z41.array(z41.string()), ts: z41.string() })
23085
+ z43.object({ type: z43.literal("client-state.changed"), userId: z43.string(), keys: z43.array(z43.string()), ts: z43.string() })
22779
23086
  ]);
22780
- var workspaceChangedEventSchema = z41.union([
23087
+ var workspaceChangedEventSchema = z43.union([
22781
23088
  workspaceEventSchemaByType,
22782
- z41.object({ type: z41.literal("presence.changed"), userId: z41.string(), entry: presenceEntrySchema.nullable(), ts: z41.string() }),
22783
- z41.object({ type: z41.literal("presence.changed"), ts: z41.string() })
23089
+ z43.object({ type: z43.literal("presence.changed"), userId: z43.string(), entry: presenceEntrySchema.nullable(), ts: z43.string() }),
23090
+ z43.object({ type: z43.literal("presence.changed"), ts: z43.string() })
22784
23091
  ]);
22785
23092
 
22786
23093
  // ../shared/src/routes/review-messages.ts
22787
- import { z as z42 } from "zod";
22788
- var sendPullRequestReviewMessageRequestSchema = z42.object({
23094
+ import { z as z44 } from "zod";
23095
+ var sendPullRequestReviewMessageRequestSchema = z44.object({
22789
23096
  ...sendChatMessageRequestSchema.pick({
22790
23097
  message: true,
22791
23098
  messageId: true,
@@ -22798,8 +23105,8 @@ var sendPullRequestReviewMessageRequestSchema = z42.object({
22798
23105
  ultrafastMode: true
22799
23106
  }).shape,
22800
23107
  /** Starts a new chat instead of continuing the PR's review chat. The provider only applies to a new chat. */
22801
- newChat: z42.boolean().optional(),
22802
- provider: z42.enum(VALID_AGENT_PROVIDERS).optional()
23108
+ newChat: z44.boolean().optional(),
23109
+ provider: z44.enum(VALID_AGENT_PROVIDERS).optional()
22803
23110
  });
22804
23111
 
22805
23112
  // ../shared/src/audit-log.ts
@@ -23245,232 +23552,6 @@ var SCHEDULE_TIMEZONES = typeof Intl.supportedValuesOf === "function" ? ["UTC",
23245
23552
  // ../shared/src/automations/form.ts
23246
23553
  var AUTOMATION_AUTO_STOP_RANGE_LABEL = `${AUTOMATION_WORKSPACE_AUTO_STOP_MINUTES_MIN}-${AUTOMATION_WORKSPACE_AUTO_STOP_MINUTES_MAX}`;
23247
23554
 
23248
- // ../shared/src/routes/issues.ts
23249
- import { z as z43 } from "zod";
23250
- var ISSUE_STATUSES = ["backlog", "todo", "in_progress", "in_review", "done", "canceled", "duplicate"];
23251
- var ISSUE_PRIORITIES = ["none", "urgent", "high", "medium", "low"];
23252
- var ISSUE_ACTOR_TYPES = ["user", "workspace"];
23253
- var ISSUE_SUBSCRIBER_ROLES = ["assignee", "creator", "mentioned", "manual"];
23254
- var ISSUE_RELATION_TYPES = ["blocks", "duplicate_of"];
23255
- var ISSUE_PULL_REQUEST_STATES = ["draft", "open", "merged", "closed"];
23256
- var issueStatusSchema = z43.enum(ISSUE_STATUSES);
23257
- var issuePrioritySchema = z43.enum(ISSUE_PRIORITIES);
23258
- var issueSubscriberRoleSchema = z43.enum(ISSUE_SUBSCRIBER_ROLES);
23259
- var issueRelationTypeSchema = z43.enum(ISSUE_RELATION_TYPES);
23260
- var issuePullRequestStateSchema = z43.enum(ISSUE_PULL_REQUEST_STATES);
23261
- var issueActorSchema = z43.object({
23262
- type: z43.enum(ISSUE_ACTOR_TYPES),
23263
- id: z43.string().toLowerCase().uuid()
23264
- });
23265
- var ISSUE_KEY_RE = /^[A-Z][A-Z0-9]{0,9}$/;
23266
- var timestamp = z43.string();
23267
- var nullableTimestamp = timestamp.nullable();
23268
- var issueSchema2 = z43.object({
23269
- id: z43.string().uuid(),
23270
- organization_id: z43.string().uuid(),
23271
- number: z43.number().int(),
23272
- identifier: z43.string(),
23273
- title: z43.string(),
23274
- description: z43.string(),
23275
- status: issueStatusSchema,
23276
- priority: issuePrioritySchema,
23277
- parent_id: z43.string().uuid().nullable(),
23278
- manager_id: z43.string().uuid().nullable(),
23279
- creator: issueActorSchema,
23280
- /** Fractional: to move an issue between two others, send the midpoint of their sort orders. */
23281
- sort_order: z43.number(),
23282
- created_at: timestamp,
23283
- updated_at: timestamp,
23284
- completed_at: nullableTimestamp,
23285
- canceled_at: nullableTimestamp,
23286
- archived_at: nullableTimestamp
23287
- });
23288
- var issueSubscriberSchema = z43.object({
23289
- issue_id: z43.string().uuid(),
23290
- subscriber: issueActorSchema,
23291
- role: issueSubscriberRoleSchema,
23292
- created_at: timestamp
23293
- });
23294
- var issueRelationSchema = z43.object({
23295
- id: z43.string().uuid(),
23296
- type: issueRelationTypeSchema,
23297
- issue_id: z43.string().uuid(),
23298
- related_issue_id: z43.string().uuid(),
23299
- created_at: timestamp
23300
- });
23301
- var issuePullRequestSchema = z43.object({
23302
- id: z43.string().uuid(),
23303
- issue_id: z43.string().uuid(),
23304
- url: z43.string(),
23305
- pull_request_id: z43.string().uuid().nullable(),
23306
- title: z43.string().nullable(),
23307
- state: issuePullRequestStateSchema,
23308
- created_at: timestamp,
23309
- updated_at: timestamp
23310
- });
23311
- var issueCommentSchema = z43.object({
23312
- id: z43.string().uuid(),
23313
- issue_id: z43.string().uuid(),
23314
- author: issueActorSchema,
23315
- body: z43.string(),
23316
- created_at: timestamp,
23317
- updated_at: timestamp
23318
- });
23319
- var change = (value) => z43.object({ from: value, to: value });
23320
- var nullableId = z43.string().uuid().nullable();
23321
- var ISSUE_EVENT_TYPES = [
23322
- "created",
23323
- "title_changed",
23324
- "description_changed",
23325
- "status_changed",
23326
- "priority_changed",
23327
- "parent_changed",
23328
- "manager_changed",
23329
- "sort_order_changed",
23330
- "assignee_added",
23331
- "assignee_removed",
23332
- "subscriber_added",
23333
- "subscriber_removed",
23334
- "relation_added",
23335
- "relation_removed",
23336
- "pr_linked",
23337
- "pr_unlinked",
23338
- "pr_state_changed",
23339
- "comment_added",
23340
- "comment_edited",
23341
- "comment_deleted",
23342
- "archived",
23343
- "restored"
23344
- ];
23345
- var issueEventDataSchemas = {
23346
- created: z43.object({ issue: issueSchema2 }),
23347
- title_changed: change(z43.string()),
23348
- description_changed: change(z43.string()),
23349
- status_changed: change(issueStatusSchema).extend({ completed_at: nullableTimestamp, canceled_at: nullableTimestamp }),
23350
- priority_changed: change(issuePrioritySchema),
23351
- parent_changed: change(nullableId),
23352
- manager_changed: change(nullableId),
23353
- sort_order_changed: change(z43.number()),
23354
- /** `subscriber` is the row after the change: an unassigned principal stays subscribed with role `manual`. */
23355
- assignee_added: z43.object({ subscriber: issueSubscriberSchema }),
23356
- assignee_removed: z43.object({ subscriber: issueSubscriberSchema }),
23357
- subscriber_added: z43.object({ subscriber: issueSubscriberSchema }),
23358
- subscriber_removed: z43.object({ subscriber: issueSubscriberSchema }),
23359
- relation_added: z43.object({ relation: issueRelationSchema }),
23360
- relation_removed: z43.object({ relation: issueRelationSchema }),
23361
- pr_linked: z43.object({ pull_request: issuePullRequestSchema }),
23362
- pr_unlinked: z43.object({ pull_request: issuePullRequestSchema }),
23363
- pr_state_changed: z43.object({ pull_request: issuePullRequestSchema, from: issuePullRequestStateSchema }),
23364
- comment_added: z43.object({ comment: issueCommentSchema }),
23365
- comment_edited: z43.object({ comment: issueCommentSchema, from: z43.string() }),
23366
- comment_deleted: z43.object({ comment: issueCommentSchema }),
23367
- archived: z43.object({ archived_at: timestamp }),
23368
- restored: z43.object({
23369
- issue: issueSchema2,
23370
- subscribers: z43.array(issueSubscriberSchema),
23371
- relations: z43.array(issueRelationSchema),
23372
- pull_requests: z43.array(issuePullRequestSchema)
23373
- })
23374
- };
23375
- var issueEventBase = z43.object({
23376
- sync_id: z43.number().int(),
23377
- issue_id: z43.string().uuid(),
23378
- actor: issueActorSchema,
23379
- /** Echo of the `client_mutation_id` sent with the write, so the writer can settle its optimistic change. */
23380
- client_mutation_id: z43.string().nullable(),
23381
- created_at: timestamp
23382
- });
23383
- var issueEventVariant = (type) => issueEventBase.extend({ type: z43.literal(type), data: issueEventDataSchemas[type] });
23384
- var issueEventSchema = z43.discriminatedUnion("type", [issueEventVariant(ISSUE_EVENT_TYPES[0]), ...ISSUE_EVENT_TYPES.slice(1).map(issueEventVariant)]);
23385
- var clientMutationId = z43.string().min(1).max(128).optional();
23386
- var title2 = z43.string().trim().min(1).max(500);
23387
- var description = z43.string().max(1e5);
23388
- var body = z43.string().trim().min(1).max(1e5);
23389
- var createIssueRequestSchema = z43.object({
23390
- /** Client-generated id, so an optimistic create can be referenced before the server answers. */
23391
- id: z43.string().uuid().optional(),
23392
- title: title2,
23393
- description: description.optional(),
23394
- status: issueStatusSchema.optional(),
23395
- priority: issuePrioritySchema.optional(),
23396
- parent_id: z43.string().uuid().optional(),
23397
- manager_id: z43.string().uuid().optional(),
23398
- sort_order: z43.number().finite().optional(),
23399
- assignees: z43.array(issueActorSchema).max(20).optional(),
23400
- subscribers: z43.array(issueActorSchema).max(50).optional(),
23401
- client_mutation_id: clientMutationId
23402
- });
23403
- var updateIssueRequestSchema = z43.object({
23404
- title: title2.optional(),
23405
- description: description.optional(),
23406
- status: issueStatusSchema.optional(),
23407
- priority: issuePrioritySchema.optional(),
23408
- // PATCH semantics: null clears the parent or Manager, omitting it leaves it unchanged.
23409
- parent_id: nullableId.optional(),
23410
- manager_id: nullableId.optional(),
23411
- sort_order: z43.number().finite().optional(),
23412
- client_mutation_id: clientMutationId
23413
- });
23414
- var issueActorRequestSchema = issueActorSchema.partial().extend({ client_mutation_id: clientMutationId });
23415
- var createIssueCommentRequestSchema = z43.object({
23416
- id: z43.string().uuid().optional(),
23417
- body,
23418
- client_mutation_id: clientMutationId
23419
- });
23420
- var updateIssueCommentRequestSchema = z43.object({ body, client_mutation_id: clientMutationId });
23421
- var createIssueRelationRequestSchema = z43.object({
23422
- id: z43.string().uuid().optional(),
23423
- type: issueRelationTypeSchema,
23424
- related_issue: z43.string().min(1),
23425
- client_mutation_id: clientMutationId
23426
- });
23427
- var linkIssuePullRequestRequestSchema = z43.object({
23428
- id: z43.string().uuid().optional(),
23429
- url: z43.string().url().max(2e3),
23430
- title: z43.string().max(500).optional(),
23431
- state: issuePullRequestStateSchema.optional(),
23432
- pull_request_id: z43.string().uuid().optional(),
23433
- client_mutation_id: clientMutationId
23434
- });
23435
- var updateIssuePullRequestRequestSchema = z43.object({
23436
- state: issuePullRequestStateSchema,
23437
- client_mutation_id: clientMutationId
23438
- });
23439
- var issueMutationRequestSchema = z43.object({ client_mutation_id: clientMutationId });
23440
- var updateIssueSettingsRequestSchema = z43.object({ issue_key: z43.string().trim().toUpperCase().regex(ISSUE_KEY_RE) });
23441
- var listIssuesQuerySchema = z43.object({
23442
- status: z43.string().optional(),
23443
- priority: z43.string().optional(),
23444
- assignee: z43.string().optional(),
23445
- subscriber: z43.string().optional(),
23446
- creator: z43.string().optional(),
23447
- manager_id: z43.string().optional(),
23448
- parent_id: z43.string().optional(),
23449
- q: z43.string().max(200).optional(),
23450
- include_archived: z43.enum(["true", "false"]).optional(),
23451
- limit: z43.coerce.number().int().min(1).max(200).optional(),
23452
- cursor: z43.coerce.number().int().min(0).max(2147483647).optional()
23453
- });
23454
- var issueDetailResponseSchema = z43.object({
23455
- issue: issueSchema2,
23456
- subscribers: z43.array(issueSubscriberSchema),
23457
- relations: z43.array(issueRelationSchema),
23458
- pull_requests: z43.array(issuePullRequestSchema),
23459
- comments: z43.array(issueCommentSchema),
23460
- events: z43.array(issueEventSchema),
23461
- sub_issues: z43.array(issueSchema2)
23462
- });
23463
- var listIssuesResponseSchema = z43.object({ issues: z43.array(issueSchema2), next_cursor: z43.number().nullable() });
23464
- var issuesDeltaQuerySchema = z43.object({
23465
- after: z43.coerce.number().int().min(0).max(Number.MAX_SAFE_INTEGER),
23466
- limit: z43.coerce.number().int().min(1).max(1e3).optional()
23467
- });
23468
- var issueInboxQuerySchema = z43.object({
23469
- limit: z43.coerce.number().int().min(1).max(100).optional(),
23470
- before: z43.coerce.number().int().min(1).optional()
23471
- });
23472
- var markIssueInboxReadRequestSchema = z43.object({ sync_id: z43.number().int().min(0).optional() });
23473
-
23474
23555
  // ../shared/src/routes/repo-files.ts
23475
23556
  var MAX_REPO_FILE_CONTENT_BYTES = 256 * 1024;
23476
23557
  function searchRepoFileIndex(repos, params, multiRepo) {
@@ -23747,40 +23828,40 @@ function isSkillRegistryManifest(value) {
23747
23828
  }
23748
23829
 
23749
23830
  // ../shared/src/routes/variable-requests.ts
23750
- import { z as z44 } from "zod";
23831
+ import { z as z45 } from "zod";
23751
23832
  var VARIABLE_REQUEST_WAIT = { defaultMs: 10 * 6e4, maxMs: 30 * 6e4, pollMs: 3e3, waiterStaleMs: 15e3 };
23752
23833
  var VARIABLE_REQUEST_DESTINATIONS = ["environment", "workspace"];
23753
- var requestedVariableSchema = z44.object({
23754
- key: z44.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name").max(ENVIRONMENT_SETUP_LIMITS.variableKeyChars),
23755
- required: z44.boolean(),
23756
- replace: z44.boolean().optional()
23834
+ var requestedVariableSchema = z45.object({
23835
+ key: z45.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name").max(ENVIRONMENT_SETUP_LIMITS.variableKeyChars),
23836
+ required: z45.boolean(),
23837
+ replace: z45.boolean().optional()
23757
23838
  });
23758
- var requestedVariablesSchema = z44.array(requestedVariableSchema).min(1, "must not be empty").max(ENVIRONMENT_SETUP_LIMITS.variables).refine((variables) => new Set(variables.map((variable) => variable.key)).size === variables.length, "must have unique keys");
23759
- var createVariableRequestSchema = z44.object({
23839
+ var requestedVariablesSchema = z45.array(requestedVariableSchema).min(1, "must not be empty").max(ENVIRONMENT_SETUP_LIMITS.variables).refine((variables) => new Set(variables.map((variable) => variable.key)).size === variables.length, "must have unique keys");
23840
+ var createVariableRequestSchema = z45.object({
23760
23841
  variables: requestedVariablesSchema,
23761
- reason: z44.string().trim().max(500).nullish().transform((value) => value || null),
23762
- wait: z44.boolean().default(true)
23842
+ reason: z45.string().trim().max(500).nullish().transform((value) => value || null),
23843
+ wait: z45.boolean().default(true)
23763
23844
  });
23764
- var respondVariableRequestSchema = z44.discriminatedUnion("action", [
23765
- z44.object({
23766
- action: z44.literal("provide"),
23767
- destination: z44.enum(VARIABLE_REQUEST_DESTINATIONS),
23845
+ var respondVariableRequestSchema = z45.discriminatedUnion("action", [
23846
+ z45.object({
23847
+ action: z45.literal("provide"),
23848
+ destination: z45.enum(VARIABLE_REQUEST_DESTINATIONS),
23768
23849
  /** Defaults to the workspace's environment, so older clients keep saving there. */
23769
- environment_ids: z44.array(z44.string().uuid()).optional(),
23770
- overwrite: z44.boolean().optional(),
23771
- values: z44.record(z44.string().regex(VARIABLE_KEY_RE), z44.string())
23850
+ environment_ids: z45.array(z45.string().uuid()).optional(),
23851
+ overwrite: z45.boolean().optional(),
23852
+ values: z45.record(z45.string().regex(VARIABLE_KEY_RE), z45.string())
23772
23853
  }),
23773
- z44.object({ action: z44.literal("skip") })
23854
+ z45.object({ action: z45.literal("skip") })
23774
23855
  ]);
23775
23856
 
23776
23857
  // ../shared/src/routes/local-control-requests.ts
23777
- import { z as z45 } from "zod";
23778
- var createLocalControlRequestSchema = z45.object({
23779
- reason: z45.string().trim().max(500).optional().transform((value) => value || null),
23780
- wait: z45.boolean().default(true)
23858
+ import { z as z46 } from "zod";
23859
+ var createLocalControlRequestSchema = z46.object({
23860
+ reason: z46.string().trim().max(500).optional().transform((value) => value || null),
23861
+ wait: z46.boolean().default(true)
23781
23862
  });
23782
- var respondLocalControlRequestSchema = z45.object({ action: z45.enum(["allow", "dismiss"]) });
23783
- var setLocalControlSchema = z45.object({ enabled: z45.boolean() });
23863
+ var respondLocalControlRequestSchema = z46.object({ action: z46.enum(["allow", "dismiss"]) });
23864
+ var setLocalControlSchema = z46.object({ enabled: z46.boolean() });
23784
23865
 
23785
23866
  export {
23786
23867
  ENGINE_SEND_MESSAGE_FAILED_ERROR,