replicas-engine 0.1.1492 → 0.1.1494
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-HRPUH5HD.js → asp-host-QPONSSTK.js} +5 -5
- package/dist/src/{chunk-3PHWYMOH.js → chunk-55SJSOI2.js} +1 -1
- package/dist/src/{chunk-BL2FTZSX.js → chunk-DOAFMAYL.js} +1 -1
- package/dist/src/{chunk-DJW3SCB4.js → chunk-DVU6R5AN.js} +2 -2
- package/dist/src/{chunk-QQA5RUEY.js → chunk-II4H6RG2.js} +2 -2
- package/dist/src/{chunk-JQ6AJ6KH.js → chunk-OQZLK6BN.js} +2 -2
- package/dist/src/{chunk-PSFE2OHM.js → chunk-QOAJHPFJ.js} +6 -6
- package/dist/src/{chunk-Q2KPK32X.js → chunk-UEWCWES6.js} +3 -3
- package/dist/src/{chunk-V6EAOWSO.js → chunk-XKXYQAIA.js} +207 -230
- package/dist/src/command-protection-hook.js +4 -4
- package/dist/src/headless-agent.js +4 -4
- package/dist/src/index.js +8 -8
- 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-QOAJHPFJ.js";
|
|
12
|
+
import "./chunk-OQZLK6BN.js";
|
|
13
|
+
import "./chunk-UEWCWES6.js";
|
|
14
|
+
import "./chunk-55SJSOI2.js";
|
|
15
15
|
import "./chunk-UZSNFLDQ.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-XKXYQAIA.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
|
HOOK_EXEC_MAX_BUFFER_BYTES
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-XKXYQAIA.js";
|
|
7
7
|
|
|
8
8
|
// src/utils/exec.ts
|
|
9
9
|
import { exec, execFile } from "child_process";
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
getOriginDefaultBranch,
|
|
7
7
|
monolithRequest,
|
|
8
8
|
runGitCommand
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-OQZLK6BN.js";
|
|
10
10
|
import {
|
|
11
11
|
extractCommandProtectionCommandText,
|
|
12
12
|
findCommandProtectionGitLookups,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
findScoutRepoWriteSignals,
|
|
16
16
|
parseCommandProtectionRequest,
|
|
17
17
|
withE2BRetry
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-XKXYQAIA.js";
|
|
19
19
|
|
|
20
20
|
// src/services/command-protection-service.ts
|
|
21
21
|
import { readFile, stat } from "fs/promises";
|
|
@@ -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-UEWCWES6.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-XKXYQAIA.js";
|
|
19
19
|
|
|
20
20
|
// src/managers/codex-asp/notification-dispatch.ts
|
|
21
21
|
var TURN_STARTED_METHOD = "turn/started";
|
|
@@ -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-55SJSOI2.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-XKXYQAIA.js";
|
|
25
25
|
|
|
26
26
|
// src/runtime-env-loader.ts
|
|
27
27
|
import { readFileSync } from "fs";
|
|
@@ -11,15 +11,15 @@ import {
|
|
|
11
11
|
resolveDiffBase,
|
|
12
12
|
runGitCommand,
|
|
13
13
|
setAgentCredentialSnapshot
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-OQZLK6BN.js";
|
|
15
15
|
import {
|
|
16
16
|
AppServerProcess,
|
|
17
17
|
buildCodexAgentEnv
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-UEWCWES6.js";
|
|
19
19
|
import {
|
|
20
20
|
SUBPROCESS_MAX_BUFFER,
|
|
21
21
|
execFileAsync
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-55SJSOI2.js";
|
|
23
23
|
import {
|
|
24
24
|
isRecord
|
|
25
25
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
resolveOpenAICompatibleModelsUrl,
|
|
58
58
|
splitMothershipInstructions,
|
|
59
59
|
withTimeout
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-XKXYQAIA.js";
|
|
61
61
|
|
|
62
62
|
// src/managers/codex-token-manager.ts
|
|
63
63
|
import { promises as fs } from "fs";
|
|
@@ -320,7 +320,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
320
320
|
await this.applyCredentialUpdate(++this.credentialGeneration, async () => {
|
|
321
321
|
await this.applyCredentialsResponse(data);
|
|
322
322
|
setAgentCredentialSnapshot("codex", data);
|
|
323
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
323
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-QPONSSTK.js");
|
|
324
324
|
await restartCodexAspHostIfRunning2();
|
|
325
325
|
});
|
|
326
326
|
await this.start(true);
|
|
@@ -342,7 +342,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
342
342
|
const accountChanged = ENGINE_ENV.REPLICAS_AGENT_CREDENTIALS.codex?.credentialId !== data.credentialId;
|
|
343
343
|
await this.applyCredentialsResponse(data);
|
|
344
344
|
if (restartOnChange && (accountChanged || CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index]))) {
|
|
345
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
345
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-QPONSSTK.js");
|
|
346
346
|
await restartCodexAspHostIfRunning2();
|
|
347
347
|
}
|
|
348
348
|
setAgentCredentialSnapshot("codex", data);
|
|
@@ -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-55SJSOI2.js";
|
|
7
7
|
import {
|
|
8
8
|
isVersionBelow
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-XKXYQAIA.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.1494";
|
|
244
244
|
var INITIALIZE_METHOD = "initialize";
|
|
245
245
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
246
246
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -8507,8 +8507,8 @@ var require_CronExpression = __commonJS({
|
|
|
8507
8507
|
return false;
|
|
8508
8508
|
}
|
|
8509
8509
|
if (this.#checkDstTransition(currentDate)) {
|
|
8510
|
-
const
|
|
8511
|
-
for (let i = 0; i <
|
|
8510
|
+
const steps = reverse ? currentHour - nextHour : nextHour - currentHour;
|
|
8511
|
+
for (let i = 0; i < steps; i++) {
|
|
8512
8512
|
currentDate.applyDateOperation(dateMathVerb, CronDate_1.TimeUnit.Hour, hours.length);
|
|
8513
8513
|
if (!reverse && currentDate.getHours() >= nextHour)
|
|
8514
8514
|
break;
|
|
@@ -9096,8 +9096,8 @@ var require_CronFileParser = __commonJS({
|
|
|
9096
9096
|
expressions: [],
|
|
9097
9097
|
errors: {}
|
|
9098
9098
|
};
|
|
9099
|
-
for (const
|
|
9100
|
-
const entry =
|
|
9099
|
+
for (const block of blocks) {
|
|
9100
|
+
const entry = block.trim();
|
|
9101
9101
|
if (entry.length === 0 || entry.startsWith("#")) {
|
|
9102
9102
|
continue;
|
|
9103
9103
|
}
|
|
@@ -11761,8 +11761,8 @@ var WORKSPACE_SEARCH_INDEX_PARAMS = {
|
|
|
11761
11761
|
// ../shared/src/auth-fallback.ts
|
|
11762
11762
|
function describeCredential(provider2, credential) {
|
|
11763
11763
|
const { ownerName, email, ordinal: ordinal2 } = credential.account ?? {};
|
|
11764
|
-
const
|
|
11765
|
-
const owner = credential.scope === CREDENTIAL_SCOPE.USER ? ownerName ? `${ownerName}'s personal ${
|
|
11764
|
+
const label = `${getCredentialMethodLabel(provider2, credential.method)}${ordinal2 ? ` #${ordinal2}` : ""}`;
|
|
11765
|
+
const owner = credential.scope === CREDENTIAL_SCOPE.USER ? ownerName ? `${ownerName}'s personal ${label}` : `your ${label}` : credential.scope === CREDENTIAL_SCOPE.ORG ? `the organization's ${label}` : `the ${label}`;
|
|
11766
11766
|
return email ? `${owner} (${email})` : owner;
|
|
11767
11767
|
}
|
|
11768
11768
|
function describeAuthFallback(payload) {
|
|
@@ -11804,7 +11804,7 @@ var fallbackPlanStepSchema = z13.discriminatedUnion("kind", [
|
|
|
11804
11804
|
fallbackHarnessStepSchema
|
|
11805
11805
|
]);
|
|
11806
11806
|
var fallbackPlanResponseSchema = z13.object({
|
|
11807
|
-
steps: z13.array(z13.unknown()).transform((
|
|
11807
|
+
steps: z13.array(z13.unknown()).transform((steps) => steps.flatMap((step) => fallbackPlanStepSchema.safeParse(step).data ?? []))
|
|
11808
11808
|
});
|
|
11809
11809
|
|
|
11810
11810
|
// ../shared/src/chat-fork.ts
|
|
@@ -12164,6 +12164,7 @@ var REPLICAS_MCP_TOOLS = {
|
|
|
12164
12164
|
waitForSubagents: "wait_for_subagents",
|
|
12165
12165
|
getBoard: "get_board",
|
|
12166
12166
|
updateBoard: "update_board",
|
|
12167
|
+
updateTicket: "update_ticket",
|
|
12167
12168
|
sendToChat: "send_to_chat",
|
|
12168
12169
|
getLinearRouting: "get_linear_routing",
|
|
12169
12170
|
setLinearRouting: "set_linear_routing",
|
|
@@ -12198,10 +12199,14 @@ var automationToolInputSchema = z19.object({
|
|
|
12198
12199
|
goal_mode: z19.boolean().optional(),
|
|
12199
12200
|
fast_mode: z19.boolean().optional(),
|
|
12200
12201
|
workspace_lifecycle_policy: z19.enum(AUTOMATION_LIFECYCLE_POLICIES).optional().describe(
|
|
12201
|
-
"What happens to a run's workspace when the agent finishes. `delete_when_done` (default) when the output lives elsewhere (PR comments, checks, Slack posts); `sleep_when_done` when later runs reuse the workspace, like one per PR across pushes; `default` (keep alive) when people follow up in the workspace."
|
|
12202
|
+
"What happens to a run's workspace when the agent finishes. `delete_when_done` (default, except one-time runs, which default to `default`) when the output lives elsewhere (PR comments, checks, Slack posts); `sleep_when_done` when later runs reuse the workspace, like one per PR across pushes; `default` (keep alive) when people follow up in the workspace."
|
|
12202
12203
|
)
|
|
12203
12204
|
});
|
|
12205
|
+
var automationBackgroundSchema = z19.boolean().optional().describe(
|
|
12206
|
+
"Marks this as an AI agent's own automation (a reminder, follow-up or recurring check-in for its task). Kept out of the main automations list."
|
|
12207
|
+
);
|
|
12204
12208
|
var automationCreateToolInputSchema = automationToolInputSchema.extend({
|
|
12209
|
+
background: automationBackgroundSchema,
|
|
12205
12210
|
scope: z19.enum(["org", "user"]).optional().describe("`org` (default) or `user` for a personal automation, which needs a personal API key.")
|
|
12206
12211
|
});
|
|
12207
12212
|
var automationUpdateToolInputSchema = automationToolInputSchema.partial().extend({
|
|
@@ -12211,6 +12216,7 @@ var automationUpdateToolInputSchema = automationToolInputSchema.partial().extend
|
|
|
12211
12216
|
model: z19.string().nullable().optional(),
|
|
12212
12217
|
thinking_level: z19.enum(VALID_THINKING_LEVELS).nullable().optional(),
|
|
12213
12218
|
workspace_size: z19.enum(WORKSPACE_SIZES).optional(),
|
|
12219
|
+
background: automationBackgroundSchema,
|
|
12214
12220
|
scope: z19.literal("org").optional().describe("`org` moves a personal automation to the organization so teammates can see and edit it. It cannot be moved back.")
|
|
12215
12221
|
});
|
|
12216
12222
|
var chatPath = { id: z19.string().describe("Workspace ID"), chat_id: z19.string().describe("Chat ID") };
|
|
@@ -14282,6 +14288,7 @@ Take action *with* Replicas itself \u2014 manage automations, environments (vari
|
|
|
14282
14288
|
**Reference:** \`references/REPLICAS.md\`
|
|
14283
14289
|
|
|
14284
14290
|
Use this when:
|
|
14291
|
+
- The user asks you to start a new workspace or thread for a task \u2014 use \`replicas create\`, not an automation
|
|
14285
14292
|
- The user asks you to create, edit, run, or delete an automation
|
|
14286
14293
|
- The user asks you to come back to something later ("check back on this in a week", "remind me tomorrow", "tell me when CI is green") \u2014 schedule a follow-up (see *Follow-ups and reminders*)
|
|
14287
14294
|
- The user asks you to manage environments, environment variables, or environment files
|
|
@@ -14312,11 +14319,13 @@ Workspace identity:
|
|
|
14312
14319
|
|
|
14313
14320
|
If you get "Not logged in", the workspace is misconfigured \u2014 surface this to the user instead of trying to work around it.
|
|
14314
14321
|
|
|
14315
|
-
In agent mode the CLI hides commands that don't make sense for in-workspace agents (\`login\`, \`logout\`, \`codex-auth\`, \`claude-auth\`, \`org switch\`, \`config\`, \`interact\`, \`code
|
|
14322
|
+
In agent mode the CLI hides commands that don't make sense for in-workspace agents (\`login\`, \`logout\`, \`codex-auth\`, \`claude-auth\`, \`org switch\`, \`config\`, \`interact\`, \`code\`). What you have includes:
|
|
14316
14323
|
|
|
14317
14324
|
| Command | What it does |
|
|
14318
14325
|
| --- | --- |
|
|
14319
14326
|
| \`replicas whoami\` | Print the workspace + org identity |
|
|
14327
|
+
| \`replicas create <name> -e <env> -a <agent> -m "<prompt>"\` | Start a new workspace with its own agent (see *Starting a new workspace*) |
|
|
14328
|
+
| \`replicas get <id>\` / \`replicas list\` | Check a workspace's status, or find workspaces |
|
|
14320
14329
|
| \`replicas identity token [--audience <aud>]\` | Print the current short-lived workspace identity token for an audience |
|
|
14321
14330
|
| \`replicas identity token --format gcp --audience <aud>\` | Supply a current token to Google's executable credential source |
|
|
14322
14331
|
| \`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 |
|
|
@@ -14340,6 +14349,7 @@ In agent mode the CLI hides commands that don't make sense for in-workspace agen
|
|
|
14340
14349
|
|
|
14341
14350
|
| User says... | Run |
|
|
14342
14351
|
| --- | --- |
|
|
14352
|
+
| "Spin up a new workspace / thread to work on X" | \`replicas create <name> -e <env> -a <agent> -m "<prompt>"\` |
|
|
14343
14353
|
| "What environments do I have?" | \`replicas environment list\` |
|
|
14344
14354
|
| "Add API key X to my staging env" | \`replicas environment vars set <env> <KEY> <VALUE>\` |
|
|
14345
14355
|
| You need a secret or API key you don't have | \`replicas environment vars request <KEY>... --reason "..."\` (see "Asking the user for variables") |
|
|
@@ -14348,6 +14358,7 @@ In agent mode the CLI hides commands that don't make sense for in-workspace agen
|
|
|
14348
14358
|
| "What automations do I have?" | \`replicas automation list\` |
|
|
14349
14359
|
| "Run my nightly automation now" | \`replicas automation run <id>\` |
|
|
14350
14360
|
| "Check back on this in a week" | \`replicas automation create ... --in 1w --background --personal\` |
|
|
14361
|
+
| "Check this daily for a week" | \`replicas automation create ... --trigger-cron "0 9 * * *" --max-runs 7 --workspace current --background --personal\` |
|
|
14351
14362
|
| "Make an automation that runs every weekday at 9am" | \`replicas automation create\` (interactive) or \`--trigger-cron "0 9 * * 1-5"\` |
|
|
14352
14363
|
| "Make an automation that runs when a PR opens on \`acme/web\`" | \`replicas automation create ... --trigger-github pull_request.opened --trigger-github-repos acme/web\` |
|
|
14353
14364
|
| "Make an automation that runs when an MR opens on \`acme/web\`" | \`replicas automation create ... --trigger-gitlab merge_request.opened --trigger-gitlab-repos acme/web\` |
|
|
@@ -14421,6 +14432,19 @@ Constraints:
|
|
|
14421
14432
|
- \`set\` is upsert (matched by destination path).
|
|
14422
14433
|
- The display \`--name\` defaults to the basename of the destination path; override only if it would be unclear in the dashboard list.
|
|
14423
14434
|
|
|
14435
|
+
## Starting a new workspace
|
|
14436
|
+
|
|
14437
|
+
When the user asks you to start a task in a new workspace or thread, create it now with \`replicas create\`. Don't use a one-time automation for this; those are for work that should start later.
|
|
14438
|
+
|
|
14439
|
+
\`\`\`bash
|
|
14440
|
+
replicas create fix-login-redirect -e <env-name-or-id> -a claude -m "Fix the login redirect loop on /settings. Open a PR when done."
|
|
14441
|
+
\`\`\`
|
|
14442
|
+
|
|
14443
|
+
- The name can't contain spaces. Pick the environment with \`replicas environment list\`; use this workspace's environment when the task is in the same repos. Use \`-a\` with this conversation's agent unless the user asked for another.
|
|
14444
|
+
- Write \`-m\` as the full task: the new agent can't see this conversation.
|
|
14445
|
+
- On success it prints the workspace ID and a **Link**. Run \`replicas get <id>\` to confirm the workspace exists and is starting, then give the user the link.
|
|
14446
|
+
- If the command fails (it exits non-zero and prints the reason), tell the user the exact error. Never say a workspace was created unless \`replicas get\` found it.
|
|
14447
|
+
|
|
14424
14448
|
## Automations
|
|
14425
14449
|
|
|
14426
14450
|
Automations are saved prompts with one or more triggers (cron schedules and/or GitHub or GitLab events). When fired, they create a workspace using the configured environment and run the prompt with the user's coding agent.
|
|
@@ -14474,7 +14498,7 @@ replicas automation create ... --lifecycle default --auto-stop-minutes 30
|
|
|
14474
14498
|
\`\`\`
|
|
14475
14499
|
|
|
14476
14500
|
Pick the lifecycle by what happens after a run:
|
|
14477
|
-
- \`delete_when_done\` (default): the output lives elsewhere and nobody opens the workspace, e.g. a PR "DRY code check" that posts a comment or check.
|
|
14501
|
+
- \`delete_when_done\` (default, except one-time \`--in\`/\`--at\` runs, which default to \`default\`): the output lives elsewhere and nobody opens the workspace, e.g. a PR "DRY code check" that posts a comment or check.
|
|
14478
14502
|
- \`sleep_when_done\`: later runs reuse the workspace, e.g. one workspace per PR across pushes.
|
|
14479
14503
|
- \`default\`: people read or follow up in the workspace, e.g. a weekly changelog the team replies to.
|
|
14480
14504
|
|
|
@@ -14494,7 +14518,7 @@ replicas automation create "Re-check PR #142 CI" \\
|
|
|
14494
14518
|
- \`--in <duration>\` (\`30m\`, \`2h\`, \`3d\`, \`1w\`, \`1d12h\`) or \`--at <ISO-8601 with offset>\` (e.g. "tomorrow at 9am" \u2192 \`--at 2026-10-08T09:00:00-07:00\`, using the user's timezone if you know it; otherwise say which timezone you assumed).
|
|
14495
14519
|
- Inside a workspace, one-time follow-ups default to \`--workspace current\`, so you resume with this conversation's context. Inside a workspace, \`--environment\` defaults to this workspace's environment (same repositories), including for \`--workspace new\` and \`reuse\`.
|
|
14496
14520
|
- Write \`--prompt\` as instructions to your future self: the links, what to check, what "done" looks like, and how to report back (e.g. reply in the original Slack thread). It runs with no memory of why it was scheduled beyond what you write.
|
|
14497
|
-
- \`--background\`
|
|
14521
|
+
- \`--background\` marks an AI agent's own automation: a reminder, follow-up or recurring check-in for its task. It stays out of the user's main automations list, under **Background**.
|
|
14498
14522
|
- \`--personal\` makes the automation the user's own. Omit it only when the follow-up belongs to the organization.
|
|
14499
14523
|
- Recurring with an end: \`--trigger-cron "0 9 * * *" --max-runs 5 --workspace current\` runs daily five times, then deletes itself. \`--workspace reuse\` creates one new workspace on the first run and sends every later run to it; \`--workspace new\` (the default for non-one-time automations) creates a fresh workspace per run.
|
|
14500
14524
|
- Repeat \`--trigger-cron\` for different times on different days: \`--trigger-cron "0 9 * * 1" --trigger-cron "0 17 * * 5"\` runs Monday at 9 and Friday at 5.
|
|
@@ -15030,19 +15054,15 @@ function removeTag(text4, tag) {
|
|
|
15030
15054
|
function stripReplicasInstructionBlock(text4) {
|
|
15031
15055
|
return removeTag(text4, REPLICAS_INSTRUCTIONS_TAG);
|
|
15032
15056
|
}
|
|
15033
|
-
var MOTHERSHIP_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 and end with a one-line note.`;
|
|
15057
|
+
var MOTHERSHIP_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.`;
|
|
15034
15058
|
var BOARD_ANSWER_NOTE = "The user answered on the board.";
|
|
15035
|
-
var BOARD_RULES = `- The board
|
|
15036
|
-
|
|
15037
|
-
|
|
15038
|
-
|
|
15039
|
-
- Done (done, collapsed): pull requests once deployed, and finished work. Move a row from Working to Done as soon as its deploy or work finishes.
|
|
15040
|
-
- On every \`finished\` and \`archived\` event, move that ship's rows out of Working, or remove them, so Working only lists ships that are working.
|
|
15041
|
-
- 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 add it to Questions only if you can't decide.
|
|
15059
|
+
var BOARD_RULES = `- The board in the Ships pane beside this chat is the user's one view of the work. Each task is a ticket: spawning a ship creates its ticket, with the \`title\` and \`task\` you pass. The ship writes its ticket's summary, screenshots, recordings and questions, and Replicas files tickets under Needs you, Ready to review, Working or Done from the ship and its pull requests. Never restate what a ticket or pull request already shows.
|
|
15060
|
+
- 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.
|
|
15061
|
+
- 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.
|
|
15062
|
+
- 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.
|
|
15042
15063
|
- When a pull request should merge once it's approved and CI passes, call \`${REPLICAS_MCP_TOOLS.mergeWhenReady}\`: Replicas merges it and sends \`merged\`, or \`needs_attention\` saying why it can't. Never watch CI or pull requests with \`gh\`, sleep loops or wait scripts, and merge one yourself only when the user wants it merged right away.
|
|
15043
|
-
- On every ship event and every answer the user gives on the board
|
|
15044
|
-
- The chat is like texting an assistant: the user sees only your final reply to each message they type, plus what you send with \`${REPLICAS_MCP_TOOLS.sendToChat}\`, never your tool calls or earlier text. 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.
|
|
15045
|
-
- 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.
|
|
15064
|
+
- 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.
|
|
15065
|
+
- The chat is like texting an assistant: the user sees only your final reply to each message they type, plus what you send with \`${REPLICAS_MCP_TOOLS.sendToChat}\`, never your tool calls or earlier text. 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.
|
|
15046
15066
|
`;
|
|
15047
15067
|
var MOTHERSHIP_INSTRUCTIONS_BLOCK = new RegExp(`\\s*<${MOTHERSHIP_INSTRUCTIONS_TAG}>\\n([\\s\\S]*?)\\n</${MOTHERSHIP_INSTRUCTIONS_TAG}>`);
|
|
15048
15068
|
function splitMothershipInstructions(customInstructions) {
|
|
@@ -15187,11 +15207,11 @@ function coerceBackgroundTaskPayload(payload) {
|
|
|
15187
15207
|
const workflowAgents = Array.isArray(payload.workflow_progress) ? payload.workflow_progress.flatMap((entry) => {
|
|
15188
15208
|
if (!isRecord(entry) || entry.type !== "workflow_agent") return [];
|
|
15189
15209
|
const agentId = optionalString(entry.agentId);
|
|
15190
|
-
const
|
|
15191
|
-
if (!agentId || !
|
|
15210
|
+
const label = optionalString(entry.label);
|
|
15211
|
+
if (!agentId || !label) return [];
|
|
15192
15212
|
return [{
|
|
15193
15213
|
agentId,
|
|
15194
|
-
label
|
|
15214
|
+
label,
|
|
15195
15215
|
model: optionalString(entry.model),
|
|
15196
15216
|
state: optionalString(entry.state),
|
|
15197
15217
|
promptPreview: optionalString(entry.promptPreview),
|
|
@@ -15842,24 +15862,24 @@ function lineCountFromOutput(output) {
|
|
|
15842
15862
|
}
|
|
15843
15863
|
return lines;
|
|
15844
15864
|
}
|
|
15845
|
-
function fileContentDiff(path, content,
|
|
15865
|
+
function fileContentDiff(path, content, action) {
|
|
15846
15866
|
const lines = content.replace(/\n$/, "").split("\n");
|
|
15847
15867
|
return [
|
|
15848
|
-
`--- ${
|
|
15849
|
-
`+++ ${
|
|
15850
|
-
|
|
15851
|
-
...lines.map((line) => `${
|
|
15868
|
+
`--- ${action === "add" ? "/dev/null" : `a/${path}`}`,
|
|
15869
|
+
`+++ ${action === "add" ? `b/${path}` : "/dev/null"}`,
|
|
15870
|
+
action === "add" ? `@@ -0,0 +1,${lines.length} @@` : `@@ -1,${lines.length} +0,0 @@`,
|
|
15871
|
+
...lines.map((line) => `${action === "add" ? "+" : "-"}${line}`)
|
|
15852
15872
|
].join("\n");
|
|
15853
15873
|
}
|
|
15854
|
-
function isRawFileContent(diff,
|
|
15874
|
+
function isRawFileContent(diff, action) {
|
|
15855
15875
|
const lines = diff.split("\n");
|
|
15856
|
-
return !lines[0].startsWith("diff --git ") && !(lines[0].startsWith("--- ") && lines[1]?.startsWith("+++ ")) && !(
|
|
15876
|
+
return !lines[0].startsWith("diff --git ") && !(lines[0].startsWith("--- ") && lines[1]?.startsWith("+++ ")) && !(action === "add" && lines.every((line) => line === "" || line.startsWith("+")));
|
|
15857
15877
|
}
|
|
15858
|
-
function operationDiffStats({ diff, action
|
|
15878
|
+
function operationDiffStats({ diff, action }) {
|
|
15859
15879
|
if (!diff) return void 0;
|
|
15860
|
-
if (
|
|
15880
|
+
if (action === "update" || !isRawFileContent(diff, action)) return getDiffStats(diff);
|
|
15861
15881
|
const lines = diff.replace(/\n$/, "").split("\n").length;
|
|
15862
|
-
return
|
|
15882
|
+
return action === "add" ? { added: lines, removed: 0 } : { added: 0, removed: lines };
|
|
15863
15883
|
}
|
|
15864
15884
|
function getDiffStats(diff) {
|
|
15865
15885
|
let added = 0;
|
|
@@ -16194,7 +16214,7 @@ function workspaceTargetFromToolOutput(output) {
|
|
|
16194
16214
|
const value = output?.split(/\r?\n/).find((line) => line.startsWith("Workspace: "))?.slice("Workspace: ".length);
|
|
16195
16215
|
if (!value) return null;
|
|
16196
16216
|
const nameEnd = value.endsWith(")") ? value.lastIndexOf(" (") : -1;
|
|
16197
|
-
const
|
|
16217
|
+
const label = nameEnd > 0 ? value.slice(0, nameEnd) : "";
|
|
16198
16218
|
const href = nameEnd > 0 ? value.slice(nameEnd + 2, -1) : value;
|
|
16199
16219
|
try {
|
|
16200
16220
|
const segments = new URL(href, DEFAULT_WEB_APP_URL).pathname.split("/").filter(Boolean);
|
|
@@ -16202,7 +16222,7 @@ function workspaceTargetFromToolOutput(output) {
|
|
|
16202
16222
|
if (!id || !UUID_RE.test(id)) return null;
|
|
16203
16223
|
return {
|
|
16204
16224
|
id,
|
|
16205
|
-
label: sanitizeTerminalLine(
|
|
16225
|
+
label: sanitizeTerminalLine(label) || "Workspace",
|
|
16206
16226
|
href: getWorkspaceDashboardUrl(id, { webAppUrl: "" })
|
|
16207
16227
|
};
|
|
16208
16228
|
} catch {
|
|
@@ -16212,115 +16232,68 @@ function workspaceTargetFromToolOutput(output) {
|
|
|
16212
16232
|
|
|
16213
16233
|
// ../shared/src/mothership-board.ts
|
|
16214
16234
|
import { z as z26 } from "zod";
|
|
16215
|
-
var
|
|
16216
|
-
|
|
16217
|
-
|
|
16218
|
-
|
|
16235
|
+
var MOTHERSHIP_TICKET_LIMITS = {
|
|
16236
|
+
title: 80,
|
|
16237
|
+
task: 1e3,
|
|
16238
|
+
summary: 600,
|
|
16239
|
+
note: 100,
|
|
16240
|
+
overview: 160,
|
|
16241
|
+
question: 300,
|
|
16242
|
+
option: 60,
|
|
16243
|
+
options: 3,
|
|
16244
|
+
questions: 2,
|
|
16245
|
+
blocked: 200,
|
|
16246
|
+
media: 6,
|
|
16247
|
+
caption: 80,
|
|
16248
|
+
answer: 2e3
|
|
16249
|
+
};
|
|
16250
|
+
var L = MOTHERSHIP_TICKET_LIMITS;
|
|
16251
|
+
var tooLong = (max) => `At most ${max} characters. Keep it short; the user should take it in at a glance`;
|
|
16252
|
+
var text3 = (max) => z26.string().trim().min(1).max(max, tooLong(max));
|
|
16253
|
+
var clearable = (schema) => z26.union([schema, z26.literal("")]).optional();
|
|
16219
16254
|
var httpsUrl = z26.url({ protocol: /^https$/, error: "Must be an https URL" });
|
|
16220
|
-
var prUrl = httpsUrl.refine((url) => parseCodeHostPrUrl(url) !== null, "Must be a GitHub pull request or GitLab merge request URL");
|
|
16221
16255
|
var linearIdentifier = z26.string().regex(/^[A-Za-z][A-Za-z0-9]{0,9}-\d{1,7}$/, "Use a Linear identifier such as REP-123");
|
|
16222
|
-
var
|
|
16223
|
-
|
|
16224
|
-
|
|
16225
|
-
|
|
16226
|
-
z26.object({ type: z26.literal("merge_pr"), url: prUrl }),
|
|
16227
|
-
z26.object({ type: z26.literal("message_mothership"), message: label(4e3) }),
|
|
16228
|
-
z26.object({ type: z26.literal("open_link"), url: httpsUrl })
|
|
16229
|
-
]);
|
|
16230
|
-
var text3 = z26.object({ type: z26.literal("text"), id: blockId.optional(), text: label(2e3) });
|
|
16231
|
-
var badge = z26.object({ type: z26.literal("badge"), id: blockId.optional(), label: label(40), tone: tone.optional() });
|
|
16232
|
-
var pr = z26.object({ type: z26.literal("pr"), id: blockId.optional(), url: prUrl });
|
|
16233
|
-
var ship = z26.object({ type: z26.literal("ship"), id: blockId.optional(), workspace_id: z26.uuid() });
|
|
16234
|
-
var linear = z26.object({ type: z26.literal("linear"), id: blockId.optional(), identifier: linearIdentifier });
|
|
16235
|
-
var button = z26.object({ type: z26.literal("button"), id: blockId.optional(), label: label(60), action, variant: z26.enum(["primary", "outline", "warning", "destructive"]).optional(), resolves: blockId.optional() });
|
|
16236
|
-
var steps = z26.object({
|
|
16237
|
-
type: z26.literal("steps"),
|
|
16238
|
-
id: blockId.optional(),
|
|
16239
|
-
steps: z26.array(z26.object({ label: label(30), state: z26.enum(["done", "current", "pending", "failed"]) })).min(1).max(8)
|
|
16256
|
+
var mediaSchema = z26.object({
|
|
16257
|
+
url: httpsUrl.describe("The URL `replicas media upload` printed."),
|
|
16258
|
+
caption: text3(L.caption).describe('What it shows, such as "After: the list stays pinned".'),
|
|
16259
|
+
kind: z26.enum(["image", "video"]).describe("video for recordings, image for screenshots and GIFs.")
|
|
16240
16260
|
});
|
|
16241
|
-
var
|
|
16242
|
-
|
|
16243
|
-
|
|
16244
|
-
text: text3,
|
|
16245
|
-
badge,
|
|
16246
|
-
pr,
|
|
16247
|
-
ship,
|
|
16248
|
-
linear,
|
|
16249
|
-
button,
|
|
16250
|
-
steps,
|
|
16251
|
-
stat: z26.object({ type: z26.literal("stat"), id: blockId.optional(), label: label(40), value: label(40), tone: tone.optional() }),
|
|
16252
|
-
divider: z26.object({ type: z26.literal("divider"), id: blockId.optional() }),
|
|
16253
|
-
updated_at: z26.object({ type: z26.literal("updated_at"), id: blockId.optional() }),
|
|
16254
|
-
choice: z26.object({
|
|
16255
|
-
type: z26.literal("choice"),
|
|
16256
|
-
id: blockId.optional(),
|
|
16257
|
-
question: label(500),
|
|
16258
|
-
options: z26.array(z26.object({ label: label(60), message: label(2e3).optional() })).min(2).max(6),
|
|
16259
|
-
allow_custom: z26.boolean().optional(),
|
|
16260
|
-
resolves: blockId.optional()
|
|
16261
|
-
}),
|
|
16262
|
-
button_group: z26.object({ type: z26.literal("button_group"), id: blockId.optional(), children: z26.array(button).min(1).max(8) }),
|
|
16263
|
-
table: z26.object({ type: z26.literal("table"), id: blockId.optional(), columns: z26.array(label(40)).min(1).max(6), children: z26.array(row).max(100) }),
|
|
16264
|
-
callout: z26.object({
|
|
16265
|
-
type: z26.literal("callout"),
|
|
16266
|
-
id: blockId.optional(),
|
|
16267
|
-
tone,
|
|
16268
|
-
title: label(120).optional(),
|
|
16269
|
-
get children() {
|
|
16270
|
-
return z26.array(block).max(20).optional();
|
|
16271
|
-
}
|
|
16272
|
-
}),
|
|
16273
|
-
list: z26.object({
|
|
16274
|
-
type: z26.literal("list"),
|
|
16275
|
-
id: blockId.optional(),
|
|
16276
|
-
ordered: z26.boolean().optional(),
|
|
16277
|
-
get children() {
|
|
16278
|
-
return z26.array(block).max(100);
|
|
16279
|
-
}
|
|
16280
|
-
}),
|
|
16281
|
-
section: z26.object({
|
|
16282
|
-
type: z26.literal("section"),
|
|
16283
|
-
id: blockId.optional(),
|
|
16284
|
-
title: label(120),
|
|
16285
|
-
tone: tone.optional(),
|
|
16286
|
-
collapsed: z26.boolean().optional(),
|
|
16287
|
-
get children() {
|
|
16288
|
-
return z26.array(block).max(100);
|
|
16289
|
-
}
|
|
16290
|
-
})
|
|
16291
|
-
};
|
|
16292
|
-
var blockSchemas = [text3, ...Object.values(blockTypes).filter((schema) => schema !== text3)];
|
|
16293
|
-
var block = z26.discriminatedUnion("type", blockSchemas);
|
|
16294
|
-
var MOTHERSHIP_BOARD_CONTAINER_TYPES = Object.entries(blockTypes).filter(([, schema]) => "children" in schema.shape).map(([type]) => type);
|
|
16295
|
-
var mothershipBoardBlocksSchema = z26.array(block).max(100).superRefine((blocks, ctx) => {
|
|
16296
|
-
const seen = /* @__PURE__ */ new Set();
|
|
16297
|
-
const visit = (node, path) => {
|
|
16298
|
-
if (typeof node === "string") return;
|
|
16299
|
-
if (node.id) {
|
|
16300
|
-
if (seen.has(node.id)) ctx.addIssue({ code: "custom", path: [...path, "id"], message: `Duplicate block id "${node.id}"` });
|
|
16301
|
-
seen.add(node.id);
|
|
16302
|
-
}
|
|
16303
|
-
if (node.type === "table") {
|
|
16304
|
-
node.children.forEach((child, index) => {
|
|
16305
|
-
if (child.cells.length > node.columns.length) ctx.addIssue({ code: "custom", path: [...path, "children", index, "cells"], message: `Row has ${child.cells.length} cells but the table has ${node.columns.length} columns` });
|
|
16306
|
-
});
|
|
16307
|
-
}
|
|
16308
|
-
if (node.type === "row") node.cells.forEach((cell, index) => visit(cell, [...path, "cells", index]));
|
|
16309
|
-
else if ("children" in node) node.children?.forEach((child, index) => visit(child, [...path, "children", index]));
|
|
16310
|
-
};
|
|
16311
|
-
blocks.forEach((node, index) => visit(node, [index]));
|
|
16261
|
+
var questionSchema = z26.object({
|
|
16262
|
+
question: text3(L.question).describe("One question, with the context needed to answer it."),
|
|
16263
|
+
options: z26.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.")
|
|
16312
16264
|
});
|
|
16313
|
-
var
|
|
16314
|
-
|
|
16315
|
-
|
|
16316
|
-
|
|
16317
|
-
|
|
16318
|
-
|
|
16319
|
-
|
|
16320
|
-
}),
|
|
16321
|
-
|
|
16322
|
-
|
|
16323
|
-
var
|
|
16265
|
+
var mothershipTicketTitleSchema = text3(L.title);
|
|
16266
|
+
var mothershipTicketTaskSchema = text3(L.task);
|
|
16267
|
+
var mothershipTicketMediaSchema = z26.array(mediaSchema);
|
|
16268
|
+
var mothershipTicketQuestionsSchema = z26.array(questionSchema.extend({ id: z26.string() }));
|
|
16269
|
+
var updateMothershipTicketRequestSchema = z26.object({
|
|
16270
|
+
summary: text3(L.summary).optional().describe(`What you did and what came of it, in two to four plain sentences a busy reader understands, with pull requests as #number. Markdown: **bold**, *italics*, \`code\` and [links](https://...). At most ${L.summary} characters.`),
|
|
16271
|
+
media: z26.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.`),
|
|
16272
|
+
questions: z26.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.`),
|
|
16273
|
+
blocked: clearable(text3(L.blocked)).describe('Why you cannot go on without the user, such as missing access. "" once unblocked.')
|
|
16274
|
+
});
|
|
16275
|
+
var updateMothershipBoardRequestSchema = z26.object({
|
|
16276
|
+
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.`),
|
|
16277
|
+
tickets: z26.array(z26.object({
|
|
16278
|
+
id: z26.uuid(),
|
|
16279
|
+
title: mothershipTicketTitleSchema.optional(),
|
|
16280
|
+
note: clearable(text3(L.note)).describe(`Your one short comment on the ticket, shown under its row, replacing the last. "" removes it. At most ${L.note} characters.`),
|
|
16281
|
+
linear: clearable(linearIdentifier).describe('The Linear issue this ticket is for, such as REP-123. "" removes it.'),
|
|
16282
|
+
archived: z26.boolean().optional().describe("Take it off the board.")
|
|
16283
|
+
})).max(50).optional().describe("Changes to existing tickets."),
|
|
16284
|
+
order: z26.array(z26.uuid()).optional().describe("Ticket ids, most important first. Tickets left out keep their order after these."),
|
|
16285
|
+
create: z26.array(z26.object({
|
|
16286
|
+
title: mothershipTicketTitleSchema,
|
|
16287
|
+
task: mothershipTicketTaskSchema.optional(),
|
|
16288
|
+
questions: z26.array(questionSchema).max(L.questions).optional(),
|
|
16289
|
+
note: text3(L.note).optional()
|
|
16290
|
+
})).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.")
|
|
16291
|
+
});
|
|
16292
|
+
var answerMothershipTicketRequestSchema = z26.object({
|
|
16293
|
+
questionId: z26.string().min(1),
|
|
16294
|
+
answer: text3(L.answer)
|
|
16295
|
+
});
|
|
16296
|
+
var mothershipTicketAnswerRefSchema = z26.object({ mothershipId: z26.uuid(), ticketId: z26.uuid(), questionId: z26.string().min(1) });
|
|
16324
16297
|
var LINEAR_ISSUE_SUMMARIES_MAX = 50;
|
|
16325
16298
|
var linearIssueSummariesRequestSchema = z26.object({ identifiers: z26.array(linearIdentifier).min(1).max(LINEAR_ISSUE_SUMMARIES_MAX) });
|
|
16326
16299
|
|
|
@@ -16374,8 +16347,8 @@ function shellPayload(command) {
|
|
|
16374
16347
|
function commandLabel(command) {
|
|
16375
16348
|
const lines = shellPayload(command.slice(0, COMMAND_PARSE_LIMIT)).replace(/^cd\s+\S+\s*&&\s*/, "").split("\n").filter((line) => line.trim());
|
|
16376
16349
|
const shown = lines.length > 1 && /(["']|<<-?\s*['"]?\w+['"]?)\s*$/.test(lines[0]) ? 2 : 1;
|
|
16377
|
-
const
|
|
16378
|
-
return lines.length > shown ? `${
|
|
16350
|
+
const label = lines.slice(0, shown).map((line) => line.trim()).join(" ");
|
|
16351
|
+
return lines.length > shown ? `${label} \u2026` : label;
|
|
16379
16352
|
}
|
|
16380
16353
|
var BACKGROUND_META = {
|
|
16381
16354
|
in_progress: "Running in background",
|
|
@@ -16536,6 +16509,7 @@ var REPLICAS_API_STEPS = {
|
|
|
16536
16509
|
[REPLICAS_MCP_TOOLS.clearLinearRouting]: { icon: "trash", live: "Clearing Linear routing", done: "Cleared Linear routing" },
|
|
16537
16510
|
[REPLICAS_MCP_TOOLS.getBoard]: { icon: "book", live: "Reading board", done: "Read board" },
|
|
16538
16511
|
[REPLICAS_MCP_TOOLS.updateBoard]: { icon: "file-pen", live: "Updating board", done: "Updated board" },
|
|
16512
|
+
[REPLICAS_MCP_TOOLS.updateTicket]: { icon: "file-pen", live: "Updating ticket", done: "Updated ticket" },
|
|
16539
16513
|
[REPLICAS_MCP_TOOLS.sendToChat]: { icon: "message", live: "Sending to chat", done: "Sent to chat" },
|
|
16540
16514
|
[REPLICAS_MCP_TOOLS.mergeWhenReady]: { icon: "target", live: "Setting merge when ready", done: "Set merge when ready" }
|
|
16541
16515
|
};
|
|
@@ -16590,13 +16564,13 @@ function describeToolCall(message2, base) {
|
|
|
16590
16564
|
const command = replicasTool === REPLICAS_MCP_TOOLS.runCommand ? inputString(input, "command") : void 0;
|
|
16591
16565
|
const name = inputString(input, "name") ?? inputString(replicaFields, "name");
|
|
16592
16566
|
const workspaceId = inputString(input, "id") ?? inputString(replicaFields, "id");
|
|
16593
|
-
const
|
|
16567
|
+
const label = command ? commandLabel(command) : inputString(input, "title") ?? (replicasTool === REPLICAS_MCP_TOOLS.createAutomation ? name : void 0);
|
|
16594
16568
|
return {
|
|
16595
16569
|
...base,
|
|
16596
16570
|
key,
|
|
16597
16571
|
category: "tool",
|
|
16598
16572
|
...replicasStep,
|
|
16599
|
-
target:
|
|
16573
|
+
target: label ? { text: label, plain: !command } : void 0,
|
|
16600
16574
|
workspace: workspaceId && UUID_RE.test(workspaceId) ? { id: workspaceId, name } : void 0,
|
|
16601
16575
|
detail: message2.input || message2.output ? "io" : void 0
|
|
16602
16576
|
};
|
|
@@ -16654,12 +16628,12 @@ function describeSteps(message2, { durations, backgroundTasks }) {
|
|
|
16654
16628
|
const background = backgroundId ? backgroundTasks?.get(backgroundId) : void 0;
|
|
16655
16629
|
const cached = stepCache.get(message2);
|
|
16656
16630
|
if (cached && cached.durationMs === durationMs && cached.background === background) return cached.steps;
|
|
16657
|
-
const
|
|
16631
|
+
const steps = describeMessageSteps(message2, durationMs, background).map((step) => ({
|
|
16658
16632
|
...step,
|
|
16659
16633
|
stats: step.operation && !step.failed ? operationDiffStats(step.operation) : void 0
|
|
16660
16634
|
}));
|
|
16661
|
-
stepCache.set(message2, { durationMs, background, steps
|
|
16662
|
-
return
|
|
16635
|
+
stepCache.set(message2, { durationMs, background, steps });
|
|
16636
|
+
return steps;
|
|
16663
16637
|
}
|
|
16664
16638
|
var NO_DURATIONS = /* @__PURE__ */ new Map();
|
|
16665
16639
|
function plainStepLabel(step) {
|
|
@@ -17319,7 +17293,7 @@ function parseCodexEvents(events) {
|
|
|
17319
17293
|
// ../shared/src/display-message/parsers/cursor-parser.ts
|
|
17320
17294
|
function getTextContent(value) {
|
|
17321
17295
|
if (!Array.isArray(value)) return "";
|
|
17322
|
-
return value.map((
|
|
17296
|
+
return value.map((block) => isRecord(block) && block.type === "text" && typeof block.text === "string" ? block.text : "").join("");
|
|
17323
17297
|
}
|
|
17324
17298
|
function cursorStatusToDisplayStatus(status) {
|
|
17325
17299
|
return status === "completed" || status === "FINISHED" ? "completed" : status === "error" || status === "ERROR" || status === "CANCELLED" || status === "EXPIRED" ? "failed" : "in_progress";
|
|
@@ -17580,8 +17554,8 @@ var SERVER_ERROR_TEXT_PATTERN = /internal ?server ?error|server ?error|service u
|
|
|
17580
17554
|
var INFERENCE_ERROR_DETAIL_MAX = 600;
|
|
17581
17555
|
var INFERENCE_ERROR_RETRY_HINT = "This is usually temporary \u2014 retry the message.";
|
|
17582
17556
|
function formatInferenceError(message2, context = {}) {
|
|
17583
|
-
const
|
|
17584
|
-
const source =
|
|
17557
|
+
const label = context.provider ? INFERENCE_PROVIDER_LABELS[context.provider] ?? context.provider : null;
|
|
17558
|
+
const source = label ? `${label}${context.model ? ` (${context.model})` : ""} request failed${typeof context.status === "number" ? ` with HTTP ${context.status}` : ""}` : null;
|
|
17585
17559
|
let body = source ? message2 ? `${source}: ${message2}` : `${source}.` : message2;
|
|
17586
17560
|
const detail = context.detail?.trim();
|
|
17587
17561
|
if (detail && !body.includes(detail)) {
|
|
@@ -17621,6 +17595,11 @@ function assistantError(info) {
|
|
|
17621
17595
|
function parseOpencodeEvents(events) {
|
|
17622
17596
|
const messages = [];
|
|
17623
17597
|
const inputState = { requests: /* @__PURE__ */ new Map(), resolutions: /* @__PURE__ */ new Map(), requestedAt: /* @__PURE__ */ new Map() };
|
|
17598
|
+
const streamedParts = /* @__PURE__ */ new Map();
|
|
17599
|
+
const upsertStreamedPart = ({ id, type, text: text4, completed, timestamp }) => {
|
|
17600
|
+
if (!text4.trim()) return;
|
|
17601
|
+
upsertDisplayMessage(messages, type === "text" ? { id, type: "agent", content: text4, timestamp } : { id, type: "reasoning", content: text4, status: completed ? "completed" : "in_progress", timestamp });
|
|
17602
|
+
};
|
|
17624
17603
|
for (const event of events) {
|
|
17625
17604
|
if (event.type === "event_msg" && event.payload.type === "user_message") {
|
|
17626
17605
|
const message2 = event.payload.message;
|
|
@@ -17636,10 +17615,11 @@ function parseOpencodeEvents(events) {
|
|
|
17636
17615
|
continue;
|
|
17637
17616
|
}
|
|
17638
17617
|
if (event.type === "opencode-message.updated") {
|
|
17639
|
-
const
|
|
17618
|
+
const { info } = event.payload;
|
|
17619
|
+
const error = assistantError(info);
|
|
17640
17620
|
if (error) {
|
|
17641
|
-
messages
|
|
17642
|
-
id: `opencode-${event.type}-${event.timestamp}`,
|
|
17621
|
+
upsertDisplayMessage(messages, {
|
|
17622
|
+
id: isRecord(info) && typeof info.id === "string" ? `opencode-error-${info.id}` : `opencode-${event.type}-${event.timestamp}`,
|
|
17643
17623
|
type: "error",
|
|
17644
17624
|
message: error,
|
|
17645
17625
|
timestamp: event.timestamp
|
|
@@ -17647,6 +17627,15 @@ function parseOpencodeEvents(events) {
|
|
|
17647
17627
|
}
|
|
17648
17628
|
continue;
|
|
17649
17629
|
}
|
|
17630
|
+
if (event.type === "opencode-message.part.delta") {
|
|
17631
|
+
const { partID, field, delta } = event.payload;
|
|
17632
|
+
const streamed = typeof partID === "string" ? streamedParts.get(partID) : void 0;
|
|
17633
|
+
if (streamed && field === "text" && typeof delta === "string") {
|
|
17634
|
+
streamed.text += delta;
|
|
17635
|
+
upsertStreamedPart(streamed);
|
|
17636
|
+
}
|
|
17637
|
+
continue;
|
|
17638
|
+
}
|
|
17650
17639
|
if (event.type === "opencode-error") {
|
|
17651
17640
|
const message2 = typeof event.payload.message === "string" ? event.payload.message : "Opencode run failed";
|
|
17652
17641
|
messages.push({
|
|
@@ -17683,29 +17672,16 @@ function parseOpencodeEvents(events) {
|
|
|
17683
17672
|
else if (typeof part.id === "string") id = `opencode-${part.id}`;
|
|
17684
17673
|
const time = isRecord(part.time) ? part.time : null;
|
|
17685
17674
|
const timestamp = timestampFromMs(time?.start, event.timestamp);
|
|
17686
|
-
if (part.type === "text") {
|
|
17687
|
-
const
|
|
17688
|
-
|
|
17689
|
-
|
|
17690
|
-
|
|
17691
|
-
|
|
17692
|
-
|
|
17693
|
-
|
|
17694
|
-
|
|
17695
|
-
|
|
17696
|
-
continue;
|
|
17697
|
-
}
|
|
17698
|
-
if (part.type === "reasoning") {
|
|
17699
|
-
const text4 = typeof part.text === "string" ? part.text : "";
|
|
17700
|
-
if (text4.trim()) {
|
|
17701
|
-
upsertDisplayMessage(messages, {
|
|
17702
|
-
id,
|
|
17703
|
-
type: "reasoning",
|
|
17704
|
-
content: text4,
|
|
17705
|
-
status: time?.end ? "completed" : "in_progress",
|
|
17706
|
-
timestamp
|
|
17707
|
-
});
|
|
17708
|
-
}
|
|
17675
|
+
if ((part.type === "text" || part.type === "reasoning") && typeof part.id === "string") {
|
|
17676
|
+
const streamed = {
|
|
17677
|
+
id,
|
|
17678
|
+
type: part.type,
|
|
17679
|
+
text: typeof part.text === "string" ? part.text : "",
|
|
17680
|
+
completed: Boolean(time?.end),
|
|
17681
|
+
timestamp
|
|
17682
|
+
};
|
|
17683
|
+
streamedParts.set(part.id, streamed);
|
|
17684
|
+
upsertStreamedPart(streamed);
|
|
17709
17685
|
continue;
|
|
17710
17686
|
}
|
|
17711
17687
|
if (part.type === "tool" && isRecord(part.state)) {
|
|
@@ -17963,7 +17939,7 @@ function normalizeContentBlocks(content) {
|
|
|
17963
17939
|
if (typeof content === "string") {
|
|
17964
17940
|
return content ? [{ type: "text", text: content }] : [];
|
|
17965
17941
|
}
|
|
17966
|
-
return Array.isArray(content) ? content.filter((
|
|
17942
|
+
return Array.isArray(content) ? content.filter((block) => isRecord(block) && typeof block.type === "string") : [];
|
|
17967
17943
|
}
|
|
17968
17944
|
function parseStringField(value) {
|
|
17969
17945
|
if (typeof value !== "string") return null;
|
|
@@ -18044,13 +18020,13 @@ var TaskAccumulator = class {
|
|
|
18044
18020
|
}
|
|
18045
18021
|
return out;
|
|
18046
18022
|
}
|
|
18047
|
-
processContentBlock(
|
|
18048
|
-
if (!isRecord(
|
|
18049
|
-
if (
|
|
18050
|
-
return this.processToolUse(
|
|
18023
|
+
processContentBlock(block) {
|
|
18024
|
+
if (!isRecord(block)) return false;
|
|
18025
|
+
if (block.type === "tool_use" && typeof block.name === "string" && typeof block.id === "string") {
|
|
18026
|
+
return this.processToolUse(block.name, block.id, toAccumulatorInput(block.input));
|
|
18051
18027
|
}
|
|
18052
|
-
if (
|
|
18053
|
-
return this.processCreateResult(
|
|
18028
|
+
if (block.type === "tool_result" && typeof block.tool_use_id === "string") {
|
|
18029
|
+
return this.processCreateResult(block.tool_use_id, block.content);
|
|
18054
18030
|
}
|
|
18055
18031
|
return false;
|
|
18056
18032
|
}
|
|
@@ -18062,12 +18038,12 @@ var COMMAND_TOOL_NAMES = /* @__PURE__ */ new Set(["Bash", "bash", "shell"]);
|
|
|
18062
18038
|
var FILE_TOOL_NAMES = /* @__PURE__ */ new Set(["Write", "Edit"]);
|
|
18063
18039
|
var toolMessageTemplates = /* @__PURE__ */ new WeakMap();
|
|
18064
18040
|
var toolResults = /* @__PURE__ */ new WeakMap();
|
|
18065
|
-
function fileOrCommandMessage(
|
|
18066
|
-
let template = toolMessageTemplates.get(
|
|
18041
|
+
function fileOrCommandMessage(block, timestamp) {
|
|
18042
|
+
let template = toolMessageTemplates.get(block);
|
|
18067
18043
|
if (!template) {
|
|
18068
|
-
const input = typeof
|
|
18069
|
-
template = toolMessageTemplate(
|
|
18070
|
-
toolMessageTemplates.set(
|
|
18044
|
+
const input = typeof block.input === "string" ? safeJsonParse(block.input, {}) : block.input ?? {};
|
|
18045
|
+
template = toolMessageTemplate(block.name ?? "", block.id ?? "", input);
|
|
18046
|
+
toolMessageTemplates.set(block, template);
|
|
18071
18047
|
}
|
|
18072
18048
|
return { ...template, timestamp };
|
|
18073
18049
|
}
|
|
@@ -18395,13 +18371,13 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
18395
18371
|
if (liveStreamId !== null && liveStreamId !== messageId) {
|
|
18396
18372
|
supersededStreamIds.add(liveStreamId);
|
|
18397
18373
|
}
|
|
18398
|
-
if (contentBlocks.some((
|
|
18374
|
+
if (contentBlocks.some((block) => block.type === "text" && block.text)) {
|
|
18399
18375
|
completedStreamIds.add(messageId);
|
|
18400
18376
|
liveStreamId = null;
|
|
18401
18377
|
}
|
|
18402
18378
|
}
|
|
18403
18379
|
const thinkingBlocks = contentBlocks.flatMap(
|
|
18404
|
-
(
|
|
18380
|
+
(block) => block.type === "thinking" && typeof block.thinking === "string" ? [block.thinking] : []
|
|
18405
18381
|
);
|
|
18406
18382
|
if (thinkingBlocks.length > 0) {
|
|
18407
18383
|
const allThinking = [...assistantThinking.get(messageKey) ?? [], ...thinkingBlocks];
|
|
@@ -18420,14 +18396,14 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
18420
18396
|
upsertMessage(reasoningMessage);
|
|
18421
18397
|
}
|
|
18422
18398
|
}
|
|
18423
|
-
contentBlocks.forEach((
|
|
18424
|
-
if (
|
|
18399
|
+
contentBlocks.forEach((block) => {
|
|
18400
|
+
if (block.type === "text" && block.text) {
|
|
18425
18401
|
const textIndex = assistantTextCounts.get(messageKey) ?? 0;
|
|
18426
18402
|
assistantTextCounts.set(messageKey, textIndex + 1);
|
|
18427
18403
|
const agentMessage = {
|
|
18428
18404
|
id: `agent-${messageKey}-${textIndex}`,
|
|
18429
18405
|
type: "agent",
|
|
18430
|
-
content:
|
|
18406
|
+
content: block.text,
|
|
18431
18407
|
timestamp: event.timestamp
|
|
18432
18408
|
};
|
|
18433
18409
|
if (streamRefs?.agent !== void 0) {
|
|
@@ -18437,10 +18413,10 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
18437
18413
|
upsertMessage(agentMessage);
|
|
18438
18414
|
}
|
|
18439
18415
|
}
|
|
18440
|
-
if (
|
|
18441
|
-
const toolName =
|
|
18442
|
-
const toolInput =
|
|
18443
|
-
const toolUseId =
|
|
18416
|
+
if (block.type === "tool_use" && block.id) {
|
|
18417
|
+
const toolName = block.name || "unknown";
|
|
18418
|
+
const toolInput = block.input || {};
|
|
18419
|
+
const toolUseId = block.id;
|
|
18444
18420
|
toolCallMap.set(toolUseId, {
|
|
18445
18421
|
messageIndex: messages.length,
|
|
18446
18422
|
toolName,
|
|
@@ -18459,9 +18435,9 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
18459
18435
|
nestedEvents
|
|
18460
18436
|
}));
|
|
18461
18437
|
} else if (COMMAND_TOOL_NAMES.has(toolName) || FILE_TOOL_NAMES.has(toolName)) {
|
|
18462
|
-
messages.push(fileOrCommandMessage(
|
|
18438
|
+
messages.push(fileOrCommandMessage(block, event.timestamp));
|
|
18463
18439
|
} else if (toolName === "TaskCreate" || toolName === "TaskUpdate" || toolName === "TaskList") {
|
|
18464
|
-
taskAccumulator.processContentBlock(
|
|
18440
|
+
taskAccumulator.processContentBlock(block);
|
|
18465
18441
|
const snapshot = taskSnapshot();
|
|
18466
18442
|
if (snapshot.length > 0) {
|
|
18467
18443
|
messages.push({
|
|
@@ -19266,17 +19242,17 @@ function compactChatHistoryEvent(event, record) {
|
|
|
19266
19242
|
...payload,
|
|
19267
19243
|
message: {
|
|
19268
19244
|
...payload.message,
|
|
19269
|
-
content: payload.message.content.map((
|
|
19270
|
-
if (!isRecord(
|
|
19271
|
-
if (
|
|
19272
|
-
if (
|
|
19273
|
-
const text4 = extractToolResultText(
|
|
19274
|
-
if (isStructuredToolOutput(text4)) return
|
|
19245
|
+
content: payload.message.content.map((block) => {
|
|
19246
|
+
if (!isRecord(block)) return block;
|
|
19247
|
+
if (block.type === "image") return compactImage(block);
|
|
19248
|
+
if (block.type !== "tool_result") return block;
|
|
19249
|
+
const text4 = extractToolResultText(block.content);
|
|
19250
|
+
if (isStructuredToolOutput(text4)) return block;
|
|
19275
19251
|
const omitted = omit(text4);
|
|
19276
|
-
if (omitted) return { ...
|
|
19277
|
-
if (!Array.isArray(
|
|
19252
|
+
if (omitted) return { ...block, content: text4.slice(0, COMPACT_PREVIEW_CHARS), ...omitted };
|
|
19253
|
+
if (!Array.isArray(block.content) || !block.content.some((part) => isRecord(part) && part.type === "image") || sizeOf(block.content) <= COMPACT_BODY_MAX_BYTES) return block;
|
|
19278
19254
|
compacted = true;
|
|
19279
|
-
return { ...
|
|
19255
|
+
return { ...block, content: text4 };
|
|
19280
19256
|
})
|
|
19281
19257
|
}
|
|
19282
19258
|
};
|
|
@@ -19353,11 +19329,11 @@ function createSubagentHistoryFilter() {
|
|
|
19353
19329
|
if (coerceBackgroundTaskPayload(payload)) return true;
|
|
19354
19330
|
const blocks = normalizeContentBlocks(isRecord(payload.message) ? payload.message.content : void 0);
|
|
19355
19331
|
if (type === "claude-assistant") {
|
|
19356
|
-
const spawns = blocks.filter((
|
|
19357
|
-
for (const
|
|
19332
|
+
const spawns = blocks.filter((block) => block.type === "tool_use" && block.id && CLAUDE_SUBAGENT_TOOL_NAMES.has(block.name ?? ""));
|
|
19333
|
+
for (const block of spawns) if (block.id) spawnIds.add(block.id);
|
|
19358
19334
|
return spawns.length > 0;
|
|
19359
19335
|
}
|
|
19360
|
-
return type === "claude-user" && blocks.some((
|
|
19336
|
+
return type === "claude-user" && blocks.some((block) => block.type === "tool_result" && spawnIds.has(block.tool_use_id ?? ""));
|
|
19361
19337
|
};
|
|
19362
19338
|
}
|
|
19363
19339
|
function readChatSubagentHistory({ size, compact, readRange }) {
|
|
@@ -19401,15 +19377,15 @@ function canonicalizeChatTranscriptBlocks(content, provider2, senders, beforeMes
|
|
|
19401
19377
|
const end = beforeMessageId === void 0 ? messages.length : messages.findIndex(({ id }) => id === beforeMessageId);
|
|
19402
19378
|
if (end === -1) throw new Error("That message is no longer in the chat history");
|
|
19403
19379
|
return messages.slice(0, end).flatMap((message2) => {
|
|
19404
|
-
let
|
|
19380
|
+
let block = null;
|
|
19405
19381
|
if (message2.type === "user") {
|
|
19406
|
-
|
|
19382
|
+
block = `## User${message2.senderEmail ? ` (${message2.senderEmail})` : ""}
|
|
19407
19383
|
${message2.content}`;
|
|
19408
19384
|
} else if (message2.type === "agent") {
|
|
19409
|
-
|
|
19385
|
+
block = `## Agent
|
|
19410
19386
|
${message2.content}`;
|
|
19411
19387
|
} else if (message2.type === "reasoning") {
|
|
19412
|
-
|
|
19388
|
+
block = `## Agent reasoning (unverified)
|
|
19413
19389
|
Timestamp: ${message2.sourceTimestamp ?? message2.timestamp}
|
|
19414
19390
|
${message2.content}`;
|
|
19415
19391
|
} else {
|
|
@@ -19424,19 +19400,19 @@ ${activity.items.map((item) => `- [${item.status}] ${item.text}`).join("\n")}`);
|
|
|
19424
19400
|
if (activity.content) details.push(`Details:
|
|
19425
19401
|
${activity.content}`);
|
|
19426
19402
|
if (message2.type === "command" && message2.exitCode != null) details.push(`Exit: ${message2.exitCode}`);
|
|
19427
|
-
|
|
19403
|
+
block = `## Activity
|
|
19428
19404
|
${activity.title}${details.length > 0 ? `
|
|
19429
19405
|
${details.join("\n")}` : ""}`;
|
|
19430
19406
|
}
|
|
19431
19407
|
}
|
|
19432
|
-
if (!
|
|
19433
|
-
return [redactSecrets(
|
|
19408
|
+
if (!block) return [];
|
|
19409
|
+
return [redactSecrets(block)];
|
|
19434
19410
|
});
|
|
19435
19411
|
}
|
|
19436
19412
|
function lastUserBlockText(blocks) {
|
|
19437
|
-
const
|
|
19438
|
-
if (!
|
|
19439
|
-
const body =
|
|
19413
|
+
const block = blocks.findLast((entry) => entry.startsWith("## User"));
|
|
19414
|
+
if (!block) return null;
|
|
19415
|
+
const body = block.slice(block.indexOf("\n") + 1).trim();
|
|
19440
19416
|
return body || null;
|
|
19441
19417
|
}
|
|
19442
19418
|
|
|
@@ -19621,7 +19597,7 @@ var VOICE_WAVEFORM = {
|
|
|
19621
19597
|
};
|
|
19622
19598
|
|
|
19623
19599
|
// ../shared/src/e2b.ts
|
|
19624
|
-
var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-11-13-
|
|
19600
|
+
var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-11-13-v3";
|
|
19625
19601
|
|
|
19626
19602
|
// ../shared/src/e2b-retry.ts
|
|
19627
19603
|
var DEFAULT_BACKOFFS_MS = [2e3, 5e3];
|
|
@@ -19636,7 +19612,7 @@ function isTransientE2BError(error) {
|
|
|
19636
19612
|
if (!/(^|[^0-9])5\d{2}(\s|:)/.test(message2)) return false;
|
|
19637
19613
|
return TRANSIENT_E2B_MESSAGE_PATTERNS.some((pattern) => pattern.test(message2));
|
|
19638
19614
|
}
|
|
19639
|
-
async function withE2BRetry(
|
|
19615
|
+
async function withE2BRetry(label, fn, options = {}) {
|
|
19640
19616
|
const backoffs = options.backoffsMs ?? DEFAULT_BACKOFFS_MS;
|
|
19641
19617
|
const retryable = options.retryable ?? isTransientE2BError;
|
|
19642
19618
|
const logPrefix = options.logPrefix ?? "e2b";
|
|
@@ -19652,7 +19628,7 @@ async function withE2BRetry(label2, fn, options = {}) {
|
|
|
19652
19628
|
}
|
|
19653
19629
|
const delayMs = backoffs[attempt - 1] ?? 5e3;
|
|
19654
19630
|
console.warn(
|
|
19655
|
-
`[${logPrefix}] ${
|
|
19631
|
+
`[${logPrefix}] ${label}: retryable failure (attempt ${attempt}/${attempts}), retrying in ${delayMs}ms: ${error instanceof Error ? error.message : String(error)}`
|
|
19656
19632
|
);
|
|
19657
19633
|
const waitStartedAt = performance.now();
|
|
19658
19634
|
await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
@@ -20279,10 +20255,10 @@ function parseCommitArgs(args) {
|
|
|
20279
20255
|
const arg = args[index];
|
|
20280
20256
|
const long = /^--([\w-]+)(?:=([\s\S]*))?$/.exec(arg);
|
|
20281
20257
|
if (long) {
|
|
20282
|
-
const [, name,
|
|
20258
|
+
const [, name, inline] = long;
|
|
20283
20259
|
if (name === "amend") amend = true;
|
|
20284
20260
|
if (!COMMIT_VALUE_OPTIONS.has(name)) continue;
|
|
20285
|
-
const value =
|
|
20261
|
+
const value = inline ?? args[++index] ?? "";
|
|
20286
20262
|
if (name === "message") messages.push(value);
|
|
20287
20263
|
else if (name === "file") file = value;
|
|
20288
20264
|
else if (name === "trailer") trailers.push(value);
|
|
@@ -20315,12 +20291,12 @@ function parsePushArgs(args) {
|
|
|
20315
20291
|
positionals.push(...args.slice(index + 1));
|
|
20316
20292
|
break;
|
|
20317
20293
|
} else if (long) {
|
|
20318
|
-
const [, name,
|
|
20294
|
+
const [, name, inline] = long;
|
|
20319
20295
|
all ||= ["all", "mirror", "branches"].includes(name);
|
|
20320
20296
|
tags ||= name === "tags";
|
|
20321
20297
|
repo ||= name === "repo";
|
|
20322
20298
|
if (["repo", "push-option", "receive-pack", "exec"].includes(name)) {
|
|
20323
|
-
const value =
|
|
20299
|
+
const value = inline ?? args[++index] ?? "";
|
|
20324
20300
|
if (name === "push-option") options.push(value);
|
|
20325
20301
|
}
|
|
20326
20302
|
} else if (/^-[^-]/.test(arg)) {
|
|
@@ -21164,6 +21140,7 @@ var workspaceEventSchemaByType = z34.discriminatedUnion("type", [
|
|
|
21164
21140
|
subagent: z34.object({ id: z34.string(), name: z34.string(), prUrl: z34.string().nullable() }),
|
|
21165
21141
|
ts: z34.string()
|
|
21166
21142
|
}),
|
|
21143
|
+
z34.object({ type: z34.literal("mothership.board.changed"), workspaceId: z34.string(), ts: z34.string() }),
|
|
21167
21144
|
z34.object({ type: z34.literal("needs-you.changed"), workspaceId: z34.string().nullable(), userId: z34.string().optional(), ts: z34.string() }),
|
|
21168
21145
|
z34.object({
|
|
21169
21146
|
type: z34.literal("workspace.shared"),
|
|
@@ -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-DVU6R5AN.js";
|
|
7
|
+
import "./chunk-OQZLK6BN.js";
|
|
8
|
+
import "./chunk-55SJSOI2.js";
|
|
9
9
|
import {
|
|
10
10
|
isRecord
|
|
11
11
|
} from "./chunk-UZSNFLDQ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-XKXYQAIA.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-II4H6RG2.js";
|
|
18
18
|
import {
|
|
19
19
|
AppServerProcess,
|
|
20
20
|
buildCodexAgentEnv
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
} from "./chunk-UEWCWES6.js";
|
|
22
|
+
import "./chunk-55SJSOI2.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-XKXYQAIA.js";
|
|
33
33
|
import "./chunk-VEQXQN22.js";
|
|
34
34
|
|
|
35
35
|
// src/headless-agent.ts
|
package/dist/src/index.js
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
evaluateCommandProtection,
|
|
28
28
|
extractToolCommand,
|
|
29
29
|
reportCommandProtectionBlock
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-DVU6R5AN.js";
|
|
31
31
|
import {
|
|
32
32
|
ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
|
|
33
33
|
AGENT_MESSAGE_DELTA_METHOD,
|
|
@@ -65,10 +65,10 @@ import {
|
|
|
65
65
|
spawnMuseMsp,
|
|
66
66
|
startMuseSession,
|
|
67
67
|
uuidV7
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-II4H6RG2.js";
|
|
69
69
|
import {
|
|
70
70
|
publishedPullRequestUrls
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-DOAFMAYL.js";
|
|
72
72
|
import {
|
|
73
73
|
ACCOUNT_RATE_LIMITS_READ_METHOD,
|
|
74
74
|
AsyncLock,
|
|
@@ -143,7 +143,7 @@ import {
|
|
|
143
143
|
timestampFromSeconds,
|
|
144
144
|
upsertCredentialFileLines,
|
|
145
145
|
writeSecureCredentialFile
|
|
146
|
-
} from "./chunk-
|
|
146
|
+
} from "./chunk-QOAJHPFJ.js";
|
|
147
147
|
import {
|
|
148
148
|
ENGINE_ENV,
|
|
149
149
|
UNQUOTED_PATHS_CONFIG,
|
|
@@ -154,15 +154,15 @@ import {
|
|
|
154
154
|
resolveDiffBase,
|
|
155
155
|
setAgentCredentialSnapshot,
|
|
156
156
|
setLinearSessionId
|
|
157
|
-
} from "./chunk-
|
|
157
|
+
} from "./chunk-OQZLK6BN.js";
|
|
158
158
|
import {
|
|
159
159
|
getCodexModelProvider
|
|
160
|
-
} from "./chunk-
|
|
160
|
+
} from "./chunk-UEWCWES6.js";
|
|
161
161
|
import {
|
|
162
162
|
SUBPROCESS_MAX_BUFFER,
|
|
163
163
|
execAsync,
|
|
164
164
|
execFileAsync
|
|
165
|
-
} from "./chunk-
|
|
165
|
+
} from "./chunk-55SJSOI2.js";
|
|
166
166
|
import {
|
|
167
167
|
isRecord as isRecord2
|
|
168
168
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -443,7 +443,7 @@ import {
|
|
|
443
443
|
workspaceTokenRequestSchema,
|
|
444
444
|
workspaceTokenResponseSchema,
|
|
445
445
|
wrapInTag
|
|
446
|
-
} from "./chunk-
|
|
446
|
+
} from "./chunk-XKXYQAIA.js";
|
|
447
447
|
import {
|
|
448
448
|
cloneMcpConfig,
|
|
449
449
|
ensureCompatibilityImports,
|
|
@@ -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-DOAFMAYL.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-XKXYQAIA.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