replicas-engine 0.1.1591 → 0.1.1592
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-UTZFS74C.js → asp-host-MSIUFJA7.js} +5 -5
- package/dist/src/{chunk-D23WREZB.js → chunk-AGDZO2Y7.js} +2 -2
- package/dist/src/{chunk-7L7EO4EE.js → chunk-IJUB4BUF.js} +3 -3
- package/dist/src/{chunk-6AS6L23S.js → chunk-KG2JNU6Y.js} +2 -2
- package/dist/src/{chunk-UDEZ62K5.js → chunk-KMNCQCA3.js} +2 -2
- package/dist/src/{chunk-MXJFZHGV.js → chunk-MP7PH577.js} +6 -6
- package/dist/src/{chunk-KPBG5CUK.js → chunk-UCFTKJ3Z.js} +1 -1
- package/dist/src/{chunk-5HVEKRPG.js → chunk-UXONE2G5.js} +1 -1
- package/dist/src/{chunk-5ZZGNHT5.js → chunk-XM5NXZVI.js} +244 -204
- 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-MP7PH577.js";
|
|
12
|
+
import "./chunk-AGDZO2Y7.js";
|
|
13
|
+
import "./chunk-IJUB4BUF.js";
|
|
14
|
+
import "./chunk-UXONE2G5.js";
|
|
15
15
|
import "./chunk-UZSNFLDQ.js";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-XM5NXZVI.js";
|
|
17
17
|
import "./chunk-VEQXQN22.js";
|
|
18
18
|
export {
|
|
19
19
|
CODEX_ULTRAFAST_SERVICE_TIER,
|
|
@@ -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-UXONE2G5.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-XM5NXZVI.js";
|
|
25
25
|
|
|
26
26
|
// src/runtime-env-loader.ts
|
|
27
27
|
import { readFileSync } from "fs";
|
|
@@ -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-UXONE2G5.js";
|
|
7
7
|
import {
|
|
8
8
|
isVersionBelow
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-XM5NXZVI.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.1592";
|
|
244
244
|
var INITIALIZE_METHOD = "initialize";
|
|
245
245
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
246
246
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
getOriginDefaultBranch,
|
|
7
7
|
monolithRequest,
|
|
8
8
|
runGitCommand
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-AGDZO2Y7.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-XM5NXZVI.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-IJUB4BUF.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-XM5NXZVI.js";
|
|
19
19
|
|
|
20
20
|
// src/managers/codex-asp/notification-dispatch.ts
|
|
21
21
|
var TURN_STARTED_METHOD = "turn/started";
|
|
@@ -12,15 +12,15 @@ import {
|
|
|
12
12
|
resolveDiffBase,
|
|
13
13
|
runGitCommand,
|
|
14
14
|
setAgentCredentialSnapshot
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-AGDZO2Y7.js";
|
|
16
16
|
import {
|
|
17
17
|
AppServerProcess,
|
|
18
18
|
buildCodexAgentEnv
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-IJUB4BUF.js";
|
|
20
20
|
import {
|
|
21
21
|
SUBPROCESS_MAX_BUFFER,
|
|
22
22
|
execFileAsync
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-UXONE2G5.js";
|
|
24
24
|
import {
|
|
25
25
|
isRecord
|
|
26
26
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -61,7 +61,7 @@ import {
|
|
|
61
61
|
shrunkImageSize,
|
|
62
62
|
splitMothershipInstructions,
|
|
63
63
|
withTimeout
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-XM5NXZVI.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-MSIUFJA7.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-MSIUFJA7.js");
|
|
487
487
|
await restartCodexAspHostIfRunning2();
|
|
488
488
|
}
|
|
489
489
|
setAgentCredentialSnapshot("codex", data);
|
|
@@ -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-XM5NXZVI.js";
|
|
7
7
|
|
|
8
8
|
// src/utils/exec.ts
|
|
9
9
|
import { exec, execFile } from "child_process";
|
|
@@ -12287,7 +12287,7 @@ var reorderCredentialPoolSchema = z21.object({
|
|
|
12287
12287
|
});
|
|
12288
12288
|
|
|
12289
12289
|
// ../shared/src/mothership-events.ts
|
|
12290
|
-
import { z as
|
|
12290
|
+
import { z as z28 } from "zod";
|
|
12291
12291
|
|
|
12292
12292
|
// ../shared/src/design-tokens.ts
|
|
12293
12293
|
var plain = {
|
|
@@ -12454,7 +12454,7 @@ var LINEAR_ICON_DEFINITION = {
|
|
|
12454
12454
|
};
|
|
12455
12455
|
|
|
12456
12456
|
// ../shared/src/replicas-mcp.ts
|
|
12457
|
-
import { z as
|
|
12457
|
+
import { z as z24 } from "zod";
|
|
12458
12458
|
|
|
12459
12459
|
// ../shared/src/automations/types.ts
|
|
12460
12460
|
var AUTOMATION_DEBOUNCE_MAX_SECONDS = 24 * 60 * 60;
|
|
@@ -12475,11 +12475,93 @@ var AUTOMATION_AUTO_PAUSE_DAYS = 7;
|
|
|
12475
12475
|
var AUTOMATION_AUTO_PAUSE_LABEL = `Paused after failing every run for ${AUTOMATION_AUTO_PAUSE_DAYS} days`;
|
|
12476
12476
|
|
|
12477
12477
|
// ../shared/src/routes/environment-config-source.ts
|
|
12478
|
+
import { z as z23 } from "zod";
|
|
12479
|
+
|
|
12480
|
+
// ../shared/src/environment-config.ts
|
|
12478
12481
|
import { z as z22 } from "zod";
|
|
12479
|
-
var
|
|
12480
|
-
var
|
|
12481
|
-
|
|
12482
|
-
|
|
12482
|
+
var variableNameSchema = z22.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name");
|
|
12483
|
+
var mcpValueSchema = z22.union([
|
|
12484
|
+
z22.string(),
|
|
12485
|
+
environmentMcpVariableReferenceSchema
|
|
12486
|
+
]);
|
|
12487
|
+
var mcpValuesSchema = z22.record(z22.string(), mcpValueSchema);
|
|
12488
|
+
var httpConfigSchema = environmentMcpHttpConfigSchema.pick({ url: true, auth: true }).extend({
|
|
12489
|
+
headers: mcpValuesSchema.default({})
|
|
12490
|
+
}).strict();
|
|
12491
|
+
var replicasMcpDefinitionSchema = z22.discriminatedUnion("transport", [
|
|
12492
|
+
z22.strictObject({
|
|
12493
|
+
transport: z22.literal("stdio"),
|
|
12494
|
+
config: environmentMcpStdioConfigSchema.pick({ command: true }).extend({
|
|
12495
|
+
args: environmentMcpStdioConfigSchema.shape.args.unwrap().default([]),
|
|
12496
|
+
env: z22.record(variableNameSchema, mcpValueSchema).default({})
|
|
12497
|
+
}).strict()
|
|
12498
|
+
}),
|
|
12499
|
+
z22.strictObject({ transport: z22.literal("http"), config: httpConfigSchema }),
|
|
12500
|
+
z22.strictObject({ transport: z22.literal("sse"), config: httpConfigSchema })
|
|
12501
|
+
]).superRefine((definition, context) => {
|
|
12502
|
+
if (definition.transport === "stdio") return;
|
|
12503
|
+
const result = validateEnvironmentMcpAuthentication(definition.transport, definition.config);
|
|
12504
|
+
if (!result.ok) context.addIssue({ code: "custom", path: result.error.code === "transport" ? ["transport"] : ["config", result.error.code ?? "auth"], message: result.error.message });
|
|
12505
|
+
});
|
|
12506
|
+
var replicasEnvironmentConfigSchema = z22.strictObject({
|
|
12507
|
+
systemPrompt: z22.string().optional(),
|
|
12508
|
+
warmHook: z22.string().optional(),
|
|
12509
|
+
startHook: z22.string().optional(),
|
|
12510
|
+
variables: z22.record(variableNameSchema, z22.string()).optional(),
|
|
12511
|
+
requiredSecrets: z22.array(variableNameSchema).optional(),
|
|
12512
|
+
mcps: z22.record(z22.string().regex(MCP_NAME_PATTERN, "must be 1\u201364 letters, digits, underscores or hyphens, starting with a letter or digit").refine((name) => !isReservedMcpName(name), "is reserved for Replicas"), replicasMcpDefinitionSchema).optional()
|
|
12513
|
+
}).superRefine((config, context) => {
|
|
12514
|
+
const names = /* @__PURE__ */ new Set();
|
|
12515
|
+
for (const name of Object.keys(config.mcps ?? {})) {
|
|
12516
|
+
const normalized = name.toLowerCase();
|
|
12517
|
+
if (names.has(normalized)) {
|
|
12518
|
+
context.addIssue({ code: "custom", path: ["mcps", name], message: "MCP names must be unique regardless of case" });
|
|
12519
|
+
}
|
|
12520
|
+
names.add(normalized);
|
|
12521
|
+
}
|
|
12522
|
+
for (const key of config.requiredSecrets ?? []) {
|
|
12523
|
+
if (config.variables && Object.hasOwn(config.variables, key)) {
|
|
12524
|
+
context.addIssue({ code: "custom", path: ["requiredSecrets"], message: `"${key}" cannot also be declared as a non-secret variable` });
|
|
12525
|
+
}
|
|
12526
|
+
}
|
|
12527
|
+
});
|
|
12528
|
+
|
|
12529
|
+
// ../shared/src/routes/environment-config-source.ts
|
|
12530
|
+
var environmentConfigLocationSchema = z23.union([
|
|
12531
|
+
z23.object({
|
|
12532
|
+
kind: z23.literal("git").default("git"),
|
|
12533
|
+
entrypoint_filename: z23.string().optional(),
|
|
12534
|
+
repository_id: z23.string(),
|
|
12535
|
+
repository_name: z23.string(),
|
|
12536
|
+
filename: z23.string(),
|
|
12537
|
+
commit_sha: z23.string(),
|
|
12538
|
+
source_url: z23.string(),
|
|
12539
|
+
file_sha: z23.undefined().optional()
|
|
12540
|
+
}),
|
|
12541
|
+
z23.object({
|
|
12542
|
+
kind: z23.literal("file"),
|
|
12543
|
+
repository_id: z23.null(),
|
|
12544
|
+
repository_name: z23.null(),
|
|
12545
|
+
filename: z23.string(),
|
|
12546
|
+
commit_sha: z23.null(),
|
|
12547
|
+
source_url: z23.null(),
|
|
12548
|
+
file_sha: z23.string()
|
|
12549
|
+
})
|
|
12550
|
+
]);
|
|
12551
|
+
var sourceInput = {
|
|
12552
|
+
repository_id: z23.string().min(1).optional(),
|
|
12553
|
+
file: z23.strictObject({ filename: z23.string().min(1).max(1024), environment: replicasEnvironmentConfigSchema }).optional()
|
|
12554
|
+
};
|
|
12555
|
+
var previewEnvironmentConfigSourceRequestSchema = z23.strictObject(sourceInput).refine(
|
|
12556
|
+
(input) => !input.file || !input.repository_id,
|
|
12557
|
+
{ message: "Choose either a repository or a file" }
|
|
12558
|
+
);
|
|
12559
|
+
var applyEnvironmentConfigSourceRequestSchema = z23.strictObject({
|
|
12560
|
+
...sourceInput,
|
|
12561
|
+
commit_sha: z23.string().min(1).optional(),
|
|
12562
|
+
fingerprint: z23.string().min(1)
|
|
12563
|
+
}).refine((input) => input.file ? !input.repository_id && !input.commit_sha : !!input.commit_sha, {
|
|
12564
|
+
message: "File configuration requires file contents; Git configuration requires a reviewed commit"
|
|
12483
12565
|
});
|
|
12484
12566
|
|
|
12485
12567
|
// ../shared/src/replicas-mcp.ts
|
|
@@ -12543,57 +12625,57 @@ var REPLICAS_MCP_TOOLS = {
|
|
|
12543
12625
|
deleteChat: "delete_chat",
|
|
12544
12626
|
listRepositories: "list_repositories"
|
|
12545
12627
|
};
|
|
12546
|
-
var automationToolInputSchema =
|
|
12547
|
-
name:
|
|
12548
|
-
prompt:
|
|
12549
|
-
environment_id:
|
|
12550
|
-
triggers:
|
|
12628
|
+
var automationToolInputSchema = z24.object({
|
|
12629
|
+
name: z24.string().describe("Short automation name."),
|
|
12630
|
+
prompt: z24.string().describe("Prompt each automation run starts with."),
|
|
12631
|
+
environment_id: z24.string().describe(`Environment id from \`${REPLICAS_MCP_TOOLS.listEnvironments}\`.`),
|
|
12632
|
+
triggers: z24.array(automationTriggerSchema).min(1).describe(
|
|
12551
12633
|
`One or more triggers. Cron: \`{ "type": "cron", "config": { "schedule": "0 9 * * 1", "timezone": "America/New_York" } }\`. GitHub: \`{ "type": "github", "config": { "event": "pull_request.opened", "repository_ids": ["<repository uuid>"] } }\`. Linear: \`{ "type": "linear", "config": { "event": "${LINEAR_ISSUE_STATE_CHANGED_EVENT}", "state_types": ["completed"] } }\`.`
|
|
12552
12634
|
),
|
|
12553
|
-
description:
|
|
12554
|
-
plan_mode:
|
|
12555
|
-
goal_mode:
|
|
12556
|
-
fast_mode:
|
|
12557
|
-
workspace_lifecycle_policy:
|
|
12635
|
+
description: z24.string().optional().describe("One-line summary shown in the dashboard."),
|
|
12636
|
+
plan_mode: z24.boolean().optional(),
|
|
12637
|
+
goal_mode: z24.boolean().optional(),
|
|
12638
|
+
fast_mode: z24.boolean().optional(),
|
|
12639
|
+
workspace_lifecycle_policy: z24.enum(AUTOMATION_LIFECYCLE_POLICIES).optional().describe(
|
|
12558
12640
|
"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."
|
|
12559
12641
|
)
|
|
12560
12642
|
});
|
|
12561
12643
|
var credentialUserIdDescription = `Organization automations only: the user ID (see \`${REPLICAS_MCP_TOOLS.whoami}\`) of the member whose coding agent credentials, such as their Claude subscription, runs use before the organization's. Only your workspace's owner, or whoever's credentials this workspace runs on.`;
|
|
12562
|
-
var automationBackgroundSchema =
|
|
12644
|
+
var automationBackgroundSchema = z24.boolean().optional().describe(
|
|
12563
12645
|
"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."
|
|
12564
12646
|
);
|
|
12565
12647
|
var automationCreateToolInputSchema = automationToolInputSchema.extend({
|
|
12566
|
-
credential_user_id:
|
|
12648
|
+
credential_user_id: z24.string().optional().describe(`${credentialUserIdDescription} Omit to use the organization's.`),
|
|
12567
12649
|
background: automationBackgroundSchema,
|
|
12568
|
-
scope:
|
|
12650
|
+
scope: z24.enum(["org", "user"]).optional().describe("`org` (default) or `user` for a personal automation, which needs a personal API key.")
|
|
12569
12651
|
});
|
|
12570
12652
|
var automationUpdateToolInputSchema = automationToolInputSchema.partial().extend({
|
|
12571
|
-
automation_id:
|
|
12572
|
-
enabled:
|
|
12573
|
-
agent_provider:
|
|
12574
|
-
model:
|
|
12575
|
-
thinking_level:
|
|
12576
|
-
workspace_size:
|
|
12577
|
-
credential_user_id:
|
|
12653
|
+
automation_id: z24.string().describe("Automation ID"),
|
|
12654
|
+
enabled: z24.boolean().optional(),
|
|
12655
|
+
agent_provider: z24.enum(AGENT).nullable().optional(),
|
|
12656
|
+
model: z24.string().nullable().optional(),
|
|
12657
|
+
thinking_level: z24.enum(VALID_THINKING_LEVELS).nullable().optional(),
|
|
12658
|
+
workspace_size: z24.enum(WORKSPACE_SIZES).optional(),
|
|
12659
|
+
credential_user_id: z24.string().nullable().optional().describe(`${credentialUserIdDescription} Null switches back to the organization's.`),
|
|
12578
12660
|
background: automationBackgroundSchema,
|
|
12579
|
-
scope:
|
|
12661
|
+
scope: z24.literal("org").optional().describe("`org` moves a personal automation to the organization so teammates can see and edit it. It cannot be moved back.")
|
|
12580
12662
|
});
|
|
12581
|
-
var chatPath = { id:
|
|
12663
|
+
var chatPath = { id: z24.string().describe("Workspace ID"), chat_id: z24.string().describe("Chat ID") };
|
|
12582
12664
|
var { provider, model, thinkingLevel, title, message } = forkChatRequestSchema.shape;
|
|
12583
|
-
var createChatToolInputSchema =
|
|
12584
|
-
var forkChatToolInputSchema =
|
|
12585
|
-
var renameChatToolInputSchema =
|
|
12586
|
-
var runCommandToolInputSchema =
|
|
12587
|
-
var environmentMcpPath = { environment_id:
|
|
12588
|
-
var createEnvironmentMcpToolInputSchema =
|
|
12589
|
-
var updateEnvironmentMcpToolInputSchema =
|
|
12665
|
+
var createChatToolInputSchema = z24.object({ id: chatPath.id, provider, title: createChatRequestSchema.shape.title });
|
|
12666
|
+
var forkChatToolInputSchema = z24.object({ ...chatPath, provider, model, thinking_level: thinkingLevel, title, message });
|
|
12667
|
+
var renameChatToolInputSchema = z24.object({ ...chatPath, display_name: updateChatDisplayNameRequestSchema.shape.displayName });
|
|
12668
|
+
var runCommandToolInputSchema = z24.object({ id: chatPath.id, ...workspaceExecRequestSchema.shape });
|
|
12669
|
+
var environmentMcpPath = { environment_id: z24.string().describe("Environment ID") };
|
|
12670
|
+
var createEnvironmentMcpToolInputSchema = z24.object({ ...environmentMcpPath, ...createEnvironmentMcpRequestSchema.shape });
|
|
12671
|
+
var updateEnvironmentMcpToolInputSchema = z24.object({
|
|
12590
12672
|
...environmentMcpPath,
|
|
12591
|
-
mcp_id:
|
|
12673
|
+
mcp_id: z24.string().describe("MCP ID"),
|
|
12592
12674
|
...updateEnvironmentMcpRequestSchema.shape
|
|
12593
12675
|
});
|
|
12594
|
-
var createEnvironmentDeviceToolInputSchema =
|
|
12595
|
-
var previewEnvironmentConfigSourceToolInputSchema =
|
|
12596
|
-
var applyEnvironmentConfigSourceToolInputSchema =
|
|
12676
|
+
var createEnvironmentDeviceToolInputSchema = z24.object({ ...environmentMcpPath, ...createEnvironmentDeviceRequestSchema.shape });
|
|
12677
|
+
var previewEnvironmentConfigSourceToolInputSchema = previewEnvironmentConfigSourceRequestSchema.safeExtend(environmentMcpPath);
|
|
12678
|
+
var applyEnvironmentConfigSourceToolInputSchema = applyEnvironmentConfigSourceRequestSchema.safeExtend(environmentMcpPath);
|
|
12597
12679
|
|
|
12598
12680
|
// ../shared/src/scout.ts
|
|
12599
12681
|
var SCOUT_SOURCE_TYPES = ["slack", "linear"];
|
|
@@ -12687,63 +12769,63 @@ When someone asks for a recurring task or accepts an offer to automate a repeate
|
|
|
12687
12769
|
`;
|
|
12688
12770
|
|
|
12689
12771
|
// ../shared/src/routes/preferences.ts
|
|
12690
|
-
import { z as
|
|
12772
|
+
import { z as z27 } from "zod";
|
|
12691
12773
|
|
|
12692
12774
|
// ../shared/src/routes/push.ts
|
|
12693
|
-
import { z as
|
|
12775
|
+
import { z as z25 } from "zod";
|
|
12694
12776
|
|
|
12695
12777
|
// ../shared/src/workspace-attention.ts
|
|
12696
12778
|
var WORKSPACE_ATTENTION_REASONS = ["question", "plan", "variables", "blocked", "setup", "deploy_failed"];
|
|
12697
12779
|
var CHAT_ATTENTION_REASONS = ["question", "blocked"];
|
|
12698
12780
|
|
|
12699
12781
|
// ../shared/src/routes/push.ts
|
|
12700
|
-
var registerPushDeviceRequestSchema =
|
|
12701
|
-
|
|
12702
|
-
platform:
|
|
12703
|
-
token:
|
|
12704
|
-
appId:
|
|
12705
|
-
apnsEnvironment:
|
|
12782
|
+
var registerPushDeviceRequestSchema = z25.discriminatedUnion("platform", [
|
|
12783
|
+
z25.object({
|
|
12784
|
+
platform: z25.literal("ios"),
|
|
12785
|
+
token: z25.string().regex(/^[0-9a-f]{64,200}$/i),
|
|
12786
|
+
appId: z25.string().min(1).max(255),
|
|
12787
|
+
apnsEnvironment: z25.enum(["sandbox", "production"])
|
|
12706
12788
|
}),
|
|
12707
|
-
|
|
12708
|
-
platform:
|
|
12709
|
-
token:
|
|
12710
|
-
appId:
|
|
12789
|
+
z25.object({
|
|
12790
|
+
platform: z25.literal("android"),
|
|
12791
|
+
token: z25.string().min(1).max(4096),
|
|
12792
|
+
appId: z25.string().min(1).max(255)
|
|
12711
12793
|
})
|
|
12712
12794
|
]);
|
|
12713
12795
|
var PUSH_HOLD_MINUTES = 5;
|
|
12714
|
-
var chatRefSchema =
|
|
12715
|
-
var recordPushActivityRequestSchema =
|
|
12716
|
-
organizationId:
|
|
12796
|
+
var chatRefSchema = z25.object({ workspaceId: z25.string().uuid(), chatId: z25.string().min(1).max(100) });
|
|
12797
|
+
var recordPushActivityRequestSchema = z25.object({
|
|
12798
|
+
organizationId: z25.string().uuid(),
|
|
12717
12799
|
/** Seconds since the last keyboard or mouse input on this computer. A phone leaves it out: it only reports what it has open. */
|
|
12718
|
-
idleSeconds:
|
|
12719
|
-
seenWorkspaceIds:
|
|
12720
|
-
seenChats:
|
|
12800
|
+
idleSeconds: z25.number().min(0).optional(),
|
|
12801
|
+
seenWorkspaceIds: z25.array(z25.string().uuid()).max(20),
|
|
12802
|
+
seenChats: z25.array(chatRefSchema).max(20).optional()
|
|
12721
12803
|
});
|
|
12722
12804
|
var PUSH_NOTIFICATION_KINDS = [...WORKSPACE_ATTENTION_REASONS, "finished"];
|
|
12723
12805
|
var PUSH_OPTION_LABEL_MAX = 60;
|
|
12724
12806
|
var PUSH_OPTIONS_MAX = 4;
|
|
12725
|
-
var pushQuestionSchema =
|
|
12726
|
-
var pushNotificationDataSchema =
|
|
12727
|
-
organizationId:
|
|
12728
|
-
workspaceId:
|
|
12729
|
-
chatId:
|
|
12730
|
-
kind:
|
|
12731
|
-
completedAt:
|
|
12732
|
-
toolRequestId:
|
|
12807
|
+
var pushQuestionSchema = z25.object({ id: z25.string().max(64), allowCustom: z25.boolean().optional(), options: z25.array(z25.object({ id: z25.string().max(64), label: z25.string().min(1).max(PUSH_OPTION_LABEL_MAX) })).min(1).max(PUSH_OPTIONS_MAX) });
|
|
12808
|
+
var pushNotificationDataSchema = z25.object({
|
|
12809
|
+
organizationId: z25.string(),
|
|
12810
|
+
workspaceId: z25.string(),
|
|
12811
|
+
chatId: z25.string().nullable(),
|
|
12812
|
+
kind: z25.enum(PUSH_NOTIFICATION_KINDS),
|
|
12813
|
+
completedAt: z25.string(),
|
|
12814
|
+
toolRequestId: z25.string().optional(),
|
|
12733
12815
|
question: pushQuestionSchema.optional()
|
|
12734
12816
|
});
|
|
12735
|
-
var workspaceSharedPushDataSchema = pushNotificationDataSchema.pick({ organizationId: true, workspaceId: true, chatId: true, completedAt: true }).extend({ kind:
|
|
12817
|
+
var workspaceSharedPushDataSchema = pushNotificationDataSchema.pick({ organizationId: true, workspaceId: true, chatId: true, completedAt: true }).extend({ kind: z25.literal("shared") });
|
|
12736
12818
|
var registerLiveActivityRequestSchema = chatRefSchema.extend({
|
|
12737
|
-
deviceId:
|
|
12819
|
+
deviceId: z25.string().uuid(),
|
|
12738
12820
|
/** The iOS activity's push token. Android leaves it out and gets FCM data messages on the device token. */
|
|
12739
|
-
pushToken:
|
|
12821
|
+
pushToken: z25.string().regex(/^[0-9a-f]{64,400}$/i).optional(),
|
|
12740
12822
|
/** iOS only: when the card's turn started, in seconds. Cards keep their order by it. */
|
|
12741
|
-
startedAt:
|
|
12823
|
+
startedAt: z25.number().positive().optional()
|
|
12742
12824
|
});
|
|
12743
|
-
var syncLiveActivitiesRequestSchema =
|
|
12744
|
-
activities:
|
|
12825
|
+
var syncLiveActivitiesRequestSchema = z25.object({
|
|
12826
|
+
activities: z25.array(chatRefSchema).max(100)
|
|
12745
12827
|
});
|
|
12746
|
-
var setLiveActivityStartTokenRequestSchema =
|
|
12828
|
+
var setLiveActivityStartTokenRequestSchema = z25.object({ token: z25.string().regex(/^[0-9a-f]{64,400}$/i) });
|
|
12747
12829
|
|
|
12748
12830
|
// ../shared/src/default-skills/replicas-agent/abilities/computer.ts
|
|
12749
12831
|
var SECTION = `### Computer use (Linux desktop control)
|
|
@@ -13495,7 +13577,7 @@ var GITLAB_ABILITY = {
|
|
|
13495
13577
|
};
|
|
13496
13578
|
|
|
13497
13579
|
// ../shared/src/routes/compute.ts
|
|
13498
|
-
import { z as
|
|
13580
|
+
import { z as z26 } from "zod";
|
|
13499
13581
|
var COMPUTE_SANDBOX_KINDS = ["gpu"];
|
|
13500
13582
|
var GPU_TYPES = ["T4", "L4", "A10G", "L40S", "A100", "A100-80GB", "H100", "H200", "B200"];
|
|
13501
13583
|
var DEFAULT_GPU_TYPE = "L4";
|
|
@@ -13512,27 +13594,27 @@ var COMPUTE_SANDBOX_LIMITS = {
|
|
|
13512
13594
|
maxIdleTimeoutMinutes: 60,
|
|
13513
13595
|
maxTransferBytes: 1024 ** 3
|
|
13514
13596
|
};
|
|
13515
|
-
var computeEnvSchema =
|
|
13516
|
-
var createComputeSandboxRequestSchema =
|
|
13517
|
-
kind:
|
|
13518
|
-
gpu:
|
|
13519
|
-
image:
|
|
13520
|
-
timeoutMinutes:
|
|
13521
|
-
idleTimeoutMinutes:
|
|
13522
|
-
ports:
|
|
13597
|
+
var computeEnvSchema = z26.record(z26.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128), z26.string().max(32768)).refine((env) => Object.keys(env).length <= 64, "At most 64 environment variables are allowed");
|
|
13598
|
+
var createComputeSandboxRequestSchema = z26.object({
|
|
13599
|
+
kind: z26.enum(COMPUTE_SANDBOX_KINDS),
|
|
13600
|
+
gpu: z26.string().trim().optional(),
|
|
13601
|
+
image: z26.string().trim().min(1).max(256).regex(/^\S+$/, "Image must not contain whitespace").optional(),
|
|
13602
|
+
timeoutMinutes: z26.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxTimeoutMinutes).optional(),
|
|
13603
|
+
idleTimeoutMinutes: z26.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxIdleTimeoutMinutes).optional(),
|
|
13604
|
+
ports: z26.array(z26.number().int().min(1).max(65535)).max(COMPUTE_SANDBOX_LIMITS.maxPorts).optional(),
|
|
13523
13605
|
env: computeEnvSchema.optional()
|
|
13524
13606
|
});
|
|
13525
|
-
var computeExecRequestSchema =
|
|
13526
|
-
command:
|
|
13527
|
-
workdir:
|
|
13607
|
+
var computeExecRequestSchema = z26.object({
|
|
13608
|
+
command: z26.string().min(1).max(1e5),
|
|
13609
|
+
workdir: z26.string().min(1).max(4096).optional(),
|
|
13528
13610
|
env: computeEnvSchema.optional(),
|
|
13529
|
-
detach:
|
|
13611
|
+
detach: z26.boolean().optional()
|
|
13530
13612
|
});
|
|
13531
|
-
var computeUploadRequestSchema =
|
|
13532
|
-
size:
|
|
13613
|
+
var computeUploadRequestSchema = z26.object({
|
|
13614
|
+
size: z26.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxTransferBytes)
|
|
13533
13615
|
});
|
|
13534
|
-
var computeTransferPathSchema =
|
|
13535
|
-
path:
|
|
13616
|
+
var computeTransferPathSchema = z26.object({
|
|
13617
|
+
path: z26.string().min(1).max(4096).optional()
|
|
13536
13618
|
});
|
|
13537
13619
|
|
|
13538
13620
|
// ../shared/src/default-skills/replicas-agent/abilities/gpu.ts
|
|
@@ -15284,9 +15366,9 @@ var DEFAULT_DEFAULT_SKILLS = {
|
|
|
15284
15366
|
}
|
|
15285
15367
|
};
|
|
15286
15368
|
var LINEAR_ROUTING_SKILL_MAX_LENGTH = 5e4;
|
|
15287
|
-
var linearRoutingSkillSchema =
|
|
15288
|
-
|
|
15289
|
-
|
|
15369
|
+
var linearRoutingSkillSchema = z27.union([
|
|
15370
|
+
z27.object({ name: z27.string().min(1), content: z27.string().trim().min(1).max(LINEAR_ROUTING_SKILL_MAX_LENGTH) }),
|
|
15371
|
+
z27.object({ name: z27.string().min(1), repository_id: z27.string().regex(UUID_RE), path: z27.string().min(1) })
|
|
15290
15372
|
]);
|
|
15291
15373
|
|
|
15292
15374
|
// ../shared/src/prompts.ts
|
|
@@ -15467,19 +15549,19 @@ var UNKNOWN_EVENT_KIND = "update";
|
|
|
15467
15549
|
var MOTHERSHIP_TURN_ERROR_SUMMARY = "Turn ended with an error.";
|
|
15468
15550
|
var MOTHERSHIP_EVENT_TYPE = "multitask-event";
|
|
15469
15551
|
var MOTHERSHIP_EVENT_MESSAGE_TYPE = "multitask_event";
|
|
15470
|
-
var mothershipEventSchema =
|
|
15471
|
-
id:
|
|
15472
|
-
at:
|
|
15473
|
-
kind:
|
|
15474
|
-
agentId:
|
|
15475
|
-
agentName:
|
|
15476
|
-
summary:
|
|
15477
|
-
detail:
|
|
15552
|
+
var mothershipEventSchema = z28.object({
|
|
15553
|
+
id: z28.string(),
|
|
15554
|
+
at: z28.string(),
|
|
15555
|
+
kind: z28.enum([...MOTHERSHIP_EVENT_KINDS, UNKNOWN_EVENT_KIND]),
|
|
15556
|
+
agentId: z28.string(),
|
|
15557
|
+
agentName: z28.string(),
|
|
15558
|
+
summary: z28.string(),
|
|
15559
|
+
detail: z28.string().optional(),
|
|
15478
15560
|
// Set when the subagent is a chat in this workspace rather than a ship; agentId is then that chat's id.
|
|
15479
|
-
chatId:
|
|
15480
|
-
ticket:
|
|
15561
|
+
chatId: z28.string().optional(),
|
|
15562
|
+
ticket: z28.object({ id: z28.string(), title: z28.string() }).optional(),
|
|
15481
15563
|
// Set on events recorded before every kind woke the orchestrator, which were shown as a row when they happened.
|
|
15482
|
-
noticed:
|
|
15564
|
+
noticed: z28.boolean().optional()
|
|
15483
15565
|
});
|
|
15484
15566
|
var TAG = "multitask_event";
|
|
15485
15567
|
var BLOCK = new RegExp(`<${TAG}((?:\\s+\\w+="[^"]*")*)>\\n?([\\s\\S]*?)\\n?</${TAG}>`, "g");
|
|
@@ -16524,7 +16606,7 @@ function subagentReport(output) {
|
|
|
16524
16606
|
}
|
|
16525
16607
|
|
|
16526
16608
|
// ../shared/src/learned-skills.ts
|
|
16527
|
-
import { z as
|
|
16609
|
+
import { z as z29 } from "zod";
|
|
16528
16610
|
|
|
16529
16611
|
// ../shared/src/frontmatter.ts
|
|
16530
16612
|
import { parse as parseYaml } from "yaml";
|
|
@@ -16547,20 +16629,20 @@ function parseFrontmatter(content) {
|
|
|
16547
16629
|
var LEARNED_SKILLS_ROOT = `${SANDBOX_PATHS.REPLICAS_DIR}/learned-skills`;
|
|
16548
16630
|
var LEARNED_SKILLS_MANIFEST_PATH = `${LEARNED_SKILLS_ROOT}/manifest.json`;
|
|
16549
16631
|
var LEARNED_SKILL_DIR_PREFIX = "replicas-learned__";
|
|
16550
|
-
var learnedSkillsManifestSchema =
|
|
16551
|
-
skills:
|
|
16632
|
+
var learnedSkillsManifestSchema = z29.object({
|
|
16633
|
+
skills: z29.array(z29.object({ name: z29.string(), sha256: z29.string() }))
|
|
16552
16634
|
});
|
|
16553
|
-
var dreamVerdictChecksSchema =
|
|
16554
|
-
repeatable:
|
|
16555
|
-
realInstruction:
|
|
16556
|
-
noContradiction:
|
|
16557
|
-
formatExact:
|
|
16558
|
-
humanOnly:
|
|
16559
|
-
actionable:
|
|
16560
|
-
durable:
|
|
16635
|
+
var dreamVerdictChecksSchema = z29.object({
|
|
16636
|
+
repeatable: z29.boolean(),
|
|
16637
|
+
realInstruction: z29.boolean(),
|
|
16638
|
+
noContradiction: z29.boolean(),
|
|
16639
|
+
formatExact: z29.boolean(),
|
|
16640
|
+
humanOnly: z29.boolean(),
|
|
16641
|
+
actionable: z29.boolean(),
|
|
16642
|
+
durable: z29.boolean()
|
|
16561
16643
|
});
|
|
16562
16644
|
var DREAM_VERDICT_CHECKS = dreamVerdictChecksSchema.keyof().options;
|
|
16563
|
-
var dreamVerdictSchema = dreamVerdictChecksSchema.extend({ approve:
|
|
16645
|
+
var dreamVerdictSchema = dreamVerdictChecksSchema.extend({ approve: z29.boolean(), reason: z29.string() });
|
|
16564
16646
|
var learnedSkillFormatInstruction = (speaker) => `Write a SKILL.md whose frontmatter has a kebab-case \`name\` and a short \`description\` that starts with "Use when" and names the situations it applies to; the body records only what ${speaker} actually said, restated as a direct instruction, usually one to three lines. Every line of a learning is loaded into future sessions, so leave out anything an agent could infer on its own: no headings, explanations, rules, or examples unless ${speaker} stated those specifics themselves. For "from now on, use Conventional Commits", the body is just "Use Conventional Commits for every commit message and PR title."`;
|
|
16565
16647
|
|
|
16566
16648
|
// ../shared/src/terminal.ts
|
|
@@ -16591,7 +16673,7 @@ function workspaceTargetFromToolOutput(output) {
|
|
|
16591
16673
|
}
|
|
16592
16674
|
|
|
16593
16675
|
// ../shared/src/mothership-board.ts
|
|
16594
|
-
import { z as
|
|
16676
|
+
import { z as z30 } from "zod";
|
|
16595
16677
|
var MOTHERSHIP_TICKET_LIMITS = {
|
|
16596
16678
|
title: 80,
|
|
16597
16679
|
task: 1e3,
|
|
@@ -16611,78 +16693,78 @@ var MOTHERSHIP_TICKET_LIMITS = {
|
|
|
16611
16693
|
};
|
|
16612
16694
|
var L = MOTHERSHIP_TICKET_LIMITS;
|
|
16613
16695
|
var tooLong = (max) => `At most ${max} characters. Keep it short; the user should take it in at a glance`;
|
|
16614
|
-
var text3 = (max) =>
|
|
16615
|
-
var clearable = (schema) =>
|
|
16616
|
-
var httpsUrl =
|
|
16696
|
+
var text3 = (max) => z30.string().trim().min(1).max(max, tooLong(max));
|
|
16697
|
+
var clearable = (schema) => z30.union([schema, z30.literal("")]).optional();
|
|
16698
|
+
var httpsUrl = z30.url({ protocol: /^https$/, error: "Must be an https URL" });
|
|
16617
16699
|
var inlineMarkdown = "Markdown: **bold**, *italics*, `code`, [links](https://... or an absolute file path)";
|
|
16618
16700
|
var markdown = `${inlineMarkdown} and line breaks.`;
|
|
16619
|
-
var linearIdentifier =
|
|
16620
|
-
var mediaSchema =
|
|
16701
|
+
var linearIdentifier = z30.string().regex(/^[A-Za-z][A-Za-z0-9]{0,9}-\d{1,7}$/, "Use a Linear identifier such as REP-123");
|
|
16702
|
+
var mediaSchema = z30.object({
|
|
16621
16703
|
url: httpsUrl.describe("The URL `replicas media upload` printed."),
|
|
16622
16704
|
caption: text3(L.caption).describe('What it shows, such as "After: the list stays pinned".'),
|
|
16623
|
-
kind:
|
|
16705
|
+
kind: z30.enum(["image", "video"]).describe("video for recordings, image for screenshots and GIFs.")
|
|
16624
16706
|
});
|
|
16625
|
-
var questionSchema =
|
|
16707
|
+
var questionSchema = z30.object({
|
|
16626
16708
|
question: text3(L.question).describe("One question, with the context needed to answer it."),
|
|
16627
|
-
options:
|
|
16709
|
+
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.")
|
|
16628
16710
|
});
|
|
16629
16711
|
var mothershipTicketTitleSchema = text3(L.title).describe(`What the task is about, in a few plain words, such as "Slack replies in Mothership channels get dropped" or "Add CSV export to Analytics". Never a ship, branch or pull request name. At most ${L.title} characters.`);
|
|
16630
16712
|
var mothershipTicketTaskSchema = text3(L.task);
|
|
16631
|
-
var mothershipTicketMediaSchema =
|
|
16632
|
-
var mothershipTicketQuestionsSchema =
|
|
16713
|
+
var mothershipTicketMediaSchema = z30.array(mediaSchema);
|
|
16714
|
+
var mothershipTicketQuestionsSchema = z30.array(questionSchema.extend({ id: z30.string() }));
|
|
16633
16715
|
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.`);
|
|
16634
16716
|
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.`);
|
|
16635
|
-
var updateMothershipTicketRequestSchema =
|
|
16717
|
+
var updateMothershipTicketRequestSchema = z30.object({
|
|
16636
16718
|
title: mothershipTicketTitleSchema.optional(),
|
|
16637
16719
|
issue: issueSchema,
|
|
16638
16720
|
fix: fixSchema,
|
|
16639
|
-
media:
|
|
16640
|
-
questions:
|
|
16721
|
+
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.`),
|
|
16722
|
+
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.`),
|
|
16641
16723
|
blocked: clearable(text3(L.blocked)).describe('Why you cannot go on without the user, such as missing access. "" once unblocked.')
|
|
16642
16724
|
});
|
|
16643
|
-
var updateMothershipBoardRequestSchema =
|
|
16725
|
+
var updateMothershipBoardRequestSchema = z30.object({
|
|
16644
16726
|
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.`),
|
|
16645
|
-
tickets:
|
|
16646
|
-
id:
|
|
16727
|
+
tickets: z30.array(z30.object({
|
|
16728
|
+
id: z30.uuid(),
|
|
16647
16729
|
title: mothershipTicketTitleSchema.optional(),
|
|
16648
16730
|
issue: issueSchema,
|
|
16649
16731
|
fix: fixSchema,
|
|
16650
|
-
pull_requests:
|
|
16732
|
+
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."),
|
|
16651
16733
|
note: clearable(text3(L.note)).describe(`Your one short comment on the ticket, shown under its row, replacing the last. ${inlineMarkdown}. "" removes it. At most ${L.note} characters.`),
|
|
16652
16734
|
linear: clearable(linearIdentifier).describe('The Linear issue this ticket is for, such as REP-123. "" removes it.'),
|
|
16653
|
-
archived:
|
|
16735
|
+
archived: z30.boolean().optional().describe("true takes it off the board for good: closes its open pull requests without merging, stops their automatic fixes, and archives its ships unless they still have other tickets. false puts it back on the board.")
|
|
16654
16736
|
})).max(50).optional().describe("Changes to existing tickets."),
|
|
16655
|
-
order:
|
|
16656
|
-
create:
|
|
16737
|
+
order: z30.array(z30.uuid()).optional().describe("Ticket ids, most important first. Tickets left out keep their order after these."),
|
|
16738
|
+
create: z30.array(z30.object({
|
|
16657
16739
|
title: mothershipTicketTitleSchema,
|
|
16658
16740
|
task: mothershipTicketTaskSchema.optional(),
|
|
16659
16741
|
issue: text3(L.issue).optional(),
|
|
16660
|
-
questions:
|
|
16742
|
+
questions: z30.array(questionSchema).max(L.questions).optional(),
|
|
16661
16743
|
note: text3(L.note).optional()
|
|
16662
16744
|
})).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.")
|
|
16663
16745
|
});
|
|
16664
|
-
var answerMothershipTicketRequestSchema =
|
|
16665
|
-
questionId:
|
|
16746
|
+
var answerMothershipTicketRequestSchema = z30.object({
|
|
16747
|
+
questionId: z30.string().min(1),
|
|
16666
16748
|
answer: text3(L.answer)
|
|
16667
16749
|
});
|
|
16668
|
-
var mothershipTicketAnswerRefSchema =
|
|
16669
|
-
var replyOnMothershipTicketRequestSchema =
|
|
16750
|
+
var mothershipTicketAnswerRefSchema = z30.object({ mothershipId: z30.uuid(), ticketId: z30.uuid(), questionId: z30.string().min(1) });
|
|
16751
|
+
var replyOnMothershipTicketRequestSchema = z30.object({
|
|
16670
16752
|
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.`),
|
|
16671
16753
|
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.")
|
|
16672
16754
|
});
|
|
16673
|
-
var mothershipTicketReplyRefSchema =
|
|
16674
|
-
var mothershipTicketThreadSchema =
|
|
16675
|
-
id:
|
|
16676
|
-
from:
|
|
16677
|
-
name:
|
|
16678
|
-
ship_id:
|
|
16679
|
-
chat_id:
|
|
16680
|
-
text:
|
|
16681
|
-
at:
|
|
16682
|
-
nudge:
|
|
16755
|
+
var mothershipTicketReplyRefSchema = z30.object({ ticketId: z30.uuid(), text: text3(L.answer) });
|
|
16756
|
+
var mothershipTicketThreadSchema = z30.array(z30.object({
|
|
16757
|
+
id: z30.string(),
|
|
16758
|
+
from: z30.enum(["user", "ship"]),
|
|
16759
|
+
name: z30.string(),
|
|
16760
|
+
ship_id: z30.string(),
|
|
16761
|
+
chat_id: z30.string(),
|
|
16762
|
+
text: z30.string(),
|
|
16763
|
+
at: z30.string(),
|
|
16764
|
+
nudge: z30.enum(["sent", "missed"]).optional()
|
|
16683
16765
|
}));
|
|
16684
16766
|
var LINEAR_ISSUE_SUMMARIES_MAX = 50;
|
|
16685
|
-
var linearIssueSummariesRequestSchema =
|
|
16767
|
+
var linearIssueSummariesRequestSchema = z30.object({ identifiers: z30.array(linearIdentifier).min(1).max(LINEAR_ISSUE_SUMMARIES_MAX) });
|
|
16686
16768
|
|
|
16687
16769
|
// ../shared/src/user-message-matching.ts
|
|
16688
16770
|
var parsedTimestamps = /* @__PURE__ */ new Map();
|
|
@@ -17052,10 +17134,10 @@ function currentStepLabel(messages, earlierPlainStep) {
|
|
|
17052
17134
|
}
|
|
17053
17135
|
|
|
17054
17136
|
// ../shared/src/user-message-attachments.ts
|
|
17055
|
-
import { z as
|
|
17137
|
+
import { z as z31 } from "zod";
|
|
17056
17138
|
var ATTACHMENT_PLACEHOLDER_REGEX = /^\[\d+ (?:(?:images?|files?)(?: and \d+ files?)? attached|(?:image )?attachments?)\]$/;
|
|
17057
17139
|
var withoutAttachmentPlaceholder = (content, attached) => attached && ATTACHMENT_PLACEHOLDER_REGEX.test(content) ? "" : content;
|
|
17058
|
-
var annotationLinesSchema =
|
|
17140
|
+
var annotationLinesSchema = z31.object({ path: z31.string(), start: z31.number(), end: z31.number() });
|
|
17059
17141
|
var ANNOTATIONS_NOTE_OPENING = '<replicas_annotations>\nThe user quoted these passages, some with a comment. Address each annotation, and when you do, refer to it as "Annotation N".';
|
|
17060
17142
|
var ANNOTATIONS_NOTE_REGEX = /(?:^|\n\n)<replicas_annotations>\n([\s\S]*?)\n<\/replicas_annotations>$/;
|
|
17061
17143
|
var ANNOTATION_HEADER_REGEX = /^Annotation \d+$/m;
|
|
@@ -20352,7 +20434,7 @@ var VOICE_WAVEFORM = {
|
|
|
20352
20434
|
};
|
|
20353
20435
|
|
|
20354
20436
|
// ../shared/src/e2b.ts
|
|
20355
|
-
var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-11-16-
|
|
20437
|
+
var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-11-16-v7";
|
|
20356
20438
|
|
|
20357
20439
|
// ../shared/src/e2b-retry.ts
|
|
20358
20440
|
var DEFAULT_BACKOFFS_MS = [2e3, 5e3];
|
|
@@ -20707,55 +20789,6 @@ function resolveWarmHookConfig(value) {
|
|
|
20707
20789
|
return resolveHookConfig(parseWarmHookConfig(value));
|
|
20708
20790
|
}
|
|
20709
20791
|
|
|
20710
|
-
// ../shared/src/environment-config.ts
|
|
20711
|
-
import { z as z31 } from "zod";
|
|
20712
|
-
var variableNameSchema = z31.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name");
|
|
20713
|
-
var mcpValueSchema = z31.union([
|
|
20714
|
-
z31.string(),
|
|
20715
|
-
environmentMcpVariableReferenceSchema
|
|
20716
|
-
]);
|
|
20717
|
-
var mcpValuesSchema = z31.record(z31.string(), mcpValueSchema);
|
|
20718
|
-
var httpConfigSchema = environmentMcpHttpConfigSchema.pick({ url: true, auth: true }).extend({
|
|
20719
|
-
headers: mcpValuesSchema.default({})
|
|
20720
|
-
}).strict();
|
|
20721
|
-
var replicasMcpDefinitionSchema = z31.discriminatedUnion("transport", [
|
|
20722
|
-
z31.strictObject({
|
|
20723
|
-
transport: z31.literal("stdio"),
|
|
20724
|
-
config: environmentMcpStdioConfigSchema.pick({ command: true }).extend({
|
|
20725
|
-
args: environmentMcpStdioConfigSchema.shape.args.unwrap().default([]),
|
|
20726
|
-
env: z31.record(variableNameSchema, mcpValueSchema).default({})
|
|
20727
|
-
}).strict()
|
|
20728
|
-
}),
|
|
20729
|
-
z31.strictObject({ transport: z31.literal("http"), config: httpConfigSchema }),
|
|
20730
|
-
z31.strictObject({ transport: z31.literal("sse"), config: httpConfigSchema })
|
|
20731
|
-
]).superRefine((definition, context) => {
|
|
20732
|
-
if (definition.transport === "stdio") return;
|
|
20733
|
-
const result = validateEnvironmentMcpAuthentication(definition.transport, definition.config);
|
|
20734
|
-
if (!result.ok) context.addIssue({ code: "custom", path: result.error.code === "transport" ? ["transport"] : ["config", result.error.code ?? "auth"], message: result.error.message });
|
|
20735
|
-
});
|
|
20736
|
-
var replicasEnvironmentConfigSchema = z31.strictObject({
|
|
20737
|
-
systemPrompt: z31.string().optional(),
|
|
20738
|
-
warmHook: z31.string().optional(),
|
|
20739
|
-
startHook: z31.string().optional(),
|
|
20740
|
-
variables: z31.record(variableNameSchema, z31.string()).optional(),
|
|
20741
|
-
requiredSecrets: z31.array(variableNameSchema).optional(),
|
|
20742
|
-
mcps: z31.record(z31.string().regex(MCP_NAME_PATTERN, "must be 1\u201364 letters, digits, underscores or hyphens, starting with a letter or digit").refine((name) => !isReservedMcpName(name), "is reserved for Replicas"), replicasMcpDefinitionSchema).optional()
|
|
20743
|
-
}).superRefine((config, context) => {
|
|
20744
|
-
const names = /* @__PURE__ */ new Set();
|
|
20745
|
-
for (const name of Object.keys(config.mcps ?? {})) {
|
|
20746
|
-
const normalized = name.toLowerCase();
|
|
20747
|
-
if (names.has(normalized)) {
|
|
20748
|
-
context.addIssue({ code: "custom", path: ["mcps", name], message: "MCP names must be unique regardless of case" });
|
|
20749
|
-
}
|
|
20750
|
-
names.add(normalized);
|
|
20751
|
-
}
|
|
20752
|
-
for (const key of config.requiredSecrets ?? []) {
|
|
20753
|
-
if (config.variables && Object.hasOwn(config.variables, key)) {
|
|
20754
|
-
context.addIssue({ code: "custom", path: ["requiredSecrets"], message: `"${key}" cannot also be declared as a non-secret variable` });
|
|
20755
|
-
}
|
|
20756
|
-
}
|
|
20757
|
-
});
|
|
20758
|
-
|
|
20759
20792
|
// ../shared/src/replicas-config.ts
|
|
20760
20793
|
var REPLICAS_CONFIG_FILENAMES = ["replicas.json", "replicas.yaml", "replicas.yml"];
|
|
20761
20794
|
function isRecord4(value) {
|
|
@@ -20766,6 +20799,13 @@ function parseReplicasConfig(value, filename = "replicas.json") {
|
|
|
20766
20799
|
throw new Error(`Invalid ${filename}: expected an object`);
|
|
20767
20800
|
}
|
|
20768
20801
|
const config = {};
|
|
20802
|
+
if ("infra" in value) {
|
|
20803
|
+
if (typeof value.infra !== "string" || !value.infra.trim()) {
|
|
20804
|
+
throw new Error(`Invalid ${filename}: "infra" must be a non-empty file path`);
|
|
20805
|
+
}
|
|
20806
|
+
if ("environment" in value) throw new Error(`Invalid ${filename}: use either "infra" or "environment", not both`);
|
|
20807
|
+
config.infra = value.infra;
|
|
20808
|
+
}
|
|
20769
20809
|
if ("organizationId" in value) {
|
|
20770
20810
|
if (typeof value.organizationId !== "string") {
|
|
20771
20811
|
throw new Error(`Invalid ${filename}: "organizationId" must be a string`);
|
|
@@ -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-KG2JNU6Y.js";
|
|
7
|
+
import "./chunk-AGDZO2Y7.js";
|
|
8
|
+
import "./chunk-UXONE2G5.js";
|
|
9
9
|
import {
|
|
10
10
|
isRecord
|
|
11
11
|
} from "./chunk-UZSNFLDQ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-XM5NXZVI.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-KMNCQCA3.js";
|
|
18
18
|
import {
|
|
19
19
|
AppServerProcess,
|
|
20
20
|
buildCodexAgentEnv
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
} from "./chunk-IJUB4BUF.js";
|
|
22
|
+
import "./chunk-UXONE2G5.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-XM5NXZVI.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-KG2JNU6Y.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-KMNCQCA3.js";
|
|
69
69
|
import {
|
|
70
70
|
publishedPullRequestUrls
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-UCFTKJ3Z.js";
|
|
72
72
|
import {
|
|
73
73
|
ACCOUNT_RATE_LIMITS_READ_METHOD,
|
|
74
74
|
AsyncLock,
|
|
@@ -147,7 +147,7 @@ import {
|
|
|
147
147
|
transcriptSecrets,
|
|
148
148
|
upsertCredentialFileLines,
|
|
149
149
|
writeSecureCredentialFile
|
|
150
|
-
} from "./chunk-
|
|
150
|
+
} from "./chunk-MP7PH577.js";
|
|
151
151
|
import {
|
|
152
152
|
ENGINE_ENV,
|
|
153
153
|
UNQUOTED_PATHS_CONFIG,
|
|
@@ -158,16 +158,16 @@ import {
|
|
|
158
158
|
resolveDiffBase,
|
|
159
159
|
setAgentCredentialSnapshot,
|
|
160
160
|
setLinearSessionId
|
|
161
|
-
} from "./chunk-
|
|
161
|
+
} from "./chunk-AGDZO2Y7.js";
|
|
162
162
|
import {
|
|
163
163
|
buildCodexAgentEnv,
|
|
164
164
|
getCodexModelProvider
|
|
165
|
-
} from "./chunk-
|
|
165
|
+
} from "./chunk-IJUB4BUF.js";
|
|
166
166
|
import {
|
|
167
167
|
SUBPROCESS_MAX_BUFFER,
|
|
168
168
|
execAsync,
|
|
169
169
|
execFileAsync
|
|
170
|
-
} from "./chunk-
|
|
170
|
+
} from "./chunk-UXONE2G5.js";
|
|
171
171
|
import {
|
|
172
172
|
isRecord as isRecord2
|
|
173
173
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -463,7 +463,7 @@ import {
|
|
|
463
463
|
workspaceTokenRequestSchema,
|
|
464
464
|
workspaceTokenResponseSchema,
|
|
465
465
|
wrapInTag
|
|
466
|
-
} from "./chunk-
|
|
466
|
+
} from "./chunk-XM5NXZVI.js";
|
|
467
467
|
import {
|
|
468
468
|
cloneMcpConfig,
|
|
469
469
|
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-UCFTKJ3Z.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-XM5NXZVI.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