replicas-engine 0.1.1210 → 0.1.1212
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-HV2J43RI.js → asp-host-PPRRLLXN.js} +5 -5
- package/dist/src/{chunk-JVBVO5SM.js → chunk-72NORPKS.js} +1 -1
- package/dist/src/{chunk-WF66TH2R.js → chunk-BTWJMRHR.js} +2 -2
- package/dist/src/{chunk-GWT3LWTC.js → chunk-C5IXAOYE.js} +6 -6
- package/dist/src/{chunk-QNL3RGIJ.js → chunk-FTRFBB2U.js} +327 -292
- package/dist/src/{chunk-PS2ARUWT.js → chunk-JSBTLSXI.js} +2 -2
- package/dist/src/{chunk-H46YGVWX.js → chunk-K6TRY5YR.js} +2 -2
- package/dist/src/{chunk-BFXPBH4O.js → chunk-N2ZH26HY.js} +1 -1
- package/dist/src/{chunk-I3URDWNH.js → chunk-ZCHENOLM.js} +3 -3
- package/dist/src/command-protection-hook.js +4 -4
- package/dist/src/headless-agent.js +4 -4
- package/dist/src/index.js +38 -18
- package/dist/src/post-tool-pr-hook.js +2 -2
- package/dist/src/subagent-mcp.js +1 -1
- package/package.json +1 -1
- package/workspace-sdk/shared/routes/plugin-catalog.d.ts +221 -197
- package/workspace-sdk/shared/routes/plugins.d.ts +5 -0
|
@@ -2279,11 +2279,18 @@ function getChatContinuation(chats, chatId) {
|
|
|
2279
2279
|
return next && (getChatContinuation(chats, next.id) ?? next);
|
|
2280
2280
|
}
|
|
2281
2281
|
|
|
2282
|
-
// ../shared/src/credential-
|
|
2282
|
+
// ../shared/src/credential-refresh.ts
|
|
2283
2283
|
import { z as z10 } from "zod";
|
|
2284
|
+
var engineCredentialRefreshFailureSchema = z10.object({
|
|
2285
|
+
code: z10.string(),
|
|
2286
|
+
credential: workspaceCredentialSelectionSchema.optional()
|
|
2287
|
+
});
|
|
2288
|
+
|
|
2289
|
+
// ../shared/src/credential-pool.ts
|
|
2290
|
+
import { z as z11 } from "zod";
|
|
2284
2291
|
var MAX_CREDENTIAL_POOL_ACCOUNTS = 10;
|
|
2285
|
-
var reorderCredentialPoolSchema =
|
|
2286
|
-
credential_ids:
|
|
2292
|
+
var reorderCredentialPoolSchema = z11.object({
|
|
2293
|
+
credential_ids: z11.array(z11.string().uuid()).min(1).max(MAX_CREDENTIAL_POOL_ACCOUNTS)
|
|
2287
2294
|
});
|
|
2288
2295
|
|
|
2289
2296
|
// ../shared/src/display-message/types.ts
|
|
@@ -3009,13 +3016,13 @@ function parseMcpToolName(name) {
|
|
|
3009
3016
|
}
|
|
3010
3017
|
|
|
3011
3018
|
// ../shared/src/mothership-events.ts
|
|
3012
|
-
import { z as
|
|
3019
|
+
import { z as z18 } from "zod";
|
|
3013
3020
|
|
|
3014
3021
|
// ../shared/src/replicas-mcp.ts
|
|
3015
|
-
import { z as
|
|
3022
|
+
import { z as z15 } from "zod";
|
|
3016
3023
|
|
|
3017
3024
|
// ../shared/src/automations/trigger-schemas.ts
|
|
3018
|
-
import { z as
|
|
3025
|
+
import { z as z12 } from "zod";
|
|
3019
3026
|
|
|
3020
3027
|
// ../shared/src/uuid.ts
|
|
3021
3028
|
function createUuidFromHex(value) {
|
|
@@ -3032,29 +3039,29 @@ function getReviewerLoginsError(event, logins) {
|
|
|
3032
3039
|
if (isReviewRequested === !!logins?.some((login) => login.trim().replace(/^@+/, ""))) return null;
|
|
3033
3040
|
return isReviewRequested ? "The PR review requested trigger needs at least one GitHub username" : "Requested reviewers only apply to the PR review requested trigger";
|
|
3034
3041
|
}
|
|
3035
|
-
var repositoryTriggerConfigSchema =
|
|
3036
|
-
event:
|
|
3037
|
-
repository_ids:
|
|
3038
|
-
group_pr_events:
|
|
3039
|
-
excluded_actors:
|
|
3040
|
-
reviewer_logins:
|
|
3042
|
+
var repositoryTriggerConfigSchema = z12.object({
|
|
3043
|
+
event: z12.string(),
|
|
3044
|
+
repository_ids: z12.array(z12.string().regex(UUID_RE, "must be a repository id")).optional(),
|
|
3045
|
+
group_pr_events: z12.boolean().optional(),
|
|
3046
|
+
excluded_actors: z12.array(z12.string()).optional(),
|
|
3047
|
+
reviewer_logins: z12.array(z12.string()).optional()
|
|
3041
3048
|
});
|
|
3042
|
-
var cronTriggerSchema =
|
|
3043
|
-
var githubTriggerSchema =
|
|
3044
|
-
type:
|
|
3049
|
+
var cronTriggerSchema = z12.object({ type: z12.literal("cron"), config: z12.object({ schedule: z12.string(), timezone: z12.string().optional() }) });
|
|
3050
|
+
var githubTriggerSchema = z12.object({
|
|
3051
|
+
type: z12.literal("github"),
|
|
3045
3052
|
config: repositoryTriggerConfigSchema.superRefine((config, ctx) => {
|
|
3046
3053
|
const message2 = getReviewerLoginsError(config.event, config.reviewer_logins);
|
|
3047
3054
|
if (message2) ctx.addIssue({ code: "custom", message: message2, path: ["reviewer_logins"] });
|
|
3048
3055
|
})
|
|
3049
3056
|
});
|
|
3050
|
-
var gitlabTriggerSchema =
|
|
3051
|
-
var automationTriggerSchema =
|
|
3057
|
+
var gitlabTriggerSchema = z12.object({ type: z12.literal("gitlab"), config: repositoryTriggerConfigSchema });
|
|
3058
|
+
var automationTriggerSchema = z12.discriminatedUnion("type", [
|
|
3052
3059
|
cronTriggerSchema,
|
|
3053
3060
|
githubTriggerSchema,
|
|
3054
3061
|
gitlabTriggerSchema,
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3062
|
+
z12.object({ type: z12.literal("slack"), config: z12.object({ event: z12.string(), channel_ids: z12.array(z12.string()).optional(), group_thread_replies: z12.boolean().optional() }) }),
|
|
3063
|
+
z12.object({ type: z12.literal("sentry"), config: z12.object({ event: z12.string(), project_slugs: z12.array(z12.string()).optional(), min_level: z12.string().optional() }) }),
|
|
3064
|
+
z12.object({ type: z12.literal("custom"), config: z12.object({}) })
|
|
3058
3065
|
]);
|
|
3059
3066
|
|
|
3060
3067
|
// ../shared/src/automations/types.ts
|
|
@@ -3062,21 +3069,21 @@ var AUTOMATION_DEBOUNCE_MAX_SECONDS = 24 * 60 * 60;
|
|
|
3062
3069
|
var AUTOMATION_LIFECYCLE_POLICIES = ["default", "archive_when_done", "sleep_when_done", "delete_when_done"];
|
|
3063
3070
|
|
|
3064
3071
|
// ../shared/src/routes/environment.ts
|
|
3065
|
-
import { z as
|
|
3072
|
+
import { z as z13 } from "zod";
|
|
3066
3073
|
var ENVIRONMENT_MCP_TRANSPORTS = ["stdio", "http", "sse"];
|
|
3067
|
-
var stringMap =
|
|
3068
|
-
var createEnvironmentMcpRequestSchema =
|
|
3069
|
-
name:
|
|
3070
|
-
transport:
|
|
3071
|
-
config:
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
+
var stringMap = z13.record(z13.string(), z13.string());
|
|
3075
|
+
var createEnvironmentMcpRequestSchema = z13.object({
|
|
3076
|
+
name: z13.string(),
|
|
3077
|
+
transport: z13.enum(ENVIRONMENT_MCP_TRANSPORTS),
|
|
3078
|
+
config: z13.union([
|
|
3079
|
+
z13.object({ command: z13.string().min(1), args: z13.array(z13.string()).optional(), env: stringMap.optional() }),
|
|
3080
|
+
z13.object({ url: z13.url(), headers: stringMap.optional(), auth: mcpAuthSchema.optional() })
|
|
3074
3081
|
]).describe("stdio: `{ command, args, env }`. http/sse: `{ url, headers }`.")
|
|
3075
3082
|
});
|
|
3076
3083
|
var updateEnvironmentMcpRequestSchema = createEnvironmentMcpRequestSchema.partial();
|
|
3077
3084
|
|
|
3078
3085
|
// ../shared/src/routes/workspaces.ts
|
|
3079
|
-
import { z as
|
|
3086
|
+
import { z as z14 } from "zod";
|
|
3080
3087
|
var WORKSPACE_STATUSES = ["active", "sleeping", "archived", "preparing", "error"];
|
|
3081
3088
|
var STALE_PREPARING_MS = 10 * 6e4;
|
|
3082
3089
|
var WORKSPACE_STATUS_FILTERS = WORKSPACE_STATUSES.map((status) => status === "error" ? "failed" : status);
|
|
@@ -3087,16 +3094,16 @@ var DEFAULT_WORKSPACE_FILTERS = {
|
|
|
3087
3094
|
activity: "any"
|
|
3088
3095
|
};
|
|
3089
3096
|
var ONE_DAY_MS = 24 * 60 * 60 * 1e3;
|
|
3090
|
-
var workspaceExecRequestSchema =
|
|
3091
|
-
command:
|
|
3092
|
-
timeout_seconds:
|
|
3097
|
+
var workspaceExecRequestSchema = z14.object({
|
|
3098
|
+
command: z14.string().regex(/\S/, "command is required"),
|
|
3099
|
+
timeout_seconds: z14.number().int().min(1).max(50).optional().describe("Default: 30")
|
|
3093
3100
|
});
|
|
3094
|
-
var terminalRtcCandidateSchema =
|
|
3095
|
-
var terminalSocketServerMessageSchema =
|
|
3096
|
-
|
|
3097
|
-
|
|
3101
|
+
var terminalRtcCandidateSchema = z14.object({ type: z14.literal("rtc-candidate"), candidate: z14.string(), mid: z14.string() });
|
|
3102
|
+
var terminalSocketServerMessageSchema = z14.discriminatedUnion("type", [
|
|
3103
|
+
z14.object({ type: z14.literal("output"), data: z14.string() }),
|
|
3104
|
+
z14.object({ type: z14.literal("rtc-answer"), sdp: z14.string() }),
|
|
3098
3105
|
terminalRtcCandidateSchema,
|
|
3099
|
-
|
|
3106
|
+
z14.object({ type: z14.literal("rtc-switch") })
|
|
3100
3107
|
]);
|
|
3101
3108
|
var TERMINAL_RTC_ICE_SERVER = "stun:stun.l.google.com:19302";
|
|
3102
3109
|
|
|
@@ -3139,44 +3146,44 @@ var REPLICAS_MCP_TOOLS = {
|
|
|
3139
3146
|
deleteChat: "delete_chat",
|
|
3140
3147
|
listRepositories: "list_repositories"
|
|
3141
3148
|
};
|
|
3142
|
-
var automationToolInputSchema =
|
|
3143
|
-
name:
|
|
3144
|
-
prompt:
|
|
3145
|
-
environment_id:
|
|
3146
|
-
triggers:
|
|
3149
|
+
var automationToolInputSchema = z15.object({
|
|
3150
|
+
name: z15.string().describe("Short automation name."),
|
|
3151
|
+
prompt: z15.string().describe("Prompt each automation run starts with."),
|
|
3152
|
+
environment_id: z15.string().describe(`Environment id from \`${REPLICAS_MCP_TOOLS.listEnvironments}\`.`),
|
|
3153
|
+
triggers: z15.array(automationTriggerSchema).min(1).describe(
|
|
3147
3154
|
'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>"] } }`.'
|
|
3148
3155
|
),
|
|
3149
|
-
description:
|
|
3150
|
-
plan_mode:
|
|
3151
|
-
goal_mode:
|
|
3152
|
-
fast_mode:
|
|
3153
|
-
workspace_lifecycle_policy:
|
|
3156
|
+
description: z15.string().optional().describe("One-line summary shown in the dashboard."),
|
|
3157
|
+
plan_mode: z15.boolean().optional(),
|
|
3158
|
+
goal_mode: z15.boolean().optional(),
|
|
3159
|
+
fast_mode: z15.boolean().optional(),
|
|
3160
|
+
workspace_lifecycle_policy: z15.enum(AUTOMATION_LIFECYCLE_POLICIES).optional().describe(
|
|
3154
3161
|
"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."
|
|
3155
3162
|
)
|
|
3156
3163
|
});
|
|
3157
3164
|
var automationCreateToolInputSchema = automationToolInputSchema.extend({
|
|
3158
|
-
scope:
|
|
3165
|
+
scope: z15.enum(["org", "user"]).optional().describe("`org` (default) or `user` for a personal automation, which needs a personal API key.")
|
|
3159
3166
|
});
|
|
3160
3167
|
var automationUpdateToolInputSchema = automationToolInputSchema.partial().extend({
|
|
3161
|
-
automation_id:
|
|
3162
|
-
enabled:
|
|
3163
|
-
agent_provider:
|
|
3164
|
-
model:
|
|
3165
|
-
thinking_level:
|
|
3166
|
-
workspace_size:
|
|
3167
|
-
scope:
|
|
3168
|
+
automation_id: z15.string().describe("Automation ID"),
|
|
3169
|
+
enabled: z15.boolean().optional(),
|
|
3170
|
+
agent_provider: z15.enum(AGENT).nullable().optional(),
|
|
3171
|
+
model: z15.string().nullable().optional(),
|
|
3172
|
+
thinking_level: z15.enum(VALID_THINKING_LEVELS).nullable().optional(),
|
|
3173
|
+
workspace_size: z15.enum(WORKSPACE_SIZES).optional(),
|
|
3174
|
+
scope: z15.literal("org").optional().describe("`org` moves a personal automation to the organization so teammates can see and edit it. It cannot be moved back.")
|
|
3168
3175
|
});
|
|
3169
|
-
var chatPath = { id:
|
|
3176
|
+
var chatPath = { id: z15.string().describe("Workspace ID"), chat_id: z15.string().describe("Chat ID") };
|
|
3170
3177
|
var { provider, model, thinkingLevel, title, message } = forkChatRequestSchema.shape;
|
|
3171
|
-
var createChatToolInputSchema =
|
|
3172
|
-
var forkChatToolInputSchema =
|
|
3173
|
-
var renameChatToolInputSchema =
|
|
3174
|
-
var runCommandToolInputSchema =
|
|
3175
|
-
var environmentMcpPath = { environment_id:
|
|
3176
|
-
var createEnvironmentMcpToolInputSchema =
|
|
3177
|
-
var updateEnvironmentMcpToolInputSchema =
|
|
3178
|
+
var createChatToolInputSchema = z15.object({ id: chatPath.id, provider, title: createChatRequestSchema.shape.title });
|
|
3179
|
+
var forkChatToolInputSchema = z15.object({ ...chatPath, provider, model, thinking_level: thinkingLevel, title, message });
|
|
3180
|
+
var renameChatToolInputSchema = z15.object({ ...chatPath, display_name: updateChatDisplayNameRequestSchema.shape.displayName });
|
|
3181
|
+
var runCommandToolInputSchema = z15.object({ id: chatPath.id, ...workspaceExecRequestSchema.shape });
|
|
3182
|
+
var environmentMcpPath = { environment_id: z15.string().describe("Environment ID") };
|
|
3183
|
+
var createEnvironmentMcpToolInputSchema = z15.object({ ...environmentMcpPath, ...createEnvironmentMcpRequestSchema.shape });
|
|
3184
|
+
var updateEnvironmentMcpToolInputSchema = z15.object({
|
|
3178
3185
|
...environmentMcpPath,
|
|
3179
|
-
mcp_id:
|
|
3186
|
+
mcp_id: z15.string().describe("MCP ID"),
|
|
3180
3187
|
...updateEnvironmentMcpRequestSchema.shape
|
|
3181
3188
|
});
|
|
3182
3189
|
|
|
@@ -3481,7 +3488,7 @@ var DOCKER_ABILITY = {
|
|
|
3481
3488
|
};
|
|
3482
3489
|
|
|
3483
3490
|
// ../shared/src/routes/environment-setups.ts
|
|
3484
|
-
import { z as
|
|
3491
|
+
import { z as z16 } from "zod";
|
|
3485
3492
|
var ENVIRONMENT_SETUP_STEPS = [
|
|
3486
3493
|
{ key: "understand", label: "Understand the codebase" },
|
|
3487
3494
|
{ key: "install", label: "Install dependencies and run the app" },
|
|
@@ -3514,17 +3521,17 @@ var ENVIRONMENT_SETUP_LIMITS = {
|
|
|
3514
3521
|
repositories: 20
|
|
3515
3522
|
};
|
|
3516
3523
|
var VARIABLE_KEY_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
3517
|
-
var text2 = (max) => max === void 0 ?
|
|
3524
|
+
var text2 = (max) => max === void 0 ? z16.string().trim() : z16.string().trim().max(max);
|
|
3518
3525
|
var requiredText = (max) => text2(max).min(1, "must not be empty");
|
|
3519
3526
|
var optionalText2 = (max) => text2(max).nullish().transform((value) => value || null);
|
|
3520
3527
|
var clearableText = (max) => text2(max).nullish().transform((value) => value === void 0 ? void 0 : value || null);
|
|
3521
|
-
var list = (item, max) => max === void 0 ?
|
|
3528
|
+
var list = (item, max) => max === void 0 ? z16.array(item) : z16.array(item).max(max);
|
|
3522
3529
|
var ENVIRONMENT_SETUP_AUTHORED_TRIGGER_TYPES = ["cron", "github", "gitlab"];
|
|
3523
3530
|
function isEnvironmentSetupAuthoredTriggerType(type) {
|
|
3524
3531
|
return ENVIRONMENT_SETUP_AUTHORED_TRIGGER_TYPES.some((authored) => authored === type);
|
|
3525
3532
|
}
|
|
3526
|
-
var proposalTriggerSchema =
|
|
3527
|
-
var existingTriggerSchema =
|
|
3533
|
+
var proposalTriggerSchema = z16.discriminatedUnion("type", [cronTriggerSchema, githubTriggerSchema, gitlabTriggerSchema]);
|
|
3534
|
+
var existingTriggerSchema = z16.custom(
|
|
3528
3535
|
(value) => isRecord(value) && typeof value.type === "string" && isRecord(value.config),
|
|
3529
3536
|
"must be an automation trigger"
|
|
3530
3537
|
);
|
|
@@ -3532,17 +3539,17 @@ var carriedTriggerSchema = existingTriggerSchema.refine(
|
|
|
3532
3539
|
(trigger) => !isEnvironmentSetupAuthoredTriggerType(trigger.type)
|
|
3533
3540
|
);
|
|
3534
3541
|
function automationSchema(limits) {
|
|
3535
|
-
const authored =
|
|
3542
|
+
const authored = z16.object({
|
|
3536
3543
|
name: text2(limits.nameChars),
|
|
3537
3544
|
description: text2(limits.descriptionChars),
|
|
3538
3545
|
prompt: text2(limits.automationPromptChars),
|
|
3539
3546
|
triggers: list(proposalTriggerSchema, limits.automationTriggers)
|
|
3540
3547
|
});
|
|
3541
|
-
const updated = authored.extend({ triggers: list(
|
|
3542
|
-
return
|
|
3548
|
+
const updated = authored.extend({ triggers: list(z16.union([proposalTriggerSchema, carriedTriggerSchema]), limits.automationTriggers) });
|
|
3549
|
+
return z16.object({
|
|
3543
3550
|
key: requiredText(limits.automationKeyChars),
|
|
3544
|
-
action:
|
|
3545
|
-
automation_id:
|
|
3551
|
+
action: z16.enum(ENVIRONMENT_SETUP_AUTOMATION_ACTIONS).default("create"),
|
|
3552
|
+
automation_id: z16.string().regex(UUID_RE, "must be an automation id").nullable().default(null),
|
|
3546
3553
|
name: text2().default(""),
|
|
3547
3554
|
description: optionalText2().transform((value) => value ?? ""),
|
|
3548
3555
|
prompt: text2().default(""),
|
|
@@ -3565,7 +3572,7 @@ function automationSchema(limits) {
|
|
|
3565
3572
|
const content = (automation.action === "update" ? updated : authored).safeParse(automation);
|
|
3566
3573
|
if (content.success) return { ...automation, ...content.data };
|
|
3567
3574
|
for (const issue of content.error.issues) ctx.addIssue({ ...issue, code: "custom" });
|
|
3568
|
-
return
|
|
3575
|
+
return z16.NEVER;
|
|
3569
3576
|
});
|
|
3570
3577
|
}
|
|
3571
3578
|
function automationListSchema(limits) {
|
|
@@ -3583,7 +3590,7 @@ function automationListSchema(limits) {
|
|
|
3583
3590
|
});
|
|
3584
3591
|
}
|
|
3585
3592
|
function environmentSchema(limits) {
|
|
3586
|
-
return
|
|
3593
|
+
return z16.object({
|
|
3587
3594
|
name: optionalText2(limits.nameChars).transform((value) => value ?? void 0),
|
|
3588
3595
|
description: clearableText(limits.descriptionChars),
|
|
3589
3596
|
system_prompt: clearableText(limits.systemPromptChars),
|
|
@@ -3592,41 +3599,41 @@ function environmentSchema(limits) {
|
|
|
3592
3599
|
});
|
|
3593
3600
|
}
|
|
3594
3601
|
function proposalSchema(limits) {
|
|
3595
|
-
return
|
|
3602
|
+
return z16.object({
|
|
3596
3603
|
summary: requiredText(limits.summaryChars),
|
|
3597
3604
|
stack: list(text2(), limits.stackItems).default([]).transform((items) => items.filter(Boolean)),
|
|
3598
3605
|
environment: environmentSchema(limits),
|
|
3599
|
-
variables: list(
|
|
3600
|
-
key:
|
|
3606
|
+
variables: list(z16.object({
|
|
3607
|
+
key: z16.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name").max(limits.variableKeyChars ?? Number.POSITIVE_INFINITY),
|
|
3601
3608
|
description: optionalText2(limits.variableDescriptionChars).transform((value) => value ?? ""),
|
|
3602
|
-
required:
|
|
3609
|
+
required: z16.boolean().default(false)
|
|
3603
3610
|
}), limits.variables).default([]),
|
|
3604
3611
|
automations: automationListSchema(limits),
|
|
3605
|
-
verification: list(
|
|
3612
|
+
verification: list(z16.object({
|
|
3606
3613
|
label: requiredText(limits.nameChars),
|
|
3607
|
-
status:
|
|
3614
|
+
status: z16.enum(ENVIRONMENT_SETUP_VERIFICATION_STATUSES),
|
|
3608
3615
|
detail: optionalText2(limits.verificationDetailChars).transform((value) => value ?? void 0)
|
|
3609
3616
|
}), limits.verificationItems).default([]),
|
|
3610
|
-
media: list(
|
|
3611
|
-
media_id:
|
|
3617
|
+
media: list(z16.object({
|
|
3618
|
+
media_id: z16.string().regex(UUID_RE, "must be a media id"),
|
|
3612
3619
|
title: requiredText(limits.nameChars)
|
|
3613
3620
|
}), limits.mediaItems).default([])
|
|
3614
3621
|
});
|
|
3615
3622
|
}
|
|
3616
3623
|
var environmentSetupProposalSchema = proposalSchema({});
|
|
3617
3624
|
var environmentSetupProposalSubmissionSchema = proposalSchema(ENVIRONMENT_SETUP_LIMITS);
|
|
3618
|
-
var environmentSetupRunStateSchema =
|
|
3619
|
-
status:
|
|
3620
|
-
steps:
|
|
3625
|
+
var environmentSetupRunStateSchema = z16.object({
|
|
3626
|
+
status: z16.enum(ENVIRONMENT_SETUP_RUN_STATUSES),
|
|
3627
|
+
steps: z16.partialRecord(z16.enum(ENVIRONMENT_SETUP_STEPS.map((step) => step.key)), z16.enum(ENVIRONMENT_SETUP_STEP_STATUSES)).default({}),
|
|
3621
3628
|
proposal: environmentSetupProposalSchema.nullable().default(null),
|
|
3622
|
-
applied:
|
|
3623
|
-
applied_at:
|
|
3624
|
-
automation_ids:
|
|
3629
|
+
applied: z16.object({
|
|
3630
|
+
applied_at: z16.string(),
|
|
3631
|
+
automation_ids: z16.array(z16.string())
|
|
3625
3632
|
}).nullable().default(null)
|
|
3626
3633
|
});
|
|
3627
|
-
var applyEnvironmentSetupRequestSchema =
|
|
3634
|
+
var applyEnvironmentSetupRequestSchema = z16.object({
|
|
3628
3635
|
environment: environmentSchema(ENVIRONMENT_SETUP_LIMITS).extend({ name: requiredText(ENVIRONMENT_SETUP_LIMITS.nameChars) }),
|
|
3629
|
-
variables: list(
|
|
3636
|
+
variables: list(z16.object({ key: z16.string().regex(VARIABLE_KEY_RE), value: z16.string() }), ENVIRONMENT_SETUP_LIMITS.variables).default([]).refine((variables) => new Set(variables.map((variable) => variable.key)).size === variables.length, "must have unique keys").transform((variables) => variables.filter((variable) => variable.value.length > 0)),
|
|
3630
3637
|
automations: automationListSchema(ENVIRONMENT_SETUP_LIMITS)
|
|
3631
3638
|
});
|
|
3632
3639
|
|
|
@@ -4079,7 +4086,7 @@ var GITLAB_ABILITY = {
|
|
|
4079
4086
|
};
|
|
4080
4087
|
|
|
4081
4088
|
// ../shared/src/routes/compute.ts
|
|
4082
|
-
import { z as
|
|
4089
|
+
import { z as z17 } from "zod";
|
|
4083
4090
|
var COMPUTE_SANDBOX_KINDS = ["gpu"];
|
|
4084
4091
|
var GPU_TYPES = ["T4", "L4", "A10G", "L40S", "A100", "A100-80GB", "H100", "H200", "B200"];
|
|
4085
4092
|
var DEFAULT_GPU_TYPE = "L4";
|
|
@@ -4096,27 +4103,27 @@ var COMPUTE_SANDBOX_LIMITS = {
|
|
|
4096
4103
|
maxIdleTimeoutMinutes: 60,
|
|
4097
4104
|
maxTransferBytes: 1024 ** 3
|
|
4098
4105
|
};
|
|
4099
|
-
var computeEnvSchema =
|
|
4100
|
-
var createComputeSandboxRequestSchema =
|
|
4101
|
-
kind:
|
|
4102
|
-
gpu:
|
|
4103
|
-
image:
|
|
4104
|
-
timeoutMinutes:
|
|
4105
|
-
idleTimeoutMinutes:
|
|
4106
|
-
ports:
|
|
4106
|
+
var computeEnvSchema = z17.record(z17.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128), z17.string().max(32768)).refine((env) => Object.keys(env).length <= 64, "At most 64 environment variables are allowed");
|
|
4107
|
+
var createComputeSandboxRequestSchema = z17.object({
|
|
4108
|
+
kind: z17.enum(COMPUTE_SANDBOX_KINDS),
|
|
4109
|
+
gpu: z17.string().trim().optional(),
|
|
4110
|
+
image: z17.string().trim().min(1).max(256).regex(/^\S+$/, "Image must not contain whitespace").optional(),
|
|
4111
|
+
timeoutMinutes: z17.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxTimeoutMinutes).optional(),
|
|
4112
|
+
idleTimeoutMinutes: z17.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxIdleTimeoutMinutes).optional(),
|
|
4113
|
+
ports: z17.array(z17.number().int().min(1).max(65535)).max(COMPUTE_SANDBOX_LIMITS.maxPorts).optional(),
|
|
4107
4114
|
env: computeEnvSchema.optional()
|
|
4108
4115
|
});
|
|
4109
|
-
var computeExecRequestSchema =
|
|
4110
|
-
command:
|
|
4111
|
-
workdir:
|
|
4116
|
+
var computeExecRequestSchema = z17.object({
|
|
4117
|
+
command: z17.string().min(1).max(1e5),
|
|
4118
|
+
workdir: z17.string().min(1).max(4096).optional(),
|
|
4112
4119
|
env: computeEnvSchema.optional(),
|
|
4113
|
-
detach:
|
|
4120
|
+
detach: z17.boolean().optional()
|
|
4114
4121
|
});
|
|
4115
|
-
var computeUploadRequestSchema =
|
|
4116
|
-
size:
|
|
4122
|
+
var computeUploadRequestSchema = z17.object({
|
|
4123
|
+
size: z17.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxTransferBytes)
|
|
4117
4124
|
});
|
|
4118
|
-
var computeTransferPathSchema =
|
|
4119
|
-
path:
|
|
4125
|
+
var computeTransferPathSchema = z17.object({
|
|
4126
|
+
path: z17.string().min(1).max(4096).optional()
|
|
4120
4127
|
});
|
|
4121
4128
|
|
|
4122
4129
|
// ../shared/src/default-skills/replicas-agent/abilities/gpu.ts
|
|
@@ -5735,16 +5742,16 @@ function splitMothershipInstructions(customInstructions) {
|
|
|
5735
5742
|
// ../shared/src/mothership-events.ts
|
|
5736
5743
|
var MOTHERSHIP_EVENT_KINDS = ["finished", "ready", "needs_attention", "merged", "closed", "archived"];
|
|
5737
5744
|
var MOTHERSHIP_EVENT_TYPE = "multitask-event";
|
|
5738
|
-
var mothershipEventSchema =
|
|
5739
|
-
id:
|
|
5740
|
-
at:
|
|
5741
|
-
kind:
|
|
5742
|
-
agentId:
|
|
5743
|
-
agentName:
|
|
5744
|
-
summary:
|
|
5745
|
-
detail:
|
|
5745
|
+
var mothershipEventSchema = z18.object({
|
|
5746
|
+
id: z18.string(),
|
|
5747
|
+
at: z18.string(),
|
|
5748
|
+
kind: z18.enum(MOTHERSHIP_EVENT_KINDS),
|
|
5749
|
+
agentId: z18.string(),
|
|
5750
|
+
agentName: z18.string(),
|
|
5751
|
+
summary: z18.string(),
|
|
5752
|
+
detail: z18.string().optional(),
|
|
5746
5753
|
// Already shown as a row when it happened, so the delivered message does not show it again.
|
|
5747
|
-
noticed:
|
|
5754
|
+
noticed: z18.boolean().optional()
|
|
5748
5755
|
});
|
|
5749
5756
|
var TAG = "multitask_event";
|
|
5750
5757
|
var BLOCK = new RegExp(`<${TAG}((?:\\s+\\w+="[^"]*")*)>\\n?([\\s\\S]*?)\\n?</${TAG}>`, "g");
|
|
@@ -5778,7 +5785,7 @@ function isMothershipEventMessage(text3) {
|
|
|
5778
5785
|
}
|
|
5779
5786
|
|
|
5780
5787
|
// ../shared/src/learned-skills.ts
|
|
5781
|
-
import { z as
|
|
5788
|
+
import { z as z19 } from "zod";
|
|
5782
5789
|
|
|
5783
5790
|
// ../shared/src/frontmatter.ts
|
|
5784
5791
|
import { parse as parseYaml } from "yaml";
|
|
@@ -5801,20 +5808,20 @@ function parseFrontmatter(content) {
|
|
|
5801
5808
|
var LEARNED_SKILLS_ROOT = `${SANDBOX_PATHS.REPLICAS_DIR}/learned-skills`;
|
|
5802
5809
|
var LEARNED_SKILLS_MANIFEST_PATH = `${LEARNED_SKILLS_ROOT}/manifest.json`;
|
|
5803
5810
|
var LEARNED_SKILL_DIR_PREFIX = "replicas-learned__";
|
|
5804
|
-
var learnedSkillsManifestSchema =
|
|
5805
|
-
skills:
|
|
5811
|
+
var learnedSkillsManifestSchema = z19.object({
|
|
5812
|
+
skills: z19.array(z19.object({ name: z19.string(), sha256: z19.string() }))
|
|
5806
5813
|
});
|
|
5807
|
-
var dreamVerdictChecksSchema =
|
|
5808
|
-
repeatable:
|
|
5809
|
-
realInstruction:
|
|
5810
|
-
noContradiction:
|
|
5811
|
-
formatExact:
|
|
5812
|
-
humanOnly:
|
|
5813
|
-
actionable:
|
|
5814
|
-
durable:
|
|
5814
|
+
var dreamVerdictChecksSchema = z19.object({
|
|
5815
|
+
repeatable: z19.boolean(),
|
|
5816
|
+
realInstruction: z19.boolean(),
|
|
5817
|
+
noContradiction: z19.boolean(),
|
|
5818
|
+
formatExact: z19.boolean(),
|
|
5819
|
+
humanOnly: z19.boolean(),
|
|
5820
|
+
actionable: z19.boolean(),
|
|
5821
|
+
durable: z19.boolean()
|
|
5815
5822
|
});
|
|
5816
5823
|
var DREAM_VERDICT_CHECKS = dreamVerdictChecksSchema.keyof().options;
|
|
5817
|
-
var dreamVerdictSchema = dreamVerdictChecksSchema.extend({ approve:
|
|
5824
|
+
var dreamVerdictSchema = dreamVerdictChecksSchema.extend({ approve: z19.boolean(), reason: z19.string() });
|
|
5818
5825
|
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."`;
|
|
5819
5826
|
|
|
5820
5827
|
// ../shared/src/user-message-matching.ts
|
|
@@ -8750,7 +8757,7 @@ var CLAUDE_AUTH_ENV_KEYS_BY_METHOD = {
|
|
|
8750
8757
|
};
|
|
8751
8758
|
|
|
8752
8759
|
// ../shared/src/routes/command-protection.ts
|
|
8753
|
-
import { z as
|
|
8760
|
+
import { z as z20 } from "zod";
|
|
8754
8761
|
|
|
8755
8762
|
// ../shared/src/git-invocations.ts
|
|
8756
8763
|
var COMMIT_VALUE_OPTIONS = /* @__PURE__ */ new Set(["message", "file", "trailer", "reuse-message", "reedit-message", "fixup", "squash", "template", "author", "date", "cleanup", "pathspec-from-file"]);
|
|
@@ -8841,27 +8848,27 @@ function findCheckoutTarget(args) {
|
|
|
8841
8848
|
}
|
|
8842
8849
|
|
|
8843
8850
|
// ../shared/src/routes/command-protection.ts
|
|
8844
|
-
var commandProtectionRepoStateSchema =
|
|
8845
|
-
branch:
|
|
8846
|
-
defaultBranch:
|
|
8847
|
-
pushBranch:
|
|
8848
|
-
pushConfig:
|
|
8849
|
-
headMessage:
|
|
8850
|
-
mergeInProgress:
|
|
8851
|
+
var commandProtectionRepoStateSchema = z20.object({
|
|
8852
|
+
branch: z20.string().nullable(),
|
|
8853
|
+
defaultBranch: z20.string().nullable(),
|
|
8854
|
+
pushBranch: z20.string().nullable(),
|
|
8855
|
+
pushConfig: z20.string().nullable(),
|
|
8856
|
+
headMessage: z20.string().nullable(),
|
|
8857
|
+
mergeInProgress: z20.boolean().optional()
|
|
8851
8858
|
});
|
|
8852
|
-
var commandProtectionEvaluateRequestSchema =
|
|
8853
|
-
provider:
|
|
8854
|
-
source:
|
|
8855
|
-
toolName:
|
|
8856
|
-
toolInput:
|
|
8857
|
-
command:
|
|
8858
|
-
cwd:
|
|
8859
|
-
toolUseId:
|
|
8859
|
+
var commandProtectionEvaluateRequestSchema = z20.object({
|
|
8860
|
+
provider: z20.enum(["claude", "codex", "cursor", "opencode", "pi"]),
|
|
8861
|
+
source: z20.enum(["claude_pre_tool_use", "codex_approval_request", "cursor_pre_tool_use", "opencode_pre_tool_use", "pi_tool_call"]),
|
|
8862
|
+
toolName: z20.string(),
|
|
8863
|
+
toolInput: z20.unknown(),
|
|
8864
|
+
command: z20.string().nullish(),
|
|
8865
|
+
cwd: z20.string().nullish(),
|
|
8866
|
+
toolUseId: z20.string().nullish(),
|
|
8860
8867
|
// Read by the engine before the command runs, keyed by absolute path, so the
|
|
8861
8868
|
// policy can see branches and commit messages the command text only references.
|
|
8862
|
-
gitContext:
|
|
8863
|
-
repos:
|
|
8864
|
-
messageFiles:
|
|
8869
|
+
gitContext: z20.object({
|
|
8870
|
+
repos: z20.record(z20.string(), commandProtectionRepoStateSchema),
|
|
8871
|
+
messageFiles: z20.record(z20.string(), z20.string())
|
|
8865
8872
|
}).optional()
|
|
8866
8873
|
});
|
|
8867
8874
|
var COMMAND_PROTECTION_COMMAND_KEYS = ["command", "cmd", "script", "query", "endpoint", "path", "url", "mutation"];
|
|
@@ -9058,113 +9065,113 @@ function shouldRefreshPullRequests(toolName, toolInput) {
|
|
|
9058
9065
|
}
|
|
9059
9066
|
|
|
9060
9067
|
// ../shared/src/routes/linear.ts
|
|
9061
|
-
import { z as
|
|
9062
|
-
var linearSessionMetadataSchema =
|
|
9063
|
-
via_mothership:
|
|
9064
|
-
issue_id:
|
|
9065
|
-
issue_identifier:
|
|
9066
|
-
issue_title:
|
|
9067
|
-
issue_description:
|
|
9068
|
-
issue_url:
|
|
9069
|
-
comment_id:
|
|
9070
|
-
comment_body:
|
|
9071
|
-
triggered_by_id:
|
|
9072
|
-
triggered_by_name:
|
|
9073
|
-
triggered_by_email:
|
|
9074
|
-
linear_workspace_id:
|
|
9075
|
-
creator_id:
|
|
9076
|
-
creator_name:
|
|
9077
|
-
creator_email:
|
|
9078
|
-
assignee_id:
|
|
9079
|
-
assignee_name:
|
|
9080
|
-
assignee_email:
|
|
9081
|
-
issue_state:
|
|
9082
|
-
parent_issue:
|
|
9083
|
-
id:
|
|
9084
|
-
identifier:
|
|
9085
|
-
title:
|
|
9086
|
-
description:
|
|
9068
|
+
import { z as z21 } from "zod";
|
|
9069
|
+
var linearSessionMetadataSchema = z21.object({
|
|
9070
|
+
via_mothership: z21.boolean().optional(),
|
|
9071
|
+
issue_id: z21.string(),
|
|
9072
|
+
issue_identifier: z21.string(),
|
|
9073
|
+
issue_title: z21.string(),
|
|
9074
|
+
issue_description: z21.string(),
|
|
9075
|
+
issue_url: z21.string(),
|
|
9076
|
+
comment_id: z21.string(),
|
|
9077
|
+
comment_body: z21.string(),
|
|
9078
|
+
triggered_by_id: z21.string().optional(),
|
|
9079
|
+
triggered_by_name: z21.string().optional(),
|
|
9080
|
+
triggered_by_email: z21.string().optional(),
|
|
9081
|
+
linear_workspace_id: z21.string().optional(),
|
|
9082
|
+
creator_id: z21.string().optional(),
|
|
9083
|
+
creator_name: z21.string().optional(),
|
|
9084
|
+
creator_email: z21.string().optional(),
|
|
9085
|
+
assignee_id: z21.string().optional(),
|
|
9086
|
+
assignee_name: z21.string().optional(),
|
|
9087
|
+
assignee_email: z21.string().optional(),
|
|
9088
|
+
issue_state: z21.string().optional(),
|
|
9089
|
+
parent_issue: z21.object({
|
|
9090
|
+
id: z21.string(),
|
|
9091
|
+
identifier: z21.string(),
|
|
9092
|
+
title: z21.string(),
|
|
9093
|
+
description: z21.string().nullable()
|
|
9087
9094
|
}).optional(),
|
|
9088
|
-
workspace:
|
|
9089
|
-
id:
|
|
9090
|
-
coding_agent:
|
|
9091
|
-
task_description:
|
|
9092
|
-
created_at:
|
|
9095
|
+
workspace: z21.object({
|
|
9096
|
+
id: z21.string(),
|
|
9097
|
+
coding_agent: z21.custom((value) => typeof value === "string" && isValidAgentProvider(value)),
|
|
9098
|
+
task_description: z21.string(),
|
|
9099
|
+
created_at: z21.string()
|
|
9093
9100
|
}).optional()
|
|
9094
9101
|
});
|
|
9095
9102
|
|
|
9096
9103
|
// ../shared/src/routes/scout.ts
|
|
9097
|
-
import { z as
|
|
9104
|
+
import { z as z22 } from "zod";
|
|
9098
9105
|
var SCOUT_LINEAR_ACTIONS = ["ask", "start"];
|
|
9099
|
-
var scoutLinearSessionIntentRequestSchema =
|
|
9100
|
-
comment_id:
|
|
9101
|
-
action:
|
|
9106
|
+
var scoutLinearSessionIntentRequestSchema = z22.object({
|
|
9107
|
+
comment_id: z22.string().trim().min(1).describe("Id of the Linear comment the session will be created on."),
|
|
9108
|
+
action: z22.enum(SCOUT_LINEAR_ACTIONS).describe("`ask` when the comment is a clarifying question, `start` when it hands off the task.")
|
|
9102
9109
|
});
|
|
9103
|
-
var scoutLinearStartRequestSchema =
|
|
9104
|
-
issue_id:
|
|
9105
|
-
agent_session_id:
|
|
9106
|
-
prompt:
|
|
9110
|
+
var scoutLinearStartRequestSchema = z22.object({
|
|
9111
|
+
issue_id: z22.string().describe("Linear issue id from the envelope's `issue_id`."),
|
|
9112
|
+
agent_session_id: z22.string().describe("Existing Linear agent session id from the envelope's `agent_session_id`."),
|
|
9113
|
+
prompt: z22.string().trim().min(1).describe("The latest request, in its author's words. The workspace already receives the issue and its comments.")
|
|
9107
9114
|
});
|
|
9108
|
-
var slackChannelIdSchema =
|
|
9109
|
-
var slackThreadTsSchema =
|
|
9110
|
-
var scoutSlackSpawnRequestSchema =
|
|
9115
|
+
var slackChannelIdSchema = z22.string().describe("Slack channel id from the envelope's `channel_id`.");
|
|
9116
|
+
var slackThreadTsSchema = z22.string().describe("Slack thread timestamp from the envelope's `thread_ts`.");
|
|
9117
|
+
var scoutSlackSpawnRequestSchema = z22.object({
|
|
9111
9118
|
channel_id: slackChannelIdSchema,
|
|
9112
9119
|
thread_ts: slackThreadTsSchema,
|
|
9113
|
-
message_ts:
|
|
9114
|
-
user_id:
|
|
9115
|
-
prompt:
|
|
9116
|
-
acknowledgement_ts:
|
|
9117
|
-
environment_id:
|
|
9120
|
+
message_ts: z22.string().describe("Timestamp of the Slack message that asked for the work (the envelope's `message_ts`). The server verifies this message and its author."),
|
|
9121
|
+
user_id: z22.string().describe("Slack user id of that message's author (the envelope's `user_id`). The workspace is attributed to them."),
|
|
9122
|
+
prompt: z22.string().describe("The person's request in their own words, quoting earlier messages only when it points to them. The workspace already receives the Slack thread, so add no research, plan, or guesses."),
|
|
9123
|
+
acknowledgement_ts: z22.string().optional().describe("`ts` of the one-line reply you posted in this thread before spawning. The server appends the workspace link to it and tells the workspace not to acknowledge again."),
|
|
9124
|
+
environment_id: z22.string().optional().describe(`Environment id from \`${REPLICAS_MCP_TOOLS.listEnvironments}\`. Pass it only when clearly confident it fits; omit it to let routing choose. If routing cannot choose, the call fails and nothing is posted, so pick one or ask the person.`)
|
|
9118
9125
|
});
|
|
9119
9126
|
var scoutSlackSpawnInNewThreadRequestSchema = scoutSlackSpawnRequestSchema.extend({
|
|
9120
|
-
title:
|
|
9121
|
-
prompt:
|
|
9122
|
-
acknowledgement_ts:
|
|
9127
|
+
title: z22.string().trim().min(1).max(500).describe("One or two sentences stating the task, posted as the new top-level message."),
|
|
9128
|
+
prompt: z22.string().describe("The person's request in their own words. The full source thread is attached as background, so add no summary, research, plan, or guesses."),
|
|
9129
|
+
acknowledgement_ts: z22.string().optional().describe("`ts` of the one-line reply you posted in this thread before spawning. The server appends the new thread's link to it.")
|
|
9123
9130
|
});
|
|
9124
|
-
var scoutSlackRelayRequestSchema =
|
|
9131
|
+
var scoutSlackRelayRequestSchema = z22.object({
|
|
9125
9132
|
channel_id: slackChannelIdSchema,
|
|
9126
9133
|
thread_ts: slackThreadTsSchema,
|
|
9127
|
-
message:
|
|
9128
|
-
user_id:
|
|
9129
|
-
queue:
|
|
9130
|
-
workspace_id:
|
|
9131
|
-
message_ts:
|
|
9134
|
+
message: z22.string().describe("The follow-up to deliver: every fresh message that belongs to this update, in its author's words, with no research, plan, or guesses added."),
|
|
9135
|
+
user_id: z22.string().optional().describe("Slack user id of the follow-up's author (the envelope's `user_id`), so it is attributed to them. Defaults to the thread's original requester. Required with `workspace_id`."),
|
|
9136
|
+
queue: z22.boolean().optional().describe("Set true only when the person explicitly asked for this to happen after the current task finishes. Delivers behind the active turn instead of interrupting it."),
|
|
9137
|
+
workspace_id: z22.string().optional().describe(`Existing workspace id, from \`${REPLICAS_MCP_TOOLS.listWorkspaces}\` or a workspace link in the thread, to bind a thread without a workspace to before relaying. The author must be able to see it. Omit to relay into the thread's own workspace.`),
|
|
9138
|
+
message_ts: z22.string().optional().describe("Timestamp of the Slack message that led to this relay (the envelope's `message_ts`). Required with `workspace_id`; the server verifies this message and its author.")
|
|
9132
9139
|
});
|
|
9133
|
-
var scoutSlackSetThreadMutedRequestSchema =
|
|
9140
|
+
var scoutSlackSetThreadMutedRequestSchema = z22.object({
|
|
9134
9141
|
channel_id: slackChannelIdSchema,
|
|
9135
9142
|
thread_ts: slackThreadTsSchema,
|
|
9136
|
-
muted:
|
|
9143
|
+
muted: z22.boolean().describe("true to mute Replicas in this thread, false to unmute it.")
|
|
9137
9144
|
});
|
|
9138
|
-
var scoutListWorkspacesRequestSchema =
|
|
9145
|
+
var scoutListWorkspacesRequestSchema = z22.object({
|
|
9139
9146
|
channel_id: slackChannelIdSchema,
|
|
9140
9147
|
thread_ts: slackThreadTsSchema,
|
|
9141
|
-
message_ts:
|
|
9142
|
-
user_id:
|
|
9143
|
-
query:
|
|
9148
|
+
message_ts: z22.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
|
|
9149
|
+
user_id: z22.string().describe("Slack user id of that message's author (the envelope's `user_id`). Only workspaces they can see are listed."),
|
|
9150
|
+
query: z22.string().trim().min(1).optional().describe("Case-insensitive text to match against workspace names and pull request URLs.")
|
|
9144
9151
|
});
|
|
9145
|
-
var scoutSlackConfirmationSchema =
|
|
9146
|
-
confirmation_channel_id:
|
|
9147
|
-
confirmation_thread_ts:
|
|
9148
|
-
confirmation_message_ts:
|
|
9149
|
-
confirmation_user_id:
|
|
9152
|
+
var scoutSlackConfirmationSchema = z22.object({
|
|
9153
|
+
confirmation_channel_id: z22.string().describe("`channel_id` from the envelope of the Slack message that asked for or accepted this."),
|
|
9154
|
+
confirmation_thread_ts: z22.string().describe("`thread_ts` from that message's envelope."),
|
|
9155
|
+
confirmation_message_ts: z22.string().describe("`message_ts` from that message's envelope."),
|
|
9156
|
+
confirmation_user_id: z22.string().describe("`user_id` from that message's envelope.")
|
|
9150
9157
|
});
|
|
9151
9158
|
var scoutAutomationToolInputSchema = automationToolInputSchema.extend(scoutSlackConfirmationSchema.shape);
|
|
9152
9159
|
var scoutSaveChannelPresetToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
9153
|
-
preset_id:
|
|
9154
|
-
name:
|
|
9155
|
-
description:
|
|
9156
|
-
icon:
|
|
9157
|
-
instructions:
|
|
9160
|
+
preset_id: z22.string().optional().describe(`Id of the preset to update, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`. Omit to create a new preset.`),
|
|
9161
|
+
name: z22.string().trim().min(1).max(SCOUT_PRESET_NAME_MAX_LENGTH).optional().describe("Preset name. Required when creating."),
|
|
9162
|
+
description: z22.string().optional().describe("One-line summary shown in settings."),
|
|
9163
|
+
icon: z22.enum(SCOUT_PRESET_ICONS).optional(),
|
|
9164
|
+
instructions: z22.string().optional().describe("Complete preset instructions; replaces the existing text. Required when creating.")
|
|
9158
9165
|
});
|
|
9159
9166
|
var scoutUpdateChannelSettingsToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
9160
|
-
source:
|
|
9161
|
-
external_id:
|
|
9162
|
-
monitored:
|
|
9163
|
-
preset_id:
|
|
9164
|
-
instructions:
|
|
9167
|
+
source: z22.enum(SCOUT_SOURCE_TYPES).optional().describe("Defaults to `slack`."),
|
|
9168
|
+
external_id: z22.string().describe("Slack channel id or Linear team id."),
|
|
9169
|
+
monitored: z22.boolean().optional().describe("`false` stops Scout from handling the source: it excludes a Slack channel or stops monitoring a Linear team. `true` resumes a Slack channel or starts monitoring a Linear team, and only an organization admin can ask for that. Omit to keep it."),
|
|
9170
|
+
preset_id: z22.string().nullable().optional().describe("Preset to assign; `null` removes the preset. Omit to keep it."),
|
|
9171
|
+
instructions: z22.string().nullable().optional().describe("Complete channel-specific instructions, applied after the preset; replaces the existing text. `null` clears them. Omit to keep them.")
|
|
9165
9172
|
});
|
|
9166
9173
|
var scoutDeleteChannelPresetToolInputSchema = scoutSlackConfirmationSchema.extend({
|
|
9167
|
-
preset_id:
|
|
9174
|
+
preset_id: z22.string().describe(`Id of the preset to delete, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`.`)
|
|
9168
9175
|
});
|
|
9169
9176
|
|
|
9170
9177
|
// ../shared/src/routes/plugin-catalog.ts
|
|
@@ -9489,10 +9496,37 @@ var HOSTED_COMPOSIO_PLUGINS = HOSTED_COMPOSIO_PLUGIN_DEFINITIONS.map(
|
|
|
9489
9496
|
description: `Use ${name} tools from workspace agents.`
|
|
9490
9497
|
})
|
|
9491
9498
|
);
|
|
9499
|
+
var READ_ONLY_SCOPES = {
|
|
9500
|
+
gmail: ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile", "https://www.googleapis.com/auth/contacts.readonly", "https://www.googleapis.com/auth/contacts.other.readonly", "https://www.googleapis.com/auth/gmail.readonly"],
|
|
9501
|
+
googledocs: ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/drive.readonly", "https://www.googleapis.com/auth/documents.readonly"],
|
|
9502
|
+
googledrive: ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/drive.readonly"],
|
|
9503
|
+
googlesheets: ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/drive.readonly", "https://www.googleapis.com/auth/spreadsheets.readonly"],
|
|
9504
|
+
googleslides: ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/drive.readonly", "https://www.googleapis.com/auth/presentations.readonly"],
|
|
9505
|
+
googlecalendar: ["https://www.googleapis.com/auth/calendar.readonly"],
|
|
9506
|
+
googletasks: ["https://www.googleapis.com/auth/tasks.readonly"],
|
|
9507
|
+
googlesearch: ["https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile", "https://www.googleapis.com/auth/webmasters.readonly"],
|
|
9508
|
+
googleanalytics: ["https://www.googleapis.com/auth/userinfo.profile", "https://www.googleapis.com/auth/analytics.readonly"],
|
|
9509
|
+
youtube: ["https://www.googleapis.com/auth/youtube.readonly"],
|
|
9510
|
+
outlook: ["User.Read", "Mail.Read", "MailboxSettings.Read", "Calendars.Read", "Contacts.Read", "offline_access"],
|
|
9511
|
+
onedrive: ["Files.Read.All", "Sites.Read.All", "offline_access"],
|
|
9512
|
+
microsoftteams: ["User.Read", "Team.ReadBasic.All", "Channel.ReadBasic.All", "ChannelMessage.Read.All", "Chat.Read", "Chat.ReadBasic", "ChatMessage.Read", "People.Read.All", "TeamsActivity.Read", "offline_access"],
|
|
9513
|
+
jira: ["read:jira-work", "read:jira-user", "read:servicedesk-request", "read:servicemanagement-insight-objects", "read:sprint:jira-software", "read:board-scope:jira-software", "read:project:jira", "read:issue-type-scheme:jira", "offline_access"],
|
|
9514
|
+
confluence: ["read:space-details:confluence", "read:audit-log:confluence", "read:page:confluence", "read:blogpost:confluence", "read:whiteboard:confluence", "read:comment:confluence", "read:content.restriction:confluence", "read:content.metadata:confluence", "read:inlinetask:confluence", "read:task:confluence", "offline_access"],
|
|
9515
|
+
pagerduty: ["read"],
|
|
9516
|
+
zendesk: ["read"],
|
|
9517
|
+
gong: ["api:calls:read:basic", "api:calls:read:extensive", "api:calls:read:transcript", "api:calls:read:media-url", "api:users:read", "api:stats:interaction", "api:stats:scorecards", "api:stats:user-actions", "api:stats:user-actions:detailed", "api:settings:scorecards:read", "api:settings:trackers:read", "api:library:read", "api:tasks:read", "api:flows:read", "api:workspaces:read", "api:crm:get-objects", "api:crm:schema", "api:crm:integrations:read", "api:call-outcomes:read", "api:permission-profile:read", "api:logs:read"],
|
|
9518
|
+
figma: ["current_user:read", "file_content:read", "file_comments:read", "file_metadata:read", "file_versions:read", "projects:read", "library_assets:read", "library_content:read", "team_library_content:read", "webhooks:read"],
|
|
9519
|
+
airtable: ["data.records:read", "data.recordComments:read", "schema.bases:read", "user.email:read"],
|
|
9520
|
+
todoist: ["data:read"],
|
|
9521
|
+
dropbox: ["openid", "email", "profile", "account_info.read", "files.metadata.read", "files.content.read", "file_requests.read", "sharing.read", "contacts.read"],
|
|
9522
|
+
canva: ["profile:read", "asset:read", "brandtemplate:content:read", "brandtemplate:meta:read", "comment:read", "design:content:read", "design:meta:read", "folder:read"],
|
|
9523
|
+
facebook: ["public_profile", "email", "pages_show_list", "pages_read_engagement", "pages_read_user_content", "read_insights"],
|
|
9524
|
+
instagram: ["instagram_business_basic", "instagram_business_manage_insights"]
|
|
9525
|
+
};
|
|
9492
9526
|
var PLUGIN_CATALOG = [
|
|
9493
9527
|
...EXPLICIT_PLUGIN_CATALOG,
|
|
9494
9528
|
...HOSTED_COMPOSIO_PLUGINS
|
|
9495
|
-
];
|
|
9529
|
+
].map((plugin) => ({ ...plugin, readOnlyScopes: READ_ONLY_SCOPES[plugin.id] }));
|
|
9496
9530
|
|
|
9497
9531
|
// ../shared/src/routes/user.ts
|
|
9498
9532
|
var PROFILE_AVATAR_MAX_SIZE_BYTES = 5 * 1024 * 1024;
|
|
@@ -9515,75 +9549,75 @@ var workspaceMarkedUnreadClientStateKey = orgUserClientStateKey(WORKSPACE_MARKED
|
|
|
9515
9549
|
var promptHistoryClientStateKey = orgUserClientStateKey(PROMPT_HISTORY_CLIENT_STATE_KEY_PREFIX);
|
|
9516
9550
|
|
|
9517
9551
|
// ../shared/src/routes/workspace-events.ts
|
|
9518
|
-
import { z as
|
|
9552
|
+
import { z as z23 } from "zod";
|
|
9519
9553
|
|
|
9520
9554
|
// ../shared/src/workspace-attention.ts
|
|
9521
9555
|
var WORKSPACE_ATTENTION_REASONS = ["question", "blocked"];
|
|
9522
9556
|
|
|
9523
9557
|
// ../shared/src/routes/workspace-events.ts
|
|
9524
|
-
var workspaceChangedEventSchema =
|
|
9525
|
-
|
|
9526
|
-
type:
|
|
9527
|
-
workspaceId:
|
|
9528
|
-
workspace:
|
|
9529
|
-
completion:
|
|
9530
|
-
workspaceName:
|
|
9531
|
-
completedAt:
|
|
9532
|
-
processing:
|
|
9533
|
-
attention:
|
|
9558
|
+
var workspaceChangedEventSchema = z23.discriminatedUnion("type", [
|
|
9559
|
+
z23.object({
|
|
9560
|
+
type: z23.literal("workspace.changed"),
|
|
9561
|
+
workspaceId: z23.string(),
|
|
9562
|
+
workspace: z23.object({ status: z23.enum(WORKSPACE_STATUSES), last_activity_at: z23.string().nullable() }).optional(),
|
|
9563
|
+
completion: z23.object({
|
|
9564
|
+
workspaceName: z23.string(),
|
|
9565
|
+
completedAt: z23.string(),
|
|
9566
|
+
processing: z23.boolean().optional(),
|
|
9567
|
+
attention: z23.object({ reason: z23.enum(WORKSPACE_ATTENTION_REASONS), userId: z23.string() }).optional()
|
|
9534
9568
|
}).optional(),
|
|
9535
|
-
ts:
|
|
9569
|
+
ts: z23.string()
|
|
9536
9570
|
}),
|
|
9537
|
-
|
|
9538
|
-
type:
|
|
9539
|
-
workspaceId:
|
|
9540
|
-
chatId:
|
|
9541
|
-
ts:
|
|
9571
|
+
z23.object({
|
|
9572
|
+
type: z23.literal("workspace.chat.changed"),
|
|
9573
|
+
workspaceId: z23.string(),
|
|
9574
|
+
chatId: z23.string(),
|
|
9575
|
+
ts: z23.string()
|
|
9542
9576
|
}),
|
|
9543
|
-
|
|
9544
|
-
|
|
9545
|
-
type:
|
|
9546
|
-
workspaceId:
|
|
9547
|
-
ts:
|
|
9577
|
+
z23.object({ type: z23.literal("presence.changed"), ts: z23.string() }),
|
|
9578
|
+
z23.object({
|
|
9579
|
+
type: z23.literal("mobile-testing.changed"),
|
|
9580
|
+
workspaceId: z23.string(),
|
|
9581
|
+
ts: z23.string()
|
|
9548
9582
|
}),
|
|
9549
|
-
|
|
9550
|
-
type:
|
|
9551
|
-
workspaceId:
|
|
9552
|
-
ts:
|
|
9583
|
+
z23.object({
|
|
9584
|
+
type: z23.literal("variable-request.changed"),
|
|
9585
|
+
workspaceId: z23.string(),
|
|
9586
|
+
ts: z23.string()
|
|
9553
9587
|
}),
|
|
9554
|
-
|
|
9555
|
-
type:
|
|
9556
|
-
prUrl:
|
|
9557
|
-
ts:
|
|
9588
|
+
z23.object({
|
|
9589
|
+
type: z23.literal("pull-request.changed"),
|
|
9590
|
+
prUrl: z23.string(),
|
|
9591
|
+
ts: z23.string()
|
|
9558
9592
|
}),
|
|
9559
|
-
|
|
9560
|
-
type:
|
|
9561
|
-
workspaceId:
|
|
9562
|
-
subagent:
|
|
9563
|
-
ts:
|
|
9593
|
+
z23.object({
|
|
9594
|
+
type: z23.literal("mothership.subagent.changed"),
|
|
9595
|
+
workspaceId: z23.string(),
|
|
9596
|
+
subagent: z23.object({ id: z23.string(), name: z23.string(), status: z23.enum(["ready", "needs_you"]), prUrl: z23.string().nullable() }),
|
|
9597
|
+
ts: z23.string()
|
|
9564
9598
|
})
|
|
9565
9599
|
]);
|
|
9566
9600
|
|
|
9567
9601
|
// ../shared/src/routes/presence.ts
|
|
9568
|
-
import { z as
|
|
9569
|
-
var presenceStatusSchema =
|
|
9570
|
-
var presenceLocationSchema =
|
|
9571
|
-
workspaceId:
|
|
9602
|
+
import { z as z24 } from "zod";
|
|
9603
|
+
var presenceStatusSchema = z24.enum(["online", "typing"]);
|
|
9604
|
+
var presenceLocationSchema = z24.object({
|
|
9605
|
+
workspaceId: z24.string().optional()
|
|
9572
9606
|
});
|
|
9573
|
-
var presenceEntrySchema =
|
|
9574
|
-
userId:
|
|
9607
|
+
var presenceEntrySchema = z24.object({
|
|
9608
|
+
userId: z24.string(),
|
|
9575
9609
|
status: presenceStatusSchema,
|
|
9576
9610
|
location: presenceLocationSchema,
|
|
9577
|
-
ts:
|
|
9611
|
+
ts: z24.string()
|
|
9578
9612
|
});
|
|
9579
|
-
var updatePresenceRequestSchema =
|
|
9613
|
+
var updatePresenceRequestSchema = z24.object({
|
|
9580
9614
|
status: presenceStatusSchema,
|
|
9581
9615
|
location: presenceLocationSchema.optional()
|
|
9582
9616
|
});
|
|
9583
9617
|
|
|
9584
9618
|
// ../shared/src/routes/review-messages.ts
|
|
9585
|
-
import { z as
|
|
9586
|
-
var sendPullRequestReviewMessageRequestSchema =
|
|
9619
|
+
import { z as z25 } from "zod";
|
|
9620
|
+
var sendPullRequestReviewMessageRequestSchema = z25.object({
|
|
9587
9621
|
...sendChatMessageRequestSchema.pick({
|
|
9588
9622
|
message: true,
|
|
9589
9623
|
messageId: true,
|
|
@@ -9596,8 +9630,8 @@ var sendPullRequestReviewMessageRequestSchema = z24.object({
|
|
|
9596
9630
|
ultrafastMode: true
|
|
9597
9631
|
}).shape,
|
|
9598
9632
|
/** Starts a new chat instead of continuing the PR's review chat. The provider only applies to a new chat. */
|
|
9599
|
-
newChat:
|
|
9600
|
-
provider:
|
|
9633
|
+
newChat: z25.boolean().optional(),
|
|
9634
|
+
provider: z25.enum(VALID_AGENT_PROVIDERS).optional()
|
|
9601
9635
|
});
|
|
9602
9636
|
|
|
9603
9637
|
// ../shared/src/audit-log.ts
|
|
@@ -9925,30 +9959,30 @@ function isSkillRegistryManifest(value) {
|
|
|
9925
9959
|
}
|
|
9926
9960
|
|
|
9927
9961
|
// ../shared/src/routes/variable-requests.ts
|
|
9928
|
-
import { z as
|
|
9962
|
+
import { z as z26 } from "zod";
|
|
9929
9963
|
var VARIABLE_REQUEST_WAIT = { defaultMs: 10 * 6e4, maxMs: 30 * 6e4, pollMs: 3e3, waiterStaleMs: 15e3 };
|
|
9930
9964
|
var VARIABLE_REQUEST_DESTINATIONS = ["environment", "workspace"];
|
|
9931
|
-
var requestedVariableSchema =
|
|
9932
|
-
key:
|
|
9933
|
-
required:
|
|
9934
|
-
replace:
|
|
9965
|
+
var requestedVariableSchema = z26.object({
|
|
9966
|
+
key: z26.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name").max(ENVIRONMENT_SETUP_LIMITS.variableKeyChars),
|
|
9967
|
+
required: z26.boolean(),
|
|
9968
|
+
replace: z26.boolean().optional()
|
|
9935
9969
|
});
|
|
9936
|
-
var requestedVariablesSchema =
|
|
9937
|
-
var createVariableRequestSchema =
|
|
9970
|
+
var requestedVariablesSchema = z26.array(requestedVariableSchema).min(1, "must not be empty").max(ENVIRONMENT_SETUP_LIMITS.variables).refine((variables) => new Set(variables.map((variable) => variable.key)).size === variables.length, "must have unique keys");
|
|
9971
|
+
var createVariableRequestSchema = z26.object({
|
|
9938
9972
|
variables: requestedVariablesSchema,
|
|
9939
|
-
reason:
|
|
9940
|
-
wait:
|
|
9973
|
+
reason: z26.string().trim().max(500).nullish().transform((value) => value || null),
|
|
9974
|
+
wait: z26.boolean().default(true)
|
|
9941
9975
|
});
|
|
9942
|
-
var respondVariableRequestSchema =
|
|
9943
|
-
|
|
9944
|
-
action:
|
|
9945
|
-
destination:
|
|
9976
|
+
var respondVariableRequestSchema = z26.discriminatedUnion("action", [
|
|
9977
|
+
z26.object({
|
|
9978
|
+
action: z26.literal("provide"),
|
|
9979
|
+
destination: z26.enum(VARIABLE_REQUEST_DESTINATIONS),
|
|
9946
9980
|
/** Defaults to the workspace's environment, so older clients keep saving there. */
|
|
9947
|
-
environment_ids:
|
|
9948
|
-
overwrite:
|
|
9949
|
-
values:
|
|
9981
|
+
environment_ids: z26.array(z26.string().uuid()).optional(),
|
|
9982
|
+
overwrite: z26.boolean().optional(),
|
|
9983
|
+
values: z26.record(z26.string().regex(VARIABLE_KEY_RE), z26.string())
|
|
9950
9984
|
}),
|
|
9951
|
-
|
|
9985
|
+
z26.object({ action: z26.literal("skip") })
|
|
9952
9986
|
]);
|
|
9953
9987
|
|
|
9954
9988
|
export {
|
|
@@ -10043,6 +10077,7 @@ export {
|
|
|
10043
10077
|
agentQuotaExhaustedPayloadSchema,
|
|
10044
10078
|
defaultForkChatTitle,
|
|
10045
10079
|
getChatContinuation,
|
|
10080
|
+
engineCredentialRefreshFailureSchema,
|
|
10046
10081
|
CLAUDE_PARTIAL_MESSAGE_EVENT_TYPE,
|
|
10047
10082
|
ACCEPTED_USER_MESSAGE_SOURCE,
|
|
10048
10083
|
QUEUED_MESSAGE_REMOVED_EVENT_TYPE,
|