replicas-engine 0.1.1647 → 0.1.1648
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/{asp-host-DBZDHCDP.js → asp-host-NO4FOM6R.js} +5 -5
- package/dist/src/{chunk-HS37HR3Y.js → chunk-7C3DRMXV.js} +2 -2
- package/dist/src/{chunk-S6QASG4F.js → chunk-FTRMFS7H.js} +94 -93
- package/dist/src/{chunk-7OEYIAU6.js → chunk-HJZBM6QV.js} +1 -1
- package/dist/src/{chunk-N46WPOAF.js → chunk-JW2PDEIB.js} +2 -2
- package/dist/src/{chunk-N7USG767.js → chunk-LPBDUZ6Y.js} +2 -2
- package/dist/src/{chunk-XQLIIUAU.js → chunk-QRBXVNQF.js} +10 -10
- package/dist/src/{chunk-A675JLJN.js → chunk-RM2JP7QY.js} +1 -1
- package/dist/src/{chunk-HXVDRUY3.js → chunk-UYI2EV26.js} +3 -3
- package/dist/src/command-protection-hook.js +4 -4
- package/dist/src/headless-agent.js +4 -4
- package/dist/src/index.js +24 -24
- package/dist/src/post-tool-pr-hook.js +2 -2
- package/dist/src/subagent-mcp.js +1 -1
- package/package.json +1 -1
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
listCodexModelsForDetails,
|
|
9
9
|
restartCodexAspHost,
|
|
10
10
|
restartCodexAspHostIfRunning
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-QRBXVNQF.js";
|
|
12
|
+
import "./chunk-LPBDUZ6Y.js";
|
|
13
|
+
import "./chunk-UYI2EV26.js";
|
|
14
|
+
import "./chunk-HJZBM6QV.js";
|
|
15
15
|
import "./chunk-UZSNFLDQ.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-FTRMFS7H.js";
|
|
17
17
|
import "./chunk-VEQXQN22.js";
|
|
18
18
|
export {
|
|
19
19
|
CODEX_ULTRAFAST_SERVICE_TIER,
|
|
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
AspClient
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-UYI2EV26.js";
|
|
7
7
|
import {
|
|
8
8
|
ASTER_BASE_URL,
|
|
9
9
|
ASTER_PROVIDER,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
isRecord,
|
|
16
16
|
readOllamaAuthEnv,
|
|
17
17
|
readOpenAICompatibleAuthEnv
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-FTRMFS7H.js";
|
|
19
19
|
|
|
20
20
|
// src/managers/codex-asp/notification-dispatch.ts
|
|
21
21
|
var TURN_STARTED_METHOD = "turn/started";
|
|
@@ -9326,7 +9326,7 @@ function createErrorResult(error) {
|
|
|
9326
9326
|
};
|
|
9327
9327
|
}
|
|
9328
9328
|
|
|
9329
|
-
// ../shared/src/routes/
|
|
9329
|
+
// ../shared/src/routes/manager.ts
|
|
9330
9330
|
import { z as z4 } from "zod";
|
|
9331
9331
|
|
|
9332
9332
|
// ../shared/src/routes/pull-requests.ts
|
|
@@ -9667,9 +9667,9 @@ var THEME_INKS = [...Object.values(PALETTE_COLORS.dark).map((palette) => palette
|
|
|
9667
9667
|
var themeAvatarTile = (ink, primary) => mix(ink, primary, 0.15);
|
|
9668
9668
|
var THEME_TILES = THEME_INKS.flatMap((ink) => THEME_PRIMARIES.map((primary) => themeAvatarTile(ink, primary)));
|
|
9669
9669
|
|
|
9670
|
-
// ../shared/src/routes/
|
|
9670
|
+
// ../shared/src/routes/manager.ts
|
|
9671
9671
|
var avatarColorSchema = z4.union([z4.literal("theme"), z4.string().regex(/^#[0-9a-f]{6}$/i)]);
|
|
9672
|
-
var
|
|
9672
|
+
var MANAGER_AVATAR_BACKGROUNDS = [
|
|
9673
9673
|
["Forest", PALETTE_COLORS.light.default.foreground],
|
|
9674
9674
|
["Black", PALETTE_COLORS.dark.default.background],
|
|
9675
9675
|
["Graphite", PALETTE_COLORS.dark.default.selected],
|
|
@@ -9681,7 +9681,7 @@ var MOTHERSHIP_AVATAR_BACKGROUNDS = [
|
|
|
9681
9681
|
["Sage", PALETTE_COLORS.light.default.muted],
|
|
9682
9682
|
["White", DESIGN_COLORS.light.white]
|
|
9683
9683
|
];
|
|
9684
|
-
var
|
|
9684
|
+
var MANAGER_AVATAR_PRIMARIES = [
|
|
9685
9685
|
["Green", ACCENT_COLORS.green.dark.primary],
|
|
9686
9686
|
["Blue", ACCENT_COLORS.blue.dark.primary],
|
|
9687
9687
|
["Purple", ACCENT_COLORS.purple.dark.primary],
|
|
@@ -9695,31 +9695,31 @@ var MOTHERSHIP_AVATAR_PRIMARIES = [
|
|
|
9695
9695
|
["Deep pink", ACCENT_COLORS.pink.light.primaryText],
|
|
9696
9696
|
["Ink", PALETTE_COLORS.light.default.foreground]
|
|
9697
9697
|
];
|
|
9698
|
-
var
|
|
9698
|
+
var managerPresetAvatarSchema = z4.object({
|
|
9699
9699
|
kind: z4.literal("preset"),
|
|
9700
9700
|
role: z4.enum(PIXEL_CREW_ROLE_NAMES),
|
|
9701
9701
|
primary: avatarColorSchema,
|
|
9702
9702
|
background: avatarColorSchema
|
|
9703
9703
|
});
|
|
9704
|
-
var
|
|
9704
|
+
var managerEmojiAvatarSchema = z4.object({
|
|
9705
9705
|
kind: z4.literal("emoji"),
|
|
9706
9706
|
emoji: z4.string().trim().min(1).max(32),
|
|
9707
9707
|
background: avatarColorSchema
|
|
9708
9708
|
});
|
|
9709
|
-
var
|
|
9710
|
-
var
|
|
9709
|
+
var managerChosenAvatarSchema = z4.discriminatedUnion("kind", [managerPresetAvatarSchema, managerEmojiAvatarSchema]);
|
|
9710
|
+
var setUpManagerTextingRequestSchema = z4.object({ line: z4.string().optional() });
|
|
9711
9711
|
var linearRuleFields = linearIssueFiltersSchema.extend({ team_id: z4.string().min(1) }).strict();
|
|
9712
9712
|
var withLabelIds = (value) => {
|
|
9713
9713
|
if (!isRecord(value) || typeof value.label_id !== "string") return value;
|
|
9714
9714
|
const { label_id, ...rest } = value;
|
|
9715
9715
|
return { ...rest, label_ids: [label_id] };
|
|
9716
9716
|
};
|
|
9717
|
-
var
|
|
9717
|
+
var managerLinearRuleSchema = z4.preprocess(withLabelIds, linearRuleFields);
|
|
9718
9718
|
var SUBAGENT_SERVICE_TIERS = ["default", "fast", "ultrafast"];
|
|
9719
9719
|
function serviceTierRequestFields(tier) {
|
|
9720
9720
|
return { fastMode: tier !== "default", ...tier === "ultrafast" ? { ultrafastMode: true } : {} };
|
|
9721
9721
|
}
|
|
9722
|
-
var
|
|
9722
|
+
var managerSubagentSettingsSchema = z4.object({
|
|
9723
9723
|
coding_agent: z4.enum(VALID_AGENT_PROVIDERS),
|
|
9724
9724
|
model: z4.string().nullable(),
|
|
9725
9725
|
thinking_level: z4.enum(VALID_THINKING_LEVELS).nullable(),
|
|
@@ -9732,8 +9732,8 @@ var QUEUE_SECTIONS = [
|
|
|
9732
9732
|
{ label: "Working", groups: ["working"] },
|
|
9733
9733
|
{ label: "Shipping", groups: ["shipping"] }
|
|
9734
9734
|
];
|
|
9735
|
-
var
|
|
9736
|
-
var
|
|
9735
|
+
var MANAGER_QUEUE_GROUPS = QUEUE_SECTIONS.flatMap((section) => section.groups);
|
|
9736
|
+
var MANAGER_SHIPPING_LOOKBACK_MS = 3 * 24 * 60 * 6e4;
|
|
9737
9737
|
|
|
9738
9738
|
// ../shared/src/models-dev.ts
|
|
9739
9739
|
import { z as z5 } from "zod";
|
|
@@ -12325,7 +12325,7 @@ var WORKSPACE_SEARCH_INDEX_PARAMS = {
|
|
|
12325
12325
|
viewModes: [...WORKSPACE_SIDEBAR_VIEWS].sort().join(","),
|
|
12326
12326
|
archived: "include",
|
|
12327
12327
|
excludeScout: "true",
|
|
12328
|
-
|
|
12328
|
+
excludeManagerShips: "true",
|
|
12329
12329
|
excludeAutomationRuns: "true",
|
|
12330
12330
|
page: 1,
|
|
12331
12331
|
limit: 1e3
|
|
@@ -12481,7 +12481,7 @@ var reorderCredentialPoolSchema = z21.object({
|
|
|
12481
12481
|
credential_ids: z21.array(z21.string().uuid()).min(1).max(MAX_CREDENTIAL_POOL_ACCOUNTS)
|
|
12482
12482
|
});
|
|
12483
12483
|
|
|
12484
|
-
// ../shared/src/
|
|
12484
|
+
// ../shared/src/manager-events.ts
|
|
12485
12485
|
import { z as z28 } from "zod";
|
|
12486
12486
|
|
|
12487
12487
|
// ../shared/src/provider-icons.ts
|
|
@@ -14487,7 +14487,7 @@ In agent mode the CLI hides commands that don't make sense for in-workspace agen
|
|
|
14487
14487
|
| --- | --- |
|
|
14488
14488
|
| \`replicas whoami\` | Print the workspace + org identity |
|
|
14489
14489
|
| \`replicas create <name> -e <env> -a <agent> -m "<prompt>"\` | Start a new workspace with its own agent (see *Starting a new workspace*) |
|
|
14490
|
-
| \`replicas get <id>\` / \`replicas list\` | Check a workspace's status, or find workspaces. \`replicas list --kind mothership\` lists only
|
|
14490
|
+
| \`replicas get <id>\` / \`replicas list\` | Check a workspace's status, or find workspaces. \`replicas list --kind mothership\` lists only Managers |
|
|
14491
14491
|
| \`replicas identity token [--audience <aud>]\` | Print the current short-lived workspace identity token for an audience |
|
|
14492
14492
|
| \`replicas identity token --format gcp --audience <aud>\` | Supply a current token to Google's executable credential source |
|
|
14493
14493
|
| \`replicas identity aws-credentials --role-arn <arn> [--region <region>] [--source-identity]\` | Exchange the current token for AWS credential_process JSON (requires AWS CLI); \`--source-identity\` records the workspace ID in CloudTrail and needs \`sts:SetSourceIdentity\` in the role trust policy |
|
|
@@ -15883,11 +15883,11 @@ There is no settings page: people change how Replicas behaves by asking you, and
|
|
|
15883
15883
|
| Stay quiet in this thread, or come back | \`${REPLICAS_MCP_TOOLS.setThreadMuted}\` | Anyone in the thread |
|
|
15884
15884
|
| A recurring task ("every Monday, summarize open PRs in #eng") | \`${REPLICAS_MCP_TOOLS.createAutomation}\` (see Automations) | Members who can create automations |
|
|
15885
15885
|
|
|
15886
|
-
You also answer questions, start a workspace for a task (in a separate thread when asked), relay follow-ups to a thread's workspace, stop it, hand a thread to a
|
|
15886
|
+
You also answer questions, start a workspace for a task (in a separate thread when asked), relay follow-ups to a thread's workspace, stop it, hand a thread to a Manager by name, and file Linear tickets with \`replicas.linear.graphql\`. Spawn for a one-time reminder ("remind me tomorrow at 9"): workspaces can schedule one-time runs.
|
|
15887
15887
|
|
|
15888
15888
|
A person's own defaults (agent, model, environment) and the organization's general defaults are changed in the Replicas app, not by you; Slack tasks use them unless the Slack agent defaults above say otherwise.
|
|
15889
15889
|
|
|
15890
|
-
You can't add yourself to or remove yourself from a channel: people type \`/invite @Replicas\` or \`/remove @Replicas\` there, and an admin can pick channels under Integrations, Slack, Configure. To keep you in a channel but out of the way, lower it to Mentions only or put it in silent mode. A channel becomes a
|
|
15890
|
+
You can't add yourself to or remove yourself from a channel: people type \`/invite @Replicas\` or \`/remove @Replicas\` there, and an admin can pick channels under Integrations, Slack, Configure. To keep you in a channel but out of the way, lower it to Mentions only or put it in silent mode. A channel becomes a Manager's own channel from that Manager, not here; any channel's instructions can still send its messages to a Manager.
|
|
15891
15891
|
|
|
15892
15892
|
## Tools
|
|
15893
15893
|
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 naming who asked. For a Slack message, fill them with its envelope \`channel_id\`, \`thread_ts\`, \`message_ts\`, and \`user_id\`. A message from a person in the Replicas dashboard has no \`[Slack]\` envelope and carries a \`confirmation_dashboard_token\`: pass only that, never one from another message, and answer in the chat. The server checks that the person who asked is an organization member (and an admin where noted). If it refuses, say why briefly and change nothing.
|
|
@@ -15900,9 +15900,9 @@ Read presets, channel instructions, and levels with \`${REPLICAS_MCP_TOOLS.listC
|
|
|
15900
15900
|
- **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.
|
|
15901
15901
|
- **Silent mode** is what people mean by muting you in a channel. A channel in silent mode still reaches you as its level allows, and you follow its instructions anywhere but there. For "watch #alerts and report to #team", an admin turns on \`silent\` for the watched channel, raises it to Balanced or High so untagged messages reach you, and its instructions name where to report. It is separate from a thread mute, which lasts hours and only quiets one thread.
|
|
15902
15902
|
- **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.
|
|
15903
|
-
- **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
|
|
15903
|
+
- **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 Manager 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 ask you to raise its level.
|
|
15904
15904
|
- **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).
|
|
15905
|
-
- **"What can you do?"** Keep it short: one line on what you do (answer questions, start a workspace for a task, hand work to a
|
|
15905
|
+
- **"What can you do?"** Keep it short: one line on what you do (answer questions, start a workspace for a task, hand work to a Manager, file Linear tickets, set up recurring tasks), two or three example requests in backticks drawn from both work and behavior (like \`fix the flaky login test\`, \`only reply here when tagged\`, \`every Monday, summarize open PRs\`), then "Ask me what you can change here to see every setting." No settings list or current values.
|
|
15906
15906
|
- **"What can I change?"** Read the current settings, then reply in a few short lines from **What you can do**: what applies here with its current value (this channel's level, silent mode, instructions or preset), then what applies everywhere (the every-channel level, shared-channel defaults, Linear teams, Slack agent defaults), marking what needs an admin. Give one example phrasing, like "only reply here when tagged".
|
|
15907
15907
|
- 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.
|
|
15908
15908
|
|
|
@@ -15910,7 +15910,7 @@ Read presets, channel instructions, and levels with \`${REPLICAS_MCP_TOOLS.listC
|
|
|
15910
15910
|
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.
|
|
15911
15911
|
- **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.
|
|
15912
15912
|
- **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.
|
|
15913
|
-
- **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
|
|
15913
|
+
- **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 Manager (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.
|
|
15914
15914
|
|
|
15915
15915
|
## Automations
|
|
15916
15916
|
When someone asks for a recurring task or 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 envelope of the message that asked or accepted. 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.
|
|
@@ -15918,7 +15918,7 @@ When someone asks for a recurring task or accepts an offer to automate a repeate
|
|
|
15918
15918
|
|
|
15919
15919
|
// ../shared/src/prompts.ts
|
|
15920
15920
|
var REPLICAS_INSTRUCTIONS_TAG = "replicas_instructions";
|
|
15921
|
-
var
|
|
15921
|
+
var MANAGER_INSTRUCTIONS_TAG = "multitask_instructions";
|
|
15922
15922
|
function wrapInTag(content, tag) {
|
|
15923
15923
|
return `<${tag}>
|
|
15924
15924
|
${content}
|
|
@@ -16015,10 +16015,10 @@ function stripAgentInstructionBlocks(text4) {
|
|
|
16015
16015
|
else spans(prose, text4.length);
|
|
16016
16016
|
return stripInstructionBlocksOutside(text4, quoted);
|
|
16017
16017
|
}
|
|
16018
|
-
var
|
|
16018
|
+
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.`;
|
|
16019
16019
|
var BOARD_ANSWER_NOTE = "The user answered on the board.";
|
|
16020
16020
|
var BOARD_RULES = `- The board in the Ships pane beside this chat is the user's one view of the work. Each task the user asks for is one ticket, with only that task's pull requests. Spawning a ship creates its ticket from the \`title\` and \`task\` you pass. A ship works on one ticket at a time: when you give an existing ship a new, separate task with \`${REPLICAS_MCP_TOOLS.messageSubagent}\`, pass \`title\` so the task gets its own ticket. Pull requests are filed under the ticket their ship was on when it opened them; move one with \`pull_requests\` in \`${REPLICAS_MCP_TOOLS.updateBoard}\` only when that's wrong. Replicas files tickets under Needs you, Ready to review, Working or Done from the ship and the ticket's pull requests. Never restate what a ticket or pull request already shows.
|
|
16021
|
-
- A title says what the task is about, such as "Slack replies in
|
|
16021
|
+
- A title says what the task is about, such as "Slack replies in Manager channels get dropped", never a ship, branch or pull request name. Each ticket also has an issue summary (what was wrong or asked, with its evidence) and a fix summary (what was done, with pull requests as #number). Replicas writes all three from the task, the ship's reports and its pull requests, and ships add to them with \`${REPLICAS_MCP_TOOLS.updateTicket}\`. Correct one with \`${REPLICAS_MCP_TOOLS.updateBoard}\` only when it's wrong.
|
|
16022
16022
|
- You keep the board organized with \`${REPLICAS_MCP_TOOLS.updateBoard}\`: the order of tickets, most important first; one short note per ticket when it adds something the ticket doesn't say, such as "Merge after #12" or "Waiting on REP-40"; and one overview line at the top on where the work as a whole stands. Archive tickets the user no longer needs. When a ship continues another ship's task, pass that ticket's id as \`ticket\` to \`${REPLICAS_MCP_TOOLS.spawnSubagent}\` instead of making a new one.
|
|
16023
16023
|
- 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.
|
|
16024
16024
|
- 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.
|
|
@@ -16026,16 +16026,16 @@ var BOARD_RULES = `- The board in the Ships pane beside this chat is the user's
|
|
|
16026
16026
|
- On every ship event and every answer the user gives on the board, act with tools on the answer or on any work the event unblocks, such as starting the next task once a pull request merges, and update the board if its order, notes or overview changed. The user sees nothing you write in these turns, unless a message they typed is still unanswered because it arrived during the turn: then your final reply answers it, as in any turn they start. Otherwise the only way to reach them is \`${REPLICAS_MCP_TOOLS.sendToChat}\`. Call it only for what they would want right now: a deliverable they asked for, with its media, links or answer (the finished video, the requested numbers); a failure or blocker that needs them, also on the board; or a request of theirs being done. Never for status, such as "PR #12 merged", "deploying", "it's on the board" or "I asked the ship to\u2026": the board and the chat's own rows show those. End the turn with a one-line note of what you did; only the activity log shows it.
|
|
16027
16027
|
- 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" or "Checking npm for outdated packages", and call it 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 to it in one line before anything else, then fold it into your work. Answer every message they type in chat, even one that arrives during a ship event or board answer, and never only on the board: if they ask something while you handle an event, answer that question, not just the event. Write in a line or two with links, and include any media inline. Never restate the board in chat: no status tables, per-ship lists or summaries of what ships did.
|
|
16028
16028
|
`;
|
|
16029
|
-
var
|
|
16030
|
-
function
|
|
16031
|
-
const match = customInstructions?.match(
|
|
16029
|
+
var MANAGER_INSTRUCTIONS_BLOCK = new RegExp(`\\s*<${MANAGER_INSTRUCTIONS_TAG}>\\n([\\s\\S]*?)\\n</${MANAGER_INSTRUCTIONS_TAG}>`);
|
|
16030
|
+
function splitManagerInstructions(customInstructions) {
|
|
16031
|
+
const match = customInstructions?.match(MANAGER_INSTRUCTIONS_BLOCK);
|
|
16032
16032
|
return {
|
|
16033
16033
|
customInstructions: match ? customInstructions?.replace(match[0], "").trim() || void 0 : customInstructions,
|
|
16034
|
-
|
|
16034
|
+
managerInstructions: match?.[1]
|
|
16035
16035
|
};
|
|
16036
16036
|
}
|
|
16037
|
-
var
|
|
16038
|
-
var
|
|
16037
|
+
var MANAGER_TICKET_MESSAGE_NOTE = `The user sent this from your ticket on the Manager's board and reads your answer there, not in this chat. Answer them with \`${REPLICAS_MCP_TOOLS.replyOnTicket}\`: briefly, with a link or screenshot if it helps, and a follow-up question only if you need one. Keep longer work and detail in this chat.`;
|
|
16038
|
+
var MANAGER_TICKET_REPLY_NUDGE = `The user is still waiting for your answer on your ticket, and they only read the ticket. Answer them now with \`${REPLICAS_MCP_TOOLS.replyOnTicket}\`, briefly.`;
|
|
16039
16039
|
var T = REPLICAS_MCP_TOOLS;
|
|
16040
16040
|
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:
|
|
16041
16041
|
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.
|
|
@@ -16088,16 +16088,16 @@ function parseMessageOrigin(raw) {
|
|
|
16088
16088
|
return automation ? { kind: "automation", id: automation[2], name: automation[1].trim(), body: stripReplicasInstructionBlock(raw.slice(automation[0].length)) } : null;
|
|
16089
16089
|
}
|
|
16090
16090
|
|
|
16091
|
-
// ../shared/src/
|
|
16092
|
-
var
|
|
16091
|
+
// ../shared/src/manager-events.ts
|
|
16092
|
+
var MANAGER_EVENT_KINDS = ["finished", "ready", "needs_attention", "approved", "merged", "closed", "archived", "replied"];
|
|
16093
16093
|
var UNKNOWN_EVENT_KIND = "update";
|
|
16094
|
-
var
|
|
16095
|
-
var
|
|
16096
|
-
var
|
|
16097
|
-
var
|
|
16094
|
+
var MANAGER_TURN_ERROR_SUMMARY = "Turn ended with an error.";
|
|
16095
|
+
var MANAGER_EVENT_TYPE = "multitask-event";
|
|
16096
|
+
var MANAGER_EVENT_MESSAGE_TYPE = "multitask_event";
|
|
16097
|
+
var managerEventSchema = z28.object({
|
|
16098
16098
|
id: z28.string(),
|
|
16099
16099
|
at: z28.string(),
|
|
16100
|
-
kind: z28.enum([...
|
|
16100
|
+
kind: z28.enum([...MANAGER_EVENT_KINDS, UNKNOWN_EVENT_KIND]),
|
|
16101
16101
|
agentId: z28.string(),
|
|
16102
16102
|
agentName: z28.string(),
|
|
16103
16103
|
summary: z28.string(),
|
|
@@ -16114,12 +16114,12 @@ var ATTRIBUTE = /(\w+)="([^"]*)"/g;
|
|
|
16114
16114
|
var escapeAttribute = (value) => value.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<");
|
|
16115
16115
|
var unescapeAttribute = (value) => value.replace(/</g, "<").replace(/"/g, '"').replace(/&/g, "&");
|
|
16116
16116
|
var EVENT_RESPONSE_MAX_CHARS = 8e3;
|
|
16117
|
-
function
|
|
16117
|
+
function truncateManagerEventResponse(response, readTool) {
|
|
16118
16118
|
return response.length > EVENT_RESPONSE_MAX_CHARS ? `${response.slice(0, EVENT_RESPONSE_MAX_CHARS)}\u2026
|
|
16119
16119
|
|
|
16120
16120
|
(Truncated; ${readTool} returns the full response.)` : response;
|
|
16121
16121
|
}
|
|
16122
|
-
function
|
|
16122
|
+
function formatManagerEvents(events) {
|
|
16123
16123
|
return events.map((event) => {
|
|
16124
16124
|
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" } : {} };
|
|
16125
16125
|
const body = [event.summary, event.detail].filter(Boolean).join("\n\n").replaceAll(`</${TAG}`, `<\\/${TAG}`);
|
|
@@ -16128,11 +16128,11 @@ ${body}
|
|
|
16128
16128
|
</${TAG}>`;
|
|
16129
16129
|
}).join("\n\n");
|
|
16130
16130
|
}
|
|
16131
|
-
function
|
|
16131
|
+
function extractManagerEvents(text4) {
|
|
16132
16132
|
return [...text4.matchAll(BLOCK)].flatMap((match) => {
|
|
16133
16133
|
const attributes = Object.fromEntries([...match[1].matchAll(ATTRIBUTE)].map(([, key, value]) => [key, unescapeAttribute(value)]));
|
|
16134
16134
|
if (!attributes.kind || !attributes.id || !attributes.agent_id) return [];
|
|
16135
|
-
const kind =
|
|
16135
|
+
const kind = MANAGER_EVENT_KINDS.find((candidate) => candidate === attributes.kind) ?? UNKNOWN_EVENT_KIND;
|
|
16136
16136
|
const [summary, ...rest] = match[2].replaceAll(`<\\/${TAG}`, `</${TAG}`).split("\n\n");
|
|
16137
16137
|
const detail = stripAgentInstructionBlocks(rest.join("\n\n"));
|
|
16138
16138
|
return [{
|
|
@@ -16149,14 +16149,14 @@ function extractMothershipEvents(text4) {
|
|
|
16149
16149
|
}];
|
|
16150
16150
|
});
|
|
16151
16151
|
}
|
|
16152
|
-
function
|
|
16153
|
-
const events =
|
|
16152
|
+
function parseManagerEvents(text4) {
|
|
16153
|
+
const events = extractManagerEvents(text4);
|
|
16154
16154
|
return events.length > 0 && text4.replace(BLOCK, "").replaceAll(MERGED_MESSAGE_SEPARATOR.trim(), "").trim() === "" ? events : null;
|
|
16155
16155
|
}
|
|
16156
|
-
function
|
|
16156
|
+
function isManagerEventMessage(text4) {
|
|
16157
16157
|
return text4.trimStart().startsWith(`<${TAG} `);
|
|
16158
16158
|
}
|
|
16159
|
-
function
|
|
16159
|
+
function stripManagerEventNotes(content) {
|
|
16160
16160
|
return stripInstructionBlocksOutside(content, [...content.matchAll(BLOCK)].map((block) => [block.index, block.index + block[0].length]));
|
|
16161
16161
|
}
|
|
16162
16162
|
|
|
@@ -17217,9 +17217,9 @@ function workspaceTargetFromToolOutput(output) {
|
|
|
17217
17217
|
}
|
|
17218
17218
|
}
|
|
17219
17219
|
|
|
17220
|
-
// ../shared/src/
|
|
17220
|
+
// ../shared/src/manager-board.ts
|
|
17221
17221
|
import { z as z30 } from "zod";
|
|
17222
|
-
var
|
|
17222
|
+
var MANAGER_TICKET_LIMITS = {
|
|
17223
17223
|
title: 80,
|
|
17224
17224
|
task: 1e3,
|
|
17225
17225
|
issue: 1e3,
|
|
@@ -17236,7 +17236,7 @@ var MOTHERSHIP_TICKET_LIMITS = {
|
|
|
17236
17236
|
answer: 2e3,
|
|
17237
17237
|
reply: 600
|
|
17238
17238
|
};
|
|
17239
|
-
var L =
|
|
17239
|
+
var L = MANAGER_TICKET_LIMITS;
|
|
17240
17240
|
var tooLong = (max) => `At most ${max} characters. Keep it short; the user should take it in at a glance`;
|
|
17241
17241
|
var text3 = (max) => z30.string().trim().min(1).max(max, tooLong(max));
|
|
17242
17242
|
var clearable = (schema) => z30.union([schema, z30.literal("")]).optional();
|
|
@@ -17253,25 +17253,25 @@ var questionSchema = z30.object({
|
|
|
17253
17253
|
question: text3(L.question).describe("One question, with the context needed to answer it."),
|
|
17254
17254
|
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.")
|
|
17255
17255
|
});
|
|
17256
|
-
var
|
|
17257
|
-
var
|
|
17258
|
-
var
|
|
17259
|
-
var
|
|
17256
|
+
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.`);
|
|
17257
|
+
var managerTicketTaskSchema = text3(L.task);
|
|
17258
|
+
var managerTicketMediaSchema = z30.array(mediaSchema);
|
|
17259
|
+
var managerTicketQuestionsSchema = z30.array(questionSchema.extend({ id: z30.string() }));
|
|
17260
17260
|
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.`);
|
|
17261
17261
|
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.`);
|
|
17262
|
-
var
|
|
17263
|
-
title:
|
|
17262
|
+
var updateManagerTicketRequestSchema = z30.object({
|
|
17263
|
+
title: managerTicketTitleSchema.optional(),
|
|
17264
17264
|
issue: issueSchema,
|
|
17265
17265
|
fix: fixSchema,
|
|
17266
17266
|
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.`),
|
|
17267
17267
|
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.`),
|
|
17268
17268
|
blocked: clearable(text3(L.blocked)).describe('Why you cannot go on without the user, such as missing access. "" once unblocked.')
|
|
17269
17269
|
});
|
|
17270
|
-
var
|
|
17270
|
+
var updateManagerBoardRequestSchema = z30.object({
|
|
17271
17271
|
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.`),
|
|
17272
17272
|
tickets: z30.array(z30.object({
|
|
17273
17273
|
id: z30.uuid(),
|
|
17274
|
-
title:
|
|
17274
|
+
title: managerTicketTitleSchema.optional(),
|
|
17275
17275
|
issue: issueSchema,
|
|
17276
17276
|
fix: fixSchema,
|
|
17277
17277
|
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."),
|
|
@@ -17281,24 +17281,24 @@ var updateMothershipBoardRequestSchema = z30.object({
|
|
|
17281
17281
|
})).max(50).optional().describe("Changes to existing tickets."),
|
|
17282
17282
|
order: z30.array(z30.uuid()).optional().describe("Ticket ids, most important first. Tickets left out keep their order after these."),
|
|
17283
17283
|
create: z30.array(z30.object({
|
|
17284
|
-
title:
|
|
17285
|
-
task:
|
|
17284
|
+
title: managerTicketTitleSchema,
|
|
17285
|
+
task: managerTicketTaskSchema.optional(),
|
|
17286
17286
|
issue: text3(L.issue).optional(),
|
|
17287
17287
|
questions: z30.array(questionSchema).max(L.questions).optional(),
|
|
17288
17288
|
note: text3(L.note).optional()
|
|
17289
17289
|
})).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.")
|
|
17290
17290
|
});
|
|
17291
|
-
var
|
|
17291
|
+
var answerManagerTicketRequestSchema = z30.object({
|
|
17292
17292
|
questionId: z30.string().min(1),
|
|
17293
17293
|
answer: text3(L.answer)
|
|
17294
17294
|
});
|
|
17295
|
-
var
|
|
17296
|
-
var
|
|
17295
|
+
var managerTicketAnswerRefSchema = z30.object({ managerId: z30.uuid(), ticketId: z30.uuid(), questionId: z30.string().min(1) });
|
|
17296
|
+
var replyOnManagerTicketRequestSchema = z30.object({
|
|
17297
17297
|
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.`),
|
|
17298
17298
|
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.")
|
|
17299
17299
|
});
|
|
17300
|
-
var
|
|
17301
|
-
var
|
|
17300
|
+
var managerTicketReplyRefSchema = z30.object({ ticketId: z30.uuid(), text: text3(L.answer) });
|
|
17301
|
+
var managerTicketThreadSchema = z30.array(z30.object({
|
|
17302
17302
|
id: z30.string(),
|
|
17303
17303
|
from: z30.enum(["user", "ship"]),
|
|
17304
17304
|
name: z30.string(),
|
|
@@ -17490,7 +17490,7 @@ var SUBAGENT_STEPS = {
|
|
|
17490
17490
|
[SUBAGENT_MCP_TOOLS.deleteAgent]: { icon: "trash", live: "Deleting", done: "Deleted" },
|
|
17491
17491
|
[SUBAGENT_MCP_TOOLS.getProviders]: { icon: "list", live: "Listing available providers", done: "Listed available providers" }
|
|
17492
17492
|
};
|
|
17493
|
-
var
|
|
17493
|
+
var MANAGER_TOOL_ACTIONS = {
|
|
17494
17494
|
[REPLICAS_MCP_TOOLS.spawnSubagent]: "spawn",
|
|
17495
17495
|
[REPLICAS_MCP_TOOLS.messageSubagent]: "send",
|
|
17496
17496
|
[REPLICAS_MCP_TOOLS.listSubagents]: "list",
|
|
@@ -17561,22 +17561,22 @@ function describeToolCall(message2, base) {
|
|
|
17561
17561
|
}
|
|
17562
17562
|
const mcp = parseMcpToolName(tool);
|
|
17563
17563
|
const replicasTool = replicasToolName(message2);
|
|
17564
|
-
const
|
|
17565
|
-
if (
|
|
17564
|
+
const managerAction = replicasTool ? MANAGER_TOOL_ACTIONS[replicasTool] : void 0;
|
|
17565
|
+
if (managerAction) {
|
|
17566
17566
|
const target = workspaceTargetFromToolOutput(message2.output);
|
|
17567
17567
|
const step = {
|
|
17568
17568
|
...base,
|
|
17569
17569
|
key,
|
|
17570
17570
|
failed: base.failed || Boolean(message2.output?.startsWith("Error:")),
|
|
17571
|
-
|
|
17571
|
+
manager: { action: managerAction, name: inputString(input, "name") ?? target?.label, agentId: inputString(input, "agent_id") ?? target?.id, chatId: inputString(input, "chat_id"), text: inputString(input, "prompt", "message") }
|
|
17572
17572
|
};
|
|
17573
|
-
if (
|
|
17574
|
-
if (
|
|
17575
|
-
if (
|
|
17576
|
-
return { ...step, category: "agent", icon: "clock", live: "Waiting for ships", done: "Waited for ships", detail: "
|
|
17573
|
+
if (managerAction === "spawn") return { ...step, category: "agent", icon: "network", live: "Spawning", done: "Spawned", detail: "manager" };
|
|
17574
|
+
if (managerAction === "send") return { ...step, category: "agent", icon: "message", live: "Messaging", done: "Messaged", detail: "manager" };
|
|
17575
|
+
if (managerAction === "wait") {
|
|
17576
|
+
return { ...step, category: "agent", icon: "clock", live: "Waiting for ships", done: "Waited for ships", detail: "manager", manager: { ...step.manager, events: extractManagerEvents(message2.output ?? "") } };
|
|
17577
17577
|
}
|
|
17578
|
-
if (
|
|
17579
|
-
return
|
|
17578
|
+
if (managerAction === "archive") return { ...step, category: "tool", icon: "archive", live: "Archiving ship", done: "Archived ship", detail: "io" };
|
|
17579
|
+
return managerAction === "list" ? { ...step, category: "tool", icon: "network", live: "Listing ships", done: "Listed ships", detail: "io" } : { ...step, category: "tool", icon: "network", live: "Reading ship response", done: "Read ship response", detail: "io" };
|
|
17580
17580
|
}
|
|
17581
17581
|
const replicasStep = replicasTool ? REPLICAS_API_STEPS[replicasTool] : void 0;
|
|
17582
17582
|
if (replicasStep) {
|
|
@@ -20299,8 +20299,8 @@ function applyInterruptions(messages, events) {
|
|
|
20299
20299
|
function applyEngineNotices(messages, events) {
|
|
20300
20300
|
const notices = [];
|
|
20301
20301
|
events.forEach((event, index) => {
|
|
20302
|
-
if (event.type ===
|
|
20303
|
-
const parsed = typeof event.payload.text === "string" ?
|
|
20302
|
+
if (event.type === MANAGER_EVENT_TYPE) {
|
|
20303
|
+
const parsed = typeof event.payload.text === "string" ? parseManagerEvents(event.payload.text) : null;
|
|
20304
20304
|
if (parsed) notices.push({ id: `multitask-event-${event.timestamp}-${index}`, type: "multitask_event", events: parsed, timestamp: event.timestamp });
|
|
20305
20305
|
return;
|
|
20306
20306
|
}
|
|
@@ -20358,7 +20358,7 @@ function filterDisplayMessages(messages, provider2) {
|
|
|
20358
20358
|
if (msg.type !== "user") return [msg];
|
|
20359
20359
|
let stripped = strippedUserContents.get(msg.content);
|
|
20360
20360
|
if (!stripped) {
|
|
20361
|
-
stripped = stripAttachmentNote(
|
|
20361
|
+
stripped = stripAttachmentNote(stripManagerEventNotes(msg.content));
|
|
20362
20362
|
if (strippedUserContents.size >= 5e3) strippedUserContents.clear();
|
|
20363
20363
|
strippedUserContents.set(msg.content, stripped);
|
|
20364
20364
|
}
|
|
@@ -20408,7 +20408,7 @@ function attachSendersToMessages(messages, senders) {
|
|
|
20408
20408
|
return sender ? attachSender(message2, sender) : message2;
|
|
20409
20409
|
});
|
|
20410
20410
|
messages.forEach((message2, index) => {
|
|
20411
|
-
if (message2.type === "user" && !message2.origin && !message2.senderUserId && !message2.senderEmail && !sendersByMessageId.has(message2.id) && !
|
|
20411
|
+
if (message2.type === "user" && !message2.origin && !message2.senderUserId && !message2.senderEmail && !sendersByMessageId.has(message2.id) && !isManagerEventMessage(message2.content)) {
|
|
20412
20412
|
userIndices.push(index);
|
|
20413
20413
|
}
|
|
20414
20414
|
});
|
|
@@ -20739,7 +20739,7 @@ function getChatHistoryTurnId(event) {
|
|
|
20739
20739
|
var COMPACT_BODY_MAX_BYTES = 2 * 1024;
|
|
20740
20740
|
var COMPACT_PREVIEW_CHARS = 1024;
|
|
20741
20741
|
function isStructuredToolOutput(text4) {
|
|
20742
|
-
if (
|
|
20742
|
+
if (extractManagerEvents(text4).length > 0) return true;
|
|
20743
20743
|
const trimmed = text4.trim();
|
|
20744
20744
|
if (!trimmed.startsWith("{") && !trimmed.startsWith("[")) return false;
|
|
20745
20745
|
return safeJsonParse(trimmed, void 0) !== void 0;
|
|
@@ -20955,7 +20955,7 @@ var ERR_RE = new RegExp(`${NOT_BEFORE}(errors?|failed|failures?|fail|fails|excep
|
|
|
20955
20955
|
var BENIGN_RE = new RegExp(`${NOT_BEFORE}0\\s+(?:fail${W}*|errors?)${NOT_AFTER}|${NOT_BEFORE}no errors?${NOT_AFTER}|${NOT_BEFORE}errors?:\\s*0${NOT_AFTER}|${NOT_BEFORE}fail(?:ed|ures)?:\\s*0${NOT_AFTER}|${NOT_BEFORE}0 failed${NOT_AFTER}`, "giu");
|
|
20956
20956
|
var OPENERS_RE = new RegExp(`^(done|all done|all set|fixed|pushed|merged|complete|completed|finished|yes|no|sure|ok|okay|got it|great|perfect|thanks|thank you|sounds good|on it|here you go|here it is|updated|sorry|my mistake|good catch|you(?:'re| are| were) right)${NOT_AFTER}[^.!?]{0,24}[.!?:]?$`, "iu");
|
|
20957
20957
|
var GENERIC_CHAT_TITLE = new RegExp(
|
|
20958
|
-
`^(?:forked from [^\\n]*|(?:claude code|claude|codex|relay|pi|opencode|cursor|gemini|amp|droid|mothership|agent|chat|new chat|new session|untitled(?: session| chat)?|session|slack|linear(?: \xB7 [^\\n]*)?|#[\\p{L}\\p{N}_.\\-]+|[^\\n]+ \\(dm\\)|pr #\\d+ fixes)(?: \\(${W}+\\))*(?: \\d+)?)$`,
|
|
20958
|
+
`^(?:forked from [^\\n]*|(?:claude code|claude|codex|relay|pi|opencode|cursor|gemini|amp|droid|manager|mothership|agent|chat|new chat|new session|untitled(?: session| chat)?|session|slack|linear(?: \xB7 [^\\n]*)?|#[\\p{L}\\p{N}_.\\-]+|[^\\n]+ \\(dm\\)|pr #\\d+ fixes)(?: \\(${W}+\\))*(?: \\d+)?)$`,
|
|
20959
20959
|
"iu"
|
|
20960
20960
|
);
|
|
20961
20961
|
|
|
@@ -21147,7 +21147,7 @@ async function withRetry(label, fn, options) {
|
|
|
21147
21147
|
}
|
|
21148
21148
|
|
|
21149
21149
|
// ../shared/src/tensorlake.ts
|
|
21150
|
-
var TENSORLAKE_IMAGE_NAME = "replicas-sandbox-2026-11-19-
|
|
21150
|
+
var TENSORLAKE_IMAGE_NAME = "replicas-sandbox-2026-11-19-v7";
|
|
21151
21151
|
var TENSORLAKE_DISK_MB = 100 * 1024;
|
|
21152
21152
|
|
|
21153
21153
|
// ../shared/src/egress.ts
|
|
@@ -22402,8 +22402,9 @@ var scoutLinearStartRequestSchema = z36.object({
|
|
|
22402
22402
|
var scoutRouteLinearTicketRequestSchema = z36.object({
|
|
22403
22403
|
agent_session_id: z36.string().trim().min(1).describe("The ticket's `agent_session_id` from the envelope."),
|
|
22404
22404
|
environment_id: z36.string().trim().min(1).optional().describe("Start the ticket in this environment."),
|
|
22405
|
-
|
|
22406
|
-
|
|
22405
|
+
manager_id: z36.string().trim().min(1).optional().describe("Hand the ticket to this Manager instead."),
|
|
22406
|
+
mothership_id: z36.string().trim().min(1).optional().describe("Old name of `manager_id`.")
|
|
22407
|
+
}).refine((args) => !(args.environment_id && (args.manager_id || args.mothership_id)), "Pass environment_id or manager_id, not both.");
|
|
22407
22408
|
var slackChannelIdSchema = z36.string().describe("Slack channel id from the envelope's `channel_id`.");
|
|
22408
22409
|
var slackThreadTsSchema = z36.string().describe("Slack thread timestamp from the envelope's `thread_ts`.");
|
|
22409
22410
|
var scoutSlackMessageReferenceSchema = z36.object({
|
|
@@ -22432,7 +22433,7 @@ var scoutSlackRelayRequestSchema = z36.object({
|
|
|
22432
22433
|
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."),
|
|
22433
22434
|
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`."),
|
|
22434
22435
|
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."),
|
|
22435
|
-
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
|
|
22436
|
+
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.`),
|
|
22436
22437
|
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.")
|
|
22437
22438
|
});
|
|
22438
22439
|
var scoutSlackSetThreadMutedRequestSchema = z36.object({
|
|
@@ -22448,7 +22449,7 @@ var scoutListWorkspacesRequestSchema = z36.object({
|
|
|
22448
22449
|
thread_ts: slackThreadTsSchema,
|
|
22449
22450
|
message_ts: z36.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
|
|
22450
22451
|
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."),
|
|
22451
|
-
query: z36.string().trim().min(1).optional().describe("Case-insensitive text to match against workspace and
|
|
22452
|
+
query: z36.string().trim().min(1).optional().describe("Case-insensitive text to match against workspace and Manager names and pull request URLs.")
|
|
22452
22453
|
});
|
|
22453
22454
|
var scoutSlackConfirmationSchema = z36.object({
|
|
22454
22455
|
confirmation_channel_id: z36.string().describe("`channel_id` from the envelope of the Slack message that asked for or accepted this."),
|
|
@@ -22477,8 +22478,8 @@ var scoutUpdateChannelSettingsToolInputSchema = scoutSettingsConfirmationSchema.
|
|
|
22477
22478
|
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.`),
|
|
22478
22479
|
muted: z36.enum(["on", "off", "default"]).optional().describe("Kept for older callers; prefer `silent`.")
|
|
22479
22480
|
});
|
|
22480
|
-
var
|
|
22481
|
-
proactivity: scoutUpdateChannelSettingsToolInputSchema.shape.proactivity.unwrap().describe("This channel's own level. `organization` makes it follow the organization's level again, which a
|
|
22481
|
+
var managerSlackChannelLevelToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
22482
|
+
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`.")
|
|
22482
22483
|
});
|
|
22483
22484
|
var scoutSetSlackConnectMutedToolInputSchema = scoutSettingsConfirmationSchema.extend({
|
|
22484
22485
|
muted: z36.boolean().describe("`true` puts every Slack Connect channel without its own setting in silent mode; `false` lets them follow their levels again.")
|
|
@@ -23177,7 +23178,7 @@ var ENVIRONMENT_HOOK_RUN_LOG_LIMIT = 5 * 1024 * 1024;
|
|
|
23177
23178
|
var ENVIRONMENT_HOOK_RUN_TAIL_LIMIT = 8 * 1024;
|
|
23178
23179
|
|
|
23179
23180
|
// ../shared/src/workspace-alerts.ts
|
|
23180
|
-
var
|
|
23181
|
+
var MANAGER_RELAY_WINDOW_MS = 5 * 6e4;
|
|
23181
23182
|
|
|
23182
23183
|
// ../shared/src/workspace-sidebar-state.ts
|
|
23183
23184
|
var WORKSPACE_SOURCE_LABELS = {
|
|
@@ -23207,7 +23208,7 @@ var WORKSPACE_STAGE_LABELS = {
|
|
|
23207
23208
|
};
|
|
23208
23209
|
var QUIET_SETTLED_MS = 3 * 24 * 60 * 6e4;
|
|
23209
23210
|
var WORKSPACE_LIST_SECTION_LABELS = {
|
|
23210
|
-
motherships: "
|
|
23211
|
+
motherships: "Managers",
|
|
23211
23212
|
needs: "Needs you",
|
|
23212
23213
|
pinned: "Pinned",
|
|
23213
23214
|
...WORKSPACE_STAGE_LABELS
|
|
@@ -23633,13 +23634,13 @@ export {
|
|
|
23633
23634
|
REPLICAS_MCP_SERVER_NAME,
|
|
23634
23635
|
REPLICAS_MCP_TOOLS,
|
|
23635
23636
|
REPLICAS_INSTRUCTIONS_TAG,
|
|
23636
|
-
|
|
23637
|
+
MANAGER_INSTRUCTIONS_TAG,
|
|
23637
23638
|
wrapInTag,
|
|
23638
|
-
|
|
23639
|
-
|
|
23640
|
-
|
|
23641
|
-
|
|
23642
|
-
|
|
23639
|
+
splitManagerInstructions,
|
|
23640
|
+
MANAGER_TURN_ERROR_SUMMARY,
|
|
23641
|
+
MANAGER_EVENT_MESSAGE_TYPE,
|
|
23642
|
+
truncateManagerEventResponse,
|
|
23643
|
+
formatManagerEvents,
|
|
23643
23644
|
coerceBackgroundTaskPayload,
|
|
23644
23645
|
CLAUDE_STOPPED_TOOL_RESULT,
|
|
23645
23646
|
CHAT_FORK_EXCERPT_OMITTED_NOTICE,
|
|
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
HOOK_EXEC_MAX_BUFFER_BYTES
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FTRMFS7H.js";
|
|
7
7
|
|
|
8
8
|
// src/utils/exec.ts
|
|
9
9
|
import { exec, execFile } from "child_process";
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
ENGINE_ENV,
|
|
6
6
|
monolithRequest,
|
|
7
7
|
runGitCommand
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-LPBDUZ6Y.js";
|
|
9
9
|
import {
|
|
10
10
|
COMMAND_PROTECTION_MAX_MESSAGE_FILE_BYTES,
|
|
11
11
|
COMMAND_PROTECTION_REPO_GIT_ARGS,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
parseCommandProtectionRequest,
|
|
19
19
|
toCommandProtectionRepoState,
|
|
20
20
|
withRetry
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-FTRMFS7H.js";
|
|
22
22
|
|
|
23
23
|
// src/services/command-protection-service.ts
|
|
24
24
|
import { readFile, stat } from "fs/promises";
|
|
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url);
|
|
|
4
4
|
import {
|
|
5
5
|
SUBPROCESS_MAX_BUFFER,
|
|
6
6
|
execFileAsync
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HJZBM6QV.js";
|
|
8
8
|
import {
|
|
9
9
|
isRecord as isRecord2
|
|
10
10
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
provisionedDeviceSchema,
|
|
22
22
|
readReplicasRuntimeEnv,
|
|
23
23
|
serializePosixEnvFile
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-FTRMFS7H.js";
|
|
25
25
|
|
|
26
26
|
// src/runtime-env-loader.ts
|
|
27
27
|
import { readFileSync } from "fs";
|
|
@@ -12,15 +12,15 @@ import {
|
|
|
12
12
|
resolveDiffBase,
|
|
13
13
|
runGitCommand,
|
|
14
14
|
setAgentCredentialSnapshot
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-LPBDUZ6Y.js";
|
|
16
16
|
import {
|
|
17
17
|
AppServerProcess,
|
|
18
18
|
buildCodexAgentEnv
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-UYI2EV26.js";
|
|
20
20
|
import {
|
|
21
21
|
SUBPROCESS_MAX_BUFFER,
|
|
22
22
|
execFileAsync
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-HJZBM6QV.js";
|
|
24
24
|
import {
|
|
25
25
|
isRecord
|
|
26
26
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
IMAGE_MEDIA_TYPES,
|
|
35
35
|
InFlightMap,
|
|
36
36
|
KEEP_IMAGE_UNDER_BYTES,
|
|
37
|
-
|
|
37
|
+
MANAGER_INSTRUCTIONS_TAG,
|
|
38
38
|
SHRUNK_IMAGE_QUALITY,
|
|
39
39
|
SUBAGENT_MCP_SERVER_NAME,
|
|
40
40
|
SUBAGENT_MCP_TOOL_NAMES,
|
|
@@ -59,9 +59,9 @@ import {
|
|
|
59
59
|
readOllamaAuthEnv,
|
|
60
60
|
resolveOpenAICompatibleModelsUrl,
|
|
61
61
|
shrunkImageSize,
|
|
62
|
-
|
|
62
|
+
splitManagerInstructions,
|
|
63
63
|
withTimeout
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-FTRMFS7H.js";
|
|
65
65
|
|
|
66
66
|
// src/managers/codex-token-manager.ts
|
|
67
67
|
import { promises as fs } from "fs";
|
|
@@ -461,7 +461,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
461
461
|
await this.applyCredentialUpdate(++this.credentialGeneration, async () => {
|
|
462
462
|
await this.applyCredentialsResponse(data);
|
|
463
463
|
setAgentCredentialSnapshot("codex", data);
|
|
464
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
464
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-NO4FOM6R.js");
|
|
465
465
|
await restartCodexAspHostIfRunning2();
|
|
466
466
|
});
|
|
467
467
|
await this.start(true);
|
|
@@ -483,7 +483,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
483
483
|
const accountChanged = ENGINE_ENV.REPLICAS_AGENT_CREDENTIALS.codex?.credentialId !== data.credentialId;
|
|
484
484
|
await this.applyCredentialsResponse(data);
|
|
485
485
|
if (restartOnChange && (accountChanged || CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index]))) {
|
|
486
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
486
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-NO4FOM6R.js");
|
|
487
487
|
await restartCodexAspHostIfRunning2();
|
|
488
488
|
}
|
|
489
489
|
setAgentCredentialSnapshot("codex", data);
|
|
@@ -2073,12 +2073,12 @@ async function buildTurnStartParams(threadId, request, serviceTier, unreadReques
|
|
|
2073
2073
|
}
|
|
2074
2074
|
const input = built.flatMap((turn) => turn.input);
|
|
2075
2075
|
const tempImagePaths = built.flatMap((turn) => turn.tempImagePaths);
|
|
2076
|
-
const {
|
|
2076
|
+
const { managerInstructions } = splitManagerInstructions(request.customInstructions);
|
|
2077
2077
|
return {
|
|
2078
2078
|
params: {
|
|
2079
2079
|
threadId,
|
|
2080
2080
|
input,
|
|
2081
|
-
...
|
|
2081
|
+
...managerInstructions ? { additionalContext: { [MANAGER_INSTRUCTIONS_TAG]: { kind: "application", value: managerInstructions } } } : {},
|
|
2082
2082
|
model,
|
|
2083
2083
|
...serviceTier !== void 0 ? { serviceTier } : {},
|
|
2084
2084
|
...codexApprovalPolicyOverrides(),
|
|
@@ -3,10 +3,10 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
execFileAsync
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-HJZBM6QV.js";
|
|
7
7
|
import {
|
|
8
8
|
isVersionBelow
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-FTRMFS7H.js";
|
|
10
10
|
|
|
11
11
|
// src/utils/codex-agent-env.ts
|
|
12
12
|
function buildCodexAgentEnv(source = process.env) {
|
|
@@ -240,7 +240,7 @@ function getCodexModelProvider(method) {
|
|
|
240
240
|
if (method === "foundry") return "azure";
|
|
241
241
|
return method === "ollama" || method === "openai-compatible" ? "replicas_openai_compatible" : "openai";
|
|
242
242
|
}
|
|
243
|
-
var ENGINE_PACKAGE_VERSION = "0.1.
|
|
243
|
+
var ENGINE_PACKAGE_VERSION = "0.1.1648";
|
|
244
244
|
var INITIALIZE_METHOD = "initialize";
|
|
245
245
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
246
246
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -3,13 +3,13 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
evaluateCommandProtection
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-JW2PDEIB.js";
|
|
7
|
+
import "./chunk-LPBDUZ6Y.js";
|
|
8
|
+
import "./chunk-HJZBM6QV.js";
|
|
9
9
|
import {
|
|
10
10
|
isRecord
|
|
11
11
|
} from "./chunk-UZSNFLDQ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-FTRMFS7H.js";
|
|
13
13
|
import "./chunk-VEQXQN22.js";
|
|
14
14
|
|
|
15
15
|
// src/command-protection-hook.ts
|
|
@@ -14,12 +14,12 @@ import {
|
|
|
14
14
|
recoverCompletedTurn,
|
|
15
15
|
spawnMuseMsp,
|
|
16
16
|
startMuseSession
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-7C3DRMXV.js";
|
|
18
18
|
import {
|
|
19
19
|
AppServerProcess,
|
|
20
20
|
buildCodexAgentEnv
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
} from "./chunk-UYI2EV26.js";
|
|
22
|
+
import "./chunk-HJZBM6QV.js";
|
|
23
23
|
import {
|
|
24
24
|
AGENT,
|
|
25
25
|
OPENCODE_GO_PROVIDER,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
headlessAgentUsagePath,
|
|
30
30
|
isRecord,
|
|
31
31
|
withTimeout
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-FTRMFS7H.js";
|
|
33
33
|
import "./chunk-VEQXQN22.js";
|
|
34
34
|
|
|
35
35
|
// src/headless-agent.ts
|
package/dist/src/index.js
CHANGED
|
@@ -91,7 +91,7 @@ import {
|
|
|
91
91
|
evaluateCommandProtection,
|
|
92
92
|
extractToolCommand,
|
|
93
93
|
reportCommandProtectionBlock
|
|
94
|
-
} from "./chunk-
|
|
94
|
+
} from "./chunk-JW2PDEIB.js";
|
|
95
95
|
import {
|
|
96
96
|
ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
|
|
97
97
|
AGENT_MESSAGE_DELTA_METHOD,
|
|
@@ -129,10 +129,10 @@ import {
|
|
|
129
129
|
spawnMuseMsp,
|
|
130
130
|
startMuseSession,
|
|
131
131
|
uuidV7
|
|
132
|
-
} from "./chunk-
|
|
132
|
+
} from "./chunk-7C3DRMXV.js";
|
|
133
133
|
import {
|
|
134
134
|
publishedPullRequestUrls
|
|
135
|
-
} from "./chunk-
|
|
135
|
+
} from "./chunk-RM2JP7QY.js";
|
|
136
136
|
import {
|
|
137
137
|
ACCOUNT_RATE_LIMITS_READ_METHOD,
|
|
138
138
|
AsyncLock,
|
|
@@ -212,7 +212,7 @@ import {
|
|
|
212
212
|
transcriptSecrets,
|
|
213
213
|
upsertCredentialFileLines,
|
|
214
214
|
writeSecureCredentialFile
|
|
215
|
-
} from "./chunk-
|
|
215
|
+
} from "./chunk-QRBXVNQF.js";
|
|
216
216
|
import {
|
|
217
217
|
ENGINE_ENV,
|
|
218
218
|
UNQUOTED_PATHS_CONFIG,
|
|
@@ -223,16 +223,16 @@ import {
|
|
|
223
223
|
resolveDiffBase,
|
|
224
224
|
setAgentCredentialSnapshot,
|
|
225
225
|
setLinearSessionId
|
|
226
|
-
} from "./chunk-
|
|
226
|
+
} from "./chunk-LPBDUZ6Y.js";
|
|
227
227
|
import {
|
|
228
228
|
buildCodexAgentEnv,
|
|
229
229
|
getCodexModelProvider
|
|
230
|
-
} from "./chunk-
|
|
230
|
+
} from "./chunk-UYI2EV26.js";
|
|
231
231
|
import {
|
|
232
232
|
SUBPROCESS_MAX_BUFFER,
|
|
233
233
|
execAsync,
|
|
234
234
|
execFileAsync
|
|
235
|
-
} from "./chunk-
|
|
235
|
+
} from "./chunk-HJZBM6QV.js";
|
|
236
236
|
import {
|
|
237
237
|
isRecord as isRecord2
|
|
238
238
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -315,6 +315,9 @@ import {
|
|
|
315
315
|
LEARNED_SKILLS_MANIFEST_PATH,
|
|
316
316
|
LEARNED_SKILL_DIR_PREFIX,
|
|
317
317
|
LOCAL_CONTROL_FILE_PREFIX,
|
|
318
|
+
MANAGER_EVENT_MESSAGE_TYPE,
|
|
319
|
+
MANAGER_INSTRUCTIONS_TAG,
|
|
320
|
+
MANAGER_TURN_ERROR_SUMMARY,
|
|
318
321
|
MAX_CANVAS_FILE_BYTES,
|
|
319
322
|
MAX_CANVAS_PREVIEW_BYTES,
|
|
320
323
|
MAX_CODEX_GOAL_OBJECTIVE_CHARS,
|
|
@@ -323,9 +326,6 @@ import {
|
|
|
323
326
|
MERGED_MESSAGE_SEPARATOR,
|
|
324
327
|
MODEL_LABELS,
|
|
325
328
|
MODEL_PREDECESSORS,
|
|
326
|
-
MOTHERSHIP_EVENT_MESSAGE_TYPE,
|
|
327
|
-
MOTHERSHIP_INSTRUCTIONS_TAG,
|
|
328
|
-
MOTHERSHIP_TURN_ERROR_SUMMARY,
|
|
329
329
|
OLLAMA_AGENTS,
|
|
330
330
|
OPENCODE_GO_BASE_URL,
|
|
331
331
|
OPENCODE_GO_PROVIDER,
|
|
@@ -409,7 +409,7 @@ import {
|
|
|
409
409
|
forkChatRequestSchema,
|
|
410
410
|
formatChatForkHandoffMessage,
|
|
411
411
|
formatChatForkUpdateMessage,
|
|
412
|
-
|
|
412
|
+
formatManagerEvents,
|
|
413
413
|
getChatContinuation,
|
|
414
414
|
getChatHistoryPageSenders,
|
|
415
415
|
getChatKind,
|
|
@@ -514,12 +514,12 @@ import {
|
|
|
514
514
|
shouldRefreshPullRequests,
|
|
515
515
|
skillNamesFromCommand,
|
|
516
516
|
spawnSubagentRequestSchema,
|
|
517
|
-
|
|
517
|
+
splitManagerInstructions,
|
|
518
518
|
steerQueuedInOrder,
|
|
519
519
|
stripAgentDiagnosticErrors,
|
|
520
520
|
threadHandoffText,
|
|
521
521
|
toolInputAnswer,
|
|
522
|
-
|
|
522
|
+
truncateManagerEventResponse,
|
|
523
523
|
updateChatDisplayNameRequestSchema,
|
|
524
524
|
waitSubagentRequestSchema,
|
|
525
525
|
withTimeout,
|
|
@@ -528,7 +528,7 @@ import {
|
|
|
528
528
|
workspaceTokenRequestSchema,
|
|
529
529
|
workspaceTokenResponseSchema,
|
|
530
530
|
wrapInTag
|
|
531
|
-
} from "./chunk-
|
|
531
|
+
} from "./chunk-FTRMFS7H.js";
|
|
532
532
|
import {
|
|
533
533
|
__commonJS,
|
|
534
534
|
__export,
|
|
@@ -14305,7 +14305,7 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
14305
14305
|
/** Query inputs shared by real sessions and slash-command discovery. */
|
|
14306
14306
|
async buildSharedQueryOptions() {
|
|
14307
14307
|
const env = buildClaudeAgentEnv({
|
|
14308
|
-
// Claude Code nudges a turn that ends without text to write some, unless it called one of these tools; a
|
|
14308
|
+
// Claude Code nudges a turn that ends without text to write some, unless it called one of these tools; a Manager handles ship events and board answers with only these.
|
|
14309
14309
|
CLAUDE_CODE_TERMINAL_MCP_TOOLS: [REPLICAS_MCP_TOOLS.updateBoard, REPLICAS_MCP_TOOLS.sendToChat, REPLICAS_MCP_TOOLS.spawnSubagent, REPLICAS_MCP_TOOLS.messageSubagent].map((tool) => `mcp__${REPLICAS_MCP_SERVER_NAME}__${tool}`).join(","),
|
|
14310
14310
|
...this.subagentMcpParentChatId() && { CLAUDE_CODE_STREAM_CLOSE_TIMEOUT: "900000" },
|
|
14311
14311
|
...this.originChatId && { REPLICAS_CHAT_ID: this.originChatId }
|
|
@@ -15630,14 +15630,14 @@ var CodexAspManager = class extends CodingAgentManager {
|
|
|
15630
15630
|
}
|
|
15631
15631
|
async prepareGoalCommand(request, recordUserMessage) {
|
|
15632
15632
|
const host = await getCodexAspHost();
|
|
15633
|
-
const developerInstructions = this.buildCombinedInstructions(
|
|
15633
|
+
const developerInstructions = this.buildCombinedInstructions(splitManagerInstructions(request.customInstructions).customInstructions, true);
|
|
15634
15634
|
recordUserMessage({ command: "goal" });
|
|
15635
15635
|
const threadId = await this.ensureThread(host, request, developerInstructions);
|
|
15636
15636
|
return { host, threadId };
|
|
15637
15637
|
}
|
|
15638
15638
|
async executeAspTurn(request, recordUserMessage, signal, options = {}) {
|
|
15639
15639
|
const host = await getCodexAspHost();
|
|
15640
|
-
const developerInstructions = this.buildCombinedInstructions(
|
|
15640
|
+
const developerInstructions = this.buildCombinedInstructions(splitManagerInstructions(request.customInstructions).customInstructions, true);
|
|
15641
15641
|
recordUserMessage(options.userMessagePayload);
|
|
15642
15642
|
const threadId = await this.ensureThread(host, request, developerInstructions);
|
|
15643
15643
|
const serviceTier = await this.resolveRequestedServiceTier(host, request);
|
|
@@ -15823,7 +15823,7 @@ ${text.slice(-24e3)}`
|
|
|
15823
15823
|
});
|
|
15824
15824
|
}
|
|
15825
15825
|
async runGoalTurn(host, threadId, request, objective, signal) {
|
|
15826
|
-
const {
|
|
15826
|
+
const { managerInstructions } = splitManagerInstructions(request.customInstructions);
|
|
15827
15827
|
const unreadContent = await Promise.all(this.unreadRequests.map(async (unread) => [
|
|
15828
15828
|
{ type: "input_text", text: unread.message },
|
|
15829
15829
|
...(await normalizeImages(unread.images ?? [])).map((image) => ({ type: "input_image", image_url: `data:${image.source.media_type};base64,${image.source.data}` }))
|
|
@@ -15832,10 +15832,10 @@ ${text.slice(-24e3)}`
|
|
|
15832
15832
|
throw error;
|
|
15833
15833
|
});
|
|
15834
15834
|
return this.observeTurn(host, threadId, request, signal, async () => {
|
|
15835
|
-
if (
|
|
15835
|
+
if (managerInstructions) {
|
|
15836
15836
|
await host.client.request(THREAD_INJECT_ITEMS_METHOD, {
|
|
15837
15837
|
threadId,
|
|
15838
|
-
items: [{ type: "message", role: "developer", content: [{ type: "input_text", text: wrapInTag(
|
|
15838
|
+
items: [{ type: "message", role: "developer", content: [{ type: "input_text", text: wrapInTag(managerInstructions, MANAGER_INSTRUCTIONS_TAG) }] }]
|
|
15839
15839
|
});
|
|
15840
15840
|
}
|
|
15841
15841
|
if (unreadContent.length > 0) {
|
|
@@ -61883,19 +61883,19 @@ var ChatService = class {
|
|
|
61883
61883
|
try {
|
|
61884
61884
|
const detail = errors?.length ? errors.join("\n") : extractFinalResponse(await chat.provider.getHistory(), chat.persisted.provider) ?? "[No response from subagent]";
|
|
61885
61885
|
await this.sendMessage(parentChatId, {
|
|
61886
|
-
message:
|
|
61886
|
+
message: formatManagerEvents([{
|
|
61887
61887
|
id: randomUUID9(),
|
|
61888
61888
|
at: completedAt,
|
|
61889
61889
|
kind: "finished",
|
|
61890
61890
|
agentId: chat.persisted.id,
|
|
61891
61891
|
agentName: chat.persisted.title,
|
|
61892
61892
|
chatId: chat.persisted.id,
|
|
61893
|
-
summary: `${errors?.length ?
|
|
61894
|
-
detail:
|
|
61893
|
+
summary: `${errors?.length ? MANAGER_TURN_ERROR_SUMMARY : "Finished its turn."} It is a subagent in this workspace: reach it with the ${SUBAGENT_MCP_TOOLS.messageAgent} and ${SUBAGENT_MCP_TOOLS.getAgent} tools and this chat_id.`,
|
|
61894
|
+
detail: truncateManagerEventResponse(detail, SUBAGENT_MCP_TOOLS.getAgent)
|
|
61895
61895
|
}]),
|
|
61896
61896
|
...last.customInstructions ? { customInstructions: last.customInstructions } : {},
|
|
61897
61897
|
...last.enableInteractiveTools !== void 0 ? { enableInteractiveTools: last.enableInteractiveTools } : {},
|
|
61898
|
-
type:
|
|
61898
|
+
type: MANAGER_EVENT_MESSAGE_TYPE,
|
|
61899
61899
|
merge: true,
|
|
61900
61900
|
inheritThinkingLevel: true,
|
|
61901
61901
|
idempotencyKey: `subagent-finished:${chat.persisted.id}:${completedAt}`
|
|
@@ -3,13 +3,13 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
publishedPullRequestUrls
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RM2JP7QY.js";
|
|
7
7
|
import {
|
|
8
8
|
isRecord
|
|
9
9
|
} from "./chunk-UZSNFLDQ.js";
|
|
10
10
|
import {
|
|
11
11
|
shouldRefreshPullRequests
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-FTRMFS7H.js";
|
|
13
13
|
import "./chunk-VEQXQN22.js";
|
|
14
14
|
|
|
15
15
|
// src/services/post-tool-pr-notifier.ts
|
package/dist/src/subagent-mcp.js
CHANGED