replicas-engine 0.1.1425 → 0.1.1427

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 z35 = void 0;
1119
+ let z36 = 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
- z35 = offsetZ;
1126
+ z36 = offsetZ;
1127
1127
  this.dt = dt;
1128
1128
  } else {
1129
- z35 = "UTC";
1129
+ z36 = "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
- z35 = dt.zone.name;
1139
+ z36 = dt.zone.name;
1140
1140
  } else {
1141
- z35 = "UTC";
1141
+ z36 = "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 || z35;
1150
+ intlOpts.timeZone = intlOpts.timeZone || z36;
1151
1151
  this.dtf = getCachedDTF(intl, intlOpts);
1152
1152
  }
1153
1153
  format() {
@@ -11742,7 +11742,7 @@ var reorderCredentialPoolSchema = z15.object({
11742
11742
  });
11743
11743
 
11744
11744
  // ../shared/src/mothership-events.ts
11745
- import { z as z23 } from "zod";
11745
+ import { z as z24 } from "zod";
11746
11746
 
11747
11747
  // ../shared/src/design-tokens.ts
11748
11748
  var plain = {
@@ -11876,6 +11876,7 @@ import { z as z16 } from "zod";
11876
11876
  var linearSessionMetadataSchema = z16.object({
11877
11877
  via_mothership: z16.boolean().optional(),
11878
11878
  attached: z16.boolean().optional(),
11879
+ routing_chat_id: z16.string().optional(),
11879
11880
  issue_id: z16.string(),
11880
11881
  issue_identifier: z16.string(),
11881
11882
  issue_title: z16.string(),
@@ -12002,6 +12003,7 @@ var REPLICAS_MCP_TOOLS = {
12002
12003
  listWorkspaces: "list_workspaces",
12003
12004
  linearStart: "start_linear_session",
12004
12005
  linearSessionIntent: "register_linear_session_intent",
12006
+ routeLinearTicket: "route_linear_ticket",
12005
12007
  listChannelSettings: "list_channel_settings",
12006
12008
  saveChannelPreset: "save_channel_preset",
12007
12009
  deleteChannelPreset: "delete_channel_preset",
@@ -12116,6 +12118,45 @@ var SCOUT_PRESET_ICONS = [
12116
12118
  "tag"
12117
12119
  ];
12118
12120
 
12121
+ // ../shared/src/default-skills/scout-settings.ts
12122
+ var SCOUT_SETTINGS_SKILL_NAME = "scout-settings";
12123
+ var CONTENT = `---
12124
+ name: ${SCOUT_SETTINGS_SKILL_NAME}
12125
+ description: Use when someone asks Scout to change or explain how Replicas behaves in Slack or Linear (channel levels, "be quieter", "only reply when tagged", channel or team instructions, presets, monitored Linear teams, Slack Connect defaults, Slack agent defaults, "what can I change?"), when someone is annoyed that Scout replied unasked ("not you", "nobody asked", a thumbs-down), when making or answering a settings or automation offer, or when setting up an automation. Not for routing ordinary requests.
12126
+ ---
12127
+
12128
+ # Scout settings
12129
+
12130
+ You own every Scout setting: each Slack channel's level, each channel's and Linear team's preset and instructions, the presets themselves, which Linear teams are monitored, Slack Connect defaults, the organization's level, and agent defaults for Slack tasks. Handle requests here, never by spawning a workspace.
12131
+
12132
+ ## Tools
12133
+ Read presets, channel instructions, and levels with \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`. Change them with \`${REPLICAS_MCP_TOOLS.updateChannelSettings}\`, \`${REPLICAS_MCP_TOOLS.saveChannelPreset}\`, \`${REPLICAS_MCP_TOOLS.deleteChannelPreset}\`, \`${REPLICAS_MCP_TOOLS.setOrganizationProactivity}\`, \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\`, or \`${REPLICAS_MCP_TOOLS.setSlackAgentDefaults}\`. Every change takes \`confirmation_*\` arguments: fill them with the requesting message's envelope \`channel_id\`, \`thread_ts\`, \`message_ts\`, and \`user_id\`. The server checks that exact Slack author is an organization member (and an admin where noted). If it refuses, say why briefly and change nothing.
12134
+
12135
+ ## Changing settings
12136
+ - Settings also change outside your chat, often on purpose: read the current settings first, never trust earlier messages, and never re-apply an earlier request the current message doesn't ask for. Save only what the current message asks.
12137
+ - **Levels**, lowest to highest: \`tagged\` (only @Replicas pings reach you, not even messages naming Replicas), \`conservative\` (also messages naming Replicas or Scout, and follow-ups in threads with a workspace), \`balanced\` (the normal triage rules), \`proactive\` (also clear untagged questions and requests). People see these as Mentions only, Low, Balanced and High: use those names, never the setting values.
12138
+ - The organization has one level for its whole Slack workspace, which only an admin can set with \`${REPLICAS_MCP_TOOLS.setOrganizationProactivity}\`. A channel or group DM can override it with \`${REPLICAS_MCP_TOOLS.updateChannelSettings}\` and \`proactivity\`. 1:1 DMs are always addressed to you. Any member can lower a channel; raising one above \`tagged\` needs an admin.
12139
+ - A request that points at a channel ("here", "in #eng", "stop replying in #random") changes that channel only. One that doesn't ("only respond when I @ you", "don't auto-reply to Slack messages") means the organization level. When it names a channel, even without "#" ("make support-inbound quieter"), find it with \`conversations.list\` and change that one, not the one you were asked in; ask if none or several match. If a non-admin asks for an organization change, say an organization admin has to ask, and offer the channel-only change when they asked from a channel. Instructions don't substitute for a level.
12140
+ - **Instructions and presets:** prefer changing the channel's own instructions; edit a shared preset only when asked, since every channel using it changes. To set up a channel without being told how, read enough of it to propose short instructions or a fitting preset (customer, vendor, internal team), and save nothing until they confirm. Never infer a channel's purpose only because Slack marks it externally shared.
12141
+ - **Linear teams:** set \`monitored: true\` to start triaging a team (admin only) and \`monitored: false\` to stop. Teams take a preset or instructions like channels.
12142
+ - **Slack Connect** channels shared with another company follow the organization's shared-channel defaults (\`tagged\` with no preset unless an admin set them with \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\`) until they get their own settings, unless a Mothership is linked to one. A request about all shared or customer channels changes only those defaults: leave channels with their own settings as they are, list them, and offer to switch them too. Asked why you stay quiet in one, say it's external and an admin can raise its level here.
12143
+ - **Slack agent defaults:** to change the agent, model, thinking level, goal mode, or fast mode for tasks started from Slack ("use Codex for Slack tasks"), call \`${REPLICAS_MCP_TOOLS.setSlackAgentDefaults}\` (admin only).
12144
+ - **"What can I change?"** Read the current settings, then list what applies with each current value: how much you speak up here and in every channel (raising a channel above Mentions only and the every-channel default need an admin), instructions or a preset for this channel, sending this channel's requests to a Mothership, which Linear teams you triage (an admin starts one), and the Slack agent defaults (admin).
12145
+ - After any change, say what changed and its scope ("every channel", or "#eng only"). Confirm only after the tool succeeded and only what it changed; say so when it failed or did less than asked.
12146
+
12147
+ ## Offers
12148
+ When the envelope has \`offers\`, it lists the offers you may still make in this channel (${SCOUT_CHANNEL_SETTINGS_OFFERS.map((offer) => `\`${offer}\``).join(", ")}); \`offers=none\` means none. Offer only what it lists, at most one per message. Claim the offer with \`${REPLICAS_MCP_TOOLS.claimSettingsOffer}\` right before posting it, and post only when the claim succeeds. When someone declines ("no", "it's fine", "leave it"), record it with \`declined: true\`; never repeat an ignored offer. When they accept, apply it with the tools above using the accepting message as confirmation, then confirm in one short line.
12149
+ - **Frustration.** When someone is clearly annoyed that you replied or acted unasked ("wtf why did replicas respond", "not you", "nobody asked", or a thumbs-down on a reply you posted unasked), claim \`proactivity\` and post one short apology offering to lower this channel exactly one step. From Balanced or High: "Sorry for jumping in. Want me to only reply here when someone mentions me by name?" From Low: "Sorry for jumping in. Want me to only reply here when someone @mentions me?" On a yes, set that level, nothing lower. Do nothing else in that thread. When the claim answers \`offer: organization\`, offer to set every channel's default to \`organization_target\` instead; when \`requester_is_admin\` is false, say an admin can change it for every channel and offer this channel. An explicit "stop replying in this thread" is still a thread mute.
12150
+ - **Having to tag you.** After doing what an earlier untagged message asked, claim \`raise_proactivity\` and end your reply with one line offering one step up. From Mentions only: "Want me to pick up messages here that name me, without an @mention? @mention me with your answer." From Low: "Want me to pick up requests like that here without a tag next time? I can raise this channel to Balanced." From Balanced: "Want me to jump in on requests like that here without being asked? I can raise this channel to High." When the claim answers \`offer: organization\`, offer to raise every channel's default to \`organization_target\` instead, and say channels with their own level keep it. Mention an admin only when the claim answers \`needs_admin: true\`, then offer this channel instead. On a yes, raise to that level only.
12151
+ - **Channel instructions.** When you join a channel or first act in one whose name or purpose points to a clear role (#triage, #bugs, #incidents, #support, #customer-*, a customer's shared channel), claim \`instructions\` and offer one concrete behavior in one line ("This looks like an incident channel. Want me to triage new reports here, check for duplicates, and post findings in the thread?"). Make the same kind of offer when you keep handling messages here the same way, or the channel clearly belongs to a Mothership (offer to send its actionable messages to it by name). On a yes, save it as the channel's instructions, or its preset when one fits exactly.
12152
+
12153
+ ## Automations
12154
+ When someone accepts an offer to automate a repeated request, set it up here instead of spawning. Infer the name, prompt, environment, repositories, schedule, and timezone from the conversation and the organization's configuration; ask one concise follow-up only for a missing detail that changes when or where it runs. Create it with \`${REPLICAS_MCP_TOOLS.createAutomation}\`, filling \`confirmation_*\` from the accepting message's envelope. The server checks that author is an organization member with automation write access; never create it if that fails. Post the result in the same thread.
12155
+ `;
12156
+
12157
+ // ../shared/src/routes/preferences.ts
12158
+ import { z as z23 } from "zod";
12159
+
12119
12160
  // ../shared/src/routes/push.ts
12120
12161
  import { z as z20 } from "zod";
12121
12162
 
@@ -14727,6 +14768,11 @@ var DEFAULT_DEFAULT_SKILLS = {
14727
14768
  abilities: defaultReplicasAgentAbilities()
14728
14769
  }
14729
14770
  };
14771
+ var LINEAR_ROUTING_SKILL_MAX_LENGTH = 5e4;
14772
+ var linearRoutingSkillSchema = z23.union([
14773
+ z23.object({ name: z23.string().min(1), content: z23.string().trim().min(1).max(LINEAR_ROUTING_SKILL_MAX_LENGTH) }),
14774
+ z23.object({ name: z23.string().min(1), repository_id: z23.string().regex(UUID_RE), path: z23.string().min(1) })
14775
+ ]);
14730
14776
 
14731
14777
  // ../shared/src/prompts.ts
14732
14778
  var REPLICAS_INSTRUCTIONS_TAG = "replicas_instructions";
@@ -14746,7 +14792,7 @@ function stripReplicasInstructionBlock(text4) {
14746
14792
  var BOARD_RULES = `- The board, a live status page you keep with \`${REPLICAS_MCP_TOOLS.updateBoard}\` in the Ships pane beside this chat, is the user's one view of the work: keep it covering every ship, pull request, deploy, blocker and ask. Show ships, pull requests and Linear tickets as ship, pr and linear blocks, which stay current on their own, instead of describing their status. Start with sections Needs you, Ready to review, Working, Shipping and Done, and add blocks and buttons whenever they help the user act.
14747
14793
  - 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 put the decision to the user if it needs one.
14748
14794
  - On every ship event, update the board, act with tools if other work waits on it, such as starting the next task once a pull request merges, and end your turn with no text at all. Never write an acknowledgement such as "Noted.", even if earlier turns did.
14749
- - Write in chat only to answer the user, or to ask a decision in a line or two. Put each decision on the board too, as a choice when it has clear options, and ask it in chat once. Never restate the board in chat: no status tables, per-ship lists or summaries of what ships did; link the pull request you mean and leave status to the board.
14795
+ - The chat is like texting an assistant: the user sees only your last message of each turn, never your tool calls or earlier text. Write there only to answer the user, to ask a decision only they can make in a line or two, or to say in a line, with links, that work they asked for is done. Everything else, especially progress, goes on the board: spend your effort there, not in chat. Put each decision on the board too, as a choice when it has clear options, and ask it in chat once. Never restate the board in chat: no status tables, per-ship lists or summaries of what ships did.
14750
14796
  - When the user picks a choice or clicks a button that messages or merges, Replicas removes that item from the board for you. Add it back, or a new item, only if the user is still needed.
14751
14797
  `;
14752
14798
  var MOTHERSHIP_INSTRUCTIONS_BLOCK = new RegExp(`\\s*<${MOTHERSHIP_INSTRUCTIONS_TAG}>\\n([\\s\\S]*?)\\n</${MOTHERSHIP_INSTRUCTIONS_TAG}>`);
@@ -14757,14 +14803,16 @@ function splitMothershipInstructions(customInstructions) {
14757
14803
  mothershipInstructions: match?.[1]
14758
14804
  };
14759
14805
  }
14760
- var SCOUT_ADAPTIVE_SETTINGS_PROMPT = `### Adapting to each channel
14761
- There is no settings page: people change how you behave by telling you, and you suggest a change when it would clearly help. The envelope carries the channel's \`proactivity\` and \`offers\`, the offers you may still make in this channel (${SCOUT_CHANNEL_SETTINGS_OFFERS.map((offer) => `\`${offer}\``).join(", ")}); \`offers=none\` means make none. Offer only what \`offers\` lists, at most one per message. Claim an offer with \`${REPLICAS_MCP_TOOLS.claimSettingsOffer}\` right before posting it, and post it only when the claim succeeds. When someone declines ("no", "it's fine", "leave it"), record it with \`declined: true\` and drop it; never repeat an ignored offer. When they accept, apply it with the settings tools using the accepting message as confirmation, then confirm what changed in one short line.
14762
- - **Frustration.** When someone is clearly annoyed that you replied or acted unasked ("wtf why did replicas respond", "stop", "not you", "nobody asked", or \`event=reaction:\u2026\`, a thumbs-down or similar on a reply you posted unasked), claim \`proactivity\` and post one short apology that offers to lower this channel exactly one step. From Balanced or High, offer Low: "Sorry for jumping in. Want me to only reply here when someone mentions me by name?" From Low, offer Mentions only: "Sorry for jumping in. Want me to only reply here when someone @mentions me?" On a yes, set the level you offered, nothing lower. Do nothing else in that thread. When the claim answers \`offer: organization\`, people were frustrated in several channels, so offer to set every channel's default to \`organization_target\` instead; when \`requester_is_admin\` is false, say an organization admin can change it for every channel and offer this channel. A thumbs-down on a reply someone asked for is about the answer, not about speaking up, so leave it. An explicit "stop replying in this thread" is still a thread mute.
14763
- - **Having to tag you.** \`prior_untagged_ignored=<ts>\` means the untagged message with that \`ts\`, just before this ping in this thread or channel, never reached you: the channel's level or the untagged check held it back. When this ping points back at it ("do the above", "^", "can you do this", "see above", a quote of it, "why didn't you pick this up") and it was a question or request for you, it was really meant for you: do what it asked, then claim \`raise_proactivity\` and end your reply with one line offering to pick up messages like that without a tag next time. Read the message first (\`conversations.replies\` in a thread, \`conversations.history\` at the top level). Make no offer when this ping is its own fresh request, or when that message was chatter or meant for someone else. Offer exactly one step up: from Mentions only, "Want me to pick up messages here that name me, without an @mention? @mention me with your answer."; from Low, "Want me to pick up requests like that here without a tag next time? I can raise this channel to Balanced."; from Balanced, "Want me to jump in on requests like that here without being asked? I can raise this channel to High." When the claim answers \`offer: organization\`, people had to tag you in several channels, so offer to raise every channel's default to \`organization_target\` instead, and say channels with their own level keep it. Mention an admin only when the claim answers \`needs_admin: true\`: then say an organization admin can make that change, and for \`offer: organization\` offer this channel instead. On a yes, raise to that level only.
14764
- - **Channel instructions.** On \`event=joined\` (you were just added to the channel; reply in that envelope's thread), or when you act in a channel for the first time, and the channel's name or purpose points to a clear role (#triage, #bugs, #incidents, #support, #customer-*, a customer's shared channel), claim \`instructions\` and offer one concrete behavior in one line, such as "This looks like an incident channel. Want me to triage new reports here, check for duplicates, and post findings in the thread?" On \`event=joined\` without a clear role, do nothing at all. Make the same kind of offer when you notice you keep handling messages here the same way, or that the channel clearly belongs to a Mothership (offer to send its actionable messages to that Mothership by name). On a yes, save it as the channel's instructions, or as its preset when one fits exactly.
14765
- - **Tip.** When the envelope has \`tip=true\`, this is the first time someone pinged you in this channel, so end the reply you post with one more line: "_Tip: tell me how you want me to act in this channel._" It is shown once per channel, so never add it otherwise.
14766
- - **Slack agent defaults.** To change the agent, model, thinking level, goal mode or fast mode used for tasks started from Slack ("use Codex for Slack tasks"), call \`${REPLICAS_MCP_TOOLS.setSlackAgentDefaults}\`; only an organization admin can.
14767
- - **What can I change?** Read the current settings, then answer with a short list of what applies: how much you speak up here or in every channel (Mentions only, Low, Balanced, High; raising a channel above Mentions only and the every-channel default need an admin), instructions or a preset for this channel, sending this channel's requests to a Mothership, which Linear teams you triage (an admin starts one), and the agent defaults for Slack tasks (admin). Say each one's current value.`;
14806
+ var T = REPLICAS_MCP_TOOLS;
14807
+ var SCOUT_LINEAR_RULES = `Linear issue triage: team instructions define what is actionable. Use \`replicas.linear.graphql\` from \`@replicas/sdk\` for every Linear read and mutation, never a Replicas CLI command. Choose exactly one:
14808
+ 1. **Ignore** issues the team instructions leave to humans or that should not start work: do nothing and write nothing to Linear. If \`agent_session_id\` is set because you asked a question earlier, create a \`response\` Agent Activity on it with one short closing response.
14809
+ 2. **Ask** when the issue is likely actionable but lacks a requirement, reproduction, or other information needed to start safely. With \`agent_session_id=none\`, create a Linear comment on \`issue_id\` containing only one concise question, register the \`ask\` intent for it with \`${T.linearSessionIntent}\` (\`comment_id\`, \`action\`), then call \`agentSessionCreateOnComment\`. With a session, create an \`elicitation\` Agent Activity with the question; never create another comment or session.
14810
+ 3. **Start** when the issue is clear and the team instructions permit work. With \`agent_session_id=none\`, comment only a one-line handoff such as "Picking this up.", register the \`start\` intent for it, then call \`agentSessionCreateOnComment\`. With a session, call \`${T.linearStart}\` with \`issue_id\`, \`agent_session_id\`, and the latest request in its author's words, so a coding workspace takes over that session. Never create a second session or do the work yourself.
14811
+ Check every mutation and tool call succeeded. Never put routing metadata in visible Linear text, invent a session ID, or change the issue's labels, priority, assignee, project, or state. Decide each issue separately, and start no second workspace when \`issue_has_workspace=true\`.`;
14812
+ var SCOUT_MUTED_RULES = `This thread is muted (\`muted=true\`). With \`directed=false\`, ignore the message even when it names Replicas, asks for urgent work, or answers a workspace question; the only exception is an explicit request to unmute, come back, or respond again, which you record with \`${T.setThreadMuted}\` and \`muted: false\` and then triage normally. Never infer an unmute from ordinary conversation. A \`directed=true\` ping may be handled normally, but it does not end the mute. Your own latest \`${T.setThreadMuted}\` call for this thread overrides this flag.`;
14813
+ var SCOUT_PRIOR_UNTAGGED_RULES = `\`prior_untagged_ignored=<ts>\`: the untagged message with that \`ts\`, just before this ping, never reached you. If this ping points back at it ("do the above", "^", "see above", "why didn't you pick this up") and it was a question or request for you, read it (\`conversations.replies\` in a thread, \`conversations.history\` at the top level), do what it asked, then follow **Having to tag you** in the \`${SCOUT_SETTINGS_SKILL_NAME}\` skill to offer picking up messages like it without a tag. Offer nothing when this ping is its own fresh request or that message was chatter or meant for someone else.`;
14814
+ var SCOUT_JOINED_RULES = `\`event=joined\`: you were just added to this channel; reply in this envelope's thread. If the channel's name or purpose points to a clear role (#triage, #bugs, #incidents, #support, #customer-*, a customer's shared channel), follow **Channel instructions** in the \`${SCOUT_SETTINGS_SKILL_NAME}\` skill to offer one concrete behavior. Otherwise do nothing at all.`;
14815
+ var SCOUT_REACTION_RULES = `\`event=reaction:\u2026\`: someone reacted to a message you posted. A thumbs-down or similar on a reply you posted unasked is frustration: follow **Frustration** in the \`${SCOUT_SETTINGS_SKILL_NAME}\` skill. On a reply someone asked for, it is about the answer: leave it. Otherwise do nothing.`;
14768
14816
 
14769
14817
  // ../shared/src/message-origin.ts
14770
14818
  var UUID = UUID_RE.source.slice(1, -1);
@@ -14792,18 +14840,18 @@ var UNKNOWN_EVENT_KIND = "update";
14792
14840
  var MOTHERSHIP_TURN_ERROR_SUMMARY = "Turn ended with an error.";
14793
14841
  var MOTHERSHIP_EVENT_TYPE = "multitask-event";
14794
14842
  var MOTHERSHIP_EVENT_MESSAGE_TYPE = "multitask_event";
14795
- var mothershipEventSchema = z23.object({
14796
- id: z23.string(),
14797
- at: z23.string(),
14798
- kind: z23.enum([...MOTHERSHIP_EVENT_KINDS, UNKNOWN_EVENT_KIND]),
14799
- agentId: z23.string(),
14800
- agentName: z23.string(),
14801
- summary: z23.string(),
14802
- detail: z23.string().optional(),
14843
+ var mothershipEventSchema = z24.object({
14844
+ id: z24.string(),
14845
+ at: z24.string(),
14846
+ kind: z24.enum([...MOTHERSHIP_EVENT_KINDS, UNKNOWN_EVENT_KIND]),
14847
+ agentId: z24.string(),
14848
+ agentName: z24.string(),
14849
+ summary: z24.string(),
14850
+ detail: z24.string().optional(),
14803
14851
  // Set when the subagent is a chat in this workspace rather than a ship; agentId is then that chat's id.
14804
- chatId: z23.string().optional(),
14852
+ chatId: z24.string().optional(),
14805
14853
  // Set on events recorded before every kind woke the orchestrator, which were shown as a row when they happened.
14806
- noticed: z23.boolean().optional()
14854
+ noticed: z24.boolean().optional()
14807
14855
  });
14808
14856
  var TAG = "multitask_event";
14809
14857
  var BLOCK = new RegExp(`<${TAG}((?:\\s+\\w+="[^"]*")*)>\\n?([\\s\\S]*?)\\n?</${TAG}>`, "g");
@@ -15825,7 +15873,7 @@ function subagentChatId(message2) {
15825
15873
  }
15826
15874
 
15827
15875
  // ../shared/src/learned-skills.ts
15828
- import { z as z24 } from "zod";
15876
+ import { z as z25 } from "zod";
15829
15877
 
15830
15878
  // ../shared/src/frontmatter.ts
15831
15879
  import { parse as parseYaml } from "yaml";
@@ -15848,20 +15896,20 @@ function parseFrontmatter(content) {
15848
15896
  var LEARNED_SKILLS_ROOT = `${SANDBOX_PATHS.REPLICAS_DIR}/learned-skills`;
15849
15897
  var LEARNED_SKILLS_MANIFEST_PATH = `${LEARNED_SKILLS_ROOT}/manifest.json`;
15850
15898
  var LEARNED_SKILL_DIR_PREFIX = "replicas-learned__";
15851
- var learnedSkillsManifestSchema = z24.object({
15852
- skills: z24.array(z24.object({ name: z24.string(), sha256: z24.string() }))
15899
+ var learnedSkillsManifestSchema = z25.object({
15900
+ skills: z25.array(z25.object({ name: z25.string(), sha256: z25.string() }))
15853
15901
  });
15854
- var dreamVerdictChecksSchema = z24.object({
15855
- repeatable: z24.boolean(),
15856
- realInstruction: z24.boolean(),
15857
- noContradiction: z24.boolean(),
15858
- formatExact: z24.boolean(),
15859
- humanOnly: z24.boolean(),
15860
- actionable: z24.boolean(),
15861
- durable: z24.boolean()
15902
+ var dreamVerdictChecksSchema = z25.object({
15903
+ repeatable: z25.boolean(),
15904
+ realInstruction: z25.boolean(),
15905
+ noContradiction: z25.boolean(),
15906
+ formatExact: z25.boolean(),
15907
+ humanOnly: z25.boolean(),
15908
+ actionable: z25.boolean(),
15909
+ durable: z25.boolean()
15862
15910
  });
15863
15911
  var DREAM_VERDICT_CHECKS = dreamVerdictChecksSchema.keyof().options;
15864
- var dreamVerdictSchema = dreamVerdictChecksSchema.extend({ approve: z24.boolean(), reason: z24.string() });
15912
+ var dreamVerdictSchema = dreamVerdictChecksSchema.extend({ approve: z25.boolean(), reason: z25.string() });
15865
15913
  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."`;
15866
15914
 
15867
15915
  // ../shared/src/user-message-matching.ts
@@ -16068,6 +16116,10 @@ var REPLICAS_API_STEPS = {
16068
16116
  [REPLICAS_MCP_TOOLS.getBoard]: { icon: "book", live: "Reading board", done: "Read board" },
16069
16117
  [REPLICAS_MCP_TOOLS.updateBoard]: { icon: "file-pen", live: "Updating board", done: "Updated board" }
16070
16118
  };
16119
+ function replicasToolName(message2) {
16120
+ const mcp = parseMcpToolName(message2.tool);
16121
+ return (mcp?.server ?? message2.server) === REPLICAS_MCP_SERVER_NAME ? mcp?.tool ?? message2.tool : message2.tool.startsWith(`${REPLICAS_MCP_SERVER_NAME}_`) ? message2.tool.slice(REPLICAS_MCP_SERVER_NAME.length + 1) : void 0;
16122
+ }
16071
16123
  var INTERNAL_TOOLS = /* @__PURE__ */ new Set(["ToolSearch", "ListAgents", "ListMcpResourcesTool", "ReadMcpResourceTool", "TaskOutput", "BashOutput"]);
16072
16124
  function describeToolCall(message2, base) {
16073
16125
  const { inputObject: input, filePath } = parseToolCallInput(message2.input);
@@ -16090,7 +16142,7 @@ function describeToolCall(message2, base) {
16090
16142
  return { ...base, key, category: "tool", ...SUBAGENT_STEPS[subagentTool], failed, target: agent ? { text: agent, plain: true } : void 0, detail: "subagent" };
16091
16143
  }
16092
16144
  const mcp = parseMcpToolName(tool);
16093
- const replicasTool = (mcp?.server ?? message2.server) === REPLICAS_MCP_SERVER_NAME ? mcp?.tool ?? tool : tool.startsWith(`${REPLICAS_MCP_SERVER_NAME}_`) ? tool.slice(REPLICAS_MCP_SERVER_NAME.length + 1) : void 0;
16145
+ const replicasTool = replicasToolName(message2);
16094
16146
  const mothershipAction = replicasTool ? MOTHERSHIP_TOOL_ACTIONS[replicasTool] : void 0;
16095
16147
  if (mothershipAction) {
16096
16148
  const step = {
@@ -19526,10 +19578,10 @@ function hasChatStarted(chat) {
19526
19578
  }
19527
19579
 
19528
19580
  // ../shared/src/routes/billing.ts
19529
- import { z as z25 } from "zod";
19581
+ import { z as z26 } from "zod";
19530
19582
  var SOURCE_LIMIT_SOURCES = ["limrun", "modal"];
19531
- var usageLimitCentsSchema = z25.number().int().min(100).max(1e8);
19532
- var sourceLimitsCentsSchema = z25.partialRecord(z25.enum(SOURCE_LIMIT_SOURCES), usageLimitCentsSchema);
19583
+ var usageLimitCentsSchema = z26.number().int().min(100).max(1e8);
19584
+ var sourceLimitsCentsSchema = z26.partialRecord(z26.enum(SOURCE_LIMIT_SOURCES), usageLimitCentsSchema);
19533
19585
 
19534
19586
  // ../shared/src/routes/codex.ts
19535
19587
  var CODEX_AUTH_ENV_KEYS = [
@@ -19683,7 +19735,7 @@ var CLAUDE_AUTH_ENV_KEYS_BY_METHOD = {
19683
19735
  };
19684
19736
 
19685
19737
  // ../shared/src/routes/command-protection.ts
19686
- import { z as z26 } from "zod";
19738
+ import { z as z27 } from "zod";
19687
19739
 
19688
19740
  // ../shared/src/git-invocations.ts
19689
19741
  var COMMIT_VALUE_OPTIONS = /* @__PURE__ */ new Set(["message", "file", "trailer", "reuse-message", "reedit-message", "fixup", "squash", "template", "author", "date", "cleanup", "pathspec-from-file"]);
@@ -19774,27 +19826,27 @@ function findCheckoutTarget(args) {
19774
19826
  }
19775
19827
 
19776
19828
  // ../shared/src/routes/command-protection.ts
19777
- var commandProtectionRepoStateSchema = z26.object({
19778
- branch: z26.string().nullable(),
19779
- defaultBranch: z26.string().nullable(),
19780
- pushBranch: z26.string().nullable(),
19781
- pushConfig: z26.string().nullable(),
19782
- headMessage: z26.string().nullable(),
19783
- mergeInProgress: z26.boolean().optional()
19829
+ var commandProtectionRepoStateSchema = z27.object({
19830
+ branch: z27.string().nullable(),
19831
+ defaultBranch: z27.string().nullable(),
19832
+ pushBranch: z27.string().nullable(),
19833
+ pushConfig: z27.string().nullable(),
19834
+ headMessage: z27.string().nullable(),
19835
+ mergeInProgress: z27.boolean().optional()
19784
19836
  });
19785
- var commandProtectionEvaluateRequestSchema = z26.object({
19786
- provider: z26.enum(["claude", "codex", "cursor", "opencode", "pi"]),
19787
- source: z26.enum(["claude_pre_tool_use", "codex_approval_request", "cursor_pre_tool_use", "opencode_pre_tool_use", "pi_tool_call"]),
19788
- toolName: z26.string(),
19789
- toolInput: z26.unknown(),
19790
- command: z26.string().nullish(),
19791
- cwd: z26.string().nullish(),
19792
- toolUseId: z26.string().nullish(),
19837
+ var commandProtectionEvaluateRequestSchema = z27.object({
19838
+ provider: z27.enum(["claude", "codex", "cursor", "opencode", "pi"]),
19839
+ source: z27.enum(["claude_pre_tool_use", "codex_approval_request", "cursor_pre_tool_use", "opencode_pre_tool_use", "pi_tool_call"]),
19840
+ toolName: z27.string(),
19841
+ toolInput: z27.unknown(),
19842
+ command: z27.string().nullish(),
19843
+ cwd: z27.string().nullish(),
19844
+ toolUseId: z27.string().nullish(),
19793
19845
  // Read by the engine before the command runs, keyed by absolute path, so the
19794
19846
  // policy can see branches and commit messages the command text only references.
19795
- gitContext: z26.object({
19796
- repos: z26.record(z26.string(), commandProtectionRepoStateSchema),
19797
- messageFiles: z26.record(z26.string(), z26.string())
19847
+ gitContext: z27.object({
19848
+ repos: z27.record(z27.string(), commandProtectionRepoStateSchema),
19849
+ messageFiles: z27.record(z27.string(), z27.string())
19798
19850
  }).optional()
19799
19851
  });
19800
19852
  var COMMAND_PROTECTION_COMMAND_KEYS = ["command", "cmd", "script", "query", "endpoint", "path", "url", "mutation"];
@@ -20014,105 +20066,110 @@ function shouldRefreshPullRequests(toolName, toolInput) {
20014
20066
  }
20015
20067
 
20016
20068
  // ../shared/src/routes/scout.ts
20017
- import { z as z27 } from "zod";
20069
+ import { z as z28 } from "zod";
20018
20070
  var SCOUT_LINEAR_ACTIONS = ["ask", "start"];
20019
- var scoutLinearSessionIntentRequestSchema = z27.object({
20020
- comment_id: z27.string().trim().min(1).describe("Id of the Linear comment the session will be created on."),
20021
- action: z27.enum(SCOUT_LINEAR_ACTIONS).describe("`ask` when the comment is a clarifying question, `start` when it hands off the task.")
20071
+ var scoutLinearSessionIntentRequestSchema = z28.object({
20072
+ comment_id: z28.string().trim().min(1).describe("Id of the Linear comment the session will be created on."),
20073
+ action: z28.enum(SCOUT_LINEAR_ACTIONS).describe("`ask` when the comment is a clarifying question, `start` when it hands off the task.")
20022
20074
  });
20023
- var scoutLinearStartRequestSchema = z27.object({
20024
- issue_id: z27.string().describe("Linear issue id from the envelope's `issue_id`."),
20025
- agent_session_id: z27.string().describe("Existing Linear agent session id from the envelope's `agent_session_id`."),
20026
- prompt: z27.string().trim().min(1).describe("The latest request, in its author's words. The workspace already receives the issue and its comments.")
20075
+ var scoutLinearStartRequestSchema = z28.object({
20076
+ issue_id: z28.string().describe("Linear issue id from the envelope's `issue_id`."),
20077
+ agent_session_id: z28.string().describe("Existing Linear agent session id from the envelope's `agent_session_id`."),
20078
+ prompt: z28.string().trim().min(1).describe("The latest request, in its author's words. The workspace already receives the issue and its comments.")
20027
20079
  });
20028
- var slackChannelIdSchema = z27.string().describe("Slack channel id from the envelope's `channel_id`.");
20029
- var slackThreadTsSchema = z27.string().describe("Slack thread timestamp from the envelope's `thread_ts`.");
20030
- var scoutSlackSpawnRequestSchema = z27.object({
20080
+ var scoutRouteLinearTicketRequestSchema = z28.object({
20081
+ agent_session_id: z28.string().trim().min(1).describe("The ticket's `agent_session_id` from the envelope."),
20082
+ environment_id: z28.string().trim().min(1).optional().describe("Start the ticket in this environment."),
20083
+ mothership_id: z28.string().trim().min(1).optional().describe("Hand the ticket to this Mothership instead.")
20084
+ }).refine((args) => !(args.environment_id && args.mothership_id), "Pass environment_id or mothership_id, not both.");
20085
+ var slackChannelIdSchema = z28.string().describe("Slack channel id from the envelope's `channel_id`.");
20086
+ var slackThreadTsSchema = z28.string().describe("Slack thread timestamp from the envelope's `thread_ts`.");
20087
+ var scoutSlackSpawnRequestSchema = z28.object({
20031
20088
  channel_id: slackChannelIdSchema,
20032
20089
  thread_ts: slackThreadTsSchema,
20033
- message_ts: z27.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."),
20034
- user_id: z27.string().describe("Slack user id of that message's author (the envelope's `user_id`). The workspace is attributed to them."),
20035
- prompt: z27.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."),
20036
- acknowledgement_ts: z27.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."),
20037
- environment_id: z27.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.`)
20090
+ message_ts: z28.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."),
20091
+ user_id: z28.string().describe("Slack user id of that message's author (the envelope's `user_id`). The workspace is attributed to them."),
20092
+ prompt: z28.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."),
20093
+ acknowledgement_ts: z28.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."),
20094
+ environment_id: z28.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.`)
20038
20095
  });
20039
20096
  var scoutSlackSpawnInNewThreadRequestSchema = scoutSlackSpawnRequestSchema.extend({
20040
- title: z27.string().trim().min(1).max(500).describe("One or two sentences stating the task, posted as the new top-level message."),
20041
- prompt: z27.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."),
20042
- acknowledgement_ts: z27.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.")
20097
+ title: z28.string().trim().min(1).max(500).describe("One or two sentences stating the task, posted as the new top-level message."),
20098
+ prompt: z28.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."),
20099
+ acknowledgement_ts: z28.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.")
20043
20100
  });
20044
- var scoutSlackRelayRequestSchema = z27.object({
20101
+ var scoutSlackRelayRequestSchema = z28.object({
20045
20102
  channel_id: slackChannelIdSchema,
20046
20103
  thread_ts: slackThreadTsSchema,
20047
- message: z27.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."),
20048
- user_id: z27.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`."),
20049
- queue: z27.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."),
20050
- workspace_id: z27.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. A Mothership gets the person's own Slack message and the thread instead of \`message\`. Omit to relay into the thread's own workspace.`),
20051
- message_ts: z27.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.")
20104
+ message: z28.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."),
20105
+ user_id: z28.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`."),
20106
+ queue: z28.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."),
20107
+ workspace_id: z28.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. A Mothership gets the person's own Slack message and the thread instead of \`message\`. Omit to relay into the thread's own workspace.`),
20108
+ message_ts: z28.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.")
20052
20109
  });
20053
- var scoutSlackSetThreadMutedRequestSchema = z27.object({
20110
+ var scoutSlackSetThreadMutedRequestSchema = z28.object({
20054
20111
  channel_id: slackChannelIdSchema,
20055
20112
  thread_ts: slackThreadTsSchema,
20056
- muted: z27.boolean().describe("true to mute Replicas in this thread, false to unmute it.")
20113
+ muted: z28.boolean().describe("true to mute Replicas in this thread, false to unmute it.")
20057
20114
  });
20058
- var scoutListWorkspacesRequestSchema = z27.object({
20115
+ var scoutListWorkspacesRequestSchema = z28.object({
20059
20116
  channel_id: slackChannelIdSchema,
20060
20117
  thread_ts: slackThreadTsSchema,
20061
- message_ts: z27.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
20062
- user_id: z27.string().describe("Slack user id of that message's author (the envelope's `user_id`). Only workspaces they can see are listed."),
20063
- query: z27.string().trim().min(1).optional().describe("Case-insensitive text to match against workspace and Mothership names and pull request URLs.")
20118
+ message_ts: z28.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
20119
+ user_id: z28.string().describe("Slack user id of that message's author (the envelope's `user_id`). Only workspaces they can see are listed."),
20120
+ query: z28.string().trim().min(1).optional().describe("Case-insensitive text to match against workspace and Mothership names and pull request URLs.")
20064
20121
  });
20065
- var scoutSlackConfirmationSchema = z27.object({
20066
- confirmation_channel_id: z27.string().describe("`channel_id` from the envelope of the Slack message that asked for or accepted this."),
20067
- confirmation_thread_ts: z27.string().describe("`thread_ts` from that message's envelope."),
20068
- confirmation_message_ts: z27.string().describe("`message_ts` from that message's envelope."),
20069
- confirmation_user_id: z27.string().describe("`user_id` from that message's envelope.")
20122
+ var scoutSlackConfirmationSchema = z28.object({
20123
+ confirmation_channel_id: z28.string().describe("`channel_id` from the envelope of the Slack message that asked for or accepted this."),
20124
+ confirmation_thread_ts: z28.string().describe("`thread_ts` from that message's envelope."),
20125
+ confirmation_message_ts: z28.string().describe("`message_ts` from that message's envelope."),
20126
+ confirmation_user_id: z28.string().describe("`user_id` from that message's envelope.")
20070
20127
  });
20071
20128
  var scoutAutomationToolInputSchema = automationToolInputSchema.extend(scoutSlackConfirmationSchema.shape);
20072
20129
  var scoutSaveChannelPresetToolInputSchema = scoutSlackConfirmationSchema.extend({
20073
- preset_id: z27.string().optional().describe(`Id of the preset to update, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`. Omit to create a new preset.`),
20074
- name: z27.string().trim().min(1).max(SCOUT_PRESET_NAME_MAX_LENGTH).optional().describe("Preset name. Required when creating."),
20075
- description: z27.string().optional().describe("One-line summary shown in settings."),
20076
- icon: z27.enum(SCOUT_PRESET_ICONS).optional(),
20077
- instructions: z27.string().optional().describe("Complete preset instructions; replaces the existing text. Required when creating.")
20130
+ preset_id: z28.string().optional().describe(`Id of the preset to update, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`. Omit to create a new preset.`),
20131
+ name: z28.string().trim().min(1).max(SCOUT_PRESET_NAME_MAX_LENGTH).optional().describe("Preset name. Required when creating."),
20132
+ description: z28.string().optional().describe("One-line summary shown in settings."),
20133
+ icon: z28.enum(SCOUT_PRESET_ICONS).optional(),
20134
+ instructions: z28.string().optional().describe("Complete preset instructions; replaces the existing text. Required when creating.")
20078
20135
  });
20079
20136
  var scoutUpdateChannelSettingsToolInputSchema = scoutSlackConfirmationSchema.extend({
20080
- source: z27.enum(SCOUT_SOURCE_TYPES).optional().describe("Defaults to `slack`."),
20081
- external_id: z27.string().describe("Slack channel id or Linear team id."),
20082
- monitored: z27.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."),
20083
- preset_id: z27.string().nullable().optional().describe("Preset to assign; `null` removes the preset. Omit to keep it."),
20084
- instructions: z27.string().nullable().optional().describe("Complete channel-specific instructions, applied after the preset; replaces the existing text. `null` clears them. Omit to keep them."),
20085
- proactivity: z27.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."),
20086
- muted: z27.enum(["on", "off", "default"]).optional().describe(`Slack only, organization admins only: \`on\` mutes Replicas in this channel, \`off\` unmutes it here, \`default\` follows the Slack Connect default from \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\`. Omit to keep it.`)
20137
+ source: z28.enum(SCOUT_SOURCE_TYPES).optional().describe("Defaults to `slack`."),
20138
+ external_id: z28.string().describe("Slack channel id or Linear team id."),
20139
+ monitored: z28.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."),
20140
+ preset_id: z28.string().nullable().optional().describe("Preset to assign; `null` removes the preset. Omit to keep it."),
20141
+ instructions: z28.string().nullable().optional().describe("Complete channel-specific instructions, applied after the preset; replaces the existing text. `null` clears them. Omit to keep them."),
20142
+ proactivity: z28.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."),
20143
+ muted: z28.enum(["on", "off", "default"]).optional().describe(`Slack only, organization admins only: \`on\` mutes Replicas in this channel, \`off\` unmutes it here, \`default\` follows the Slack Connect default from \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\`. Omit to keep it.`)
20087
20144
  });
20088
20145
  var scoutSetSlackConnectMutedToolInputSchema = scoutSlackConfirmationSchema.extend({
20089
- muted: z27.boolean().describe("`true` mutes Replicas in every Slack Connect channel without its own setting; `false` lets them follow their levels again.")
20146
+ muted: z28.boolean().describe("`true` mutes Replicas in every Slack Connect channel without its own setting; `false` lets them follow their levels again.")
20090
20147
  });
20091
20148
  var scoutSetSlackConnectDefaultsToolInputSchema = scoutSetSlackConnectMutedToolInputSchema.partial({ muted: true }).extend({
20092
- preset_id: z27.string().optional().describe("Preset for every Slack Connect channel without its own preset or instructions; an empty string removes it. Omit to keep it."),
20093
- instructions: z27.string().optional().describe("Complete default instructions, applied after that preset; replaces the existing text. An empty string clears them. Omit to keep them."),
20094
- proactivity: z27.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.")
20149
+ preset_id: z28.string().optional().describe("Preset for every Slack Connect channel without its own preset or instructions; an empty string removes it. Omit to keep it."),
20150
+ instructions: z28.string().optional().describe("Complete default instructions, applied after that preset; replaces the existing text. An empty string clears them. Omit to keep them."),
20151
+ proactivity: z28.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.")
20095
20152
  });
20096
20153
  var scoutSetOrganizationProactivityToolInputSchema = scoutSlackConfirmationSchema.extend({
20097
- proactivity: z27.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.`)
20154
+ proactivity: z28.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.`)
20098
20155
  });
20099
20156
  var scoutDeleteChannelPresetToolInputSchema = scoutSlackConfirmationSchema.extend({
20100
- preset_id: z27.string().describe(`Id of the preset to delete, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`.`)
20157
+ preset_id: z28.string().describe(`Id of the preset to delete, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`.`)
20101
20158
  });
20102
20159
  var RESET_TO_DEFAULT = "default";
20103
- var resettable = (schema, description) => z27.union([schema, z27.literal(RESET_TO_DEFAULT)]).optional().describe(`${description} \`${RESET_TO_DEFAULT}\` falls back to the organization default. Omit to keep it.`);
20160
+ var resettable = (schema, description) => z28.union([schema, z28.literal(RESET_TO_DEFAULT)]).optional().describe(`${description} \`${RESET_TO_DEFAULT}\` falls back to the organization default. Omit to keep it.`);
20104
20161
  var scoutSetSlackAgentDefaultsToolInputSchema = scoutSlackConfirmationSchema.extend({
20105
- agent_provider: resettable(z27.enum(AGENT), "Agent for Slack-triggered workspaces. Changing it without `model` resets the model to that agent's default."),
20106
- model: resettable(z27.string(), "Model id for that agent; the default is the agent's own."),
20107
- thinking_level: resettable(z27.enum(VALID_THINKING_LEVELS), "Thinking level."),
20108
- goal_mode: resettable(z27.boolean(), "Goal mode."),
20109
- fast_mode: resettable(z27.boolean(), "Fast mode.")
20162
+ agent_provider: resettable(z28.enum(AGENT), "Agent for Slack-triggered workspaces. Changing it without `model` resets the model to that agent's default."),
20163
+ model: resettable(z28.string(), "Model id for that agent; the default is the agent's own."),
20164
+ thinking_level: resettable(z28.enum(VALID_THINKING_LEVELS), "Thinking level."),
20165
+ goal_mode: resettable(z28.boolean(), "Goal mode."),
20166
+ fast_mode: resettable(z28.boolean(), "Fast mode.")
20110
20167
  });
20111
- var scoutClaimSettingsOfferToolInputSchema = z27.object({
20168
+ var scoutClaimSettingsOfferToolInputSchema = z28.object({
20112
20169
  channel_id: slackChannelIdSchema,
20113
- kind: z27.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."),
20114
- user_id: z27.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."),
20115
- declined: z27.boolean().optional().describe("true when the person declined an offer you already made, so it is not made again.")
20170
+ kind: z28.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."),
20171
+ user_id: z28.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."),
20172
+ declined: z28.boolean().optional().describe("true when the person declined an offer you already made, so it is not made again.")
20116
20173
  });
20117
20174
 
20118
20175
  // ../shared/src/routes/plugin-catalog.ts
@@ -20470,22 +20527,22 @@ var PLUGIN_CATALOG = [
20470
20527
  ].map((plugin) => ({ ...plugin, readOnlyScopes: READ_ONLY_SCOPES[plugin.id] }));
20471
20528
 
20472
20529
  // ../shared/src/routes/sentry.ts
20473
- import { z as z28 } from "zod";
20474
- var sentrySelfHostedConnectRequestSchema = z28.object({
20475
- baseUrl: z28.string().min(1),
20476
- token: z28.string().trim().min(1),
20477
- webhookSecret: z28.string().trim().optional()
20530
+ import { z as z29 } from "zod";
20531
+ var sentrySelfHostedConnectRequestSchema = z29.object({
20532
+ baseUrl: z29.string().min(1),
20533
+ token: z29.string().trim().min(1),
20534
+ webhookSecret: z29.string().trim().optional()
20478
20535
  });
20479
20536
 
20480
20537
  // ../shared/src/routes/user.ts
20481
20538
  var PROFILE_AVATAR_MAX_SIZE_BYTES = 5 * 1024 * 1024;
20482
20539
 
20483
20540
  // ../shared/src/routes/web-auth.ts
20484
- import { z as z29 } from "zod";
20485
- var webAuthRedeemResponseSchema = z29.object({
20486
- path: z29.string(),
20487
- organizationId: z29.string().nullable(),
20488
- session: z29.object({ access_token: z29.string(), refresh_token: z29.string(), user: z29.object({ id: z29.string(), email: z29.string() }) }).nullable()
20541
+ import { z as z30 } from "zod";
20542
+ var webAuthRedeemResponseSchema = z30.object({
20543
+ path: z30.string(),
20544
+ organizationId: z30.string().nullable(),
20545
+ session: z30.object({ access_token: z30.string(), refresh_token: z30.string(), user: z30.object({ id: z30.string(), email: z30.string() }) }).nullable()
20489
20546
  });
20490
20547
 
20491
20548
  // ../shared/src/routes/client-state.ts
@@ -20508,81 +20565,81 @@ var promptHistoryClientStateKey = orgUserClientStateKey(PROMPT_HISTORY_CLIENT_ST
20508
20565
  var workspaceSearchOpensClientStateKey = orgUserClientStateKey(WORKSPACE_SEARCH_OPENS_CLIENT_STATE_KEY_PREFIX);
20509
20566
 
20510
20567
  // ../shared/src/routes/workspace-events.ts
20511
- import { z as z30 } from "zod";
20512
- var workspaceTurnCompletionSchema = z30.object({
20513
- workspaceName: z30.string(),
20514
- completedAt: z30.string(),
20515
- processing: z30.boolean().optional(),
20516
- pullRequestFeedback: z30.boolean().optional(),
20517
- attention: z30.object({ reason: z30.enum(CHAT_ATTENTION_REASONS), userId: z30.string() }).optional()
20568
+ import { z as z31 } from "zod";
20569
+ var workspaceTurnCompletionSchema = z31.object({
20570
+ workspaceName: z31.string(),
20571
+ completedAt: z31.string(),
20572
+ processing: z31.boolean().optional(),
20573
+ pullRequestFeedback: z31.boolean().optional(),
20574
+ attention: z31.object({ reason: z31.enum(CHAT_ATTENTION_REASONS), userId: z31.string() }).optional()
20518
20575
  });
20519
- var workspaceChangedEventSchema = z30.discriminatedUnion("type", [
20520
- z30.object({
20521
- type: z30.literal("workspace.changed"),
20522
- workspaceId: z30.string(),
20523
- workspace: z30.object({ status: z30.enum(WORKSPACE_STATUSES), last_activity_at: z30.string().nullable() }).optional(),
20576
+ var workspaceChangedEventSchema = z31.discriminatedUnion("type", [
20577
+ z31.object({
20578
+ type: z31.literal("workspace.changed"),
20579
+ workspaceId: z31.string(),
20580
+ workspace: z31.object({ status: z31.enum(WORKSPACE_STATUSES), last_activity_at: z31.string().nullable() }).optional(),
20524
20581
  completion: workspaceTurnCompletionSchema.optional(),
20525
- ts: z30.string()
20582
+ ts: z31.string()
20526
20583
  }),
20527
- z30.object({
20528
- type: z30.literal("workspace.chat.changed"),
20529
- workspaceId: z30.string(),
20530
- chatId: z30.string(),
20531
- ts: z30.string()
20584
+ z31.object({
20585
+ type: z31.literal("workspace.chat.changed"),
20586
+ workspaceId: z31.string(),
20587
+ chatId: z31.string(),
20588
+ ts: z31.string()
20532
20589
  }),
20533
- z30.object({
20534
- type: z30.literal("workspace.chat.advanced"),
20535
- workspaceId: z30.string(),
20536
- chatId: z30.string(),
20537
- afterCursor: z30.string().optional(),
20538
- processing: z30.boolean(),
20539
- ts: z30.string()
20590
+ z31.object({
20591
+ type: z31.literal("workspace.chat.advanced"),
20592
+ workspaceId: z31.string(),
20593
+ chatId: z31.string(),
20594
+ afterCursor: z31.string().optional(),
20595
+ processing: z31.boolean(),
20596
+ ts: z31.string()
20540
20597
  }),
20541
- z30.object({ type: z30.literal("presence.changed"), ts: z30.string() }),
20542
- z30.object({
20543
- type: z30.literal("mobile-testing.changed"),
20544
- workspaceId: z30.string(),
20545
- ts: z30.string()
20598
+ z31.object({ type: z31.literal("presence.changed"), ts: z31.string() }),
20599
+ z31.object({
20600
+ type: z31.literal("mobile-testing.changed"),
20601
+ workspaceId: z31.string(),
20602
+ ts: z31.string()
20546
20603
  }),
20547
- z30.object({
20548
- type: z30.literal("variable-request.changed"),
20549
- workspaceId: z30.string(),
20550
- ts: z30.string()
20604
+ z31.object({
20605
+ type: z31.literal("variable-request.changed"),
20606
+ workspaceId: z31.string(),
20607
+ ts: z31.string()
20551
20608
  }),
20552
- z30.object({
20553
- type: z30.literal("pull-request.changed"),
20554
- prUrl: z30.string(),
20555
- ts: z30.string()
20609
+ z31.object({
20610
+ type: z31.literal("pull-request.changed"),
20611
+ prUrl: z31.string(),
20612
+ ts: z31.string()
20556
20613
  }),
20557
- z30.object({
20558
- type: z30.literal("mothership.subagent.changed"),
20559
- workspaceId: z30.string(),
20560
- subagent: z30.object({ id: z30.string(), name: z30.string(), prUrl: z30.string().nullable() }),
20561
- ts: z30.string()
20614
+ z31.object({
20615
+ type: z31.literal("mothership.subagent.changed"),
20616
+ workspaceId: z31.string(),
20617
+ subagent: z31.object({ id: z31.string(), name: z31.string(), prUrl: z31.string().nullable() }),
20618
+ ts: z31.string()
20562
20619
  }),
20563
- z30.object({ type: z30.literal("needs-you.changed"), workspaceId: z30.string().nullable(), ts: z30.string() })
20620
+ z31.object({ type: z31.literal("needs-you.changed"), workspaceId: z31.string().nullable(), ts: z31.string() })
20564
20621
  ]);
20565
20622
 
20566
20623
  // ../shared/src/routes/presence.ts
20567
- import { z as z31 } from "zod";
20568
- var presenceStatusSchema = z31.enum(["online", "typing"]);
20569
- var presenceLocationSchema = z31.object({
20570
- workspaceId: z31.string().optional()
20624
+ import { z as z32 } from "zod";
20625
+ var presenceStatusSchema = z32.enum(["online", "typing"]);
20626
+ var presenceLocationSchema = z32.object({
20627
+ workspaceId: z32.string().optional()
20571
20628
  });
20572
- var presenceEntrySchema = z31.object({
20573
- userId: z31.string(),
20629
+ var presenceEntrySchema = z32.object({
20630
+ userId: z32.string(),
20574
20631
  status: presenceStatusSchema,
20575
20632
  location: presenceLocationSchema,
20576
- ts: z31.string()
20633
+ ts: z32.string()
20577
20634
  });
20578
- var updatePresenceRequestSchema = z31.object({
20635
+ var updatePresenceRequestSchema = z32.object({
20579
20636
  status: presenceStatusSchema,
20580
20637
  location: presenceLocationSchema.optional()
20581
20638
  });
20582
20639
 
20583
20640
  // ../shared/src/routes/review-messages.ts
20584
- import { z as z32 } from "zod";
20585
- var sendPullRequestReviewMessageRequestSchema = z32.object({
20641
+ import { z as z33 } from "zod";
20642
+ var sendPullRequestReviewMessageRequestSchema = z33.object({
20586
20643
  ...sendChatMessageRequestSchema.pick({
20587
20644
  message: true,
20588
20645
  messageId: true,
@@ -20595,8 +20652,8 @@ var sendPullRequestReviewMessageRequestSchema = z32.object({
20595
20652
  ultrafastMode: true
20596
20653
  }).shape,
20597
20654
  /** Starts a new chat instead of continuing the PR's review chat. The provider only applies to a new chat. */
20598
- newChat: z32.boolean().optional(),
20599
- provider: z32.enum(VALID_AGENT_PROVIDERS).optional()
20655
+ newChat: z33.boolean().optional(),
20656
+ provider: z33.enum(VALID_AGENT_PROVIDERS).optional()
20600
20657
  });
20601
20658
 
20602
20659
  // ../shared/src/audit-log.ts
@@ -20817,62 +20874,62 @@ function isSkillRegistryManifest(value) {
20817
20874
  }
20818
20875
 
20819
20876
  // ../shared/src/routes/variable-requests.ts
20820
- import { z as z33 } from "zod";
20877
+ import { z as z34 } from "zod";
20821
20878
  var VARIABLE_REQUEST_WAIT = { defaultMs: 10 * 6e4, maxMs: 30 * 6e4, pollMs: 3e3, waiterStaleMs: 15e3 };
20822
20879
  var VARIABLE_REQUEST_DESTINATIONS = ["environment", "workspace"];
20823
- var requestedVariableSchema = z33.object({
20824
- key: z33.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name").max(ENVIRONMENT_SETUP_LIMITS.variableKeyChars),
20825
- required: z33.boolean(),
20826
- replace: z33.boolean().optional()
20880
+ var requestedVariableSchema = z34.object({
20881
+ key: z34.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name").max(ENVIRONMENT_SETUP_LIMITS.variableKeyChars),
20882
+ required: z34.boolean(),
20883
+ replace: z34.boolean().optional()
20827
20884
  });
20828
- var requestedVariablesSchema = z33.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");
20829
- var createVariableRequestSchema = z33.object({
20885
+ var requestedVariablesSchema = z34.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");
20886
+ var createVariableRequestSchema = z34.object({
20830
20887
  variables: requestedVariablesSchema,
20831
- reason: z33.string().trim().max(500).nullish().transform((value) => value || null),
20832
- wait: z33.boolean().default(true)
20888
+ reason: z34.string().trim().max(500).nullish().transform((value) => value || null),
20889
+ wait: z34.boolean().default(true)
20833
20890
  });
20834
- var respondVariableRequestSchema = z33.discriminatedUnion("action", [
20835
- z33.object({
20836
- action: z33.literal("provide"),
20837
- destination: z33.enum(VARIABLE_REQUEST_DESTINATIONS),
20891
+ var respondVariableRequestSchema = z34.discriminatedUnion("action", [
20892
+ z34.object({
20893
+ action: z34.literal("provide"),
20894
+ destination: z34.enum(VARIABLE_REQUEST_DESTINATIONS),
20838
20895
  /** Defaults to the workspace's environment, so older clients keep saving there. */
20839
- environment_ids: z33.array(z33.string().uuid()).optional(),
20840
- overwrite: z33.boolean().optional(),
20841
- values: z33.record(z33.string().regex(VARIABLE_KEY_RE), z33.string())
20896
+ environment_ids: z34.array(z34.string().uuid()).optional(),
20897
+ overwrite: z34.boolean().optional(),
20898
+ values: z34.record(z34.string().regex(VARIABLE_KEY_RE), z34.string())
20842
20899
  }),
20843
- z33.object({ action: z33.literal("skip") })
20900
+ z34.object({ action: z34.literal("skip") })
20844
20901
  ]);
20845
20902
 
20846
20903
  // ../shared/src/mothership-board.ts
20847
- import { z as z34 } from "zod";
20904
+ import { z as z35 } from "zod";
20848
20905
  var MOTHERSHIP_BOARD_TONES = ["neutral", "needs_you", "warning", "success", "danger"];
20849
- var label = (max) => z34.string().trim().min(1).max(max);
20850
- var tone = z34.enum(MOTHERSHIP_BOARD_TONES);
20851
- var blockId = z34.string().regex(/^[\w.:-]{1,64}$/, "Use 1-64 letters, digits, _, -, . or :");
20852
- var httpsUrl = z34.url({ protocol: /^https$/, error: "Must be an https URL" });
20906
+ var label = (max) => z35.string().trim().min(1).max(max);
20907
+ var tone = z35.enum(MOTHERSHIP_BOARD_TONES);
20908
+ var blockId = z35.string().regex(/^[\w.:-]{1,64}$/, "Use 1-64 letters, digits, _, -, . or :");
20909
+ var httpsUrl = z35.url({ protocol: /^https$/, error: "Must be an https URL" });
20853
20910
  var prUrl = httpsUrl.refine((url) => parseCodeHostPrUrl(url) !== null, "Must be a GitHub pull request or GitLab merge request URL");
20854
- var linearIdentifier = z34.string().regex(/^[A-Za-z][A-Za-z0-9]{0,9}-\d{1,7}$/, "Use a Linear identifier such as REP-123");
20855
- var action = z34.discriminatedUnion("type", [
20856
- z34.object({ type: z34.literal("open_ship"), workspace_id: z34.uuid() }),
20857
- z34.object({ type: z34.literal("message_ship"), workspace_id: z34.uuid(), message: label(4e3) }),
20858
- z34.object({ type: z34.literal("open_pr"), url: prUrl }),
20859
- z34.object({ type: z34.literal("merge_pr"), url: prUrl }),
20860
- z34.object({ type: z34.literal("message_mothership"), message: label(4e3) }),
20861
- z34.object({ type: z34.literal("open_link"), url: httpsUrl })
20911
+ var linearIdentifier = z35.string().regex(/^[A-Za-z][A-Za-z0-9]{0,9}-\d{1,7}$/, "Use a Linear identifier such as REP-123");
20912
+ var action = z35.discriminatedUnion("type", [
20913
+ z35.object({ type: z35.literal("open_ship"), workspace_id: z35.uuid() }),
20914
+ z35.object({ type: z35.literal("message_ship"), workspace_id: z35.uuid(), message: label(4e3) }),
20915
+ z35.object({ type: z35.literal("open_pr"), url: prUrl }),
20916
+ z35.object({ type: z35.literal("merge_pr"), url: prUrl }),
20917
+ z35.object({ type: z35.literal("message_mothership"), message: label(4e3) }),
20918
+ z35.object({ type: z35.literal("open_link"), url: httpsUrl })
20862
20919
  ]);
20863
- var text3 = z34.object({ type: z34.literal("text"), id: blockId.optional(), text: label(2e3) });
20864
- var badge = z34.object({ type: z34.literal("badge"), id: blockId.optional(), label: label(40), tone: tone.optional() });
20865
- var pr = z34.object({ type: z34.literal("pr"), id: blockId.optional(), url: prUrl });
20866
- var ship = z34.object({ type: z34.literal("ship"), id: blockId.optional(), workspace_id: z34.uuid() });
20867
- var linear = z34.object({ type: z34.literal("linear"), id: blockId.optional(), identifier: linearIdentifier });
20868
- var button = z34.object({ type: z34.literal("button"), id: blockId.optional(), label: label(60), action, variant: z34.enum(["primary", "outline", "warning", "destructive"]).optional(), resolves: blockId.optional() });
20869
- var steps = z34.object({
20870
- type: z34.literal("steps"),
20920
+ var text3 = z35.object({ type: z35.literal("text"), id: blockId.optional(), text: label(2e3) });
20921
+ var badge = z35.object({ type: z35.literal("badge"), id: blockId.optional(), label: label(40), tone: tone.optional() });
20922
+ var pr = z35.object({ type: z35.literal("pr"), id: blockId.optional(), url: prUrl });
20923
+ var ship = z35.object({ type: z35.literal("ship"), id: blockId.optional(), workspace_id: z35.uuid() });
20924
+ var linear = z35.object({ type: z35.literal("linear"), id: blockId.optional(), identifier: linearIdentifier });
20925
+ var button = z35.object({ type: z35.literal("button"), id: blockId.optional(), label: label(60), action, variant: z35.enum(["primary", "outline", "warning", "destructive"]).optional(), resolves: blockId.optional() });
20926
+ var steps = z35.object({
20927
+ type: z35.literal("steps"),
20871
20928
  id: blockId.optional(),
20872
- steps: z34.array(z34.object({ label: label(30), state: z34.enum(["done", "current", "pending", "failed"]) })).min(1).max(8)
20929
+ steps: z35.array(z35.object({ label: label(30), state: z35.enum(["done", "current", "pending", "failed"]) })).min(1).max(8)
20873
20930
  });
20874
- var inline = z34.discriminatedUnion("type", [text3, badge, pr, ship, linear, button, steps]);
20875
- var row = z34.object({ type: z34.literal("row"), id: blockId.optional(), cells: z34.array(z34.union([label(500), inline])).min(1).max(6) });
20931
+ var inline = z35.discriminatedUnion("type", [text3, badge, pr, ship, linear, button, steps]);
20932
+ var row = z35.object({ type: z35.literal("row"), id: blockId.optional(), cells: z35.array(z35.union([label(500), inline])).min(1).max(6) });
20876
20933
  var blockTypes = {
20877
20934
  text: text3,
20878
20935
  badge,
@@ -20881,49 +20938,50 @@ var blockTypes = {
20881
20938
  linear,
20882
20939
  button,
20883
20940
  steps,
20884
- stat: z34.object({ type: z34.literal("stat"), id: blockId.optional(), label: label(40), value: label(40), tone: tone.optional() }),
20885
- divider: z34.object({ type: z34.literal("divider"), id: blockId.optional() }),
20886
- updated_at: z34.object({ type: z34.literal("updated_at"), id: blockId.optional() }),
20887
- choice: z34.object({
20888
- type: z34.literal("choice"),
20941
+ stat: z35.object({ type: z35.literal("stat"), id: blockId.optional(), label: label(40), value: label(40), tone: tone.optional() }),
20942
+ divider: z35.object({ type: z35.literal("divider"), id: blockId.optional() }),
20943
+ updated_at: z35.object({ type: z35.literal("updated_at"), id: blockId.optional() }),
20944
+ choice: z35.object({
20945
+ type: z35.literal("choice"),
20889
20946
  id: blockId.optional(),
20890
20947
  question: label(500),
20891
- options: z34.array(z34.object({ label: label(60), message: label(2e3).optional() })).min(2).max(6),
20948
+ options: z35.array(z35.object({ label: label(60), message: label(2e3).optional() })).min(2).max(6),
20892
20949
  resolves: blockId.optional()
20893
20950
  }),
20894
- button_group: z34.object({ type: z34.literal("button_group"), id: blockId.optional(), children: z34.array(button).min(1).max(8) }),
20895
- table: z34.object({ type: z34.literal("table"), id: blockId.optional(), columns: z34.array(label(40)).min(1).max(6), children: z34.array(row).max(100) }),
20896
- callout: z34.object({
20897
- type: z34.literal("callout"),
20951
+ button_group: z35.object({ type: z35.literal("button_group"), id: blockId.optional(), children: z35.array(button).min(1).max(8) }),
20952
+ table: z35.object({ type: z35.literal("table"), id: blockId.optional(), columns: z35.array(label(40)).min(1).max(6), children: z35.array(row).max(100) }),
20953
+ callout: z35.object({
20954
+ type: z35.literal("callout"),
20898
20955
  id: blockId.optional(),
20899
20956
  tone,
20900
20957
  title: label(120).optional(),
20901
20958
  get children() {
20902
- return z34.array(block).max(20).optional();
20959
+ return z35.array(block).max(20).optional();
20903
20960
  }
20904
20961
  }),
20905
- list: z34.object({
20906
- type: z34.literal("list"),
20962
+ list: z35.object({
20963
+ type: z35.literal("list"),
20907
20964
  id: blockId.optional(),
20908
- ordered: z34.boolean().optional(),
20965
+ ordered: z35.boolean().optional(),
20909
20966
  get children() {
20910
- return z34.array(block).max(100);
20967
+ return z35.array(block).max(100);
20911
20968
  }
20912
20969
  }),
20913
- section: z34.object({
20914
- type: z34.literal("section"),
20970
+ section: z35.object({
20971
+ type: z35.literal("section"),
20915
20972
  id: blockId.optional(),
20916
20973
  title: label(120),
20917
- collapsed: z34.boolean().optional(),
20974
+ tone: tone.optional(),
20975
+ collapsed: z35.boolean().optional(),
20918
20976
  get children() {
20919
- return z34.array(block).max(100);
20977
+ return z35.array(block).max(100);
20920
20978
  }
20921
20979
  })
20922
20980
  };
20923
20981
  var blockSchemas = [text3, ...Object.values(blockTypes).filter((schema) => schema !== text3)];
20924
- var block = z34.discriminatedUnion("type", blockSchemas);
20982
+ var block = z35.discriminatedUnion("type", blockSchemas);
20925
20983
  var MOTHERSHIP_BOARD_CONTAINER_TYPES = Object.entries(blockTypes).filter(([, schema]) => "children" in schema.shape).map(([type]) => type);
20926
- var mothershipBoardBlocksSchema = z34.array(block).max(100).superRefine((blocks, ctx) => {
20984
+ var mothershipBoardBlocksSchema = z35.array(block).max(100).superRefine((blocks, ctx) => {
20927
20985
  const seen = /* @__PURE__ */ new Set();
20928
20986
  const visit = (node, path) => {
20929
20987
  if (typeof node === "string") return;
@@ -20941,19 +20999,19 @@ var mothershipBoardBlocksSchema = z34.array(block).max(100).superRefine((blocks,
20941
20999
  };
20942
21000
  blocks.forEach((node, index) => visit(node, [index]));
20943
21001
  });
20944
- var mothershipBoardOperationsSchema = z34.array(z34.discriminatedUnion("op", [
20945
- z34.object({ op: z34.literal("replace"), blocks: z34.array(block) }),
20946
- z34.object({
20947
- op: z34.literal("upsert"),
20948
- block: z34.discriminatedUnion("type", [row, ...blockSchemas]).refine((value) => Boolean(value.id), { message: "Give the block an id", path: ["id"] }),
21002
+ var mothershipBoardOperationsSchema = z35.array(z35.discriminatedUnion("op", [
21003
+ z35.object({ op: z35.literal("replace"), blocks: z35.array(block) }),
21004
+ z35.object({
21005
+ op: z35.literal("upsert"),
21006
+ block: z35.discriminatedUnion("type", [row, ...blockSchemas]).refine((value) => Boolean(value.id), { message: "Give the block an id", path: ["id"] }),
20949
21007
  parent_id: blockId.optional(),
20950
- position: z34.number().int().min(0).optional()
21008
+ position: z35.number().int().min(0).optional()
20951
21009
  }),
20952
- z34.object({ op: z34.literal("remove"), id: blockId })
21010
+ z35.object({ op: z35.literal("remove"), id: blockId })
20953
21011
  ])).min(1).max(50);
20954
- var mothershipBoardItemRefSchema = z34.object({ mothershipId: z34.uuid(), block, occurrence: z34.number().int().min(0).optional() });
21012
+ var mothershipBoardItemRefSchema = z35.object({ mothershipId: z35.uuid(), block, occurrence: z35.number().int().min(0).optional() });
20955
21013
  var LINEAR_ISSUE_SUMMARIES_MAX = 50;
20956
- var linearIssueSummariesRequestSchema = z34.object({ identifiers: z34.array(linearIdentifier).min(1).max(LINEAR_ISSUE_SUMMARIES_MAX) });
21014
+ var linearIssueSummariesRequestSchema = z35.object({ identifiers: z35.array(linearIdentifier).min(1).max(LINEAR_ISSUE_SUMMARIES_MAX) });
20957
21015
 
20958
21016
  export {
20959
21017
  ENGINE_SEND_MESSAGE_FAILED_ERROR,
@@ -21132,6 +21190,8 @@ export {
21132
21190
  SUBAGENT_SERVICE_TIERS,
21133
21191
  serviceTierRequestFields,
21134
21192
  TERMINAL_RTC_ICE_SERVER,
21193
+ REPLICAS_MCP_SERVER_NAME,
21194
+ REPLICAS_MCP_TOOLS,
21135
21195
  REPLICAS_RUNTIME_ENV_ALIASES,
21136
21196
  readReplicasRuntimeEnv,
21137
21197
  shellQuotePosix,