replicas-engine 0.1.1582 → 0.1.1584

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1116,17 +1116,17 @@ var require_luxon = __commonJS({
1116
1116
  constructor(dt, intl, opts) {
1117
1117
  this.opts = opts;
1118
1118
  this.originalZone = void 0;
1119
- let z39 = void 0;
1119
+ let z41 = void 0;
1120
1120
  if (this.opts.timeZone) {
1121
1121
  this.dt = dt;
1122
1122
  } else if (dt.zone.type === "fixed") {
1123
1123
  const gmtOffset = -1 * (dt.offset / 60);
1124
1124
  const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;
1125
1125
  if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {
1126
- z39 = offsetZ;
1126
+ z41 = offsetZ;
1127
1127
  this.dt = dt;
1128
1128
  } else {
1129
- z39 = "UTC";
1129
+ z41 = "UTC";
1130
1130
  this.dt = dt.offset === 0 ? dt : dt.setZone("UTC").plus({
1131
1131
  minutes: dt.offset
1132
1132
  });
@@ -1136,9 +1136,9 @@ var require_luxon = __commonJS({
1136
1136
  this.dt = dt;
1137
1137
  } else if (dt.zone.type === "iana") {
1138
1138
  this.dt = dt;
1139
- z39 = dt.zone.name;
1139
+ z41 = dt.zone.name;
1140
1140
  } else {
1141
- z39 = "UTC";
1141
+ z41 = "UTC";
1142
1142
  this.dt = dt.setZone("UTC").plus({
1143
1143
  minutes: dt.offset
1144
1144
  });
@@ -1147,7 +1147,7 @@ var require_luxon = __commonJS({
1147
1147
  const intlOpts = {
1148
1148
  ...this.opts
1149
1149
  };
1150
- intlOpts.timeZone = intlOpts.timeZone || z39;
1150
+ intlOpts.timeZone = intlOpts.timeZone || z41;
1151
1151
  this.dtf = getCachedDTF(intl, intlOpts);
1152
1152
  }
1153
1153
  format() {
@@ -11354,47 +11354,279 @@ var engineMcpOAuthTokenResponseSchema = z10.object({
11354
11354
  });
11355
11355
 
11356
11356
  // ../shared/src/routes/environment.ts
11357
+ import { z as z13 } from "zod";
11358
+
11359
+ // ../shared/src/routes/environment-setups.ts
11360
+ import { z as z12 } from "zod";
11361
+
11362
+ // ../shared/src/automations/trigger-schemas.ts
11357
11363
  import { z as z11 } from "zod";
11364
+
11365
+ // ../shared/src/uuid.ts
11366
+ function createUuidFromHex(value) {
11367
+ return `${value.slice(0, 8)}-${value.slice(8, 12)}-5${value.slice(13, 16)}-${(Number.parseInt(value.slice(16, 17), 16) & 3 | 8).toString(16)}${value.slice(17, 20)}-${value.slice(20, 32)}`;
11368
+ }
11369
+ var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
11370
+
11371
+ // ../shared/src/automations/github/index.ts
11372
+ var REVIEW_REQUESTED_EVENT = "pull_request.review_requested";
11373
+
11374
+ // ../shared/src/automations/trigger-schemas.ts
11375
+ function getReviewerLoginsError(event, logins) {
11376
+ const isReviewRequested = event === REVIEW_REQUESTED_EVENT;
11377
+ if (isReviewRequested === !!logins?.some((login) => login.trim().replace(/^@+/, ""))) return null;
11378
+ return isReviewRequested ? "The PR review requested trigger needs at least one GitHub username" : "Requested reviewers only apply to the PR review requested trigger";
11379
+ }
11380
+ var repositoryTriggerConfigSchema = z11.object({
11381
+ event: z11.string(),
11382
+ repository_ids: z11.array(z11.string().regex(UUID_RE, "must be a repository id")).optional(),
11383
+ group_pr_events: z11.boolean().optional(),
11384
+ excluded_actors: z11.array(z11.string()).optional(),
11385
+ reviewer_logins: z11.array(z11.string()).optional()
11386
+ });
11387
+ var cronTriggerSchema = z11.object({ type: z11.literal("cron"), config: z11.object({ schedule: z11.string(), timezone: z11.string().optional() }) });
11388
+ var githubTriggerSchema = z11.object({
11389
+ type: z11.literal("github"),
11390
+ config: repositoryTriggerConfigSchema.superRefine((config, ctx) => {
11391
+ const message2 = getReviewerLoginsError(config.event, config.reviewer_logins);
11392
+ if (message2) ctx.addIssue({ code: "custom", message: message2, path: ["reviewer_logins"] });
11393
+ })
11394
+ });
11395
+ var gitlabTriggerSchema = z11.object({ type: z11.literal("gitlab"), config: repositoryTriggerConfigSchema });
11396
+ var linearTriggerConfigSchema = linearIssueFiltersSchema.extend({
11397
+ event: z11.string(),
11398
+ team_ids: z11.array(z11.string()).optional(),
11399
+ state_types: z11.array(z11.enum(LINEAR_STATE_TYPES)).optional()
11400
+ }).superRefine((config, ctx) => {
11401
+ if (config.event === LINEAR_ISSUE_MATCHED_EVENT && config.team_ids?.length !== 1) ctx.addIssue({ code: "custom", message: "The Linear issue matches trigger needs exactly one team", path: ["team_ids"] });
11402
+ });
11403
+ var automationTriggerSchema = z11.discriminatedUnion("type", [
11404
+ cronTriggerSchema,
11405
+ githubTriggerSchema,
11406
+ gitlabTriggerSchema,
11407
+ z11.object({ type: z11.literal("slack"), config: z11.object({ event: z11.string(), channel_ids: z11.array(z11.string()).optional(), group_thread_replies: z11.boolean().optional() }) }),
11408
+ z11.object({ type: z11.literal("sentry"), config: z11.object({ event: z11.string(), project_slugs: z11.array(z11.string()).optional(), min_level: z11.string().optional() }) }),
11409
+ z11.object({ type: z11.literal("linear"), config: linearTriggerConfigSchema }),
11410
+ z11.object({ type: z11.literal("custom"), config: z11.object({}) })
11411
+ ]);
11412
+
11413
+ // ../shared/src/routes/environment-setups.ts
11414
+ var ENVIRONMENT_SETUP_STEPS = [
11415
+ { key: "understand", label: "Understand the codebase" },
11416
+ { key: "install", label: "Install dependencies and run the app" },
11417
+ { key: "verify", label: "Verify checks and record a walkthrough" },
11418
+ { key: "configure", label: "Draft hooks, system prompt, and automations" },
11419
+ { key: "propose", label: "Propose the configuration for review" }
11420
+ ];
11421
+ var ENVIRONMENT_SETUP_STEP_STATUSES = ["pending", "in_progress", "completed", "skipped"];
11422
+ var ENVIRONMENT_SETUP_RUN_STATUSES = ["running", "proposed", "applied", "failed", "cancelled", "expired"];
11423
+ var ENVIRONMENT_SETUP_AUTOMATION_ACTIONS = ["create", "update", "keep", "disable"];
11424
+ var ENVIRONMENT_SETUP_VERIFICATION_STATUSES = ["passed", "failed", "skipped"];
11425
+ var ENVIRONMENT_SETUP_LIMITS = {
11426
+ summaryChars: 600,
11427
+ stackItems: 30,
11428
+ nameChars: 120,
11429
+ descriptionChars: 1e3,
11430
+ systemPromptChars: 2e4,
11431
+ hookChars: 5e4,
11432
+ variables: 50,
11433
+ variableKeyChars: 128,
11434
+ variableDescriptionChars: 500,
11435
+ automations: 8,
11436
+ automationKeyChars: 80,
11437
+ automationPromptChars: 1e4,
11438
+ automationTriggers: 5,
11439
+ automationNoteChars: 300,
11440
+ verificationItems: 8,
11441
+ verificationDetailChars: 300,
11442
+ mediaItems: 8,
11443
+ repositories: 20
11444
+ };
11445
+ var VARIABLE_KEY_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
11446
+ var text2 = (max) => max === void 0 ? z12.string().trim() : z12.string().trim().max(max);
11447
+ var requiredText = (max) => text2(max).min(1, "must not be empty");
11448
+ var optionalText2 = (max) => text2(max).nullish().transform((value) => value || null);
11449
+ var clearableText = (max) => text2(max).nullish().transform((value) => value === void 0 ? void 0 : value || null);
11450
+ var list = (item, max) => max === void 0 ? z12.array(item) : z12.array(item).max(max);
11451
+ var ENVIRONMENT_SETUP_AUTHORED_TRIGGER_TYPES = ["cron", "github", "gitlab"];
11452
+ function isEnvironmentSetupAuthoredTriggerType(type) {
11453
+ return ENVIRONMENT_SETUP_AUTHORED_TRIGGER_TYPES.some((authored) => authored === type);
11454
+ }
11455
+ var proposalTriggerSchema = z12.discriminatedUnion("type", [cronTriggerSchema, githubTriggerSchema, gitlabTriggerSchema]);
11456
+ var existingTriggerSchema = z12.custom(
11457
+ (value) => isRecord(value) && typeof value.type === "string" && isRecord(value.config),
11458
+ "must be an automation trigger"
11459
+ );
11460
+ var carriedTriggerSchema = existingTriggerSchema.refine(
11461
+ (trigger) => !isEnvironmentSetupAuthoredTriggerType(trigger.type)
11462
+ );
11463
+ function automationSchema(limits) {
11464
+ const authored = z12.object({
11465
+ name: text2(limits.nameChars),
11466
+ description: text2(limits.descriptionChars),
11467
+ prompt: text2(limits.automationPromptChars),
11468
+ triggers: list(proposalTriggerSchema, limits.automationTriggers)
11469
+ });
11470
+ const updated = authored.extend({ triggers: list(z12.union([proposalTriggerSchema, carriedTriggerSchema]), limits.automationTriggers) });
11471
+ return z12.object({
11472
+ key: requiredText(limits.automationKeyChars),
11473
+ action: z12.enum(ENVIRONMENT_SETUP_AUTOMATION_ACTIONS).default("create"),
11474
+ automation_id: z12.string().regex(UUID_RE, "must be an automation id").nullable().default(null),
11475
+ name: text2().default(""),
11476
+ description: optionalText2().transform((value) => value ?? ""),
11477
+ prompt: text2().default(""),
11478
+ triggers: list(existingTriggerSchema).default([]),
11479
+ note: optionalText2(limits.automationNoteChars)
11480
+ }).superRefine((automation, ctx) => {
11481
+ if (automation.action === "create" && automation.automation_id) {
11482
+ ctx.addIssue({ code: "custom", path: ["automation_id"], message: "belongs on an update, keep, or disable entry" });
11483
+ }
11484
+ if (automation.action !== "create" && !automation.automation_id) {
11485
+ ctx.addIssue({ code: "custom", path: ["automation_id"], message: "must be the id of an automation attached to this environment" });
11486
+ }
11487
+ if (automation.action === "create" || automation.action === "update") {
11488
+ if (!automation.name) ctx.addIssue({ code: "custom", path: ["name"], message: "must not be empty" });
11489
+ if (!automation.prompt) ctx.addIssue({ code: "custom", path: ["prompt"], message: "must not be empty" });
11490
+ if (automation.triggers.length === 0) ctx.addIssue({ code: "custom", path: ["triggers"], message: "must not be empty" });
11491
+ }
11492
+ }).transform((automation, ctx) => {
11493
+ if (automation.action === "keep" || automation.action === "disable") return automation;
11494
+ const content = (automation.action === "update" ? updated : authored).safeParse(automation);
11495
+ if (content.success) return { ...automation, ...content.data };
11496
+ for (const issue of content.error.issues) ctx.addIssue({ ...issue, code: "custom" });
11497
+ return z12.NEVER;
11498
+ });
11499
+ }
11500
+ function automationListSchema(limits) {
11501
+ return list(automationSchema(limits)).default([]).superRefine((automations, ctx) => {
11502
+ if (new Set(automations.map((automation) => automation.key)).size !== automations.length) {
11503
+ ctx.addIssue({ code: "custom", message: "must have unique keys" });
11504
+ }
11505
+ const targets = automations.flatMap((automation) => automation.automation_id ?? []);
11506
+ if (new Set(targets).size !== targets.length) {
11507
+ ctx.addIssue({ code: "custom", message: "must mention each existing automation once" });
11508
+ }
11509
+ if (limits.automations !== void 0 && automations.filter((automation) => automation.action === "create").length > limits.automations) {
11510
+ ctx.addIssue({ code: "custom", message: `must create at most ${limits.automations} new automations` });
11511
+ }
11512
+ });
11513
+ }
11514
+ function environmentSchema(limits) {
11515
+ return z12.object({
11516
+ name: optionalText2(limits.nameChars).transform((value) => value ?? void 0),
11517
+ description: clearableText(limits.descriptionChars),
11518
+ system_prompt: clearableText(limits.systemPromptChars),
11519
+ start_hook: clearableText(limits.hookChars),
11520
+ warm_hook: clearableText(limits.hookChars)
11521
+ });
11522
+ }
11523
+ function proposalSchema(limits) {
11524
+ return z12.object({
11525
+ summary: requiredText(limits.summaryChars),
11526
+ stack: list(text2(), limits.stackItems).default([]).transform((items) => items.filter(Boolean)),
11527
+ environment: environmentSchema(limits),
11528
+ variables: list(z12.object({
11529
+ key: z12.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name").max(limits.variableKeyChars ?? Number.POSITIVE_INFINITY),
11530
+ description: optionalText2(limits.variableDescriptionChars).transform((value) => value ?? ""),
11531
+ required: z12.boolean().default(false)
11532
+ }), limits.variables).default([]),
11533
+ automations: automationListSchema(limits),
11534
+ verification: list(z12.object({
11535
+ label: requiredText(limits.nameChars),
11536
+ status: z12.enum(ENVIRONMENT_SETUP_VERIFICATION_STATUSES),
11537
+ detail: optionalText2(limits.verificationDetailChars).transform((value) => value ?? void 0)
11538
+ }), limits.verificationItems).default([]),
11539
+ media: list(z12.object({
11540
+ media_id: z12.string().regex(UUID_RE, "must be a media id"),
11541
+ title: requiredText(limits.nameChars)
11542
+ }), limits.mediaItems).default([])
11543
+ });
11544
+ }
11545
+ var environmentSetupProposalSchema = proposalSchema({});
11546
+ var environmentSetupProposalSubmissionSchema = proposalSchema(ENVIRONMENT_SETUP_LIMITS);
11547
+ var environmentSetupRunStateSchema = z12.object({
11548
+ status: z12.enum(ENVIRONMENT_SETUP_RUN_STATUSES),
11549
+ steps: z12.partialRecord(z12.enum(ENVIRONMENT_SETUP_STEPS.map((step) => step.key)), z12.enum(ENVIRONMENT_SETUP_STEP_STATUSES)).default({}),
11550
+ proposal: environmentSetupProposalSchema.nullable().default(null),
11551
+ applied: z12.object({
11552
+ applied_at: z12.string(),
11553
+ automation_ids: z12.array(z12.string())
11554
+ }).nullable().default(null)
11555
+ });
11556
+ var applyEnvironmentSetupRequestSchema = z12.object({
11557
+ environment: environmentSchema(ENVIRONMENT_SETUP_LIMITS).extend({ name: requiredText(ENVIRONMENT_SETUP_LIMITS.nameChars) }),
11558
+ variables: list(z12.object({ key: z12.string().regex(VARIABLE_KEY_RE), value: z12.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)),
11559
+ automations: automationListSchema(ENVIRONMENT_SETUP_LIMITS)
11560
+ });
11561
+
11562
+ // ../shared/src/routes/environment.ts
11358
11563
  var ENVIRONMENT_MCP_TRANSPORTS = ["stdio", "http", "sse"];
11359
- var stringMap = z11.record(z11.string(), z11.string());
11360
- var createEnvironmentMcpRequestSchema = z11.object({
11361
- name: z11.string(),
11362
- transport: z11.enum(ENVIRONMENT_MCP_TRANSPORTS),
11363
- config: z11.union([
11364
- z11.object({ command: z11.string().min(1), args: z11.array(z11.string()).optional(), env: stringMap.optional() }),
11365
- z11.object({ url: z11.url(), headers: stringMap.optional(), auth: mcpAuthSchema.optional() })
11564
+ var MCP_NAME_PATTERN = /^[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/;
11565
+ var environmentMcpVariableReferenceSchema = z13.strictObject({
11566
+ env: z13.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name"),
11567
+ prefix: z13.string().optional()
11568
+ });
11569
+ var getMcpProxyDroppedHeader = (headers) => Object.keys(headers).find((name) => ["authorization", "proxy-authorization", "cookie"].includes(name.toLowerCase()));
11570
+ function validateEnvironmentMcpAuthentication(transport, config) {
11571
+ if (!config.auth) return createSuccessResult();
11572
+ const url = new URL(config.url);
11573
+ if (url.search || url.protocol !== "https:") {
11574
+ return createErrorResult({ code: "url", message: "OAuth and workspace identity authentication require an HTTPS MCP URL without query parameters" });
11575
+ }
11576
+ const dropped = getMcpProxyDroppedHeader({ ...config.headers, ...config.headersFrom });
11577
+ if (dropped) {
11578
+ return createErrorResult({ code: "headers", message: `Remove the ${dropped} header: OAuth and workspace identity MCPs don't send it` });
11579
+ }
11580
+ if (config.auth.type === "oauth" && transport === "sse") {
11581
+ return createErrorResult({ code: "transport", message: "OAuth requires the HTTP transport" });
11582
+ }
11583
+ return createSuccessResult();
11584
+ }
11585
+ var stringMap = z13.record(z13.string(), z13.string());
11586
+ var environmentMcpStdioConfigSchema = z13.object({ command: z13.string().min(1), args: z13.array(z13.string()).optional(), env: stringMap.optional(), envFrom: z13.record(z13.string().regex(VARIABLE_KEY_RE), environmentMcpVariableReferenceSchema).optional() });
11587
+ var environmentMcpHttpConfigSchema = z13.object({ url: z13.url(), headers: stringMap.optional(), headersFrom: z13.record(z13.string(), environmentMcpVariableReferenceSchema).optional(), auth: mcpAuthSchema.optional() });
11588
+ var createEnvironmentMcpRequestSchema = z13.object({
11589
+ name: z13.string(),
11590
+ transport: z13.enum(ENVIRONMENT_MCP_TRANSPORTS),
11591
+ config: z13.union([
11592
+ environmentMcpStdioConfigSchema,
11593
+ environmentMcpHttpConfigSchema
11366
11594
  ]).describe("stdio: `{ command, args, env }`. http/sse: `{ url, headers }`.")
11367
11595
  });
11368
11596
  var updateEnvironmentMcpRequestSchema = createEnvironmentMcpRequestSchema.partial();
11369
- var screenPasswordSchema = z11.string().min(1, "Enter the screen password").max(256).describe('Screen Sharing password, for `replicas computer screen`. On a Mac, the "VNC viewers may control screen with password" password. Never returned.');
11370
- var hostSchema = z11.string().max(253).regex(/^(?:[A-Za-z0-9](?:[A-Za-z0-9.-]*[A-Za-z0-9])?|[0-9A-Fa-f:]+)$/, "Enter a hostname or IP address");
11371
- var createEnvironmentDeviceRequestSchema = z11.object({
11372
- name: z11.string().regex(/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/, "Use lowercase letters, numbers and dashes").describe("SSH alias in workspaces, e.g. `mac-mini` for `ssh mac-mini`."),
11597
+ var RESERVED_MCP_NAME_PREFIXES = ["replicas-", SUBAGENT_MCP_SERVER_NAME];
11598
+ function isReservedMcpName(name) {
11599
+ return RESERVED_MCP_NAME_PREFIXES.some((prefix) => name.startsWith(prefix));
11600
+ }
11601
+ var screenPasswordSchema = z13.string().min(1, "Enter the screen password").max(256).describe('Screen Sharing password, for `replicas computer screen`. On a Mac, the "VNC viewers may control screen with password" password. Never returned.');
11602
+ var hostSchema = z13.string().max(253).regex(/^(?:[A-Za-z0-9](?:[A-Za-z0-9.-]*[A-Za-z0-9])?|[0-9A-Fa-f:]+)$/, "Enter a hostname or IP address");
11603
+ var createEnvironmentDeviceRequestSchema = z13.object({
11604
+ name: z13.string().regex(/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/, "Use lowercase letters, numbers and dashes").describe("SSH alias in workspaces, e.g. `mac-mini` for `ssh mac-mini`."),
11373
11605
  host: hostSchema.optional().describe("Hostname or IP, such as a Tailscale MagicDNS name (`mac-mini`) or a public address. Leave it out when the device connects to Replicas itself with `replicas device connect`."),
11374
- port: z11.number().int().min(1).max(65535).optional().describe("SSH port on the device. Defaults to 22."),
11375
- username: z11.string().regex(/^[A-Za-z0-9_][A-Za-z0-9._-]{0,63}$/, "Enter the account name on the device").describe("Account the agent signs in as."),
11606
+ port: z13.number().int().min(1).max(65535).optional().describe("SSH port on the device. Defaults to 22."),
11607
+ username: z13.string().regex(/^[A-Za-z0-9_][A-Za-z0-9._-]{0,63}$/, "Enter the account name on the device").describe("Account the agent signs in as."),
11376
11608
  screen_password: screenPasswordSchema.optional()
11377
11609
  });
11378
11610
  var updateEnvironmentDeviceRequestSchema = createEnvironmentDeviceRequestSchema.partial().extend({
11379
- host: z11.union([hostSchema, z11.literal("")]).optional().describe("New hostname or IP, or an empty string for a device that connects to Replicas itself."),
11380
- screen_password: z11.union([screenPasswordSchema, z11.literal("")]).optional().describe("New Screen Sharing password, or an empty string to remove it.")
11611
+ host: z13.union([hostSchema, z13.literal("")]).optional().describe("New hostname or IP, or an empty string for a device that connects to Replicas itself."),
11612
+ screen_password: z13.union([screenPasswordSchema, z13.literal("")]).optional().describe("New Screen Sharing password, or an empty string to remove it.")
11381
11613
  });
11382
- var deviceConnectionResponseSchema = z11.object({
11383
- name: z11.string(),
11384
- port: z11.number(),
11385
- workspace_ids: z11.array(z11.string())
11614
+ var deviceConnectionResponseSchema = z13.object({
11615
+ name: z13.string(),
11616
+ port: z13.number(),
11617
+ workspace_ids: z13.array(z13.string())
11386
11618
  });
11387
- var deviceHostKeysRequestSchema = z11.object({
11388
- host_keys: z11.array(z11.string().max(2048).regex(/^[a-z0-9@.-]+ [A-Za-z0-9+/]+={0,3}$/, "Each host key must be `<type> <base64>`")).min(1).max(8).transform((keys) => [...new Set(keys)].sort())
11619
+ var deviceHostKeysRequestSchema = z13.object({
11620
+ host_keys: z13.array(z13.string().max(2048).regex(/^[a-z0-9@.-]+ [A-Za-z0-9+/]+={0,3}$/, "Each host key must be `<type> <base64>`")).min(1).max(8).transform((keys) => [...new Set(keys)].sort())
11389
11621
  });
11390
11622
  var DEVICE_HOST_KEYS_HEADER = "x-replicas-device-host-keys";
11391
- var provisionedDeviceSchema = z11.object({
11392
- name: z11.string(),
11393
- host: z11.string().nullable(),
11394
- port: z11.number(),
11395
- username: z11.string(),
11396
- private_key: z11.string(),
11397
- screen_password: z11.string().optional()
11623
+ var provisionedDeviceSchema = z13.object({
11624
+ name: z13.string(),
11625
+ host: z13.string().nullable(),
11626
+ port: z13.number(),
11627
+ username: z13.string(),
11628
+ private_key: z13.string(),
11629
+ screen_password: z13.string().optional()
11398
11630
  });
11399
11631
 
11400
11632
  // ../shared/src/runtime-env.ts
@@ -11617,19 +11849,19 @@ function gitIdentityConfigCommands(identity, scope = "global") {
11617
11849
  }
11618
11850
 
11619
11851
  // ../shared/src/headless-agent.ts
11620
- import { z as z12 } from "zod";
11621
- var headlessAgentRequestSchema = z12.object({
11622
- mode: z12.literal("structured"),
11623
- agent: z12.custom(
11852
+ import { z as z14 } from "zod";
11853
+ var headlessAgentRequestSchema = z14.object({
11854
+ mode: z14.literal("structured"),
11855
+ agent: z14.custom(
11624
11856
  (value) => typeof value === "string" && isValidAgentProvider(value)
11625
11857
  ),
11626
- model: z12.string().min(1),
11627
- prompt: z12.string(),
11628
- workingDirectory: z12.string().min(1),
11629
- timeoutSeconds: z12.number().int().min(1).max(1800).default(300),
11630
- thinkingLevel: z12.enum(STANDARD_THINKING_LEVELS).optional(),
11631
- codexOauthTokens: z12.object({ accessToken: z12.string(), accountId: z12.string() }).optional(),
11632
- outputSchema: z12.record(z12.string(), z12.json())
11858
+ model: z14.string().min(1),
11859
+ prompt: z14.string(),
11860
+ workingDirectory: z14.string().min(1),
11861
+ timeoutSeconds: z14.number().int().min(1).max(1800).default(300),
11862
+ thinkingLevel: z14.enum(STANDARD_THINKING_LEVELS).optional(),
11863
+ codexOauthTokens: z14.object({ accessToken: z14.string(), accountId: z14.string() }).optional(),
11864
+ outputSchema: z14.record(z14.string(), z14.json())
11633
11865
  });
11634
11866
  var headlessAgentUsagePath = (outputPath) => `${outputPath}.usage`;
11635
11867
 
@@ -11717,15 +11949,15 @@ var SEARCH_OPEN_DEDUPE_MS = 10 * 60 * 1e3;
11717
11949
  var PICK_WINDOW_MS = 21 * DAY_MS;
11718
11950
 
11719
11951
  // ../shared/src/routes/workspaces.ts
11720
- import { z as z14 } from "zod";
11952
+ import { z as z16 } from "zod";
11721
11953
 
11722
11954
  // ../shared/src/workspace-credentials.ts
11723
- import { z as z13 } from "zod";
11955
+ import { z as z15 } from "zod";
11724
11956
  var WORKSPACE_CREDENTIAL_PROVIDERS = ["claude", "codex"];
11725
- var workspaceCredentialProviderSchema = z13.enum(WORKSPACE_CREDENTIAL_PROVIDERS);
11957
+ var workspaceCredentialProviderSchema = z15.enum(WORKSPACE_CREDENTIAL_PROVIDERS);
11726
11958
  var workspaceCredentialSelectionSchema = agentCredentialSnapshotSchema.omit({ revision: true, account: true, credentialId: true });
11727
11959
  var createWorkspaceCredentialSchema = workspaceCredentialSelectionSchema.extend({
11728
- provider: z13.enum(VALID_AGENT_PROVIDERS)
11960
+ provider: z15.enum(VALID_AGENT_PROVIDERS)
11729
11961
  }).refine(({ provider: provider2, method }) => agentCredentialMethods(provider2).includes(method), {
11730
11962
  message: "This inference provider is not supported by this agent"
11731
11963
  });
@@ -11759,16 +11991,16 @@ var DEFAULT_WORKSPACE_FILTERS = {
11759
11991
  activity: "any"
11760
11992
  };
11761
11993
  var ONE_DAY_MS = 24 * 60 * 60 * 1e3;
11762
- var workspaceExecRequestSchema = z14.object({
11763
- command: z14.string().regex(/\S/, "command is required"),
11764
- timeout_seconds: z14.number().int().min(1).max(50).optional().describe("Default: 30")
11994
+ var workspaceExecRequestSchema = z16.object({
11995
+ command: z16.string().regex(/\S/, "command is required"),
11996
+ timeout_seconds: z16.number().int().min(1).max(50).optional().describe("Default: 30")
11765
11997
  });
11766
- var terminalRtcCandidateSchema = z14.object({ type: z14.literal("rtc-candidate"), candidate: z14.string(), mid: z14.string() });
11767
- var terminalSocketServerMessageSchema = z14.discriminatedUnion("type", [
11768
- z14.object({ type: z14.literal("output"), data: z14.string() }),
11769
- z14.object({ type: z14.literal("rtc-answer"), sdp: z14.string() }),
11998
+ var terminalRtcCandidateSchema = z16.object({ type: z16.literal("rtc-candidate"), candidate: z16.string(), mid: z16.string() });
11999
+ var terminalSocketServerMessageSchema = z16.discriminatedUnion("type", [
12000
+ z16.object({ type: z16.literal("output"), data: z16.string() }),
12001
+ z16.object({ type: z16.literal("rtc-answer"), sdp: z16.string() }),
11770
12002
  terminalRtcCandidateSchema,
11771
- z14.object({ type: z14.literal("rtc-switch") })
12003
+ z16.object({ type: z16.literal("rtc-switch") })
11772
12004
  ]);
11773
12005
  var TERMINAL_RTC_ICE_SERVER = "stun:stun.l.google.com:19302";
11774
12006
 
@@ -11815,62 +12047,62 @@ function describeAuthFallback(payload) {
11815
12047
  }
11816
12048
 
11817
12049
  // ../shared/src/chat-fork.ts
11818
- import { z as z16 } from "zod";
12050
+ import { z as z18 } from "zod";
11819
12051
 
11820
12052
  // ../shared/src/fallback-chains.ts
11821
- import { z as z15 } from "zod";
11822
- var fallbackHarnessStepSchema = z15.object({
11823
- kind: z15.literal("harness"),
11824
- provider: z15.enum(VALID_AGENT_PROVIDERS),
11825
- model: z15.string().min(1),
11826
- thinkingLevel: z15.enum(VALID_THINKING_LEVELS).optional().catch(void 0)
12053
+ import { z as z17 } from "zod";
12054
+ var fallbackHarnessStepSchema = z17.object({
12055
+ kind: z17.literal("harness"),
12056
+ provider: z17.enum(VALID_AGENT_PROVIDERS),
12057
+ model: z17.string().min(1),
12058
+ thinkingLevel: z17.enum(VALID_THINKING_LEVELS).optional().catch(void 0)
11827
12059
  });
11828
- var fallbackPlanStepSchema = z15.discriminatedUnion("kind", [
11829
- z15.object({
11830
- kind: z15.literal("credentials"),
12060
+ var fallbackPlanStepSchema = z17.discriminatedUnion("kind", [
12061
+ z17.object({
12062
+ kind: z17.literal("credentials"),
11831
12063
  // An empty list would allow every method.
11832
- methods: z15.array(z15.unknown()).transform((methods) => methods.filter(isAuthMethod)).refine((methods) => methods.length > 0),
11833
- models: z15.record(z15.string(), z15.string().min(1)).optional()
12064
+ methods: z17.array(z17.unknown()).transform((methods) => methods.filter(isAuthMethod)).refine((methods) => methods.length > 0),
12065
+ models: z17.record(z17.string(), z17.string().min(1)).optional()
11834
12066
  }),
11835
12067
  fallbackHarnessStepSchema
11836
12068
  ]);
11837
- var fallbackPlanResponseSchema = z15.object({
11838
- steps: z15.array(z15.unknown()).transform((steps) => steps.flatMap((step) => fallbackPlanStepSchema.safeParse(step).data ?? []))
12069
+ var fallbackPlanResponseSchema = z17.object({
12070
+ steps: z17.array(z17.unknown()).transform((steps) => steps.flatMap((step) => fallbackPlanStepSchema.safeParse(step).data ?? []))
11839
12071
  });
11840
12072
 
11841
12073
  // ../shared/src/chat-fork.ts
11842
- var fallbackReasonSchema = z16.enum(AGENT_FALLBACK_REASONS);
11843
- var chatForkInfoSchema = z16.object({
11844
- source: z16.object({
11845
- chatId: z16.string().min(1),
11846
- provider: z16.enum(VALID_AGENT_PROVIDERS),
11847
- title: z16.string()
12074
+ var fallbackReasonSchema = z18.enum(AGENT_FALLBACK_REASONS);
12075
+ var chatForkInfoSchema = z18.object({
12076
+ source: z18.object({
12077
+ chatId: z18.string().min(1),
12078
+ provider: z18.enum(VALID_AGENT_PROVIDERS),
12079
+ title: z18.string()
11848
12080
  }),
11849
- trigger: z16.enum(["manual", "auto", "side", "switch"]),
12081
+ trigger: z18.enum(["manual", "auto", "side", "switch"]),
11850
12082
  reason: fallbackReasonSchema.optional(),
11851
- state: z16.enum(["preparing", "ready", "failed"]),
11852
- error: z16.string().optional(),
11853
- startedAt: z16.string(),
11854
- completedAt: z16.string().optional()
12083
+ state: z18.enum(["preparing", "ready", "failed"]),
12084
+ error: z18.string().optional(),
12085
+ startedAt: z18.string(),
12086
+ completedAt: z18.string().optional()
11855
12087
  });
11856
12088
  function coerceChatForkInfo(value) {
11857
12089
  const parsed = chatForkInfoSchema.safeParse(value);
11858
12090
  return parsed.success ? parsed.data : null;
11859
12091
  }
11860
- var forkChatRequestSchema = z16.object({
11861
- provider: z16.enum(VALID_AGENT_PROVIDERS),
11862
- model: z16.string().min(1).optional(),
11863
- thinkingLevel: z16.enum(VALID_THINKING_LEVELS).optional(),
11864
- title: z16.string().min(1).max(200).optional(),
11865
- message: z16.string().trim().optional(),
11866
- id: z16.string().uuid().optional(),
11867
- clientRequestId: z16.string().min(1).max(128).optional(),
11868
- enableInteractiveTools: z16.boolean().optional(),
12092
+ var forkChatRequestSchema = z18.object({
12093
+ provider: z18.enum(VALID_AGENT_PROVIDERS),
12094
+ model: z18.string().min(1).optional(),
12095
+ thinkingLevel: z18.enum(VALID_THINKING_LEVELS).optional(),
12096
+ title: z18.string().min(1).max(200).optional(),
12097
+ message: z18.string().trim().optional(),
12098
+ id: z18.string().uuid().optional(),
12099
+ clientRequestId: z18.string().min(1).max(128).optional(),
12100
+ enableInteractiveTools: z18.boolean().optional(),
11869
12101
  // Server-injected by the monolith from the authenticated request; never trusted from clients.
11870
- senderUserId: z16.string().optional(),
11871
- senderEmail: z16.string().optional(),
11872
- senderDisplayName: z16.string().optional(),
11873
- senderAvatarUrl: z16.string().optional()
12102
+ senderUserId: z18.string().optional(),
12103
+ senderEmail: z18.string().optional(),
12104
+ senderDisplayName: z18.string().optional(),
12105
+ senderAvatarUrl: z18.string().optional()
11874
12106
  });
11875
12107
  function describeQuotaLimit(reason) {
11876
12108
  if (reason === "auth_failed") return "could not authenticate";
@@ -11882,10 +12114,10 @@ function describeChatForkReason(reason, provider2) {
11882
12114
  return reason ? `${getProviderDisplayName(provider2)} ${describeQuotaLimit(reason)}` : null;
11883
12115
  }
11884
12116
  var AGENT_QUOTA_EXHAUSTED_EVENT_TYPE = "agent-quota-exhausted";
11885
- var agentQuotaExhaustedPayloadSchema = z16.object({
11886
- provider: z16.enum(VALID_AGENT_PROVIDERS),
12117
+ var agentQuotaExhaustedPayloadSchema = z18.object({
12118
+ provider: z18.enum(VALID_AGENT_PROVIDERS),
11887
12119
  reason: fallbackReasonSchema,
11888
- detail: z16.string().optional(),
12120
+ detail: z18.string().optional(),
11889
12121
  forkTo: fallbackHarnessStepSchema.optional()
11890
12122
  });
11891
12123
  function defaultForkChatTitle(source, provider2) {
@@ -11920,21 +12152,21 @@ function getChatThreadSources(chats, chat) {
11920
12152
  }
11921
12153
 
11922
12154
  // ../shared/src/credential-refresh.ts
11923
- import { z as z17 } from "zod";
11924
- var engineCredentialRefreshFailureSchema = z17.object({
11925
- code: z17.string(),
12155
+ import { z as z19 } from "zod";
12156
+ var engineCredentialRefreshFailureSchema = z19.object({
12157
+ code: z19.string(),
11926
12158
  credential: workspaceCredentialSelectionSchema.optional()
11927
12159
  });
11928
12160
 
11929
12161
  // ../shared/src/credential-pool.ts
11930
- import { z as z18 } from "zod";
12162
+ import { z as z20 } from "zod";
11931
12163
  var MAX_CREDENTIAL_POOL_ACCOUNTS = 10;
11932
- var reorderCredentialPoolSchema = z18.object({
11933
- credential_ids: z18.array(z18.string().uuid()).min(1).max(MAX_CREDENTIAL_POOL_ACCOUNTS)
12164
+ var reorderCredentialPoolSchema = z20.object({
12165
+ credential_ids: z20.array(z20.string().uuid()).min(1).max(MAX_CREDENTIAL_POOL_ACCOUNTS)
11934
12166
  });
11935
12167
 
11936
12168
  // ../shared/src/mothership-events.ts
11937
- import { z as z25 } from "zod";
12169
+ import { z as z26 } from "zod";
11938
12170
 
11939
12171
  // ../shared/src/design-tokens.ts
11940
12172
  var plain = {
@@ -12101,58 +12333,7 @@ var LINEAR_ICON_DEFINITION = {
12101
12333
  };
12102
12334
 
12103
12335
  // ../shared/src/replicas-mcp.ts
12104
- import { z as z20 } from "zod";
12105
-
12106
- // ../shared/src/automations/trigger-schemas.ts
12107
- import { z as z19 } from "zod";
12108
-
12109
- // ../shared/src/uuid.ts
12110
- function createUuidFromHex(value) {
12111
- return `${value.slice(0, 8)}-${value.slice(8, 12)}-5${value.slice(13, 16)}-${(Number.parseInt(value.slice(16, 17), 16) & 3 | 8).toString(16)}${value.slice(17, 20)}-${value.slice(20, 32)}`;
12112
- }
12113
- var UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
12114
-
12115
- // ../shared/src/automations/github/index.ts
12116
- var REVIEW_REQUESTED_EVENT = "pull_request.review_requested";
12117
-
12118
- // ../shared/src/automations/trigger-schemas.ts
12119
- function getReviewerLoginsError(event, logins) {
12120
- const isReviewRequested = event === REVIEW_REQUESTED_EVENT;
12121
- if (isReviewRequested === !!logins?.some((login) => login.trim().replace(/^@+/, ""))) return null;
12122
- return isReviewRequested ? "The PR review requested trigger needs at least one GitHub username" : "Requested reviewers only apply to the PR review requested trigger";
12123
- }
12124
- var repositoryTriggerConfigSchema = z19.object({
12125
- event: z19.string(),
12126
- repository_ids: z19.array(z19.string().regex(UUID_RE, "must be a repository id")).optional(),
12127
- group_pr_events: z19.boolean().optional(),
12128
- excluded_actors: z19.array(z19.string()).optional(),
12129
- reviewer_logins: z19.array(z19.string()).optional()
12130
- });
12131
- var cronTriggerSchema = z19.object({ type: z19.literal("cron"), config: z19.object({ schedule: z19.string(), timezone: z19.string().optional() }) });
12132
- var githubTriggerSchema = z19.object({
12133
- type: z19.literal("github"),
12134
- config: repositoryTriggerConfigSchema.superRefine((config, ctx) => {
12135
- const message2 = getReviewerLoginsError(config.event, config.reviewer_logins);
12136
- if (message2) ctx.addIssue({ code: "custom", message: message2, path: ["reviewer_logins"] });
12137
- })
12138
- });
12139
- var gitlabTriggerSchema = z19.object({ type: z19.literal("gitlab"), config: repositoryTriggerConfigSchema });
12140
- var linearTriggerConfigSchema = linearIssueFiltersSchema.extend({
12141
- event: z19.string(),
12142
- team_ids: z19.array(z19.string()).optional(),
12143
- state_types: z19.array(z19.enum(LINEAR_STATE_TYPES)).optional()
12144
- }).superRefine((config, ctx) => {
12145
- if (config.event === LINEAR_ISSUE_MATCHED_EVENT && config.team_ids?.length !== 1) ctx.addIssue({ code: "custom", message: "The Linear issue matches trigger needs exactly one team", path: ["team_ids"] });
12146
- });
12147
- var automationTriggerSchema = z19.discriminatedUnion("type", [
12148
- cronTriggerSchema,
12149
- githubTriggerSchema,
12150
- gitlabTriggerSchema,
12151
- z19.object({ type: z19.literal("slack"), config: z19.object({ event: z19.string(), channel_ids: z19.array(z19.string()).optional(), group_thread_replies: z19.boolean().optional() }) }),
12152
- z19.object({ type: z19.literal("sentry"), config: z19.object({ event: z19.string(), project_slugs: z19.array(z19.string()).optional(), min_level: z19.string().optional() }) }),
12153
- z19.object({ type: z19.literal("linear"), config: linearTriggerConfigSchema }),
12154
- z19.object({ type: z19.literal("custom"), config: z19.object({}) })
12155
- ]);
12336
+ import { z as z22 } from "zod";
12156
12337
 
12157
12338
  // ../shared/src/automations/types.ts
12158
12339
  var AUTOMATION_DEBOUNCE_MAX_SECONDS = 24 * 60 * 60;
@@ -12172,6 +12353,14 @@ var AUTOMATION_EXECUTION_MACHINE = defineStateMachine(AUTOMATION_EXECUTION_STATU
12172
12353
  var AUTOMATION_AUTO_PAUSE_DAYS = 7;
12173
12354
  var AUTOMATION_AUTO_PAUSE_LABEL = `Paused after failing every run for ${AUTOMATION_AUTO_PAUSE_DAYS} days`;
12174
12355
 
12356
+ // ../shared/src/routes/environment-config-source.ts
12357
+ import { z as z21 } from "zod";
12358
+ var previewEnvironmentConfigSourceRequestSchema = z21.strictObject({ repository_id: z21.string().min(1).optional() });
12359
+ var applyEnvironmentConfigSourceRequestSchema = previewEnvironmentConfigSourceRequestSchema.extend({
12360
+ commit_sha: z21.string().min(1),
12361
+ fingerprint: z21.string().min(1)
12362
+ });
12363
+
12175
12364
  // ../shared/src/replicas-mcp.ts
12176
12365
  var REPLICAS_MCP_SERVER_NAME = "replicas-mcp";
12177
12366
  var REPLICAS_MCP_TOOLS = {
@@ -12233,55 +12422,57 @@ var REPLICAS_MCP_TOOLS = {
12233
12422
  deleteChat: "delete_chat",
12234
12423
  listRepositories: "list_repositories"
12235
12424
  };
12236
- var automationToolInputSchema = z20.object({
12237
- name: z20.string().describe("Short automation name."),
12238
- prompt: z20.string().describe("Prompt each automation run starts with."),
12239
- environment_id: z20.string().describe(`Environment id from \`${REPLICAS_MCP_TOOLS.listEnvironments}\`.`),
12240
- triggers: z20.array(automationTriggerSchema).min(1).describe(
12425
+ var automationToolInputSchema = z22.object({
12426
+ name: z22.string().describe("Short automation name."),
12427
+ prompt: z22.string().describe("Prompt each automation run starts with."),
12428
+ environment_id: z22.string().describe(`Environment id from \`${REPLICAS_MCP_TOOLS.listEnvironments}\`.`),
12429
+ triggers: z22.array(automationTriggerSchema).min(1).describe(
12241
12430
  `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"] } }\`.`
12242
12431
  ),
12243
- description: z20.string().optional().describe("One-line summary shown in the dashboard."),
12244
- plan_mode: z20.boolean().optional(),
12245
- goal_mode: z20.boolean().optional(),
12246
- fast_mode: z20.boolean().optional(),
12247
- workspace_lifecycle_policy: z20.enum(AUTOMATION_LIFECYCLE_POLICIES).optional().describe(
12432
+ description: z22.string().optional().describe("One-line summary shown in the dashboard."),
12433
+ plan_mode: z22.boolean().optional(),
12434
+ goal_mode: z22.boolean().optional(),
12435
+ fast_mode: z22.boolean().optional(),
12436
+ workspace_lifecycle_policy: z22.enum(AUTOMATION_LIFECYCLE_POLICIES).optional().describe(
12248
12437
  "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."
12249
12438
  )
12250
12439
  });
12251
12440
  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.`;
12252
- var automationBackgroundSchema = z20.boolean().optional().describe(
12441
+ var automationBackgroundSchema = z22.boolean().optional().describe(
12253
12442
  "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."
12254
12443
  );
12255
12444
  var automationCreateToolInputSchema = automationToolInputSchema.extend({
12256
- credential_user_id: z20.string().optional().describe(`${credentialUserIdDescription} Omit to use the organization's.`),
12445
+ credential_user_id: z22.string().optional().describe(`${credentialUserIdDescription} Omit to use the organization's.`),
12257
12446
  background: automationBackgroundSchema,
12258
- scope: z20.enum(["org", "user"]).optional().describe("`org` (default) or `user` for a personal automation, which needs a personal API key.")
12447
+ scope: z22.enum(["org", "user"]).optional().describe("`org` (default) or `user` for a personal automation, which needs a personal API key.")
12259
12448
  });
12260
12449
  var automationUpdateToolInputSchema = automationToolInputSchema.partial().extend({
12261
- automation_id: z20.string().describe("Automation ID"),
12262
- enabled: z20.boolean().optional(),
12263
- agent_provider: z20.enum(AGENT).nullable().optional(),
12264
- model: z20.string().nullable().optional(),
12265
- thinking_level: z20.enum(VALID_THINKING_LEVELS).nullable().optional(),
12266
- workspace_size: z20.enum(WORKSPACE_SIZES).optional(),
12267
- credential_user_id: z20.string().nullable().optional().describe(`${credentialUserIdDescription} Null switches back to the organization's.`),
12450
+ automation_id: z22.string().describe("Automation ID"),
12451
+ enabled: z22.boolean().optional(),
12452
+ agent_provider: z22.enum(AGENT).nullable().optional(),
12453
+ model: z22.string().nullable().optional(),
12454
+ thinking_level: z22.enum(VALID_THINKING_LEVELS).nullable().optional(),
12455
+ workspace_size: z22.enum(WORKSPACE_SIZES).optional(),
12456
+ credential_user_id: z22.string().nullable().optional().describe(`${credentialUserIdDescription} Null switches back to the organization's.`),
12268
12457
  background: automationBackgroundSchema,
12269
- scope: z20.literal("org").optional().describe("`org` moves a personal automation to the organization so teammates can see and edit it. It cannot be moved back.")
12458
+ scope: z22.literal("org").optional().describe("`org` moves a personal automation to the organization so teammates can see and edit it. It cannot be moved back.")
12270
12459
  });
12271
- var chatPath = { id: z20.string().describe("Workspace ID"), chat_id: z20.string().describe("Chat ID") };
12460
+ var chatPath = { id: z22.string().describe("Workspace ID"), chat_id: z22.string().describe("Chat ID") };
12272
12461
  var { provider, model, thinkingLevel, title, message } = forkChatRequestSchema.shape;
12273
- var createChatToolInputSchema = z20.object({ id: chatPath.id, provider, title: createChatRequestSchema.shape.title });
12274
- var forkChatToolInputSchema = z20.object({ ...chatPath, provider, model, thinking_level: thinkingLevel, title, message });
12275
- var renameChatToolInputSchema = z20.object({ ...chatPath, display_name: updateChatDisplayNameRequestSchema.shape.displayName });
12276
- var runCommandToolInputSchema = z20.object({ id: chatPath.id, ...workspaceExecRequestSchema.shape });
12277
- var environmentMcpPath = { environment_id: z20.string().describe("Environment ID") };
12278
- var createEnvironmentMcpToolInputSchema = z20.object({ ...environmentMcpPath, ...createEnvironmentMcpRequestSchema.shape });
12279
- var updateEnvironmentMcpToolInputSchema = z20.object({
12462
+ var createChatToolInputSchema = z22.object({ id: chatPath.id, provider, title: createChatRequestSchema.shape.title });
12463
+ var forkChatToolInputSchema = z22.object({ ...chatPath, provider, model, thinking_level: thinkingLevel, title, message });
12464
+ var renameChatToolInputSchema = z22.object({ ...chatPath, display_name: updateChatDisplayNameRequestSchema.shape.displayName });
12465
+ var runCommandToolInputSchema = z22.object({ id: chatPath.id, ...workspaceExecRequestSchema.shape });
12466
+ var environmentMcpPath = { environment_id: z22.string().describe("Environment ID") };
12467
+ var createEnvironmentMcpToolInputSchema = z22.object({ ...environmentMcpPath, ...createEnvironmentMcpRequestSchema.shape });
12468
+ var updateEnvironmentMcpToolInputSchema = z22.object({
12280
12469
  ...environmentMcpPath,
12281
- mcp_id: z20.string().describe("MCP ID"),
12470
+ mcp_id: z22.string().describe("MCP ID"),
12282
12471
  ...updateEnvironmentMcpRequestSchema.shape
12283
12472
  });
12284
- var createEnvironmentDeviceToolInputSchema = z20.object({ ...environmentMcpPath, ...createEnvironmentDeviceRequestSchema.shape });
12473
+ var createEnvironmentDeviceToolInputSchema = z22.object({ ...environmentMcpPath, ...createEnvironmentDeviceRequestSchema.shape });
12474
+ var previewEnvironmentConfigSourceToolInputSchema = z22.object({ ...environmentMcpPath, ...previewEnvironmentConfigSourceRequestSchema.shape });
12475
+ var applyEnvironmentConfigSourceToolInputSchema = z22.object({ ...environmentMcpPath, ...applyEnvironmentConfigSourceRequestSchema.shape });
12285
12476
 
12286
12477
  // ../shared/src/scout.ts
12287
12478
  var SCOUT_SOURCE_TYPES = ["slack", "linear"];
@@ -12320,7 +12511,7 @@ var SCOUT_PRESET_ICONS = [
12320
12511
  var SCOUT_SETTINGS_SKILL_NAME = "scout-settings";
12321
12512
  var CONTENT = `---
12322
12513
  name: ${SCOUT_SETTINGS_SKILL_NAME}
12323
- description: Use when someone asks what Replicas can do or what they can change ("what can you do?", "what can I change here?"), asks to change or explain how Replicas behaves in Slack or Linear (channel levels, "be quieter", "only reply when tagged", mute, channel or team instructions, presets, monitored Linear teams, Slack Connect defaults, Slack agent defaults), when someone is annoyed that Scout replied unasked ("not you", "nobody asked", a thumbs-down), when making or answering a settings or automation offer, or when setting up an automation. Not for routing ordinary requests.
12514
+ description: Use when someone asks what Replicas can do or what they can change ("what can you do?", "what can I change here?"), asks to change or explain how Replicas behaves in Slack or Linear (channel levels, "be quieter", "only reply when tagged", silent mode, mute, channel or team instructions, presets, monitored Linear teams, Slack Connect defaults, Slack agent defaults), when someone is annoyed that Scout replied unasked ("not you", "nobody asked", a thumbs-down), when making or answering a settings or automation offer, or when setting up an automation. Not for routing ordinary requests.
12324
12515
  ---
12325
12516
 
12326
12517
  # Scout settings
@@ -12332,10 +12523,10 @@ There is no settings page: people change how Replicas behaves by asking you, and
12332
12523
  | --- | --- | --- |
12333
12524
  | How much you speak up in a channel or group DM (Mentions only, Low, Balanced, High) | \`${REPLICAS_MCP_TOOLS.updateChannelSettings}\` \`proactivity\` | Any member, except that raising one from Mentions only needs an admin |
12334
12525
  | How much you speak up in every channel | \`${REPLICAS_MCP_TOOLS.setOrganizationProactivity}\` | Admin |
12335
- | Mute or unmute you in a channel (you still read it and follow its instructions, but never post there) | \`${REPLICAS_MCP_TOOLS.updateChannelSettings}\` \`muted\` | Admin |
12526
+ | Silent mode for a channel, also asked as muting you there (you still read it and follow its instructions, but never post there) | \`${REPLICAS_MCP_TOOLS.updateChannelSettings}\` \`silent\` | Admin |
12336
12527
  | Instructions for a channel or Linear team, such as "file bugs in Linear and post them in #triage", "send actionable messages to App Support", or "mobile requests go to the mobile-ios environment" | \`${REPLICAS_MCP_TOOLS.updateChannelSettings}\` \`instructions\` | Any member |
12337
12528
  | Create, edit, or delete a preset (reusable instructions), or assign one | \`${REPLICAS_MCP_TOOLS.saveChannelPreset}\`, \`${REPLICAS_MCP_TOOLS.deleteChannelPreset}\`, \`${REPLICAS_MCP_TOOLS.updateChannelSettings}\` \`preset_id\` | Any member |
12338
- | Defaults for every channel shared with another company: preset, instructions, level, mute | \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\` | Admin |
12529
+ | Defaults for every channel shared with another company: preset, instructions, level, silent mode | \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\` | Admin |
12339
12530
  | Triage new issues in a Linear team, or stop | \`${REPLICAS_MCP_TOOLS.updateChannelSettings}\` \`source: linear\`, \`monitored\` | Admin starts; any member stops |
12340
12531
  | Agent, model, thinking level, goal mode, and fast mode for tasks started from Slack | \`${REPLICAS_MCP_TOOLS.setSlackAgentDefaults}\` | Admin |
12341
12532
  | Stay quiet in this thread, or come back | \`${REPLICAS_MCP_TOOLS.setThreadMuted}\` | Anyone in the thread |
@@ -12345,7 +12536,7 @@ You also answer questions, start a workspace for a task (in a separate thread wh
12345
12536
 
12346
12537
  A person's own defaults (agent, model, environment) and the organization's general defaults are changed in the Replicas app, not by you; Slack tasks use them unless the Slack agent defaults above say otherwise.
12347
12538
 
12348
- You can't add yourself to or remove yourself from a channel: people type \`/invite @Replicas\` or \`/remove @Replicas\` there, and an admin can pick channels under Integrations, Slack, Configure. To keep you in a channel but out of the way, lower it to Mentions only or mute it. A channel becomes a Mothership's own channel from that Mothership, not here; any channel's instructions can still send its messages to a Mothership.
12539
+ You can't add yourself to or remove yourself from a channel: people type \`/invite @Replicas\` or \`/remove @Replicas\` there, and an admin can pick channels under Integrations, Slack, Configure. To keep you in a channel but out of the way, lower it to Mentions only or put it in silent mode. A channel becomes a Mothership's own channel from that Mothership, not here; any channel's instructions can still send its messages to a Mothership.
12349
12540
 
12350
12541
  ## Tools
12351
12542
  Read presets, channel instructions, and levels with \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`. Change them with \`${REPLICAS_MCP_TOOLS.updateChannelSettings}\`, \`${REPLICAS_MCP_TOOLS.saveChannelPreset}\`, \`${REPLICAS_MCP_TOOLS.deleteChannelPreset}\`, \`${REPLICAS_MCP_TOOLS.setOrganizationProactivity}\`, \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\`, or \`${REPLICAS_MCP_TOOLS.setSlackAgentDefaults}\`. Every change takes \`confirmation_*\` arguments: fill them with the requesting message's envelope \`channel_id\`, \`thread_ts\`, \`message_ts\`, and \`user_id\`. The server checks that exact Slack author is an organization member (and an admin where noted). If it refuses, say why briefly and change nothing.
@@ -12356,11 +12547,12 @@ Read presets, channel instructions, and levels with \`${REPLICAS_MCP_TOOLS.listC
12356
12547
  - The organization has one level for its whole Slack workspace, which only an admin can set with \`${REPLICAS_MCP_TOOLS.setOrganizationProactivity}\`. A channel or group DM can override it with \`${REPLICAS_MCP_TOOLS.updateChannelSettings}\` and \`proactivity\`. 1:1 DMs are always addressed to you. Any member can lower a channel; raising one above \`tagged\` needs an admin.
12357
12548
  - A request that points at a channel ("here", "in #eng", "stop replying in #random") changes that channel only. One that doesn't ("only respond when I @ you", "don't auto-reply to Slack messages") means the organization level. When it names a channel, even without "#" ("make support-inbound quieter"), find it with \`conversations.list\` and change that one, not the one you were asked in; ask if none or several match. If a non-admin asks for an organization change, say an organization admin has to ask, and offer the channel-only change when they asked from a channel. Instructions don't substitute for a level.
12358
12549
  - **Instructions and presets:** prefer changing the channel's own instructions; edit a shared preset only when asked, since every channel using it changes. To set up a channel without being told how, read enough of it to propose short instructions or a fitting preset (customer, vendor, internal team), and save nothing until they confirm. Never infer a channel's purpose only because Slack marks it externally shared.
12550
+ - **Silent mode** is what people mean by muting you in a channel. A channel in silent mode still reaches you as its level allows, and you follow its instructions anywhere but there. For "watch #alerts and report to #team", an admin turns on \`silent\` for the watched channel, raises it to Balanced or High so untagged messages reach you, and its instructions name where to report. It is separate from a thread mute, which lasts hours and only quiets one thread.
12359
12551
  - **Linear teams:** set \`monitored: true\` to start triaging a team (admin only) and \`monitored: false\` to stop. Teams take a preset or instructions like channels.
12360
12552
  - **Slack Connect** channels shared with another company follow the organization's shared-channel defaults (\`tagged\` with no preset unless an admin set them with \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\`) until they get their own settings, unless a Mothership is linked to one. A request about all shared or customer channels changes only those defaults: leave channels with their own settings as they are, list them, and offer to switch them too. Asked why you stay quiet in one, say it's external and an admin can ask you to raise its level.
12361
12553
  - **Slack agent defaults:** to change the agent, model, thinking level, goal mode, or fast mode for tasks started from Slack ("use Codex for Slack tasks"), call \`${REPLICAS_MCP_TOOLS.setSlackAgentDefaults}\` (admin only).
12362
12554
  - **"What can you do?"** Keep it short: one line on what you do (answer questions, start a workspace for a task, hand work to a Mothership, file Linear tickets, set up recurring tasks), two or three example requests in backticks drawn from both work and behavior (like \`fix the flaky login test\`, \`only reply here when tagged\`, \`every Monday, summarize open PRs\`), then "Ask me what you can change here to see every setting." No settings list or current values.
12363
- - **"What can I change?"** Read the current settings, then reply in a few short lines from **What you can do**: what applies here with its current value (this channel's level, mute, instructions or preset), then what applies everywhere (the every-channel level, shared-channel defaults, Linear teams, Slack agent defaults), marking what needs an admin. Give one example phrasing, like "only reply here when tagged".
12555
+ - **"What can I change?"** Read the current settings, then reply in a few short lines from **What you can do**: what applies here with its current value (this channel's level, silent mode, instructions or preset), then what applies everywhere (the every-channel level, shared-channel defaults, Linear teams, Slack agent defaults), marking what needs an admin. Give one example phrasing, like "only reply here when tagged".
12364
12556
  - After any change, say what changed and its scope ("every channel", or "#eng only"). Confirm only after the tool succeeded and only what it changed; say so when it failed or did less than asked.
12365
12557
 
12366
12558
  ## Offers
@@ -12374,63 +12566,63 @@ When someone asks for a recurring task or accepts an offer to automate a repeate
12374
12566
  `;
12375
12567
 
12376
12568
  // ../shared/src/routes/preferences.ts
12377
- import { z as z24 } from "zod";
12569
+ import { z as z25 } from "zod";
12378
12570
 
12379
12571
  // ../shared/src/routes/push.ts
12380
- import { z as z21 } from "zod";
12572
+ import { z as z23 } from "zod";
12381
12573
 
12382
12574
  // ../shared/src/workspace-attention.ts
12383
12575
  var WORKSPACE_ATTENTION_REASONS = ["question", "plan", "variables", "blocked", "setup", "deploy_failed"];
12384
12576
  var CHAT_ATTENTION_REASONS = ["question", "blocked"];
12385
12577
 
12386
12578
  // ../shared/src/routes/push.ts
12387
- var registerPushDeviceRequestSchema = z21.discriminatedUnion("platform", [
12388
- z21.object({
12389
- platform: z21.literal("ios"),
12390
- token: z21.string().regex(/^[0-9a-f]{64,200}$/i),
12391
- appId: z21.string().min(1).max(255),
12392
- apnsEnvironment: z21.enum(["sandbox", "production"])
12579
+ var registerPushDeviceRequestSchema = z23.discriminatedUnion("platform", [
12580
+ z23.object({
12581
+ platform: z23.literal("ios"),
12582
+ token: z23.string().regex(/^[0-9a-f]{64,200}$/i),
12583
+ appId: z23.string().min(1).max(255),
12584
+ apnsEnvironment: z23.enum(["sandbox", "production"])
12393
12585
  }),
12394
- z21.object({
12395
- platform: z21.literal("android"),
12396
- token: z21.string().min(1).max(4096),
12397
- appId: z21.string().min(1).max(255)
12586
+ z23.object({
12587
+ platform: z23.literal("android"),
12588
+ token: z23.string().min(1).max(4096),
12589
+ appId: z23.string().min(1).max(255)
12398
12590
  })
12399
12591
  ]);
12400
12592
  var PUSH_HOLD_MINUTES = 5;
12401
- var chatRefSchema = z21.object({ workspaceId: z21.string().uuid(), chatId: z21.string().min(1).max(100) });
12402
- var recordPushActivityRequestSchema = z21.object({
12403
- organizationId: z21.string().uuid(),
12593
+ var chatRefSchema = z23.object({ workspaceId: z23.string().uuid(), chatId: z23.string().min(1).max(100) });
12594
+ var recordPushActivityRequestSchema = z23.object({
12595
+ organizationId: z23.string().uuid(),
12404
12596
  /** Seconds since the last keyboard or mouse input on this computer. A phone leaves it out: it only reports what it has open. */
12405
- idleSeconds: z21.number().min(0).optional(),
12406
- seenWorkspaceIds: z21.array(z21.string().uuid()).max(20),
12407
- seenChats: z21.array(chatRefSchema).max(20).optional()
12597
+ idleSeconds: z23.number().min(0).optional(),
12598
+ seenWorkspaceIds: z23.array(z23.string().uuid()).max(20),
12599
+ seenChats: z23.array(chatRefSchema).max(20).optional()
12408
12600
  });
12409
12601
  var PUSH_NOTIFICATION_KINDS = [...WORKSPACE_ATTENTION_REASONS, "finished"];
12410
12602
  var PUSH_OPTION_LABEL_MAX = 60;
12411
12603
  var PUSH_OPTIONS_MAX = 4;
12412
- var pushQuestionSchema = z21.object({ id: z21.string().max(64), allowCustom: z21.boolean().optional(), options: z21.array(z21.object({ id: z21.string().max(64), label: z21.string().min(1).max(PUSH_OPTION_LABEL_MAX) })).min(1).max(PUSH_OPTIONS_MAX) });
12413
- var pushNotificationDataSchema = z21.object({
12414
- organizationId: z21.string(),
12415
- workspaceId: z21.string(),
12416
- chatId: z21.string().nullable(),
12417
- kind: z21.enum(PUSH_NOTIFICATION_KINDS),
12418
- completedAt: z21.string(),
12419
- toolRequestId: z21.string().optional(),
12604
+ var pushQuestionSchema = z23.object({ id: z23.string().max(64), allowCustom: z23.boolean().optional(), options: z23.array(z23.object({ id: z23.string().max(64), label: z23.string().min(1).max(PUSH_OPTION_LABEL_MAX) })).min(1).max(PUSH_OPTIONS_MAX) });
12605
+ var pushNotificationDataSchema = z23.object({
12606
+ organizationId: z23.string(),
12607
+ workspaceId: z23.string(),
12608
+ chatId: z23.string().nullable(),
12609
+ kind: z23.enum(PUSH_NOTIFICATION_KINDS),
12610
+ completedAt: z23.string(),
12611
+ toolRequestId: z23.string().optional(),
12420
12612
  question: pushQuestionSchema.optional()
12421
12613
  });
12422
- var workspaceSharedPushDataSchema = pushNotificationDataSchema.pick({ organizationId: true, workspaceId: true, chatId: true, completedAt: true }).extend({ kind: z21.literal("shared") });
12614
+ var workspaceSharedPushDataSchema = pushNotificationDataSchema.pick({ organizationId: true, workspaceId: true, chatId: true, completedAt: true }).extend({ kind: z23.literal("shared") });
12423
12615
  var registerLiveActivityRequestSchema = chatRefSchema.extend({
12424
- deviceId: z21.string().uuid(),
12616
+ deviceId: z23.string().uuid(),
12425
12617
  /** The iOS activity's push token. Android leaves it out and gets FCM data messages on the device token. */
12426
- pushToken: z21.string().regex(/^[0-9a-f]{64,400}$/i).optional(),
12618
+ pushToken: z23.string().regex(/^[0-9a-f]{64,400}$/i).optional(),
12427
12619
  /** iOS only: when the card's turn started, in seconds. Cards keep their order by it. */
12428
- startedAt: z21.number().positive().optional()
12620
+ startedAt: z23.number().positive().optional()
12429
12621
  });
12430
- var syncLiveActivitiesRequestSchema = z21.object({
12431
- activities: z21.array(chatRefSchema).max(100)
12622
+ var syncLiveActivitiesRequestSchema = z23.object({
12623
+ activities: z23.array(chatRefSchema).max(100)
12432
12624
  });
12433
- var setLiveActivityStartTokenRequestSchema = z21.object({ token: z21.string().regex(/^[0-9a-f]{64,400}$/i) });
12625
+ var setLiveActivityStartTokenRequestSchema = z23.object({ token: z23.string().regex(/^[0-9a-f]{64,400}$/i) });
12434
12626
 
12435
12627
  // ../shared/src/default-skills/replicas-agent/abilities/computer.ts
12436
12628
  var SECTION = `### Computer use (Linux desktop control)
@@ -12711,156 +12903,6 @@ var DOCKER_ABILITY = {
12711
12903
  referenceFile: { name: "DOCKER.md", content: REFERENCE2 }
12712
12904
  };
12713
12905
 
12714
- // ../shared/src/routes/environment-setups.ts
12715
- import { z as z22 } from "zod";
12716
- var ENVIRONMENT_SETUP_STEPS = [
12717
- { key: "understand", label: "Understand the codebase" },
12718
- { key: "install", label: "Install dependencies and run the app" },
12719
- { key: "verify", label: "Verify checks and record a walkthrough" },
12720
- { key: "configure", label: "Draft hooks, system prompt, and automations" },
12721
- { key: "propose", label: "Propose the configuration for review" }
12722
- ];
12723
- var ENVIRONMENT_SETUP_STEP_STATUSES = ["pending", "in_progress", "completed", "skipped"];
12724
- var ENVIRONMENT_SETUP_RUN_STATUSES = ["running", "proposed", "applied", "failed", "cancelled", "expired"];
12725
- var ENVIRONMENT_SETUP_AUTOMATION_ACTIONS = ["create", "update", "keep", "disable"];
12726
- var ENVIRONMENT_SETUP_VERIFICATION_STATUSES = ["passed", "failed", "skipped"];
12727
- var ENVIRONMENT_SETUP_LIMITS = {
12728
- summaryChars: 600,
12729
- stackItems: 30,
12730
- nameChars: 120,
12731
- descriptionChars: 1e3,
12732
- systemPromptChars: 2e4,
12733
- hookChars: 5e4,
12734
- variables: 50,
12735
- variableKeyChars: 128,
12736
- variableDescriptionChars: 500,
12737
- automations: 8,
12738
- automationKeyChars: 80,
12739
- automationPromptChars: 1e4,
12740
- automationTriggers: 5,
12741
- automationNoteChars: 300,
12742
- verificationItems: 8,
12743
- verificationDetailChars: 300,
12744
- mediaItems: 8,
12745
- repositories: 20
12746
- };
12747
- var VARIABLE_KEY_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
12748
- var text2 = (max) => max === void 0 ? z22.string().trim() : z22.string().trim().max(max);
12749
- var requiredText = (max) => text2(max).min(1, "must not be empty");
12750
- var optionalText2 = (max) => text2(max).nullish().transform((value) => value || null);
12751
- var clearableText = (max) => text2(max).nullish().transform((value) => value === void 0 ? void 0 : value || null);
12752
- var list = (item, max) => max === void 0 ? z22.array(item) : z22.array(item).max(max);
12753
- var ENVIRONMENT_SETUP_AUTHORED_TRIGGER_TYPES = ["cron", "github", "gitlab"];
12754
- function isEnvironmentSetupAuthoredTriggerType(type) {
12755
- return ENVIRONMENT_SETUP_AUTHORED_TRIGGER_TYPES.some((authored) => authored === type);
12756
- }
12757
- var proposalTriggerSchema = z22.discriminatedUnion("type", [cronTriggerSchema, githubTriggerSchema, gitlabTriggerSchema]);
12758
- var existingTriggerSchema = z22.custom(
12759
- (value) => isRecord(value) && typeof value.type === "string" && isRecord(value.config),
12760
- "must be an automation trigger"
12761
- );
12762
- var carriedTriggerSchema = existingTriggerSchema.refine(
12763
- (trigger) => !isEnvironmentSetupAuthoredTriggerType(trigger.type)
12764
- );
12765
- function automationSchema(limits) {
12766
- const authored = z22.object({
12767
- name: text2(limits.nameChars),
12768
- description: text2(limits.descriptionChars),
12769
- prompt: text2(limits.automationPromptChars),
12770
- triggers: list(proposalTriggerSchema, limits.automationTriggers)
12771
- });
12772
- const updated = authored.extend({ triggers: list(z22.union([proposalTriggerSchema, carriedTriggerSchema]), limits.automationTriggers) });
12773
- return z22.object({
12774
- key: requiredText(limits.automationKeyChars),
12775
- action: z22.enum(ENVIRONMENT_SETUP_AUTOMATION_ACTIONS).default("create"),
12776
- automation_id: z22.string().regex(UUID_RE, "must be an automation id").nullable().default(null),
12777
- name: text2().default(""),
12778
- description: optionalText2().transform((value) => value ?? ""),
12779
- prompt: text2().default(""),
12780
- triggers: list(existingTriggerSchema).default([]),
12781
- note: optionalText2(limits.automationNoteChars)
12782
- }).superRefine((automation, ctx) => {
12783
- if (automation.action === "create" && automation.automation_id) {
12784
- ctx.addIssue({ code: "custom", path: ["automation_id"], message: "belongs on an update, keep, or disable entry" });
12785
- }
12786
- if (automation.action !== "create" && !automation.automation_id) {
12787
- ctx.addIssue({ code: "custom", path: ["automation_id"], message: "must be the id of an automation attached to this environment" });
12788
- }
12789
- if (automation.action === "create" || automation.action === "update") {
12790
- if (!automation.name) ctx.addIssue({ code: "custom", path: ["name"], message: "must not be empty" });
12791
- if (!automation.prompt) ctx.addIssue({ code: "custom", path: ["prompt"], message: "must not be empty" });
12792
- if (automation.triggers.length === 0) ctx.addIssue({ code: "custom", path: ["triggers"], message: "must not be empty" });
12793
- }
12794
- }).transform((automation, ctx) => {
12795
- if (automation.action === "keep" || automation.action === "disable") return automation;
12796
- const content = (automation.action === "update" ? updated : authored).safeParse(automation);
12797
- if (content.success) return { ...automation, ...content.data };
12798
- for (const issue of content.error.issues) ctx.addIssue({ ...issue, code: "custom" });
12799
- return z22.NEVER;
12800
- });
12801
- }
12802
- function automationListSchema(limits) {
12803
- return list(automationSchema(limits)).default([]).superRefine((automations, ctx) => {
12804
- if (new Set(automations.map((automation) => automation.key)).size !== automations.length) {
12805
- ctx.addIssue({ code: "custom", message: "must have unique keys" });
12806
- }
12807
- const targets = automations.flatMap((automation) => automation.automation_id ?? []);
12808
- if (new Set(targets).size !== targets.length) {
12809
- ctx.addIssue({ code: "custom", message: "must mention each existing automation once" });
12810
- }
12811
- if (limits.automations !== void 0 && automations.filter((automation) => automation.action === "create").length > limits.automations) {
12812
- ctx.addIssue({ code: "custom", message: `must create at most ${limits.automations} new automations` });
12813
- }
12814
- });
12815
- }
12816
- function environmentSchema(limits) {
12817
- return z22.object({
12818
- name: optionalText2(limits.nameChars).transform((value) => value ?? void 0),
12819
- description: clearableText(limits.descriptionChars),
12820
- system_prompt: clearableText(limits.systemPromptChars),
12821
- start_hook: clearableText(limits.hookChars),
12822
- warm_hook: clearableText(limits.hookChars)
12823
- });
12824
- }
12825
- function proposalSchema(limits) {
12826
- return z22.object({
12827
- summary: requiredText(limits.summaryChars),
12828
- stack: list(text2(), limits.stackItems).default([]).transform((items) => items.filter(Boolean)),
12829
- environment: environmentSchema(limits),
12830
- variables: list(z22.object({
12831
- key: z22.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name").max(limits.variableKeyChars ?? Number.POSITIVE_INFINITY),
12832
- description: optionalText2(limits.variableDescriptionChars).transform((value) => value ?? ""),
12833
- required: z22.boolean().default(false)
12834
- }), limits.variables).default([]),
12835
- automations: automationListSchema(limits),
12836
- verification: list(z22.object({
12837
- label: requiredText(limits.nameChars),
12838
- status: z22.enum(ENVIRONMENT_SETUP_VERIFICATION_STATUSES),
12839
- detail: optionalText2(limits.verificationDetailChars).transform((value) => value ?? void 0)
12840
- }), limits.verificationItems).default([]),
12841
- media: list(z22.object({
12842
- media_id: z22.string().regex(UUID_RE, "must be a media id"),
12843
- title: requiredText(limits.nameChars)
12844
- }), limits.mediaItems).default([])
12845
- });
12846
- }
12847
- var environmentSetupProposalSchema = proposalSchema({});
12848
- var environmentSetupProposalSubmissionSchema = proposalSchema(ENVIRONMENT_SETUP_LIMITS);
12849
- var environmentSetupRunStateSchema = z22.object({
12850
- status: z22.enum(ENVIRONMENT_SETUP_RUN_STATUSES),
12851
- steps: z22.partialRecord(z22.enum(ENVIRONMENT_SETUP_STEPS.map((step) => step.key)), z22.enum(ENVIRONMENT_SETUP_STEP_STATUSES)).default({}),
12852
- proposal: environmentSetupProposalSchema.nullable().default(null),
12853
- applied: z22.object({
12854
- applied_at: z22.string(),
12855
- automation_ids: z22.array(z22.string())
12856
- }).nullable().default(null)
12857
- });
12858
- var applyEnvironmentSetupRequestSchema = z22.object({
12859
- environment: environmentSchema(ENVIRONMENT_SETUP_LIMITS).extend({ name: requiredText(ENVIRONMENT_SETUP_LIMITS.nameChars) }),
12860
- variables: list(z22.object({ key: z22.string().regex(VARIABLE_KEY_RE), value: z22.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)),
12861
- automations: automationListSchema(ENVIRONMENT_SETUP_LIMITS)
12862
- });
12863
-
12864
12906
  // ../shared/src/default-skills/replicas-agent/abilities/environment-setup.ts
12865
12907
  var SECTION3 = `### Environment setup (agent-led)
12866
12908
  Explore a codebase, get it running in this workspace, verify it end to end, and propose the Replicas environment configuration (start hook, warm hook, system prompt, variables) plus a few automations for the user to review and save.
@@ -13332,7 +13374,7 @@ var GITLAB_ABILITY = {
13332
13374
  };
13333
13375
 
13334
13376
  // ../shared/src/routes/compute.ts
13335
- import { z as z23 } from "zod";
13377
+ import { z as z24 } from "zod";
13336
13378
  var COMPUTE_SANDBOX_KINDS = ["gpu"];
13337
13379
  var GPU_TYPES = ["T4", "L4", "A10G", "L40S", "A100", "A100-80GB", "H100", "H200", "B200"];
13338
13380
  var DEFAULT_GPU_TYPE = "L4";
@@ -13349,27 +13391,27 @@ var COMPUTE_SANDBOX_LIMITS = {
13349
13391
  maxIdleTimeoutMinutes: 60,
13350
13392
  maxTransferBytes: 1024 ** 3
13351
13393
  };
13352
- var computeEnvSchema = z23.record(z23.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128), z23.string().max(32768)).refine((env) => Object.keys(env).length <= 64, "At most 64 environment variables are allowed");
13353
- var createComputeSandboxRequestSchema = z23.object({
13354
- kind: z23.enum(COMPUTE_SANDBOX_KINDS),
13355
- gpu: z23.string().trim().optional(),
13356
- image: z23.string().trim().min(1).max(256).regex(/^\S+$/, "Image must not contain whitespace").optional(),
13357
- timeoutMinutes: z23.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxTimeoutMinutes).optional(),
13358
- idleTimeoutMinutes: z23.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxIdleTimeoutMinutes).optional(),
13359
- ports: z23.array(z23.number().int().min(1).max(65535)).max(COMPUTE_SANDBOX_LIMITS.maxPorts).optional(),
13394
+ var computeEnvSchema = z24.record(z24.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128), z24.string().max(32768)).refine((env) => Object.keys(env).length <= 64, "At most 64 environment variables are allowed");
13395
+ var createComputeSandboxRequestSchema = z24.object({
13396
+ kind: z24.enum(COMPUTE_SANDBOX_KINDS),
13397
+ gpu: z24.string().trim().optional(),
13398
+ image: z24.string().trim().min(1).max(256).regex(/^\S+$/, "Image must not contain whitespace").optional(),
13399
+ timeoutMinutes: z24.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxTimeoutMinutes).optional(),
13400
+ idleTimeoutMinutes: z24.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxIdleTimeoutMinutes).optional(),
13401
+ ports: z24.array(z24.number().int().min(1).max(65535)).max(COMPUTE_SANDBOX_LIMITS.maxPorts).optional(),
13360
13402
  env: computeEnvSchema.optional()
13361
13403
  });
13362
- var computeExecRequestSchema = z23.object({
13363
- command: z23.string().min(1).max(1e5),
13364
- workdir: z23.string().min(1).max(4096).optional(),
13404
+ var computeExecRequestSchema = z24.object({
13405
+ command: z24.string().min(1).max(1e5),
13406
+ workdir: z24.string().min(1).max(4096).optional(),
13365
13407
  env: computeEnvSchema.optional(),
13366
- detach: z23.boolean().optional()
13408
+ detach: z24.boolean().optional()
13367
13409
  });
13368
- var computeUploadRequestSchema = z23.object({
13369
- size: z23.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxTransferBytes)
13410
+ var computeUploadRequestSchema = z24.object({
13411
+ size: z24.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxTransferBytes)
13370
13412
  });
13371
- var computeTransferPathSchema = z23.object({
13372
- path: z23.string().min(1).max(4096).optional()
13413
+ var computeTransferPathSchema = z24.object({
13414
+ path: z24.string().min(1).max(4096).optional()
13373
13415
  });
13374
13416
 
13375
13417
  // ../shared/src/default-skills/replicas-agent/abilities/gpu.ts
@@ -15121,9 +15163,9 @@ var DEFAULT_DEFAULT_SKILLS = {
15121
15163
  }
15122
15164
  };
15123
15165
  var LINEAR_ROUTING_SKILL_MAX_LENGTH = 5e4;
15124
- var linearRoutingSkillSchema = z24.union([
15125
- z24.object({ name: z24.string().min(1), content: z24.string().trim().min(1).max(LINEAR_ROUTING_SKILL_MAX_LENGTH) }),
15126
- z24.object({ name: z24.string().min(1), repository_id: z24.string().regex(UUID_RE), path: z24.string().min(1) })
15166
+ var linearRoutingSkillSchema = z25.union([
15167
+ z25.object({ name: z25.string().min(1), content: z25.string().trim().min(1).max(LINEAR_ROUTING_SKILL_MAX_LENGTH) }),
15168
+ z25.object({ name: z25.string().min(1), repository_id: z25.string().regex(UUID_RE), path: z25.string().min(1) })
15127
15169
  ]);
15128
15170
 
15129
15171
  // ../shared/src/prompts.ts
@@ -15304,19 +15346,19 @@ var UNKNOWN_EVENT_KIND = "update";
15304
15346
  var MOTHERSHIP_TURN_ERROR_SUMMARY = "Turn ended with an error.";
15305
15347
  var MOTHERSHIP_EVENT_TYPE = "multitask-event";
15306
15348
  var MOTHERSHIP_EVENT_MESSAGE_TYPE = "multitask_event";
15307
- var mothershipEventSchema = z25.object({
15308
- id: z25.string(),
15309
- at: z25.string(),
15310
- kind: z25.enum([...MOTHERSHIP_EVENT_KINDS, UNKNOWN_EVENT_KIND]),
15311
- agentId: z25.string(),
15312
- agentName: z25.string(),
15313
- summary: z25.string(),
15314
- detail: z25.string().optional(),
15349
+ var mothershipEventSchema = z26.object({
15350
+ id: z26.string(),
15351
+ at: z26.string(),
15352
+ kind: z26.enum([...MOTHERSHIP_EVENT_KINDS, UNKNOWN_EVENT_KIND]),
15353
+ agentId: z26.string(),
15354
+ agentName: z26.string(),
15355
+ summary: z26.string(),
15356
+ detail: z26.string().optional(),
15315
15357
  // Set when the subagent is a chat in this workspace rather than a ship; agentId is then that chat's id.
15316
- chatId: z25.string().optional(),
15317
- ticket: z25.object({ id: z25.string(), title: z25.string() }).optional(),
15358
+ chatId: z26.string().optional(),
15359
+ ticket: z26.object({ id: z26.string(), title: z26.string() }).optional(),
15318
15360
  // Set on events recorded before every kind woke the orchestrator, which were shown as a row when they happened.
15319
- noticed: z25.boolean().optional()
15361
+ noticed: z26.boolean().optional()
15320
15362
  });
15321
15363
  var TAG = "multitask_event";
15322
15364
  var BLOCK = new RegExp(`<${TAG}((?:\\s+\\w+="[^"]*")*)>\\n?([\\s\\S]*?)\\n?</${TAG}>`, "g");
@@ -16361,7 +16403,7 @@ function subagentReport(output) {
16361
16403
  }
16362
16404
 
16363
16405
  // ../shared/src/learned-skills.ts
16364
- import { z as z26 } from "zod";
16406
+ import { z as z27 } from "zod";
16365
16407
 
16366
16408
  // ../shared/src/frontmatter.ts
16367
16409
  import { parse as parseYaml } from "yaml";
@@ -16384,20 +16426,20 @@ function parseFrontmatter(content) {
16384
16426
  var LEARNED_SKILLS_ROOT = `${SANDBOX_PATHS.REPLICAS_DIR}/learned-skills`;
16385
16427
  var LEARNED_SKILLS_MANIFEST_PATH = `${LEARNED_SKILLS_ROOT}/manifest.json`;
16386
16428
  var LEARNED_SKILL_DIR_PREFIX = "replicas-learned__";
16387
- var learnedSkillsManifestSchema = z26.object({
16388
- skills: z26.array(z26.object({ name: z26.string(), sha256: z26.string() }))
16429
+ var learnedSkillsManifestSchema = z27.object({
16430
+ skills: z27.array(z27.object({ name: z27.string(), sha256: z27.string() }))
16389
16431
  });
16390
- var dreamVerdictChecksSchema = z26.object({
16391
- repeatable: z26.boolean(),
16392
- realInstruction: z26.boolean(),
16393
- noContradiction: z26.boolean(),
16394
- formatExact: z26.boolean(),
16395
- humanOnly: z26.boolean(),
16396
- actionable: z26.boolean(),
16397
- durable: z26.boolean()
16432
+ var dreamVerdictChecksSchema = z27.object({
16433
+ repeatable: z27.boolean(),
16434
+ realInstruction: z27.boolean(),
16435
+ noContradiction: z27.boolean(),
16436
+ formatExact: z27.boolean(),
16437
+ humanOnly: z27.boolean(),
16438
+ actionable: z27.boolean(),
16439
+ durable: z27.boolean()
16398
16440
  });
16399
16441
  var DREAM_VERDICT_CHECKS = dreamVerdictChecksSchema.keyof().options;
16400
- var dreamVerdictSchema = dreamVerdictChecksSchema.extend({ approve: z26.boolean(), reason: z26.string() });
16442
+ var dreamVerdictSchema = dreamVerdictChecksSchema.extend({ approve: z27.boolean(), reason: z27.string() });
16401
16443
  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."`;
16402
16444
 
16403
16445
  // ../shared/src/terminal.ts
@@ -16428,7 +16470,7 @@ function workspaceTargetFromToolOutput(output) {
16428
16470
  }
16429
16471
 
16430
16472
  // ../shared/src/mothership-board.ts
16431
- import { z as z27 } from "zod";
16473
+ import { z as z28 } from "zod";
16432
16474
  var MOTHERSHIP_TICKET_LIMITS = {
16433
16475
  title: 80,
16434
16476
  task: 1e3,
@@ -16448,78 +16490,78 @@ var MOTHERSHIP_TICKET_LIMITS = {
16448
16490
  };
16449
16491
  var L = MOTHERSHIP_TICKET_LIMITS;
16450
16492
  var tooLong = (max) => `At most ${max} characters. Keep it short; the user should take it in at a glance`;
16451
- var text3 = (max) => z27.string().trim().min(1).max(max, tooLong(max));
16452
- var clearable = (schema) => z27.union([schema, z27.literal("")]).optional();
16453
- var httpsUrl = z27.url({ protocol: /^https$/, error: "Must be an https URL" });
16493
+ var text3 = (max) => z28.string().trim().min(1).max(max, tooLong(max));
16494
+ var clearable = (schema) => z28.union([schema, z28.literal("")]).optional();
16495
+ var httpsUrl = z28.url({ protocol: /^https$/, error: "Must be an https URL" });
16454
16496
  var inlineMarkdown = "Markdown: **bold**, *italics*, `code`, [links](https://... or an absolute file path)";
16455
16497
  var markdown = `${inlineMarkdown} and line breaks.`;
16456
- var linearIdentifier = z27.string().regex(/^[A-Za-z][A-Za-z0-9]{0,9}-\d{1,7}$/, "Use a Linear identifier such as REP-123");
16457
- var mediaSchema = z27.object({
16498
+ var linearIdentifier = z28.string().regex(/^[A-Za-z][A-Za-z0-9]{0,9}-\d{1,7}$/, "Use a Linear identifier such as REP-123");
16499
+ var mediaSchema = z28.object({
16458
16500
  url: httpsUrl.describe("The URL `replicas media upload` printed."),
16459
16501
  caption: text3(L.caption).describe('What it shows, such as "After: the list stays pinned".'),
16460
- kind: z27.enum(["image", "video"]).describe("video for recordings, image for screenshots and GIFs.")
16502
+ kind: z28.enum(["image", "video"]).describe("video for recordings, image for screenshots and GIFs.")
16461
16503
  });
16462
- var questionSchema = z27.object({
16504
+ var questionSchema = z28.object({
16463
16505
  question: text3(L.question).describe("One question, with the context needed to answer it."),
16464
- options: z27.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.")
16506
+ options: z28.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.")
16465
16507
  });
16466
16508
  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.`);
16467
16509
  var mothershipTicketTaskSchema = text3(L.task);
16468
- var mothershipTicketMediaSchema = z27.array(mediaSchema);
16469
- var mothershipTicketQuestionsSchema = z27.array(questionSchema.extend({ id: z27.string() }));
16510
+ var mothershipTicketMediaSchema = z28.array(mediaSchema);
16511
+ var mothershipTicketQuestionsSchema = z28.array(questionSchema.extend({ id: z28.string() }));
16470
16512
  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.`);
16471
16513
  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.`);
16472
- var updateMothershipTicketRequestSchema = z27.object({
16514
+ var updateMothershipTicketRequestSchema = z28.object({
16473
16515
  title: mothershipTicketTitleSchema.optional(),
16474
16516
  issue: issueSchema,
16475
16517
  fix: fixSchema,
16476
- media: z27.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.`),
16477
- questions: z27.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.`),
16518
+ media: z28.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.`),
16519
+ questions: z28.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.`),
16478
16520
  blocked: clearable(text3(L.blocked)).describe('Why you cannot go on without the user, such as missing access. "" once unblocked.')
16479
16521
  });
16480
- var updateMothershipBoardRequestSchema = z27.object({
16522
+ var updateMothershipBoardRequestSchema = z28.object({
16481
16523
  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.`),
16482
- tickets: z27.array(z27.object({
16483
- id: z27.uuid(),
16524
+ tickets: z28.array(z28.object({
16525
+ id: z28.uuid(),
16484
16526
  title: mothershipTicketTitleSchema.optional(),
16485
16527
  issue: issueSchema,
16486
16528
  fix: fixSchema,
16487
- pull_requests: z27.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."),
16529
+ pull_requests: z28.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."),
16488
16530
  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.`),
16489
16531
  linear: clearable(linearIdentifier).describe('The Linear issue this ticket is for, such as REP-123. "" removes it.'),
16490
- archived: z27.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.")
16532
+ archived: z28.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.")
16491
16533
  })).max(50).optional().describe("Changes to existing tickets."),
16492
- order: z27.array(z27.uuid()).optional().describe("Ticket ids, most important first. Tickets left out keep their order after these."),
16493
- create: z27.array(z27.object({
16534
+ order: z28.array(z28.uuid()).optional().describe("Ticket ids, most important first. Tickets left out keep their order after these."),
16535
+ create: z28.array(z28.object({
16494
16536
  title: mothershipTicketTitleSchema,
16495
16537
  task: mothershipTicketTaskSchema.optional(),
16496
16538
  issue: text3(L.issue).optional(),
16497
- questions: z27.array(questionSchema).max(L.questions).optional(),
16539
+ questions: z28.array(questionSchema).max(L.questions).optional(),
16498
16540
  note: text3(L.note).optional()
16499
16541
  })).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.")
16500
16542
  });
16501
- var answerMothershipTicketRequestSchema = z27.object({
16502
- questionId: z27.string().min(1),
16543
+ var answerMothershipTicketRequestSchema = z28.object({
16544
+ questionId: z28.string().min(1),
16503
16545
  answer: text3(L.answer)
16504
16546
  });
16505
- var mothershipTicketAnswerRefSchema = z27.object({ mothershipId: z27.uuid(), ticketId: z27.uuid(), questionId: z27.string().min(1) });
16506
- var replyOnMothershipTicketRequestSchema = z27.object({
16547
+ var mothershipTicketAnswerRefSchema = z28.object({ mothershipId: z28.uuid(), ticketId: z28.uuid(), questionId: z28.string().min(1) });
16548
+ var replyOnMothershipTicketRequestSchema = z28.object({
16507
16549
  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.`),
16508
16550
  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.")
16509
16551
  });
16510
- var mothershipTicketReplyRefSchema = z27.object({ ticketId: z27.uuid(), text: text3(L.answer) });
16511
- var mothershipTicketThreadSchema = z27.array(z27.object({
16512
- id: z27.string(),
16513
- from: z27.enum(["user", "ship"]),
16514
- name: z27.string(),
16515
- ship_id: z27.string(),
16516
- chat_id: z27.string(),
16517
- text: z27.string(),
16518
- at: z27.string(),
16519
- nudge: z27.enum(["sent", "missed"]).optional()
16552
+ var mothershipTicketReplyRefSchema = z28.object({ ticketId: z28.uuid(), text: text3(L.answer) });
16553
+ var mothershipTicketThreadSchema = z28.array(z28.object({
16554
+ id: z28.string(),
16555
+ from: z28.enum(["user", "ship"]),
16556
+ name: z28.string(),
16557
+ ship_id: z28.string(),
16558
+ chat_id: z28.string(),
16559
+ text: z28.string(),
16560
+ at: z28.string(),
16561
+ nudge: z28.enum(["sent", "missed"]).optional()
16520
16562
  }));
16521
16563
  var LINEAR_ISSUE_SUMMARIES_MAX = 50;
16522
- var linearIssueSummariesRequestSchema = z27.object({ identifiers: z27.array(linearIdentifier).min(1).max(LINEAR_ISSUE_SUMMARIES_MAX) });
16564
+ var linearIssueSummariesRequestSchema = z28.object({ identifiers: z28.array(linearIdentifier).min(1).max(LINEAR_ISSUE_SUMMARIES_MAX) });
16523
16565
 
16524
16566
  // ../shared/src/user-message-matching.ts
16525
16567
  var parsedTimestamps = /* @__PURE__ */ new Map();
@@ -16889,10 +16931,10 @@ function currentStepLabel(messages, earlierPlainStep) {
16889
16931
  }
16890
16932
 
16891
16933
  // ../shared/src/user-message-attachments.ts
16892
- import { z as z28 } from "zod";
16934
+ import { z as z29 } from "zod";
16893
16935
  var ATTACHMENT_PLACEHOLDER_REGEX = /^\[\d+ (?:(?:images?|files?)(?: and \d+ files?)? attached|(?:image )?attachments?)\]$/;
16894
16936
  var withoutAttachmentPlaceholder = (content, attached) => attached && ATTACHMENT_PLACEHOLDER_REGEX.test(content) ? "" : content;
16895
- var annotationLinesSchema = z28.object({ path: z28.string(), start: z28.number(), end: z28.number() });
16937
+ var annotationLinesSchema = z29.object({ path: z29.string(), start: z29.number(), end: z29.number() });
16896
16938
  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".';
16897
16939
  var ANNOTATIONS_NOTE_REGEX = /(?:^|\n\n)<replicas_annotations>\n([\s\S]*?)\n<\/replicas_annotations>$/;
16898
16940
  var ANNOTATION_HEADER_REGEX = /^Annotation \d+$/m;
@@ -20189,7 +20231,7 @@ var VOICE_WAVEFORM = {
20189
20231
  };
20190
20232
 
20191
20233
  // ../shared/src/e2b.ts
20192
- var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-11-15-v7";
20234
+ var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-11-15-v9";
20193
20235
 
20194
20236
  // ../shared/src/e2b-retry.ts
20195
20237
  var DEFAULT_BACKOFFS_MS = [2e3, 5e3];
@@ -20544,6 +20586,55 @@ function resolveWarmHookConfig(value) {
20544
20586
  return resolveHookConfig(parseWarmHookConfig(value));
20545
20587
  }
20546
20588
 
20589
+ // ../shared/src/environment-config.ts
20590
+ import { z as z30 } from "zod";
20591
+ var variableNameSchema = z30.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name");
20592
+ var mcpValueSchema = z30.union([
20593
+ z30.string(),
20594
+ environmentMcpVariableReferenceSchema
20595
+ ]);
20596
+ var mcpValuesSchema = z30.record(z30.string(), mcpValueSchema);
20597
+ var httpConfigSchema = environmentMcpHttpConfigSchema.pick({ url: true, auth: true }).extend({
20598
+ headers: mcpValuesSchema.default({})
20599
+ }).strict();
20600
+ var replicasMcpDefinitionSchema = z30.discriminatedUnion("transport", [
20601
+ z30.strictObject({
20602
+ transport: z30.literal("stdio"),
20603
+ config: environmentMcpStdioConfigSchema.pick({ command: true }).extend({
20604
+ args: environmentMcpStdioConfigSchema.shape.args.unwrap().default([]),
20605
+ env: z30.record(variableNameSchema, mcpValueSchema).default({})
20606
+ }).strict()
20607
+ }),
20608
+ z30.strictObject({ transport: z30.literal("http"), config: httpConfigSchema }),
20609
+ z30.strictObject({ transport: z30.literal("sse"), config: httpConfigSchema })
20610
+ ]).superRefine((definition, context) => {
20611
+ if (definition.transport === "stdio") return;
20612
+ const result = validateEnvironmentMcpAuthentication(definition.transport, definition.config);
20613
+ if (!result.ok) context.addIssue({ code: "custom", path: result.error.code === "transport" ? ["transport"] : ["config", result.error.code ?? "auth"], message: result.error.message });
20614
+ });
20615
+ var replicasEnvironmentConfigSchema = z30.strictObject({
20616
+ systemPrompt: z30.string().optional(),
20617
+ warmHook: z30.string().optional(),
20618
+ startHook: z30.string().optional(),
20619
+ variables: z30.record(variableNameSchema, z30.string()).optional(),
20620
+ requiredSecrets: z30.array(variableNameSchema).optional(),
20621
+ mcps: z30.record(z30.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()
20622
+ }).superRefine((config, context) => {
20623
+ const names = /* @__PURE__ */ new Set();
20624
+ for (const name of Object.keys(config.mcps ?? {})) {
20625
+ const normalized = name.toLowerCase();
20626
+ if (names.has(normalized)) {
20627
+ context.addIssue({ code: "custom", path: ["mcps", name], message: "MCP names must be unique regardless of case" });
20628
+ }
20629
+ names.add(normalized);
20630
+ }
20631
+ for (const key of config.requiredSecrets ?? []) {
20632
+ if (config.variables && Object.hasOwn(config.variables, key)) {
20633
+ context.addIssue({ code: "custom", path: ["requiredSecrets"], message: `"${key}" cannot also be declared as a non-secret variable` });
20634
+ }
20635
+ }
20636
+ });
20637
+
20547
20638
  // ../shared/src/replicas-config.ts
20548
20639
  var REPLICAS_CONFIG_FILENAMES = ["replicas.json", "replicas.yaml", "replicas.yml"];
20549
20640
  function isRecord4(value) {
@@ -20585,6 +20676,14 @@ function parseReplicasConfig(value, filename = "replicas.json") {
20585
20676
  if ("warmHook" in value) {
20586
20677
  config.warmHook = parseWarmHookConfig(value.warmHook, filename);
20587
20678
  }
20679
+ if ("environment" in value) {
20680
+ const parsed = replicasEnvironmentConfigSchema.safeParse(value.environment);
20681
+ if (!parsed.success) {
20682
+ const issue = parsed.error.issues[0];
20683
+ throw new Error(`Invalid ${filename}: "environment${issue.path.length ? `.${issue.path.join(".")}` : ""}" ${issue.message}`);
20684
+ }
20685
+ config.environment = parsed.data;
20686
+ }
20588
20687
  return config;
20589
20688
  }
20590
20689
  function parseReplicasConfigString(content, filename) {
@@ -20672,10 +20771,10 @@ function hasChatStarted(chat) {
20672
20771
  }
20673
20772
 
20674
20773
  // ../shared/src/routes/billing.ts
20675
- import { z as z29 } from "zod";
20774
+ import { z as z31 } from "zod";
20676
20775
  var SOURCE_LIMIT_SOURCES = ["limrun", "modal"];
20677
- var usageLimitCentsSchema = z29.number().int().min(100).max(1e8);
20678
- var sourceLimitsCentsSchema = z29.partialRecord(z29.enum(SOURCE_LIMIT_SOURCES), usageLimitCentsSchema);
20776
+ var usageLimitCentsSchema = z31.number().int().min(100).max(1e8);
20777
+ var sourceLimitsCentsSchema = z31.partialRecord(z31.enum(SOURCE_LIMIT_SOURCES), usageLimitCentsSchema);
20679
20778
 
20680
20779
  // ../shared/src/routes/codex.ts
20681
20780
  var CODEX_AUTH_ENV_KEYS = [
@@ -20829,7 +20928,7 @@ var CLAUDE_AUTH_ENV_KEYS_BY_METHOD = {
20829
20928
  };
20830
20929
 
20831
20930
  // ../shared/src/routes/command-protection.ts
20832
- import { z as z30 } from "zod";
20931
+ import { z as z32 } from "zod";
20833
20932
 
20834
20933
  // ../shared/src/git-invocations.ts
20835
20934
  var COMMIT_VALUE_OPTIONS = /* @__PURE__ */ new Set(["message", "file", "trailer", "reuse-message", "reedit-message", "fixup", "squash", "template", "author", "date", "cleanup", "pathspec-from-file"]);
@@ -20920,27 +21019,27 @@ function findCheckoutTarget(args) {
20920
21019
  }
20921
21020
 
20922
21021
  // ../shared/src/routes/command-protection.ts
20923
- var commandProtectionRepoStateSchema = z30.object({
20924
- branch: z30.string().nullable(),
20925
- defaultBranch: z30.string().nullable(),
20926
- pushBranch: z30.string().nullable(),
20927
- pushConfig: z30.string().nullable(),
20928
- headMessage: z30.string().nullable(),
20929
- mergeInProgress: z30.boolean().optional()
21022
+ var commandProtectionRepoStateSchema = z32.object({
21023
+ branch: z32.string().nullable(),
21024
+ defaultBranch: z32.string().nullable(),
21025
+ pushBranch: z32.string().nullable(),
21026
+ pushConfig: z32.string().nullable(),
21027
+ headMessage: z32.string().nullable(),
21028
+ mergeInProgress: z32.boolean().optional()
20930
21029
  });
20931
- var commandProtectionEvaluateRequestSchema = z30.object({
20932
- provider: z30.enum(["claude", "codex", "cursor", "opencode", "pi"]),
20933
- source: z30.enum(["claude_pre_tool_use", "codex_approval_request", "cursor_pre_tool_use", "opencode_pre_tool_use", "pi_tool_call"]),
20934
- toolName: z30.string(),
20935
- toolInput: z30.unknown(),
20936
- command: z30.string().nullish(),
20937
- cwd: z30.string().nullish(),
20938
- toolUseId: z30.string().nullish(),
21030
+ var commandProtectionEvaluateRequestSchema = z32.object({
21031
+ provider: z32.enum(["claude", "codex", "cursor", "opencode", "pi"]),
21032
+ source: z32.enum(["claude_pre_tool_use", "codex_approval_request", "cursor_pre_tool_use", "opencode_pre_tool_use", "pi_tool_call"]),
21033
+ toolName: z32.string(),
21034
+ toolInput: z32.unknown(),
21035
+ command: z32.string().nullish(),
21036
+ cwd: z32.string().nullish(),
21037
+ toolUseId: z32.string().nullish(),
20939
21038
  // Read by the engine before the command runs, keyed by absolute path, so the
20940
21039
  // policy can see branches and commit messages the command text only references.
20941
- gitContext: z30.object({
20942
- repos: z30.record(z30.string(), commandProtectionRepoStateSchema),
20943
- messageFiles: z30.record(z30.string(), z30.string())
21040
+ gitContext: z32.object({
21041
+ repos: z32.record(z32.string(), commandProtectionRepoStateSchema),
21042
+ messageFiles: z32.record(z32.string(), z32.string())
20944
21043
  }).optional()
20945
21044
  });
20946
21045
  var COMMAND_PROTECTION_COMMAND_KEYS = ["command", "cmd", "script", "query", "endpoint", "path", "url", "mutation"];
@@ -21161,122 +21260,125 @@ function shouldRefreshPullRequests(toolName, toolInput) {
21161
21260
  }
21162
21261
 
21163
21262
  // ../shared/src/routes/scout.ts
21164
- import { z as z31 } from "zod";
21263
+ import { z as z33 } from "zod";
21165
21264
  var SCOUT_LINEAR_ACTIONS = ["ask", "start"];
21166
- var scoutLinearSessionIntentRequestSchema = z31.object({
21167
- comment_id: z31.string().trim().min(1).describe("Id of the Linear comment the session will be created on."),
21168
- action: z31.enum(SCOUT_LINEAR_ACTIONS).describe("`ask` when the comment is a clarifying question, `start` when it hands off the task.")
21265
+ var scoutLinearSessionIntentRequestSchema = z33.object({
21266
+ comment_id: z33.string().trim().min(1).describe("Id of the Linear comment the session will be created on."),
21267
+ action: z33.enum(SCOUT_LINEAR_ACTIONS).describe("`ask` when the comment is a clarifying question, `start` when it hands off the task.")
21169
21268
  });
21170
- var scoutLinearStartRequestSchema = z31.object({
21171
- issue_id: z31.string().describe("Linear issue id from the envelope's `issue_id`."),
21172
- agent_session_id: z31.string().describe("Existing Linear agent session id from the envelope's `agent_session_id`."),
21173
- prompt: z31.string().trim().min(1).describe("The latest request, in its author's words. The workspace already receives the issue and its comments.")
21269
+ var scoutLinearStartRequestSchema = z33.object({
21270
+ issue_id: z33.string().describe("Linear issue id from the envelope's `issue_id`."),
21271
+ agent_session_id: z33.string().describe("Existing Linear agent session id from the envelope's `agent_session_id`."),
21272
+ prompt: z33.string().trim().min(1).describe("The latest request, in its author's words. The workspace already receives the issue and its comments.")
21174
21273
  });
21175
- var scoutRouteLinearTicketRequestSchema = z31.object({
21176
- agent_session_id: z31.string().trim().min(1).describe("The ticket's `agent_session_id` from the envelope."),
21177
- environment_id: z31.string().trim().min(1).optional().describe("Start the ticket in this environment."),
21178
- mothership_id: z31.string().trim().min(1).optional().describe("Hand the ticket to this Mothership instead.")
21274
+ var scoutRouteLinearTicketRequestSchema = z33.object({
21275
+ agent_session_id: z33.string().trim().min(1).describe("The ticket's `agent_session_id` from the envelope."),
21276
+ environment_id: z33.string().trim().min(1).optional().describe("Start the ticket in this environment."),
21277
+ mothership_id: z33.string().trim().min(1).optional().describe("Hand the ticket to this Mothership instead.")
21179
21278
  }).refine((args) => !(args.environment_id && args.mothership_id), "Pass environment_id or mothership_id, not both.");
21180
- var slackChannelIdSchema = z31.string().describe("Slack channel id from the envelope's `channel_id`.");
21181
- var slackThreadTsSchema = z31.string().describe("Slack thread timestamp from the envelope's `thread_ts`.");
21182
- var scoutSlackMessageReferenceSchema = z31.object({
21279
+ var slackChannelIdSchema = z33.string().describe("Slack channel id from the envelope's `channel_id`.");
21280
+ var slackThreadTsSchema = z33.string().describe("Slack thread timestamp from the envelope's `thread_ts`.");
21281
+ var scoutSlackMessageReferenceSchema = z33.object({
21183
21282
  channel_id: slackChannelIdSchema,
21184
21283
  thread_ts: slackThreadTsSchema,
21185
- message_ts: z31.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
21186
- user_id: z31.string().describe("Slack user id of that message's author (the envelope's `user_id`).")
21284
+ message_ts: z33.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
21285
+ user_id: z33.string().describe("Slack user id of that message's author (the envelope's `user_id`).")
21187
21286
  });
21188
- var scoutSlackSpawnRequestSchema = z31.object({
21287
+ var scoutSlackSpawnRequestSchema = z33.object({
21189
21288
  channel_id: slackChannelIdSchema,
21190
21289
  thread_ts: slackThreadTsSchema,
21191
- message_ts: z31.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."),
21192
- user_id: z31.string().describe("Slack user id of that message's author (the envelope's `user_id`). The workspace is attributed to them."),
21193
- prompt: z31.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."),
21194
- acknowledgement_ts: z31.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."),
21195
- environment_id: z31.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.`)
21290
+ message_ts: z33.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."),
21291
+ user_id: z33.string().describe("Slack user id of that message's author (the envelope's `user_id`). The workspace is attributed to them."),
21292
+ prompt: z33.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."),
21293
+ acknowledgement_ts: z33.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."),
21294
+ environment_id: z33.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.`)
21196
21295
  });
21197
21296
  var scoutSlackSpawnInNewThreadRequestSchema = scoutSlackSpawnRequestSchema.extend({
21198
- title: z31.string().trim().min(1).max(500).describe("One or two sentences stating the task, posted as the new top-level message."),
21199
- prompt: z31.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."),
21200
- acknowledgement_ts: z31.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.")
21297
+ title: z33.string().trim().min(1).max(500).describe("One or two sentences stating the task, posted as the new top-level message."),
21298
+ prompt: z33.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."),
21299
+ acknowledgement_ts: z33.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.")
21201
21300
  });
21202
- var scoutSlackRelayRequestSchema = z31.object({
21301
+ var scoutSlackRelayRequestSchema = z33.object({
21203
21302
  channel_id: slackChannelIdSchema,
21204
21303
  thread_ts: slackThreadTsSchema,
21205
- message: z31.string().describe("The follow-up to deliver: every fresh message that belongs to this update, in its author's words, with no research, plan, or guesses added. When forwarding to a `workspace_id` other than the thread's own workspace, also quote exactly the thread messages the request points to (\"forward this\"), since that workspace gets only this message."),
21206
- user_id: z31.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`."),
21207
- queue: z31.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."),
21208
- workspace_id: z31.string().optional().describe(`Existing workspace id, from \`${REPLICAS_MCP_TOOLS.listWorkspaces}\` or a workspace link in the thread, to bind a thread without a workspace to before relaying. The author must be able to see it. Binding a Mothership gives it the person's own Slack message and the thread instead of \`message\`. In a thread already bound to a different workspace, or in a Mothership's channel, nothing is bound: the workspace or Mothership gets only \`message\`, once, with a link back to Slack, and the thread stays where it is. Omit to relay into the thread's own workspace.`),
21209
- message_ts: z31.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.")
21304
+ message: z33.string().describe("The follow-up to deliver: every fresh message that belongs to this update, in its author's words, with no research, plan, or guesses added. When forwarding to a `workspace_id` other than the thread's own workspace, also quote exactly the thread messages the request points to (\"forward this\"), since that workspace gets only this message."),
21305
+ user_id: z33.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`."),
21306
+ queue: z33.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."),
21307
+ workspace_id: z33.string().optional().describe(`Existing workspace id, from \`${REPLICAS_MCP_TOOLS.listWorkspaces}\` or a workspace link in the thread, to bind a thread without a workspace to before relaying. The author must be able to see it. Binding a Mothership gives it the person's own Slack message and the thread instead of \`message\`. In a thread already bound to a different workspace, or in a Mothership's channel, nothing is bound: the workspace or Mothership gets only \`message\`, once, with a link back to Slack, and the thread stays where it is. Omit to relay into the thread's own workspace.`),
21308
+ message_ts: z33.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.")
21210
21309
  });
21211
- var scoutSlackSetThreadMutedRequestSchema = z31.object({
21310
+ var scoutSlackSetThreadMutedRequestSchema = z33.object({
21212
21311
  channel_id: slackChannelIdSchema,
21213
21312
  thread_ts: slackThreadTsSchema,
21214
- muted: z31.boolean().describe("true to mute Replicas in this thread, false to unmute it.")
21313
+ muted: z33.boolean().describe("true to mute Replicas in this thread, false to unmute it.")
21215
21314
  });
21216
21315
  var scoutSlackStopWorkspaceRequestSchema = scoutSlackMessageReferenceSchema.extend({
21217
- archive: z31.boolean().describe("true only when the person also asked to close or archive the workspace.")
21316
+ archive: z33.boolean().describe("true only when the person also asked to close or archive the workspace.")
21218
21317
  });
21219
- var scoutListWorkspacesRequestSchema = z31.object({
21318
+ var scoutListWorkspacesRequestSchema = z33.object({
21220
21319
  channel_id: slackChannelIdSchema,
21221
21320
  thread_ts: slackThreadTsSchema,
21222
- message_ts: z31.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
21223
- user_id: z31.string().describe("Slack user id of that message's author (the envelope's `user_id`). Only workspaces they can see are listed."),
21224
- query: z31.string().trim().min(1).optional().describe("Case-insensitive text to match against workspace and Mothership names and pull request URLs.")
21321
+ message_ts: z33.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
21322
+ user_id: z33.string().describe("Slack user id of that message's author (the envelope's `user_id`). Only workspaces they can see are listed."),
21323
+ query: z33.string().trim().min(1).optional().describe("Case-insensitive text to match against workspace and Mothership names and pull request URLs.")
21225
21324
  });
21226
- var scoutSlackConfirmationSchema = z31.object({
21227
- confirmation_channel_id: z31.string().describe("`channel_id` from the envelope of the Slack message that asked for or accepted this."),
21228
- confirmation_thread_ts: z31.string().describe("`thread_ts` from that message's envelope."),
21229
- confirmation_message_ts: z31.string().describe("`message_ts` from that message's envelope."),
21230
- confirmation_user_id: z31.string().describe("`user_id` from that message's envelope.")
21325
+ var scoutSlackConfirmationSchema = z33.object({
21326
+ confirmation_channel_id: z33.string().describe("`channel_id` from the envelope of the Slack message that asked for or accepted this."),
21327
+ confirmation_thread_ts: z33.string().describe("`thread_ts` from that message's envelope."),
21328
+ confirmation_message_ts: z33.string().describe("`message_ts` from that message's envelope."),
21329
+ confirmation_user_id: z33.string().describe("`user_id` from that message's envelope.")
21231
21330
  });
21232
21331
  var scoutAutomationToolInputSchema = automationToolInputSchema.extend(scoutSlackConfirmationSchema.shape);
21233
21332
  var scoutSaveChannelPresetToolInputSchema = scoutSlackConfirmationSchema.extend({
21234
- preset_id: z31.string().optional().describe(`Id of the preset to update, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`. Omit to create a new preset.`),
21235
- name: z31.string().trim().min(1).max(SCOUT_PRESET_NAME_MAX_LENGTH).optional().describe("Preset name. Required when creating."),
21236
- description: z31.string().optional().describe("One-line summary of what the preset is for."),
21237
- icon: z31.enum(SCOUT_PRESET_ICONS).optional(),
21238
- instructions: z31.string().optional().describe("Complete preset instructions; replaces the existing text. Required when creating.")
21333
+ preset_id: z33.string().optional().describe(`Id of the preset to update, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`. Omit to create a new preset.`),
21334
+ name: z33.string().trim().min(1).max(SCOUT_PRESET_NAME_MAX_LENGTH).optional().describe("Preset name. Required when creating."),
21335
+ description: z33.string().optional().describe("One-line summary of what the preset is for."),
21336
+ icon: z33.enum(SCOUT_PRESET_ICONS).optional(),
21337
+ instructions: z33.string().optional().describe("Complete preset instructions; replaces the existing text. Required when creating.")
21239
21338
  });
21240
21339
  var scoutUpdateChannelSettingsToolInputSchema = scoutSlackConfirmationSchema.extend({
21241
- source: z31.enum(SCOUT_SOURCE_TYPES).optional().describe("Defaults to `slack`."),
21242
- external_id: z31.string().describe("Slack channel id or Linear team id."),
21243
- monitored: z31.boolean().optional().describe("Linear: `true` starts monitoring the team (organization admins only), `false` stops. Slack: kept for older callers; prefer `proactivity`. `false` means `tagged`, and `true` lifts a `tagged` channel back to the organization's level. Omit to keep it."),
21244
- preset_id: z31.string().nullable().optional().describe("Preset to assign; `null` removes the preset. Omit to keep it."),
21245
- instructions: z31.string().nullable().optional().describe("Complete channel-specific instructions, applied after the preset; replaces the existing text. `null` clears them. Omit to keep them."),
21246
- proactivity: z31.enum([...SCOUT_PROACTIVITY_LEVELS, "organization"]).optional().describe("Slack only: this channel's or group DM's own level, overriding the organization's here alone. `organization` makes it follow the organization's level again. Omit to keep it. 1:1 DMs are always addressed to Replicas, so they take no level."),
21247
- muted: z31.enum(["on", "off", "default"]).optional().describe(`Slack only, organization admins only: \`on\` mutes Replicas in this channel, \`off\` unmutes it here, \`default\` follows the Slack Connect default from \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\`. Omit to keep it.`)
21340
+ source: z33.enum(SCOUT_SOURCE_TYPES).optional().describe("Defaults to `slack`."),
21341
+ external_id: z33.string().describe("Slack channel id or Linear team id."),
21342
+ monitored: z33.boolean().optional().describe("Linear: `true` starts monitoring the team (organization admins only), `false` stops. Slack: kept for older callers; prefer `proactivity`. `false` means `tagged`, and `true` lifts a `tagged` channel back to the organization's level. Omit to keep it."),
21343
+ preset_id: z33.string().nullable().optional().describe("Preset to assign; `null` removes the preset. Omit to keep it."),
21344
+ instructions: z33.string().nullable().optional().describe("Complete channel-specific instructions, applied after the preset; replaces the existing text. `null` clears them. Omit to keep them."),
21345
+ proactivity: z33.enum([...SCOUT_PROACTIVITY_LEVELS, "organization"]).optional().describe("Slack only: this channel's or group DM's own level, overriding the organization's here alone. `organization` makes it follow the organization's level again. Omit to keep it. 1:1 DMs are always addressed to Replicas, so they take no level."),
21346
+ silent: z33.enum(["on", "off", "default"]).optional().describe(`Slack only, organization admins only: \`on\` puts this channel in silent mode, where Replicas reads it and follows its instructions but never posts, reacts, or starts work there. \`off\` turns silent mode off here, \`default\` follows the Slack Connect default from \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\`. Omit to keep it.`),
21347
+ muted: z33.enum(["on", "off", "default"]).optional().describe("Kept for older callers; prefer `silent`.")
21248
21348
  });
21249
21349
  var mothershipSlackChannelLevelToolInputSchema = scoutSlackConfirmationSchema.extend({
21250
21350
  proactivity: scoutUpdateChannelSettingsToolInputSchema.shape.proactivity.unwrap().describe("This channel's own level. `organization` makes it follow the organization's level again, which a Mothership's channel raises to at least `balanced`.")
21251
21351
  });
21252
21352
  var scoutSetSlackConnectMutedToolInputSchema = scoutSlackConfirmationSchema.extend({
21253
- muted: z31.boolean().describe("`true` mutes Replicas in every Slack Connect channel without its own setting; `false` lets them follow their levels again.")
21353
+ muted: z33.boolean().describe("`true` puts every Slack Connect channel without its own setting in silent mode; `false` lets them follow their levels again.")
21254
21354
  });
21255
- var scoutSetSlackConnectDefaultsToolInputSchema = scoutSetSlackConnectMutedToolInputSchema.partial({ muted: true }).extend({
21256
- preset_id: z31.string().optional().describe("Preset for every Slack Connect channel without its own preset or instructions; an empty string removes it. Omit to keep it."),
21257
- instructions: z31.string().optional().describe("Complete default instructions, applied after that preset; replaces the existing text. An empty string clears them. Omit to keep them."),
21258
- proactivity: z31.enum([...SCOUT_PROACTIVITY_LEVELS, "default"]).optional().describe("Level for every Slack Connect channel without its own level. `default` returns them to `tagged`. Omit to keep it.")
21355
+ var scoutSetSlackConnectDefaultsToolInputSchema = scoutSlackConfirmationSchema.extend({
21356
+ silent: z33.boolean().optional().describe("`true` puts every Slack Connect channel without its own setting in silent mode; `false` lets them follow their levels again. Omit to keep it."),
21357
+ muted: z33.boolean().optional().describe("Kept for older callers; prefer `silent`."),
21358
+ preset_id: z33.string().optional().describe("Preset for every Slack Connect channel without its own preset or instructions; an empty string removes it. Omit to keep it."),
21359
+ instructions: z33.string().optional().describe("Complete default instructions, applied after that preset; replaces the existing text. An empty string clears them. Omit to keep them."),
21360
+ proactivity: z33.enum([...SCOUT_PROACTIVITY_LEVELS, "default"]).optional().describe("Level for every Slack Connect channel without its own level. `default` returns them to `tagged`. Omit to keep it.")
21259
21361
  });
21260
21362
  var scoutSetOrganizationProactivityToolInputSchema = scoutSlackConfirmationSchema.extend({
21261
- proactivity: z31.enum(SCOUT_PROACTIVITY_LEVELS).describe(`The level every Slack channel and group DM follows unless it has its own. Slack Connect channels without their own level follow the shared-channel default from \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\` instead.`)
21363
+ proactivity: z33.enum(SCOUT_PROACTIVITY_LEVELS).describe(`The level every Slack channel and group DM follows unless it has its own. Slack Connect channels without their own level follow the shared-channel default from \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\` instead.`)
21262
21364
  });
21263
21365
  var scoutDeleteChannelPresetToolInputSchema = scoutSlackConfirmationSchema.extend({
21264
- preset_id: z31.string().describe(`Id of the preset to delete, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`.`)
21366
+ preset_id: z33.string().describe(`Id of the preset to delete, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`.`)
21265
21367
  });
21266
21368
  var RESET_TO_DEFAULT = "default";
21267
- var resettable = (schema, description) => z31.union([schema, z31.literal(RESET_TO_DEFAULT)]).optional().describe(`${description} \`${RESET_TO_DEFAULT}\` falls back to the organization default. Omit to keep it.`);
21369
+ var resettable = (schema, description) => z33.union([schema, z33.literal(RESET_TO_DEFAULT)]).optional().describe(`${description} \`${RESET_TO_DEFAULT}\` falls back to the organization default. Omit to keep it.`);
21268
21370
  var scoutSetSlackAgentDefaultsToolInputSchema = scoutSlackConfirmationSchema.extend({
21269
- agent_provider: resettable(z31.enum(AGENT), "Agent for Slack-triggered workspaces. Changing it without `model` resets the model to that agent's default."),
21270
- model: resettable(z31.string(), "Model id for that agent; the default is the agent's own."),
21271
- thinking_level: resettable(z31.enum(VALID_THINKING_LEVELS), "Thinking level."),
21272
- goal_mode: resettable(z31.boolean(), "Goal mode."),
21273
- fast_mode: resettable(z31.boolean(), "Fast mode.")
21371
+ agent_provider: resettable(z33.enum(AGENT), "Agent for Slack-triggered workspaces. Changing it without `model` resets the model to that agent's default."),
21372
+ model: resettable(z33.string(), "Model id for that agent; the default is the agent's own."),
21373
+ thinking_level: resettable(z33.enum(VALID_THINKING_LEVELS), "Thinking level."),
21374
+ goal_mode: resettable(z33.boolean(), "Goal mode."),
21375
+ fast_mode: resettable(z33.boolean(), "Fast mode.")
21274
21376
  });
21275
- var scoutClaimSettingsOfferToolInputSchema = z31.object({
21377
+ var scoutClaimSettingsOfferToolInputSchema = z33.object({
21276
21378
  channel_id: slackChannelIdSchema,
21277
- kind: z31.enum(SCOUT_SETTINGS_OFFERS).describe("`proactivity`: offering a lower level after frustration. `raise_proactivity`: offering a higher level after someone had to @mention you. `instructions`: offering channel instructions or a preset. `organization_proactivity` and `raise_organization_proactivity`: offering to lower or raise the workspace default; only decline them, the server claims them for you."),
21278
- user_id: z31.string().optional().describe("The envelope's `user_id`. Required for `proactivity` and `raise_proactivity`, so the server can say whether they are an organization admin."),
21279
- declined: z31.boolean().optional().describe("true when the person declined an offer you already made, so it is not made again.")
21379
+ kind: z33.enum(SCOUT_SETTINGS_OFFERS).describe("`proactivity`: offering a lower level after frustration. `raise_proactivity`: offering a higher level after someone had to @mention you. `instructions`: offering channel instructions or a preset. `organization_proactivity` and `raise_organization_proactivity`: offering to lower or raise the workspace default; only decline them, the server claims them for you."),
21380
+ user_id: z33.string().optional().describe("The envelope's `user_id`. Required for `proactivity` and `raise_proactivity`, so the server can say whether they are an organization admin."),
21381
+ declined: z33.boolean().optional().describe("true when the person declined an offer you already made, so it is not made again.")
21280
21382
  });
21281
21383
 
21282
21384
  // ../shared/src/routes/plugin-catalog.ts
@@ -21634,22 +21736,22 @@ var PLUGIN_CATALOG = [
21634
21736
  ].map((plugin) => ({ ...plugin, readOnlyScopes: READ_ONLY_SCOPES[plugin.id] }));
21635
21737
 
21636
21738
  // ../shared/src/routes/sentry.ts
21637
- import { z as z32 } from "zod";
21638
- var sentrySelfHostedConnectRequestSchema = z32.object({
21639
- baseUrl: z32.string().min(1),
21640
- token: z32.string().trim().min(1),
21641
- webhookSecret: z32.string().trim().optional()
21739
+ import { z as z34 } from "zod";
21740
+ var sentrySelfHostedConnectRequestSchema = z34.object({
21741
+ baseUrl: z34.string().min(1),
21742
+ token: z34.string().trim().min(1),
21743
+ webhookSecret: z34.string().trim().optional()
21642
21744
  });
21643
21745
 
21644
21746
  // ../shared/src/routes/user.ts
21645
21747
  var PROFILE_AVATAR_MAX_SIZE_BYTES = 5 * 1024 * 1024;
21646
21748
 
21647
21749
  // ../shared/src/routes/web-auth.ts
21648
- import { z as z33 } from "zod";
21649
- var webAuthRedeemResponseSchema = z33.object({
21650
- path: z33.string(),
21651
- organizationId: z33.string().nullable(),
21652
- session: z33.object({ access_token: z33.string(), refresh_token: z33.string(), user: z33.object({ id: z33.string(), email: z33.string() }) }).nullable()
21750
+ import { z as z35 } from "zod";
21751
+ var webAuthRedeemResponseSchema = z35.object({
21752
+ path: z35.string(),
21753
+ organizationId: z35.string().nullable(),
21754
+ session: z35.object({ access_token: z35.string(), refresh_token: z35.string(), user: z35.object({ id: z35.string(), email: z35.string() }) }).nullable()
21653
21755
  });
21654
21756
 
21655
21757
  // ../shared/src/routes/client-state.ts
@@ -21674,104 +21776,104 @@ var promptHistoryClientStateKey = orgUserClientStateKey(PROMPT_HISTORY_CLIENT_ST
21674
21776
  var workspaceSearchOpensClientStateKey = orgUserClientStateKey(WORKSPACE_SEARCH_OPENS_CLIENT_STATE_KEY_PREFIX);
21675
21777
 
21676
21778
  // ../shared/src/routes/workspace-events.ts
21677
- import { z as z35 } from "zod";
21779
+ import { z as z37 } from "zod";
21678
21780
 
21679
21781
  // ../shared/src/routes/presence.ts
21680
- import { z as z34 } from "zod";
21681
- var presenceStatusSchema = z34.enum(["online", "typing"]);
21682
- var presenceLocationSchema = z34.object({
21683
- workspaceId: z34.string().optional()
21782
+ import { z as z36 } from "zod";
21783
+ var presenceStatusSchema = z36.enum(["online", "typing"]);
21784
+ var presenceLocationSchema = z36.object({
21785
+ workspaceId: z36.string().optional()
21684
21786
  });
21685
- var presenceEntrySchema = z34.object({
21686
- userId: z34.string(),
21787
+ var presenceEntrySchema = z36.object({
21788
+ userId: z36.string(),
21687
21789
  status: presenceStatusSchema,
21688
21790
  location: presenceLocationSchema,
21689
- ts: z34.string()
21791
+ ts: z36.string()
21690
21792
  });
21691
- var updatePresenceRequestSchema = z34.object({
21793
+ var updatePresenceRequestSchema = z36.object({
21692
21794
  status: presenceStatusSchema,
21693
21795
  location: presenceLocationSchema.optional()
21694
21796
  });
21695
21797
 
21696
21798
  // ../shared/src/routes/workspace-events.ts
21697
- var workspaceTurnCompletionSchema = z35.object({
21698
- workspaceName: z35.string(),
21699
- completedAt: z35.string(),
21700
- processing: z35.boolean().optional(),
21701
- pullRequestFeedback: z35.boolean().optional(),
21702
- attention: z35.object({ reason: z35.enum(CHAT_ATTENTION_REASONS), userId: z35.string() }).optional()
21799
+ var workspaceTurnCompletionSchema = z37.object({
21800
+ workspaceName: z37.string(),
21801
+ completedAt: z37.string(),
21802
+ processing: z37.boolean().optional(),
21803
+ pullRequestFeedback: z37.boolean().optional(),
21804
+ attention: z37.object({ reason: z37.enum(CHAT_ATTENTION_REASONS), userId: z37.string() }).optional()
21703
21805
  });
21704
- var workspaceEventSchemaByType = z35.discriminatedUnion("type", [
21705
- z35.object({
21706
- type: z35.literal("workspace.changed"),
21707
- workspaceId: z35.string(),
21708
- accessChangedFor: z35.string().optional(),
21709
- accessChangedForOrg: z35.literal(true).optional(),
21710
- workspace: z35.object({ status: z35.enum(WORKSPACE_STATUSES), last_activity_at: z35.string().nullable() }).optional(),
21711
- name: z35.string().optional(),
21806
+ var workspaceEventSchemaByType = z37.discriminatedUnion("type", [
21807
+ z37.object({
21808
+ type: z37.literal("workspace.changed"),
21809
+ workspaceId: z37.string(),
21810
+ accessChangedFor: z37.string().optional(),
21811
+ accessChangedForOrg: z37.literal(true).optional(),
21812
+ workspace: z37.object({ status: z37.enum(WORKSPACE_STATUSES), last_activity_at: z37.string().nullable() }).optional(),
21813
+ name: z37.string().optional(),
21712
21814
  completion: workspaceTurnCompletionSchema.optional(),
21713
- ts: z35.string()
21815
+ ts: z37.string()
21714
21816
  }),
21715
- z35.object({
21716
- type: z35.literal("workspace.chat.changed"),
21717
- workspaceId: z35.string(),
21718
- chatId: z35.string(),
21719
- ts: z35.string()
21817
+ z37.object({
21818
+ type: z37.literal("workspace.chat.changed"),
21819
+ workspaceId: z37.string(),
21820
+ chatId: z37.string(),
21821
+ ts: z37.string()
21720
21822
  }),
21721
- z35.object({
21722
- type: z35.literal("workspace.chat.advanced"),
21723
- workspaceId: z35.string(),
21724
- chatId: z35.string(),
21725
- afterCursor: z35.string().optional(),
21726
- processing: z35.boolean(),
21727
- ts: z35.string()
21823
+ z37.object({
21824
+ type: z37.literal("workspace.chat.advanced"),
21825
+ workspaceId: z37.string(),
21826
+ chatId: z37.string(),
21827
+ afterCursor: z37.string().optional(),
21828
+ processing: z37.boolean(),
21829
+ ts: z37.string()
21728
21830
  }),
21729
- z35.object({
21730
- type: z35.literal("mobile-testing.changed"),
21731
- workspaceId: z35.string(),
21732
- ts: z35.string()
21831
+ z37.object({
21832
+ type: z37.literal("mobile-testing.changed"),
21833
+ workspaceId: z37.string(),
21834
+ ts: z37.string()
21733
21835
  }),
21734
- z35.object({
21735
- type: z35.literal("variable-request.changed"),
21736
- workspaceId: z35.string(),
21737
- ts: z35.string()
21836
+ z37.object({
21837
+ type: z37.literal("variable-request.changed"),
21838
+ workspaceId: z37.string(),
21839
+ ts: z37.string()
21738
21840
  }),
21739
- z35.object({
21740
- type: z35.literal("local-control-request.changed"),
21741
- workspaceId: z35.string(),
21742
- ts: z35.string()
21841
+ z37.object({
21842
+ type: z37.literal("local-control-request.changed"),
21843
+ workspaceId: z37.string(),
21844
+ ts: z37.string()
21743
21845
  }),
21744
- z35.object({
21745
- type: z35.literal("pull-request.changed"),
21746
- prUrl: z35.string(),
21747
- ts: z35.string()
21846
+ z37.object({
21847
+ type: z37.literal("pull-request.changed"),
21848
+ prUrl: z37.string(),
21849
+ ts: z37.string()
21748
21850
  }),
21749
- z35.object({
21750
- type: z35.literal("mothership.subagent.changed"),
21751
- workspaceId: z35.string(),
21752
- subagent: z35.object({ id: z35.string(), name: z35.string(), prUrl: z35.string().nullable() }),
21753
- ts: z35.string()
21851
+ z37.object({
21852
+ type: z37.literal("mothership.subagent.changed"),
21853
+ workspaceId: z37.string(),
21854
+ subagent: z37.object({ id: z37.string(), name: z37.string(), prUrl: z37.string().nullable() }),
21855
+ ts: z37.string()
21754
21856
  }),
21755
- z35.object({ type: z35.literal("mothership.board.changed"), workspaceId: z35.string(), ts: z35.string() }),
21756
- z35.object({ type: z35.literal("needs-you.changed"), workspaceId: z35.string().nullable(), userId: z35.string().optional(), ts: z35.string() }),
21757
- z35.object({
21758
- type: z35.literal("workspace.shared"),
21759
- workspaceId: z35.string(),
21760
- workspaceName: z35.string(),
21761
- sharedWithUserId: z35.string(),
21762
- sharedByName: z35.string(),
21763
- ts: z35.string()
21857
+ z37.object({ type: z37.literal("mothership.board.changed"), workspaceId: z37.string(), ts: z37.string() }),
21858
+ z37.object({ type: z37.literal("needs-you.changed"), workspaceId: z37.string().nullable(), userId: z37.string().optional(), ts: z37.string() }),
21859
+ z37.object({
21860
+ type: z37.literal("workspace.shared"),
21861
+ workspaceId: z37.string(),
21862
+ workspaceName: z37.string(),
21863
+ sharedWithUserId: z37.string(),
21864
+ sharedByName: z37.string(),
21865
+ ts: z37.string()
21764
21866
  })
21765
21867
  ]);
21766
- var workspaceChangedEventSchema = z35.union([
21868
+ var workspaceChangedEventSchema = z37.union([
21767
21869
  workspaceEventSchemaByType,
21768
- z35.object({ type: z35.literal("presence.changed"), userId: z35.string(), entry: presenceEntrySchema.nullable(), ts: z35.string() }),
21769
- z35.object({ type: z35.literal("presence.changed"), ts: z35.string() })
21870
+ z37.object({ type: z37.literal("presence.changed"), userId: z37.string(), entry: presenceEntrySchema.nullable(), ts: z37.string() }),
21871
+ z37.object({ type: z37.literal("presence.changed"), ts: z37.string() })
21770
21872
  ]);
21771
21873
 
21772
21874
  // ../shared/src/routes/review-messages.ts
21773
- import { z as z36 } from "zod";
21774
- var sendPullRequestReviewMessageRequestSchema = z36.object({
21875
+ import { z as z38 } from "zod";
21876
+ var sendPullRequestReviewMessageRequestSchema = z38.object({
21775
21877
  ...sendChatMessageRequestSchema.pick({
21776
21878
  message: true,
21777
21879
  messageId: true,
@@ -21784,8 +21886,8 @@ var sendPullRequestReviewMessageRequestSchema = z36.object({
21784
21886
  ultrafastMode: true
21785
21887
  }).shape,
21786
21888
  /** Starts a new chat instead of continuing the PR's review chat. The provider only applies to a new chat. */
21787
- newChat: z36.boolean().optional(),
21788
- provider: z36.enum(VALID_AGENT_PROVIDERS).optional()
21889
+ newChat: z38.boolean().optional(),
21890
+ provider: z38.enum(VALID_AGENT_PROVIDERS).optional()
21789
21891
  });
21790
21892
 
21791
21893
  // ../shared/src/audit-log.ts
@@ -22448,40 +22550,40 @@ function isSkillRegistryManifest(value) {
22448
22550
  }
22449
22551
 
22450
22552
  // ../shared/src/routes/variable-requests.ts
22451
- import { z as z37 } from "zod";
22553
+ import { z as z39 } from "zod";
22452
22554
  var VARIABLE_REQUEST_WAIT = { defaultMs: 10 * 6e4, maxMs: 30 * 6e4, pollMs: 3e3, waiterStaleMs: 15e3 };
22453
22555
  var VARIABLE_REQUEST_DESTINATIONS = ["environment", "workspace"];
22454
- var requestedVariableSchema = z37.object({
22455
- key: z37.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name").max(ENVIRONMENT_SETUP_LIMITS.variableKeyChars),
22456
- required: z37.boolean(),
22457
- replace: z37.boolean().optional()
22556
+ var requestedVariableSchema = z39.object({
22557
+ key: z39.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name").max(ENVIRONMENT_SETUP_LIMITS.variableKeyChars),
22558
+ required: z39.boolean(),
22559
+ replace: z39.boolean().optional()
22458
22560
  });
22459
- var requestedVariablesSchema = z37.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");
22460
- var createVariableRequestSchema = z37.object({
22561
+ var requestedVariablesSchema = z39.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");
22562
+ var createVariableRequestSchema = z39.object({
22461
22563
  variables: requestedVariablesSchema,
22462
- reason: z37.string().trim().max(500).nullish().transform((value) => value || null),
22463
- wait: z37.boolean().default(true)
22564
+ reason: z39.string().trim().max(500).nullish().transform((value) => value || null),
22565
+ wait: z39.boolean().default(true)
22464
22566
  });
22465
- var respondVariableRequestSchema = z37.discriminatedUnion("action", [
22466
- z37.object({
22467
- action: z37.literal("provide"),
22468
- destination: z37.enum(VARIABLE_REQUEST_DESTINATIONS),
22567
+ var respondVariableRequestSchema = z39.discriminatedUnion("action", [
22568
+ z39.object({
22569
+ action: z39.literal("provide"),
22570
+ destination: z39.enum(VARIABLE_REQUEST_DESTINATIONS),
22469
22571
  /** Defaults to the workspace's environment, so older clients keep saving there. */
22470
- environment_ids: z37.array(z37.string().uuid()).optional(),
22471
- overwrite: z37.boolean().optional(),
22472
- values: z37.record(z37.string().regex(VARIABLE_KEY_RE), z37.string())
22572
+ environment_ids: z39.array(z39.string().uuid()).optional(),
22573
+ overwrite: z39.boolean().optional(),
22574
+ values: z39.record(z39.string().regex(VARIABLE_KEY_RE), z39.string())
22473
22575
  }),
22474
- z37.object({ action: z37.literal("skip") })
22576
+ z39.object({ action: z39.literal("skip") })
22475
22577
  ]);
22476
22578
 
22477
22579
  // ../shared/src/routes/local-control-requests.ts
22478
- import { z as z38 } from "zod";
22479
- var createLocalControlRequestSchema = z38.object({
22480
- reason: z38.string().trim().max(500).optional().transform((value) => value || null),
22481
- wait: z38.boolean().default(true)
22580
+ import { z as z40 } from "zod";
22581
+ var createLocalControlRequestSchema = z40.object({
22582
+ reason: z40.string().trim().max(500).optional().transform((value) => value || null),
22583
+ wait: z40.boolean().default(true)
22482
22584
  });
22483
- var respondLocalControlRequestSchema = z38.object({ action: z38.enum(["allow", "dismiss"]) });
22484
- var setLocalControlSchema = z38.object({ enabled: z38.boolean() });
22585
+ var respondLocalControlRequestSchema = z40.object({ action: z40.enum(["allow", "dismiss"]) });
22586
+ var setLocalControlSchema = z40.object({ enabled: z40.boolean() });
22485
22587
 
22486
22588
  export {
22487
22589
  ENGINE_SEND_MESSAGE_FAILED_ERROR,