replicas-engine 0.1.1586 → 0.1.1588

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 z41 = void 0;
1119
+ let z42 = 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
- z41 = offsetZ;
1126
+ z42 = offsetZ;
1127
1127
  this.dt = dt;
1128
1128
  } else {
1129
- z41 = "UTC";
1129
+ z42 = "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
- z41 = dt.zone.name;
1139
+ z42 = dt.zone.name;
1140
1140
  } else {
1141
- z41 = "UTC";
1141
+ z42 = "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 || z41;
1150
+ intlOpts.timeZone = intlOpts.timeZone || z42;
1151
1151
  this.dtf = getCachedDTF(intl, intlOpts);
1152
1152
  }
1153
1153
  format() {
@@ -11865,6 +11865,114 @@ var headlessAgentRequestSchema = z14.object({
11865
11865
  });
11866
11866
  var headlessAgentUsagePath = (outputPath) => `${outputPath}.usage`;
11867
11867
 
11868
+ // ../shared/src/engine/exec-protocol.ts
11869
+ import { z as z15 } from "zod";
11870
+ var EXEC_SOCKET_PATH = "/v1/exec/ws";
11871
+ var EXEC_PROTOCOL_VERSION = 1;
11872
+ var EXEC_PING_INTERVAL_MS = 5e3;
11873
+ var EXEC_SILENCE_TIMEOUT_MS = 2e4;
11874
+ var EXEC_MAX_FRAME_BYTES = 16 * 1024 * 1024;
11875
+ var EXEC_DEFAULT_READ_BYTES = 8 * 1024 * 1024;
11876
+ var EXEC_PROCESS_BUFFER_BYTES = 2 * 1024 * 1024;
11877
+ var EXEC_DEFAULT_IDLE_TTL_MS = 30 * 6e4;
11878
+ var EXEC_MAX_IDLE_TTL_MS = 24 * 60 * 6e4;
11879
+ var EXEC_FRAME = { request: 1, result: 2, error: 3, event: 4, cancel: 5, ping: 6 };
11880
+ var HEADER_BYTES = 9;
11881
+ var encoder = new TextEncoder();
11882
+ var decoder = new TextDecoder();
11883
+ function encodeExecFrame(type, id, json = {}, payload) {
11884
+ const body = encoder.encode(JSON.stringify(json));
11885
+ const frame = new Uint8Array(HEADER_BYTES + body.length + (payload?.length ?? 0));
11886
+ const view = new DataView(frame.buffer);
11887
+ view.setUint8(0, type);
11888
+ view.setUint32(1, id);
11889
+ view.setUint32(5, body.length);
11890
+ frame.set(body, HEADER_BYTES);
11891
+ if (payload) frame.set(payload, HEADER_BYTES + body.length);
11892
+ return frame;
11893
+ }
11894
+ function decodeExecFrame(data) {
11895
+ if (data.length < HEADER_BYTES) return null;
11896
+ const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
11897
+ const type = view.getUint8(0);
11898
+ const jsonLength = view.getUint32(5);
11899
+ if (type < EXEC_FRAME.request || type > EXEC_FRAME.ping || HEADER_BYTES + jsonLength > data.length) return null;
11900
+ try {
11901
+ const json = JSON.parse(decoder.decode(data.subarray(HEADER_BYTES, HEADER_BYTES + jsonLength)));
11902
+ if (typeof json !== "object" || json === null || Array.isArray(json)) return null;
11903
+ return { type, id: view.getUint32(1), json, payload: data.subarray(HEADER_BYTES + jsonLength) };
11904
+ } catch {
11905
+ return null;
11906
+ }
11907
+ }
11908
+ var EXEC_ERROR_CODES = [
11909
+ "ENOENT",
11910
+ "EISDIR",
11911
+ "ENOTDIR",
11912
+ "EACCES",
11913
+ "EEXIST",
11914
+ "EINVAL",
11915
+ "EFBIG",
11916
+ "ESRCH",
11917
+ "ENOTSUP",
11918
+ "spawn_error",
11919
+ "aborted",
11920
+ "lost",
11921
+ "unknown"
11922
+ ];
11923
+ var execRequestSchema = z15.object({
11924
+ /** The thread that owns the process; ending the thread kills its processes. */
11925
+ threadId: z15.string().min(1),
11926
+ label: z15.string().max(200).optional(),
11927
+ /** Run through bash; `login` (default true) sources the login profile like Codex's `bash -lc`. */
11928
+ command: z15.string().min(1).optional(),
11929
+ argv: z15.array(z15.string()).min(1).optional(),
11930
+ login: z15.boolean().optional(),
11931
+ cwd: z15.string().min(1).optional(),
11932
+ env: z15.record(z15.string(), z15.string()).optional(),
11933
+ /** Kill after this long, whoever is attached. */
11934
+ timeoutMs: z15.number().int().positive().optional(),
11935
+ /** Kill after this long with nobody attached. */
11936
+ idleTtlMs: z15.number().int().positive().max(EXEC_MAX_IDLE_TTL_MS).optional()
11937
+ }).refine((body) => body.command === void 0 !== (body.argv === void 0), { message: "Pass exactly one of command or argv" });
11938
+ var execStartedSchema = z15.object({ processId: z15.string(), pid: z15.number() });
11939
+ var execExitSchema = z15.object({ exitCode: z15.number(), signal: z15.string().nullable(), reason: z15.enum(["exit", "timeout", "killed", "idle"]) });
11940
+ var execReplySchemas = {
11941
+ hello: z15.object({
11942
+ protocol: z15.number(),
11943
+ version: z15.string(),
11944
+ os: z15.string(),
11945
+ arch: z15.string(),
11946
+ home: z15.string(),
11947
+ root: z15.string(),
11948
+ bootId: z15.string(),
11949
+ features: z15.array(z15.string())
11950
+ }),
11951
+ stat: z15.object({ kind: z15.enum(["file", "directory", "symlink", "other"]), size: z15.number(), mtimeMs: z15.number() }),
11952
+ read: z15.object({ size: z15.number() }),
11953
+ write: z15.object({ bytes: z15.number() }),
11954
+ exit: execExitSchema,
11955
+ kill: z15.object({}).strip(),
11956
+ killThread: z15.object({ killed: z15.number() }),
11957
+ list: z15.object({
11958
+ processes: z15.array(execStartedSchema.extend({
11959
+ threadId: z15.string(),
11960
+ label: z15.string().nullable(),
11961
+ command: z15.string(),
11962
+ startedAt: z15.string(),
11963
+ outputBytes: z15.number(),
11964
+ bufferStart: z15.number(),
11965
+ exit: execExitSchema.nullable()
11966
+ }))
11967
+ })
11968
+ };
11969
+ var execEventSchema = z15.discriminatedUnion("kind", [
11970
+ execStartedSchema.extend({ kind: z15.literal("started") }),
11971
+ z15.object({ kind: z15.literal("output"), stream: z15.enum(["stdout", "stderr"]), offset: z15.number() }),
11972
+ z15.object({ kind: z15.literal("skipped"), offset: z15.number(), bytes: z15.number() })
11973
+ ]);
11974
+ var execErrorBodySchema = z15.object({ code: z15.enum(EXEC_ERROR_CODES), message: z15.string(), path: z15.string().optional() });
11975
+
11868
11976
  // ../shared/src/sse.ts
11869
11977
  function parseSseChunk(chunk) {
11870
11978
  let data = "";
@@ -11882,14 +11990,14 @@ function parseSseChunk(chunk) {
11882
11990
  }
11883
11991
  async function* iterateSseStream(body, onChunk) {
11884
11992
  const reader = body.getReader();
11885
- const decoder2 = new TextDecoder();
11993
+ const decoder3 = new TextDecoder();
11886
11994
  let buffer = "";
11887
11995
  let searchFrom = 0;
11888
11996
  while (true) {
11889
11997
  const { done, value } = await reader.read();
11890
11998
  if (done) break;
11891
11999
  onChunk?.();
11892
- buffer += decoder2.decode(value, { stream: true });
12000
+ buffer += decoder3.decode(value, { stream: true });
11893
12001
  let end = buffer.indexOf("\n\n", searchFrom);
11894
12002
  while (end >= 0) {
11895
12003
  const event = parseSseChunk(buffer.slice(0, end));
@@ -11949,15 +12057,15 @@ var SEARCH_OPEN_DEDUPE_MS = 10 * 60 * 1e3;
11949
12057
  var PICK_WINDOW_MS = 21 * DAY_MS;
11950
12058
 
11951
12059
  // ../shared/src/routes/workspaces.ts
11952
- import { z as z16 } from "zod";
12060
+ import { z as z17 } from "zod";
11953
12061
 
11954
12062
  // ../shared/src/workspace-credentials.ts
11955
- import { z as z15 } from "zod";
12063
+ import { z as z16 } from "zod";
11956
12064
  var WORKSPACE_CREDENTIAL_PROVIDERS = ["claude", "codex"];
11957
- var workspaceCredentialProviderSchema = z15.enum(WORKSPACE_CREDENTIAL_PROVIDERS);
12065
+ var workspaceCredentialProviderSchema = z16.enum(WORKSPACE_CREDENTIAL_PROVIDERS);
11958
12066
  var workspaceCredentialSelectionSchema = agentCredentialSnapshotSchema.omit({ revision: true, account: true, credentialId: true });
11959
12067
  var createWorkspaceCredentialSchema = workspaceCredentialSelectionSchema.extend({
11960
- provider: z15.enum(VALID_AGENT_PROVIDERS)
12068
+ provider: z16.enum(VALID_AGENT_PROVIDERS)
11961
12069
  }).refine(({ provider: provider2, method }) => agentCredentialMethods(provider2).includes(method), {
11962
12070
  message: "This inference provider is not supported by this agent"
11963
12071
  });
@@ -11991,16 +12099,16 @@ var DEFAULT_WORKSPACE_FILTERS = {
11991
12099
  activity: "any"
11992
12100
  };
11993
12101
  var ONE_DAY_MS = 24 * 60 * 60 * 1e3;
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")
12102
+ var workspaceExecRequestSchema = z17.object({
12103
+ command: z17.string().regex(/\S/, "command is required"),
12104
+ timeout_seconds: z17.number().int().min(1).max(50).optional().describe("Default: 30")
11997
12105
  });
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() }),
12106
+ var terminalRtcCandidateSchema = z17.object({ type: z17.literal("rtc-candidate"), candidate: z17.string(), mid: z17.string() });
12107
+ var terminalSocketServerMessageSchema = z17.discriminatedUnion("type", [
12108
+ z17.object({ type: z17.literal("output"), data: z17.string() }),
12109
+ z17.object({ type: z17.literal("rtc-answer"), sdp: z17.string() }),
12002
12110
  terminalRtcCandidateSchema,
12003
- z16.object({ type: z16.literal("rtc-switch") })
12111
+ z17.object({ type: z17.literal("rtc-switch") })
12004
12112
  ]);
12005
12113
  var TERMINAL_RTC_ICE_SERVER = "stun:stun.l.google.com:19302";
12006
12114
 
@@ -12047,62 +12155,62 @@ function describeAuthFallback(payload) {
12047
12155
  }
12048
12156
 
12049
12157
  // ../shared/src/chat-fork.ts
12050
- import { z as z18 } from "zod";
12158
+ import { z as z19 } from "zod";
12051
12159
 
12052
12160
  // ../shared/src/fallback-chains.ts
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)
12161
+ import { z as z18 } from "zod";
12162
+ var fallbackHarnessStepSchema = z18.object({
12163
+ kind: z18.literal("harness"),
12164
+ provider: z18.enum(VALID_AGENT_PROVIDERS),
12165
+ model: z18.string().min(1),
12166
+ thinkingLevel: z18.enum(VALID_THINKING_LEVELS).optional().catch(void 0)
12059
12167
  });
12060
- var fallbackPlanStepSchema = z17.discriminatedUnion("kind", [
12061
- z17.object({
12062
- kind: z17.literal("credentials"),
12168
+ var fallbackPlanStepSchema = z18.discriminatedUnion("kind", [
12169
+ z18.object({
12170
+ kind: z18.literal("credentials"),
12063
12171
  // An empty list would allow every method.
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()
12172
+ methods: z18.array(z18.unknown()).transform((methods) => methods.filter(isAuthMethod)).refine((methods) => methods.length > 0),
12173
+ models: z18.record(z18.string(), z18.string().min(1)).optional()
12066
12174
  }),
12067
12175
  fallbackHarnessStepSchema
12068
12176
  ]);
12069
- var fallbackPlanResponseSchema = z17.object({
12070
- steps: z17.array(z17.unknown()).transform((steps) => steps.flatMap((step) => fallbackPlanStepSchema.safeParse(step).data ?? []))
12177
+ var fallbackPlanResponseSchema = z18.object({
12178
+ steps: z18.array(z18.unknown()).transform((steps) => steps.flatMap((step) => fallbackPlanStepSchema.safeParse(step).data ?? []))
12071
12179
  });
12072
12180
 
12073
12181
  // ../shared/src/chat-fork.ts
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()
12182
+ var fallbackReasonSchema = z19.enum(AGENT_FALLBACK_REASONS);
12183
+ var chatForkInfoSchema = z19.object({
12184
+ source: z19.object({
12185
+ chatId: z19.string().min(1),
12186
+ provider: z19.enum(VALID_AGENT_PROVIDERS),
12187
+ title: z19.string()
12080
12188
  }),
12081
- trigger: z18.enum(["manual", "auto", "side", "switch"]),
12189
+ trigger: z19.enum(["manual", "auto", "side", "switch"]),
12082
12190
  reason: fallbackReasonSchema.optional(),
12083
- state: z18.enum(["preparing", "ready", "failed"]),
12084
- error: z18.string().optional(),
12085
- startedAt: z18.string(),
12086
- completedAt: z18.string().optional()
12191
+ state: z19.enum(["preparing", "ready", "failed"]),
12192
+ error: z19.string().optional(),
12193
+ startedAt: z19.string(),
12194
+ completedAt: z19.string().optional()
12087
12195
  });
12088
12196
  function coerceChatForkInfo(value) {
12089
12197
  const parsed = chatForkInfoSchema.safeParse(value);
12090
12198
  return parsed.success ? parsed.data : null;
12091
12199
  }
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(),
12200
+ var forkChatRequestSchema = z19.object({
12201
+ provider: z19.enum(VALID_AGENT_PROVIDERS),
12202
+ model: z19.string().min(1).optional(),
12203
+ thinkingLevel: z19.enum(VALID_THINKING_LEVELS).optional(),
12204
+ title: z19.string().min(1).max(200).optional(),
12205
+ message: z19.string().trim().optional(),
12206
+ id: z19.string().uuid().optional(),
12207
+ clientRequestId: z19.string().min(1).max(128).optional(),
12208
+ enableInteractiveTools: z19.boolean().optional(),
12101
12209
  // Server-injected by the monolith from the authenticated request; never trusted from clients.
12102
- senderUserId: z18.string().optional(),
12103
- senderEmail: z18.string().optional(),
12104
- senderDisplayName: z18.string().optional(),
12105
- senderAvatarUrl: z18.string().optional()
12210
+ senderUserId: z19.string().optional(),
12211
+ senderEmail: z19.string().optional(),
12212
+ senderDisplayName: z19.string().optional(),
12213
+ senderAvatarUrl: z19.string().optional()
12106
12214
  });
12107
12215
  function describeQuotaLimit(reason) {
12108
12216
  if (reason === "auth_failed") return "could not authenticate";
@@ -12114,10 +12222,10 @@ function describeChatForkReason(reason, provider2) {
12114
12222
  return reason ? `${getProviderDisplayName(provider2)} ${describeQuotaLimit(reason)}` : null;
12115
12223
  }
12116
12224
  var AGENT_QUOTA_EXHAUSTED_EVENT_TYPE = "agent-quota-exhausted";
12117
- var agentQuotaExhaustedPayloadSchema = z18.object({
12118
- provider: z18.enum(VALID_AGENT_PROVIDERS),
12225
+ var agentQuotaExhaustedPayloadSchema = z19.object({
12226
+ provider: z19.enum(VALID_AGENT_PROVIDERS),
12119
12227
  reason: fallbackReasonSchema,
12120
- detail: z18.string().optional(),
12228
+ detail: z19.string().optional(),
12121
12229
  forkTo: fallbackHarnessStepSchema.optional()
12122
12230
  });
12123
12231
  function defaultForkChatTitle(source, provider2) {
@@ -12152,21 +12260,21 @@ function getChatThreadSources(chats, chat) {
12152
12260
  }
12153
12261
 
12154
12262
  // ../shared/src/credential-refresh.ts
12155
- import { z as z19 } from "zod";
12156
- var engineCredentialRefreshFailureSchema = z19.object({
12157
- code: z19.string(),
12263
+ import { z as z20 } from "zod";
12264
+ var engineCredentialRefreshFailureSchema = z20.object({
12265
+ code: z20.string(),
12158
12266
  credential: workspaceCredentialSelectionSchema.optional()
12159
12267
  });
12160
12268
 
12161
12269
  // ../shared/src/credential-pool.ts
12162
- import { z as z20 } from "zod";
12270
+ import { z as z21 } from "zod";
12163
12271
  var MAX_CREDENTIAL_POOL_ACCOUNTS = 10;
12164
- var reorderCredentialPoolSchema = z20.object({
12165
- credential_ids: z20.array(z20.string().uuid()).min(1).max(MAX_CREDENTIAL_POOL_ACCOUNTS)
12272
+ var reorderCredentialPoolSchema = z21.object({
12273
+ credential_ids: z21.array(z21.string().uuid()).min(1).max(MAX_CREDENTIAL_POOL_ACCOUNTS)
12166
12274
  });
12167
12275
 
12168
12276
  // ../shared/src/mothership-events.ts
12169
- import { z as z26 } from "zod";
12277
+ import { z as z27 } from "zod";
12170
12278
 
12171
12279
  // ../shared/src/design-tokens.ts
12172
12280
  var plain = {
@@ -12333,7 +12441,7 @@ var LINEAR_ICON_DEFINITION = {
12333
12441
  };
12334
12442
 
12335
12443
  // ../shared/src/replicas-mcp.ts
12336
- import { z as z22 } from "zod";
12444
+ import { z as z23 } from "zod";
12337
12445
 
12338
12446
  // ../shared/src/automations/types.ts
12339
12447
  var AUTOMATION_DEBOUNCE_MAX_SECONDS = 24 * 60 * 60;
@@ -12354,11 +12462,11 @@ var AUTOMATION_AUTO_PAUSE_DAYS = 7;
12354
12462
  var AUTOMATION_AUTO_PAUSE_LABEL = `Paused after failing every run for ${AUTOMATION_AUTO_PAUSE_DAYS} days`;
12355
12463
 
12356
12464
  // ../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() });
12465
+ import { z as z22 } from "zod";
12466
+ var previewEnvironmentConfigSourceRequestSchema = z22.strictObject({ repository_id: z22.string().min(1).optional() });
12359
12467
  var applyEnvironmentConfigSourceRequestSchema = previewEnvironmentConfigSourceRequestSchema.extend({
12360
- commit_sha: z21.string().min(1),
12361
- fingerprint: z21.string().min(1)
12468
+ commit_sha: z22.string().min(1),
12469
+ fingerprint: z22.string().min(1)
12362
12470
  });
12363
12471
 
12364
12472
  // ../shared/src/replicas-mcp.ts
@@ -12422,57 +12530,57 @@ var REPLICAS_MCP_TOOLS = {
12422
12530
  deleteChat: "delete_chat",
12423
12531
  listRepositories: "list_repositories"
12424
12532
  };
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(
12533
+ var automationToolInputSchema = z23.object({
12534
+ name: z23.string().describe("Short automation name."),
12535
+ prompt: z23.string().describe("Prompt each automation run starts with."),
12536
+ environment_id: z23.string().describe(`Environment id from \`${REPLICAS_MCP_TOOLS.listEnvironments}\`.`),
12537
+ triggers: z23.array(automationTriggerSchema).min(1).describe(
12430
12538
  `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"] } }\`.`
12431
12539
  ),
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(
12540
+ description: z23.string().optional().describe("One-line summary shown in the dashboard."),
12541
+ plan_mode: z23.boolean().optional(),
12542
+ goal_mode: z23.boolean().optional(),
12543
+ fast_mode: z23.boolean().optional(),
12544
+ workspace_lifecycle_policy: z23.enum(AUTOMATION_LIFECYCLE_POLICIES).optional().describe(
12437
12545
  "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."
12438
12546
  )
12439
12547
  });
12440
12548
  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.`;
12441
- var automationBackgroundSchema = z22.boolean().optional().describe(
12549
+ var automationBackgroundSchema = z23.boolean().optional().describe(
12442
12550
  "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."
12443
12551
  );
12444
12552
  var automationCreateToolInputSchema = automationToolInputSchema.extend({
12445
- credential_user_id: z22.string().optional().describe(`${credentialUserIdDescription} Omit to use the organization's.`),
12553
+ credential_user_id: z23.string().optional().describe(`${credentialUserIdDescription} Omit to use the organization's.`),
12446
12554
  background: automationBackgroundSchema,
12447
- scope: z22.enum(["org", "user"]).optional().describe("`org` (default) or `user` for a personal automation, which needs a personal API key.")
12555
+ scope: z23.enum(["org", "user"]).optional().describe("`org` (default) or `user` for a personal automation, which needs a personal API key.")
12448
12556
  });
12449
12557
  var automationUpdateToolInputSchema = automationToolInputSchema.partial().extend({
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.`),
12558
+ automation_id: z23.string().describe("Automation ID"),
12559
+ enabled: z23.boolean().optional(),
12560
+ agent_provider: z23.enum(AGENT).nullable().optional(),
12561
+ model: z23.string().nullable().optional(),
12562
+ thinking_level: z23.enum(VALID_THINKING_LEVELS).nullable().optional(),
12563
+ workspace_size: z23.enum(WORKSPACE_SIZES).optional(),
12564
+ credential_user_id: z23.string().nullable().optional().describe(`${credentialUserIdDescription} Null switches back to the organization's.`),
12457
12565
  background: automationBackgroundSchema,
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.")
12566
+ scope: z23.literal("org").optional().describe("`org` moves a personal automation to the organization so teammates can see and edit it. It cannot be moved back.")
12459
12567
  });
12460
- var chatPath = { id: z22.string().describe("Workspace ID"), chat_id: z22.string().describe("Chat ID") };
12568
+ var chatPath = { id: z23.string().describe("Workspace ID"), chat_id: z23.string().describe("Chat ID") };
12461
12569
  var { provider, model, thinkingLevel, title, message } = forkChatRequestSchema.shape;
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({
12570
+ var createChatToolInputSchema = z23.object({ id: chatPath.id, provider, title: createChatRequestSchema.shape.title });
12571
+ var forkChatToolInputSchema = z23.object({ ...chatPath, provider, model, thinking_level: thinkingLevel, title, message });
12572
+ var renameChatToolInputSchema = z23.object({ ...chatPath, display_name: updateChatDisplayNameRequestSchema.shape.displayName });
12573
+ var runCommandToolInputSchema = z23.object({ id: chatPath.id, ...workspaceExecRequestSchema.shape });
12574
+ var environmentMcpPath = { environment_id: z23.string().describe("Environment ID") };
12575
+ var createEnvironmentMcpToolInputSchema = z23.object({ ...environmentMcpPath, ...createEnvironmentMcpRequestSchema.shape });
12576
+ var updateEnvironmentMcpToolInputSchema = z23.object({
12469
12577
  ...environmentMcpPath,
12470
- mcp_id: z22.string().describe("MCP ID"),
12578
+ mcp_id: z23.string().describe("MCP ID"),
12471
12579
  ...updateEnvironmentMcpRequestSchema.shape
12472
12580
  });
12473
- var createEnvironmentDeviceToolInputSchema = z22.object({ ...environmentMcpPath, ...createEnvironmentDeviceRequestSchema.shape });
12474
- var previewEnvironmentConfigSourceToolInputSchema = z22.object({ ...environmentMcpPath, ...previewEnvironmentConfigSourceRequestSchema.shape });
12475
- var applyEnvironmentConfigSourceToolInputSchema = z22.object({ ...environmentMcpPath, ...applyEnvironmentConfigSourceRequestSchema.shape });
12581
+ var createEnvironmentDeviceToolInputSchema = z23.object({ ...environmentMcpPath, ...createEnvironmentDeviceRequestSchema.shape });
12582
+ var previewEnvironmentConfigSourceToolInputSchema = z23.object({ ...environmentMcpPath, ...previewEnvironmentConfigSourceRequestSchema.shape });
12583
+ var applyEnvironmentConfigSourceToolInputSchema = z23.object({ ...environmentMcpPath, ...applyEnvironmentConfigSourceRequestSchema.shape });
12476
12584
 
12477
12585
  // ../shared/src/scout.ts
12478
12586
  var SCOUT_SOURCE_TYPES = ["slack", "linear"];
@@ -12566,63 +12674,63 @@ When someone asks for a recurring task or accepts an offer to automate a repeate
12566
12674
  `;
12567
12675
 
12568
12676
  // ../shared/src/routes/preferences.ts
12569
- import { z as z25 } from "zod";
12677
+ import { z as z26 } from "zod";
12570
12678
 
12571
12679
  // ../shared/src/routes/push.ts
12572
- import { z as z23 } from "zod";
12680
+ import { z as z24 } from "zod";
12573
12681
 
12574
12682
  // ../shared/src/workspace-attention.ts
12575
12683
  var WORKSPACE_ATTENTION_REASONS = ["question", "plan", "variables", "blocked", "setup", "deploy_failed"];
12576
12684
  var CHAT_ATTENTION_REASONS = ["question", "blocked"];
12577
12685
 
12578
12686
  // ../shared/src/routes/push.ts
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"])
12687
+ var registerPushDeviceRequestSchema = z24.discriminatedUnion("platform", [
12688
+ z24.object({
12689
+ platform: z24.literal("ios"),
12690
+ token: z24.string().regex(/^[0-9a-f]{64,200}$/i),
12691
+ appId: z24.string().min(1).max(255),
12692
+ apnsEnvironment: z24.enum(["sandbox", "production"])
12585
12693
  }),
12586
- z23.object({
12587
- platform: z23.literal("android"),
12588
- token: z23.string().min(1).max(4096),
12589
- appId: z23.string().min(1).max(255)
12694
+ z24.object({
12695
+ platform: z24.literal("android"),
12696
+ token: z24.string().min(1).max(4096),
12697
+ appId: z24.string().min(1).max(255)
12590
12698
  })
12591
12699
  ]);
12592
12700
  var PUSH_HOLD_MINUTES = 5;
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(),
12701
+ var chatRefSchema = z24.object({ workspaceId: z24.string().uuid(), chatId: z24.string().min(1).max(100) });
12702
+ var recordPushActivityRequestSchema = z24.object({
12703
+ organizationId: z24.string().uuid(),
12596
12704
  /** Seconds since the last keyboard or mouse input on this computer. A phone leaves it out: it only reports what it has open. */
12597
- idleSeconds: z23.number().min(0).optional(),
12598
- seenWorkspaceIds: z23.array(z23.string().uuid()).max(20),
12599
- seenChats: z23.array(chatRefSchema).max(20).optional()
12705
+ idleSeconds: z24.number().min(0).optional(),
12706
+ seenWorkspaceIds: z24.array(z24.string().uuid()).max(20),
12707
+ seenChats: z24.array(chatRefSchema).max(20).optional()
12600
12708
  });
12601
12709
  var PUSH_NOTIFICATION_KINDS = [...WORKSPACE_ATTENTION_REASONS, "finished"];
12602
12710
  var PUSH_OPTION_LABEL_MAX = 60;
12603
12711
  var PUSH_OPTIONS_MAX = 4;
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(),
12712
+ var pushQuestionSchema = z24.object({ id: z24.string().max(64), allowCustom: z24.boolean().optional(), options: z24.array(z24.object({ id: z24.string().max(64), label: z24.string().min(1).max(PUSH_OPTION_LABEL_MAX) })).min(1).max(PUSH_OPTIONS_MAX) });
12713
+ var pushNotificationDataSchema = z24.object({
12714
+ organizationId: z24.string(),
12715
+ workspaceId: z24.string(),
12716
+ chatId: z24.string().nullable(),
12717
+ kind: z24.enum(PUSH_NOTIFICATION_KINDS),
12718
+ completedAt: z24.string(),
12719
+ toolRequestId: z24.string().optional(),
12612
12720
  question: pushQuestionSchema.optional()
12613
12721
  });
12614
- var workspaceSharedPushDataSchema = pushNotificationDataSchema.pick({ organizationId: true, workspaceId: true, chatId: true, completedAt: true }).extend({ kind: z23.literal("shared") });
12722
+ var workspaceSharedPushDataSchema = pushNotificationDataSchema.pick({ organizationId: true, workspaceId: true, chatId: true, completedAt: true }).extend({ kind: z24.literal("shared") });
12615
12723
  var registerLiveActivityRequestSchema = chatRefSchema.extend({
12616
- deviceId: z23.string().uuid(),
12724
+ deviceId: z24.string().uuid(),
12617
12725
  /** The iOS activity's push token. Android leaves it out and gets FCM data messages on the device token. */
12618
- pushToken: z23.string().regex(/^[0-9a-f]{64,400}$/i).optional(),
12726
+ pushToken: z24.string().regex(/^[0-9a-f]{64,400}$/i).optional(),
12619
12727
  /** iOS only: when the card's turn started, in seconds. Cards keep their order by it. */
12620
- startedAt: z23.number().positive().optional()
12728
+ startedAt: z24.number().positive().optional()
12621
12729
  });
12622
- var syncLiveActivitiesRequestSchema = z23.object({
12623
- activities: z23.array(chatRefSchema).max(100)
12730
+ var syncLiveActivitiesRequestSchema = z24.object({
12731
+ activities: z24.array(chatRefSchema).max(100)
12624
12732
  });
12625
- var setLiveActivityStartTokenRequestSchema = z23.object({ token: z23.string().regex(/^[0-9a-f]{64,400}$/i) });
12733
+ var setLiveActivityStartTokenRequestSchema = z24.object({ token: z24.string().regex(/^[0-9a-f]{64,400}$/i) });
12626
12734
 
12627
12735
  // ../shared/src/default-skills/replicas-agent/abilities/computer.ts
12628
12736
  var SECTION = `### Computer use (Linux desktop control)
@@ -13374,7 +13482,7 @@ var GITLAB_ABILITY = {
13374
13482
  };
13375
13483
 
13376
13484
  // ../shared/src/routes/compute.ts
13377
- import { z as z24 } from "zod";
13485
+ import { z as z25 } from "zod";
13378
13486
  var COMPUTE_SANDBOX_KINDS = ["gpu"];
13379
13487
  var GPU_TYPES = ["T4", "L4", "A10G", "L40S", "A100", "A100-80GB", "H100", "H200", "B200"];
13380
13488
  var DEFAULT_GPU_TYPE = "L4";
@@ -13391,27 +13499,27 @@ var COMPUTE_SANDBOX_LIMITS = {
13391
13499
  maxIdleTimeoutMinutes: 60,
13392
13500
  maxTransferBytes: 1024 ** 3
13393
13501
  };
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(),
13502
+ var computeEnvSchema = z25.record(z25.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128), z25.string().max(32768)).refine((env) => Object.keys(env).length <= 64, "At most 64 environment variables are allowed");
13503
+ var createComputeSandboxRequestSchema = z25.object({
13504
+ kind: z25.enum(COMPUTE_SANDBOX_KINDS),
13505
+ gpu: z25.string().trim().optional(),
13506
+ image: z25.string().trim().min(1).max(256).regex(/^\S+$/, "Image must not contain whitespace").optional(),
13507
+ timeoutMinutes: z25.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxTimeoutMinutes).optional(),
13508
+ idleTimeoutMinutes: z25.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxIdleTimeoutMinutes).optional(),
13509
+ ports: z25.array(z25.number().int().min(1).max(65535)).max(COMPUTE_SANDBOX_LIMITS.maxPorts).optional(),
13402
13510
  env: computeEnvSchema.optional()
13403
13511
  });
13404
- var computeExecRequestSchema = z24.object({
13405
- command: z24.string().min(1).max(1e5),
13406
- workdir: z24.string().min(1).max(4096).optional(),
13512
+ var computeExecRequestSchema = z25.object({
13513
+ command: z25.string().min(1).max(1e5),
13514
+ workdir: z25.string().min(1).max(4096).optional(),
13407
13515
  env: computeEnvSchema.optional(),
13408
- detach: z24.boolean().optional()
13516
+ detach: z25.boolean().optional()
13409
13517
  });
13410
- var computeUploadRequestSchema = z24.object({
13411
- size: z24.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxTransferBytes)
13518
+ var computeUploadRequestSchema = z25.object({
13519
+ size: z25.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxTransferBytes)
13412
13520
  });
13413
- var computeTransferPathSchema = z24.object({
13414
- path: z24.string().min(1).max(4096).optional()
13521
+ var computeTransferPathSchema = z25.object({
13522
+ path: z25.string().min(1).max(4096).optional()
13415
13523
  });
13416
13524
 
13417
13525
  // ../shared/src/default-skills/replicas-agent/abilities/gpu.ts
@@ -15163,9 +15271,9 @@ var DEFAULT_DEFAULT_SKILLS = {
15163
15271
  }
15164
15272
  };
15165
15273
  var LINEAR_ROUTING_SKILL_MAX_LENGTH = 5e4;
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) })
15274
+ var linearRoutingSkillSchema = z26.union([
15275
+ z26.object({ name: z26.string().min(1), content: z26.string().trim().min(1).max(LINEAR_ROUTING_SKILL_MAX_LENGTH) }),
15276
+ z26.object({ name: z26.string().min(1), repository_id: z26.string().regex(UUID_RE), path: z26.string().min(1) })
15169
15277
  ]);
15170
15278
 
15171
15279
  // ../shared/src/prompts.ts
@@ -15346,19 +15454,19 @@ var UNKNOWN_EVENT_KIND = "update";
15346
15454
  var MOTHERSHIP_TURN_ERROR_SUMMARY = "Turn ended with an error.";
15347
15455
  var MOTHERSHIP_EVENT_TYPE = "multitask-event";
15348
15456
  var MOTHERSHIP_EVENT_MESSAGE_TYPE = "multitask_event";
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(),
15457
+ var mothershipEventSchema = z27.object({
15458
+ id: z27.string(),
15459
+ at: z27.string(),
15460
+ kind: z27.enum([...MOTHERSHIP_EVENT_KINDS, UNKNOWN_EVENT_KIND]),
15461
+ agentId: z27.string(),
15462
+ agentName: z27.string(),
15463
+ summary: z27.string(),
15464
+ detail: z27.string().optional(),
15357
15465
  // Set when the subagent is a chat in this workspace rather than a ship; agentId is then that chat's id.
15358
- chatId: z26.string().optional(),
15359
- ticket: z26.object({ id: z26.string(), title: z26.string() }).optional(),
15466
+ chatId: z27.string().optional(),
15467
+ ticket: z27.object({ id: z27.string(), title: z27.string() }).optional(),
15360
15468
  // Set on events recorded before every kind woke the orchestrator, which were shown as a row when they happened.
15361
- noticed: z26.boolean().optional()
15469
+ noticed: z27.boolean().optional()
15362
15470
  });
15363
15471
  var TAG = "multitask_event";
15364
15472
  var BLOCK = new RegExp(`<${TAG}((?:\\s+\\w+="[^"]*")*)>\\n?([\\s\\S]*?)\\n?</${TAG}>`, "g");
@@ -16403,7 +16511,7 @@ function subagentReport(output) {
16403
16511
  }
16404
16512
 
16405
16513
  // ../shared/src/learned-skills.ts
16406
- import { z as z27 } from "zod";
16514
+ import { z as z28 } from "zod";
16407
16515
 
16408
16516
  // ../shared/src/frontmatter.ts
16409
16517
  import { parse as parseYaml } from "yaml";
@@ -16426,20 +16534,20 @@ function parseFrontmatter(content) {
16426
16534
  var LEARNED_SKILLS_ROOT = `${SANDBOX_PATHS.REPLICAS_DIR}/learned-skills`;
16427
16535
  var LEARNED_SKILLS_MANIFEST_PATH = `${LEARNED_SKILLS_ROOT}/manifest.json`;
16428
16536
  var LEARNED_SKILL_DIR_PREFIX = "replicas-learned__";
16429
- var learnedSkillsManifestSchema = z27.object({
16430
- skills: z27.array(z27.object({ name: z27.string(), sha256: z27.string() }))
16537
+ var learnedSkillsManifestSchema = z28.object({
16538
+ skills: z28.array(z28.object({ name: z28.string(), sha256: z28.string() }))
16431
16539
  });
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()
16540
+ var dreamVerdictChecksSchema = z28.object({
16541
+ repeatable: z28.boolean(),
16542
+ realInstruction: z28.boolean(),
16543
+ noContradiction: z28.boolean(),
16544
+ formatExact: z28.boolean(),
16545
+ humanOnly: z28.boolean(),
16546
+ actionable: z28.boolean(),
16547
+ durable: z28.boolean()
16440
16548
  });
16441
16549
  var DREAM_VERDICT_CHECKS = dreamVerdictChecksSchema.keyof().options;
16442
- var dreamVerdictSchema = dreamVerdictChecksSchema.extend({ approve: z27.boolean(), reason: z27.string() });
16550
+ var dreamVerdictSchema = dreamVerdictChecksSchema.extend({ approve: z28.boolean(), reason: z28.string() });
16443
16551
  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."`;
16444
16552
 
16445
16553
  // ../shared/src/terminal.ts
@@ -16470,7 +16578,7 @@ function workspaceTargetFromToolOutput(output) {
16470
16578
  }
16471
16579
 
16472
16580
  // ../shared/src/mothership-board.ts
16473
- import { z as z28 } from "zod";
16581
+ import { z as z29 } from "zod";
16474
16582
  var MOTHERSHIP_TICKET_LIMITS = {
16475
16583
  title: 80,
16476
16584
  task: 1e3,
@@ -16490,78 +16598,78 @@ var MOTHERSHIP_TICKET_LIMITS = {
16490
16598
  };
16491
16599
  var L = MOTHERSHIP_TICKET_LIMITS;
16492
16600
  var tooLong = (max) => `At most ${max} characters. Keep it short; the user should take it in at a glance`;
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" });
16601
+ var text3 = (max) => z29.string().trim().min(1).max(max, tooLong(max));
16602
+ var clearable = (schema) => z29.union([schema, z29.literal("")]).optional();
16603
+ var httpsUrl = z29.url({ protocol: /^https$/, error: "Must be an https URL" });
16496
16604
  var inlineMarkdown = "Markdown: **bold**, *italics*, `code`, [links](https://... or an absolute file path)";
16497
16605
  var markdown = `${inlineMarkdown} and line breaks.`;
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({
16606
+ var linearIdentifier = z29.string().regex(/^[A-Za-z][A-Za-z0-9]{0,9}-\d{1,7}$/, "Use a Linear identifier such as REP-123");
16607
+ var mediaSchema = z29.object({
16500
16608
  url: httpsUrl.describe("The URL `replicas media upload` printed."),
16501
16609
  caption: text3(L.caption).describe('What it shows, such as "After: the list stays pinned".'),
16502
- kind: z28.enum(["image", "video"]).describe("video for recordings, image for screenshots and GIFs.")
16610
+ kind: z29.enum(["image", "video"]).describe("video for recordings, image for screenshots and GIFs.")
16503
16611
  });
16504
- var questionSchema = z28.object({
16612
+ var questionSchema = z29.object({
16505
16613
  question: text3(L.question).describe("One question, with the context needed to answer it."),
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.")
16614
+ options: z29.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.")
16507
16615
  });
16508
16616
  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.`);
16509
16617
  var mothershipTicketTaskSchema = text3(L.task);
16510
- var mothershipTicketMediaSchema = z28.array(mediaSchema);
16511
- var mothershipTicketQuestionsSchema = z28.array(questionSchema.extend({ id: z28.string() }));
16618
+ var mothershipTicketMediaSchema = z29.array(mediaSchema);
16619
+ var mothershipTicketQuestionsSchema = z29.array(questionSchema.extend({ id: z29.string() }));
16512
16620
  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.`);
16513
16621
  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.`);
16514
- var updateMothershipTicketRequestSchema = z28.object({
16622
+ var updateMothershipTicketRequestSchema = z29.object({
16515
16623
  title: mothershipTicketTitleSchema.optional(),
16516
16624
  issue: issueSchema,
16517
16625
  fix: fixSchema,
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.`),
16626
+ media: z29.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.`),
16627
+ questions: z29.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.`),
16520
16628
  blocked: clearable(text3(L.blocked)).describe('Why you cannot go on without the user, such as missing access. "" once unblocked.')
16521
16629
  });
16522
- var updateMothershipBoardRequestSchema = z28.object({
16630
+ var updateMothershipBoardRequestSchema = z29.object({
16523
16631
  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.`),
16524
- tickets: z28.array(z28.object({
16525
- id: z28.uuid(),
16632
+ tickets: z29.array(z29.object({
16633
+ id: z29.uuid(),
16526
16634
  title: mothershipTicketTitleSchema.optional(),
16527
16635
  issue: issueSchema,
16528
16636
  fix: fixSchema,
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."),
16637
+ pull_requests: z29.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."),
16530
16638
  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.`),
16531
16639
  linear: clearable(linearIdentifier).describe('The Linear issue this ticket is for, such as REP-123. "" removes it.'),
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.")
16640
+ archived: z29.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.")
16533
16641
  })).max(50).optional().describe("Changes to existing tickets."),
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({
16642
+ order: z29.array(z29.uuid()).optional().describe("Ticket ids, most important first. Tickets left out keep their order after these."),
16643
+ create: z29.array(z29.object({
16536
16644
  title: mothershipTicketTitleSchema,
16537
16645
  task: mothershipTicketTaskSchema.optional(),
16538
16646
  issue: text3(L.issue).optional(),
16539
- questions: z28.array(questionSchema).max(L.questions).optional(),
16647
+ questions: z29.array(questionSchema).max(L.questions).optional(),
16540
16648
  note: text3(L.note).optional()
16541
16649
  })).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.")
16542
16650
  });
16543
- var answerMothershipTicketRequestSchema = z28.object({
16544
- questionId: z28.string().min(1),
16651
+ var answerMothershipTicketRequestSchema = z29.object({
16652
+ questionId: z29.string().min(1),
16545
16653
  answer: text3(L.answer)
16546
16654
  });
16547
- var mothershipTicketAnswerRefSchema = z28.object({ mothershipId: z28.uuid(), ticketId: z28.uuid(), questionId: z28.string().min(1) });
16548
- var replyOnMothershipTicketRequestSchema = z28.object({
16655
+ var mothershipTicketAnswerRefSchema = z29.object({ mothershipId: z29.uuid(), ticketId: z29.uuid(), questionId: z29.string().min(1) });
16656
+ var replyOnMothershipTicketRequestSchema = z29.object({
16549
16657
  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.`),
16550
16658
  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.")
16551
16659
  });
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()
16660
+ var mothershipTicketReplyRefSchema = z29.object({ ticketId: z29.uuid(), text: text3(L.answer) });
16661
+ var mothershipTicketThreadSchema = z29.array(z29.object({
16662
+ id: z29.string(),
16663
+ from: z29.enum(["user", "ship"]),
16664
+ name: z29.string(),
16665
+ ship_id: z29.string(),
16666
+ chat_id: z29.string(),
16667
+ text: z29.string(),
16668
+ at: z29.string(),
16669
+ nudge: z29.enum(["sent", "missed"]).optional()
16562
16670
  }));
16563
16671
  var LINEAR_ISSUE_SUMMARIES_MAX = 50;
16564
- var linearIssueSummariesRequestSchema = z28.object({ identifiers: z28.array(linearIdentifier).min(1).max(LINEAR_ISSUE_SUMMARIES_MAX) });
16672
+ var linearIssueSummariesRequestSchema = z29.object({ identifiers: z29.array(linearIdentifier).min(1).max(LINEAR_ISSUE_SUMMARIES_MAX) });
16565
16673
 
16566
16674
  // ../shared/src/user-message-matching.ts
16567
16675
  var parsedTimestamps = /* @__PURE__ */ new Map();
@@ -16931,10 +17039,10 @@ function currentStepLabel(messages, earlierPlainStep) {
16931
17039
  }
16932
17040
 
16933
17041
  // ../shared/src/user-message-attachments.ts
16934
- import { z as z29 } from "zod";
17042
+ import { z as z30 } from "zod";
16935
17043
  var ATTACHMENT_PLACEHOLDER_REGEX = /^\[\d+ (?:(?:images?|files?)(?: and \d+ files?)? attached|(?:image )?attachments?)\]$/;
16936
17044
  var withoutAttachmentPlaceholder = (content, attached) => attached && ATTACHMENT_PLACEHOLDER_REGEX.test(content) ? "" : content;
16937
- var annotationLinesSchema = z29.object({ path: z29.string(), start: z29.number(), end: z29.number() });
17045
+ var annotationLinesSchema = z30.object({ path: z30.string(), start: z30.number(), end: z30.number() });
16938
17046
  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".';
16939
17047
  var ANNOTATIONS_NOTE_REGEX = /(?:^|\n\n)<replicas_annotations>\n([\s\S]*?)\n<\/replicas_annotations>$/;
16940
17048
  var ANNOTATION_HEADER_REGEX = /^Annotation \d+$/m;
@@ -19617,8 +19725,8 @@ function parseAgentEventJsonl(content, options = {}) {
19617
19725
  }
19618
19726
 
19619
19727
  // ../shared/src/chat-transcript-pages.ts
19620
- var decoder = new TextDecoder("utf-8", { fatal: true });
19621
- var encoder = new TextEncoder();
19728
+ var decoder2 = new TextDecoder("utf-8", { fatal: true });
19729
+ var encoder2 = new TextEncoder();
19622
19730
  var MAX_SOURCE_PAGE_BYTES = 4 * 1024 * 1024;
19623
19731
  var SOURCE_RANGE_BYTES = 256 * 1024;
19624
19732
  var CHAT_HISTORY_PAGE_MAX_BYTES = 1024 * 1024;
@@ -19630,7 +19738,7 @@ async function readExactRange(readRange, startByte, endByte, error) {
19630
19738
  function forEachJsonlRecord(bytes, lineStart, offset, visit) {
19631
19739
  for (let lineEnd = bytes.indexOf(10, lineStart); lineEnd !== -1; lineEnd = bytes.indexOf(10, lineStart)) {
19632
19740
  try {
19633
- visit(JSON.parse(decoder.decode(bytes.subarray(lineStart, lineEnd))), { offset: offset + lineStart, length: lineEnd - lineStart });
19741
+ visit(JSON.parse(decoder2.decode(bytes.subarray(lineStart, lineEnd))), { offset: offset + lineStart, length: lineEnd - lineStart });
19634
19742
  } catch {
19635
19743
  }
19636
19744
  lineStart = lineEnd + 1;
@@ -19682,7 +19790,7 @@ async function readJsonlPage(args) {
19682
19790
  pageRecordStarts.push(record.offset);
19683
19791
  const item = args.parse(value, record);
19684
19792
  if (item === void 0) return;
19685
- const itemSize = item === value ? record.length : encoder.encode(JSON.stringify(item)).byteLength;
19793
+ const itemSize = item === value ? record.length : encoder2.encode(JSON.stringify(item)).byteLength;
19686
19794
  page.push({ item, startByte: record.offset, bytes: itemSize });
19687
19795
  itemBytes += itemSize;
19688
19796
  const turnId = args.turns?.turnId(item);
@@ -19792,7 +19900,7 @@ async function readJsonlRecord(args) {
19792
19900
  const bytes = await readExactRange(args.readRange, from, offset + length + 1, "Incomplete JSONL record read");
19793
19901
  if (offset > 0 && bytes[0] !== 10 || bytes[bytes.length - 1] !== 10) return void 0;
19794
19902
  try {
19795
- return JSON.parse(decoder.decode(bytes.subarray(offset - from, bytes.length - 1)));
19903
+ return JSON.parse(decoder2.decode(bytes.subarray(offset - from, bytes.length - 1)));
19796
19904
  } catch {
19797
19905
  return void 0;
19798
19906
  }
@@ -20231,7 +20339,7 @@ var VOICE_WAVEFORM = {
20231
20339
  };
20232
20340
 
20233
20341
  // ../shared/src/e2b.ts
20234
- var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-11-16-v2";
20342
+ var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-11-16-v4";
20235
20343
 
20236
20344
  // ../shared/src/e2b-retry.ts
20237
20345
  var DEFAULT_BACKOFFS_MS = [2e3, 5e3];
@@ -20587,38 +20695,38 @@ function resolveWarmHookConfig(value) {
20587
20695
  }
20588
20696
 
20589
20697
  // ../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(),
20698
+ import { z as z31 } from "zod";
20699
+ var variableNameSchema = z31.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name");
20700
+ var mcpValueSchema = z31.union([
20701
+ z31.string(),
20594
20702
  environmentMcpVariableReferenceSchema
20595
20703
  ]);
20596
- var mcpValuesSchema = z30.record(z30.string(), mcpValueSchema);
20704
+ var mcpValuesSchema = z31.record(z31.string(), mcpValueSchema);
20597
20705
  var httpConfigSchema = environmentMcpHttpConfigSchema.pick({ url: true, auth: true }).extend({
20598
20706
  headers: mcpValuesSchema.default({})
20599
20707
  }).strict();
20600
- var replicasMcpDefinitionSchema = z30.discriminatedUnion("transport", [
20601
- z30.strictObject({
20602
- transport: z30.literal("stdio"),
20708
+ var replicasMcpDefinitionSchema = z31.discriminatedUnion("transport", [
20709
+ z31.strictObject({
20710
+ transport: z31.literal("stdio"),
20603
20711
  config: environmentMcpStdioConfigSchema.pick({ command: true }).extend({
20604
20712
  args: environmentMcpStdioConfigSchema.shape.args.unwrap().default([]),
20605
- env: z30.record(variableNameSchema, mcpValueSchema).default({})
20713
+ env: z31.record(variableNameSchema, mcpValueSchema).default({})
20606
20714
  }).strict()
20607
20715
  }),
20608
- z30.strictObject({ transport: z30.literal("http"), config: httpConfigSchema }),
20609
- z30.strictObject({ transport: z30.literal("sse"), config: httpConfigSchema })
20716
+ z31.strictObject({ transport: z31.literal("http"), config: httpConfigSchema }),
20717
+ z31.strictObject({ transport: z31.literal("sse"), config: httpConfigSchema })
20610
20718
  ]).superRefine((definition, context) => {
20611
20719
  if (definition.transport === "stdio") return;
20612
20720
  const result = validateEnvironmentMcpAuthentication(definition.transport, definition.config);
20613
20721
  if (!result.ok) context.addIssue({ code: "custom", path: result.error.code === "transport" ? ["transport"] : ["config", result.error.code ?? "auth"], message: result.error.message });
20614
20722
  });
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()
20723
+ var replicasEnvironmentConfigSchema = z31.strictObject({
20724
+ systemPrompt: z31.string().optional(),
20725
+ warmHook: z31.string().optional(),
20726
+ startHook: z31.string().optional(),
20727
+ variables: z31.record(variableNameSchema, z31.string()).optional(),
20728
+ requiredSecrets: z31.array(variableNameSchema).optional(),
20729
+ mcps: z31.record(z31.string().regex(MCP_NAME_PATTERN, "must be 1\u201364 letters, digits, underscores or hyphens, starting with a letter or digit").refine((name) => !isReservedMcpName(name), "is reserved for Replicas"), replicasMcpDefinitionSchema).optional()
20622
20730
  }).superRefine((config, context) => {
20623
20731
  const names = /* @__PURE__ */ new Set();
20624
20732
  for (const name of Object.keys(config.mcps ?? {})) {
@@ -20770,11 +20878,15 @@ function hasChatStarted(chat) {
20770
20878
  return chat.processing || Boolean(chat.awaitingInput) || Boolean(chat.goal) || Boolean(chat.lastMessageText) || chat.updatedAt > chat.createdAt;
20771
20879
  }
20772
20880
 
20881
+ // ../shared/src/engine/exec-client.ts
20882
+ var RECONNECT_GIVE_UP_MS = 2 * 6e4;
20883
+ var encoder3 = new TextEncoder();
20884
+
20773
20885
  // ../shared/src/routes/billing.ts
20774
- import { z as z31 } from "zod";
20886
+ import { z as z32 } from "zod";
20775
20887
  var SOURCE_LIMIT_SOURCES = ["limrun", "modal"];
20776
- var usageLimitCentsSchema = z31.number().int().min(100).max(1e8);
20777
- var sourceLimitsCentsSchema = z31.partialRecord(z31.enum(SOURCE_LIMIT_SOURCES), usageLimitCentsSchema);
20888
+ var usageLimitCentsSchema = z32.number().int().min(100).max(1e8);
20889
+ var sourceLimitsCentsSchema = z32.partialRecord(z32.enum(SOURCE_LIMIT_SOURCES), usageLimitCentsSchema);
20778
20890
 
20779
20891
  // ../shared/src/routes/codex.ts
20780
20892
  var CODEX_AUTH_ENV_KEYS = [
@@ -20928,7 +21040,7 @@ var CLAUDE_AUTH_ENV_KEYS_BY_METHOD = {
20928
21040
  };
20929
21041
 
20930
21042
  // ../shared/src/routes/command-protection.ts
20931
- import { z as z32 } from "zod";
21043
+ import { z as z33 } from "zod";
20932
21044
 
20933
21045
  // ../shared/src/git-invocations.ts
20934
21046
  var COMMIT_VALUE_OPTIONS = /* @__PURE__ */ new Set(["message", "file", "trailer", "reuse-message", "reedit-message", "fixup", "squash", "template", "author", "date", "cleanup", "pathspec-from-file"]);
@@ -21019,27 +21131,27 @@ function findCheckoutTarget(args) {
21019
21131
  }
21020
21132
 
21021
21133
  // ../shared/src/routes/command-protection.ts
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()
21134
+ var commandProtectionRepoStateSchema = z33.object({
21135
+ branch: z33.string().nullable(),
21136
+ defaultBranch: z33.string().nullable(),
21137
+ pushBranch: z33.string().nullable(),
21138
+ pushConfig: z33.string().nullable(),
21139
+ headMessage: z33.string().nullable(),
21140
+ mergeInProgress: z33.boolean().optional()
21029
21141
  });
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(),
21142
+ var commandProtectionEvaluateRequestSchema = z33.object({
21143
+ provider: z33.enum(["claude", "codex", "cursor", "opencode", "pi"]),
21144
+ source: z33.enum(["claude_pre_tool_use", "codex_approval_request", "cursor_pre_tool_use", "opencode_pre_tool_use", "pi_tool_call"]),
21145
+ toolName: z33.string(),
21146
+ toolInput: z33.unknown(),
21147
+ command: z33.string().nullish(),
21148
+ cwd: z33.string().nullish(),
21149
+ toolUseId: z33.string().nullish(),
21038
21150
  // Read by the engine before the command runs, keyed by absolute path, so the
21039
21151
  // policy can see branches and commit messages the command text only references.
21040
- gitContext: z32.object({
21041
- repos: z32.record(z32.string(), commandProtectionRepoStateSchema),
21042
- messageFiles: z32.record(z32.string(), z32.string())
21152
+ gitContext: z33.object({
21153
+ repos: z33.record(z33.string(), commandProtectionRepoStateSchema),
21154
+ messageFiles: z33.record(z33.string(), z33.string())
21043
21155
  }).optional()
21044
21156
  });
21045
21157
  var COMMAND_PROTECTION_COMMAND_KEYS = ["command", "cmd", "script", "query", "endpoint", "path", "url", "mutation"];
@@ -21260,125 +21372,125 @@ function shouldRefreshPullRequests(toolName, toolInput) {
21260
21372
  }
21261
21373
 
21262
21374
  // ../shared/src/routes/scout.ts
21263
- import { z as z33 } from "zod";
21375
+ import { z as z34 } from "zod";
21264
21376
  var SCOUT_LINEAR_ACTIONS = ["ask", "start"];
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.")
21377
+ var scoutLinearSessionIntentRequestSchema = z34.object({
21378
+ comment_id: z34.string().trim().min(1).describe("Id of the Linear comment the session will be created on."),
21379
+ action: z34.enum(SCOUT_LINEAR_ACTIONS).describe("`ask` when the comment is a clarifying question, `start` when it hands off the task.")
21268
21380
  });
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.")
21381
+ var scoutLinearStartRequestSchema = z34.object({
21382
+ issue_id: z34.string().describe("Linear issue id from the envelope's `issue_id`."),
21383
+ agent_session_id: z34.string().describe("Existing Linear agent session id from the envelope's `agent_session_id`."),
21384
+ prompt: z34.string().trim().min(1).describe("The latest request, in its author's words. The workspace already receives the issue and its comments.")
21273
21385
  });
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.")
21386
+ var scoutRouteLinearTicketRequestSchema = z34.object({
21387
+ agent_session_id: z34.string().trim().min(1).describe("The ticket's `agent_session_id` from the envelope."),
21388
+ environment_id: z34.string().trim().min(1).optional().describe("Start the ticket in this environment."),
21389
+ mothership_id: z34.string().trim().min(1).optional().describe("Hand the ticket to this Mothership instead.")
21278
21390
  }).refine((args) => !(args.environment_id && args.mothership_id), "Pass environment_id or mothership_id, not both.");
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({
21391
+ var slackChannelIdSchema = z34.string().describe("Slack channel id from the envelope's `channel_id`.");
21392
+ var slackThreadTsSchema = z34.string().describe("Slack thread timestamp from the envelope's `thread_ts`.");
21393
+ var scoutSlackMessageReferenceSchema = z34.object({
21282
21394
  channel_id: slackChannelIdSchema,
21283
21395
  thread_ts: slackThreadTsSchema,
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`).")
21396
+ message_ts: z34.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
21397
+ user_id: z34.string().describe("Slack user id of that message's author (the envelope's `user_id`).")
21286
21398
  });
21287
- var scoutSlackSpawnRequestSchema = z33.object({
21399
+ var scoutSlackSpawnRequestSchema = z34.object({
21288
21400
  channel_id: slackChannelIdSchema,
21289
21401
  thread_ts: slackThreadTsSchema,
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.`)
21402
+ message_ts: z34.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."),
21403
+ user_id: z34.string().describe("Slack user id of that message's author (the envelope's `user_id`). The workspace is attributed to them."),
21404
+ prompt: z34.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."),
21405
+ acknowledgement_ts: z34.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."),
21406
+ environment_id: z34.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.`)
21295
21407
  });
21296
21408
  var scoutSlackSpawnInNewThreadRequestSchema = scoutSlackSpawnRequestSchema.extend({
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.")
21409
+ title: z34.string().trim().min(1).max(500).describe("One or two sentences stating the task, posted as the new top-level message."),
21410
+ prompt: z34.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."),
21411
+ acknowledgement_ts: z34.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.")
21300
21412
  });
21301
- var scoutSlackRelayRequestSchema = z33.object({
21413
+ var scoutSlackRelayRequestSchema = z34.object({
21302
21414
  channel_id: slackChannelIdSchema,
21303
21415
  thread_ts: slackThreadTsSchema,
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.")
21416
+ message: z34.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."),
21417
+ user_id: z34.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`."),
21418
+ queue: z34.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."),
21419
+ workspace_id: z34.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.`),
21420
+ message_ts: z34.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.")
21309
21421
  });
21310
- var scoutSlackSetThreadMutedRequestSchema = z33.object({
21422
+ var scoutSlackSetThreadMutedRequestSchema = z34.object({
21311
21423
  channel_id: slackChannelIdSchema,
21312
21424
  thread_ts: slackThreadTsSchema,
21313
- muted: z33.boolean().describe("true to mute Replicas in this thread, false to unmute it.")
21425
+ muted: z34.boolean().describe("true to mute Replicas in this thread, false to unmute it.")
21314
21426
  });
21315
21427
  var scoutSlackStopWorkspaceRequestSchema = scoutSlackMessageReferenceSchema.extend({
21316
- archive: z33.boolean().describe("true only when the person also asked to close or archive the workspace.")
21428
+ archive: z34.boolean().describe("true only when the person also asked to close or archive the workspace.")
21317
21429
  });
21318
- var scoutListWorkspacesRequestSchema = z33.object({
21430
+ var scoutListWorkspacesRequestSchema = z34.object({
21319
21431
  channel_id: slackChannelIdSchema,
21320
21432
  thread_ts: slackThreadTsSchema,
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.")
21433
+ message_ts: z34.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
21434
+ user_id: z34.string().describe("Slack user id of that message's author (the envelope's `user_id`). Only workspaces they can see are listed."),
21435
+ query: z34.string().trim().min(1).optional().describe("Case-insensitive text to match against workspace and Mothership names and pull request URLs.")
21324
21436
  });
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.")
21437
+ var scoutSlackConfirmationSchema = z34.object({
21438
+ confirmation_channel_id: z34.string().describe("`channel_id` from the envelope of the Slack message that asked for or accepted this."),
21439
+ confirmation_thread_ts: z34.string().describe("`thread_ts` from that message's envelope."),
21440
+ confirmation_message_ts: z34.string().describe("`message_ts` from that message's envelope."),
21441
+ confirmation_user_id: z34.string().describe("`user_id` from that message's envelope.")
21330
21442
  });
21331
21443
  var scoutAutomationToolInputSchema = automationToolInputSchema.extend(scoutSlackConfirmationSchema.shape);
21332
21444
  var scoutSaveChannelPresetToolInputSchema = scoutSlackConfirmationSchema.extend({
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.")
21445
+ preset_id: z34.string().optional().describe(`Id of the preset to update, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`. Omit to create a new preset.`),
21446
+ name: z34.string().trim().min(1).max(SCOUT_PRESET_NAME_MAX_LENGTH).optional().describe("Preset name. Required when creating."),
21447
+ description: z34.string().optional().describe("One-line summary of what the preset is for."),
21448
+ icon: z34.enum(SCOUT_PRESET_ICONS).optional(),
21449
+ instructions: z34.string().optional().describe("Complete preset instructions; replaces the existing text. Required when creating.")
21338
21450
  });
21339
21451
  var scoutUpdateChannelSettingsToolInputSchema = scoutSlackConfirmationSchema.extend({
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`.")
21452
+ source: z34.enum(SCOUT_SOURCE_TYPES).optional().describe("Defaults to `slack`."),
21453
+ external_id: z34.string().describe("Slack channel id or Linear team id."),
21454
+ monitored: z34.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."),
21455
+ preset_id: z34.string().nullable().optional().describe("Preset to assign; `null` removes the preset. Omit to keep it."),
21456
+ instructions: z34.string().nullable().optional().describe("Complete channel-specific instructions, applied after the preset; replaces the existing text. `null` clears them. Omit to keep them."),
21457
+ proactivity: z34.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."),
21458
+ silent: z34.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.`),
21459
+ muted: z34.enum(["on", "off", "default"]).optional().describe("Kept for older callers; prefer `silent`.")
21348
21460
  });
21349
21461
  var mothershipSlackChannelLevelToolInputSchema = scoutSlackConfirmationSchema.extend({
21350
21462
  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`.")
21351
21463
  });
21352
21464
  var scoutSetSlackConnectMutedToolInputSchema = scoutSlackConfirmationSchema.extend({
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.")
21465
+ muted: z34.boolean().describe("`true` puts every Slack Connect channel without its own setting in silent mode; `false` lets them follow their levels again.")
21354
21466
  });
21355
21467
  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.")
21468
+ silent: z34.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."),
21469
+ muted: z34.boolean().optional().describe("Kept for older callers; prefer `silent`."),
21470
+ preset_id: z34.string().optional().describe("Preset for every Slack Connect channel without its own preset or instructions; an empty string removes it. Omit to keep it."),
21471
+ instructions: z34.string().optional().describe("Complete default instructions, applied after that preset; replaces the existing text. An empty string clears them. Omit to keep them."),
21472
+ proactivity: z34.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.")
21361
21473
  });
21362
21474
  var scoutSetOrganizationProactivityToolInputSchema = scoutSlackConfirmationSchema.extend({
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.`)
21475
+ proactivity: z34.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.`)
21364
21476
  });
21365
21477
  var scoutDeleteChannelPresetToolInputSchema = scoutSlackConfirmationSchema.extend({
21366
- preset_id: z33.string().describe(`Id of the preset to delete, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`.`)
21478
+ preset_id: z34.string().describe(`Id of the preset to delete, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`.`)
21367
21479
  });
21368
21480
  var RESET_TO_DEFAULT = "default";
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.`);
21481
+ var resettable = (schema, description) => z34.union([schema, z34.literal(RESET_TO_DEFAULT)]).optional().describe(`${description} \`${RESET_TO_DEFAULT}\` falls back to the organization default. Omit to keep it.`);
21370
21482
  var scoutSetSlackAgentDefaultsToolInputSchema = scoutSlackConfirmationSchema.extend({
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.")
21483
+ agent_provider: resettable(z34.enum(AGENT), "Agent for Slack-triggered workspaces. Changing it without `model` resets the model to that agent's default."),
21484
+ model: resettable(z34.string(), "Model id for that agent; the default is the agent's own."),
21485
+ thinking_level: resettable(z34.enum(VALID_THINKING_LEVELS), "Thinking level."),
21486
+ goal_mode: resettable(z34.boolean(), "Goal mode."),
21487
+ fast_mode: resettable(z34.boolean(), "Fast mode.")
21376
21488
  });
21377
- var scoutClaimSettingsOfferToolInputSchema = z33.object({
21489
+ var scoutClaimSettingsOfferToolInputSchema = z34.object({
21378
21490
  channel_id: slackChannelIdSchema,
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.")
21491
+ kind: z34.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."),
21492
+ user_id: z34.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."),
21493
+ declined: z34.boolean().optional().describe("true when the person declined an offer you already made, so it is not made again.")
21382
21494
  });
21383
21495
 
21384
21496
  // ../shared/src/routes/plugin-catalog.ts
@@ -21736,22 +21848,22 @@ var PLUGIN_CATALOG = [
21736
21848
  ].map((plugin) => ({ ...plugin, readOnlyScopes: READ_ONLY_SCOPES[plugin.id] }));
21737
21849
 
21738
21850
  // ../shared/src/routes/sentry.ts
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()
21851
+ import { z as z35 } from "zod";
21852
+ var sentrySelfHostedConnectRequestSchema = z35.object({
21853
+ baseUrl: z35.string().min(1),
21854
+ token: z35.string().trim().min(1),
21855
+ webhookSecret: z35.string().trim().optional()
21744
21856
  });
21745
21857
 
21746
21858
  // ../shared/src/routes/user.ts
21747
21859
  var PROFILE_AVATAR_MAX_SIZE_BYTES = 5 * 1024 * 1024;
21748
21860
 
21749
21861
  // ../shared/src/routes/web-auth.ts
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()
21862
+ import { z as z36 } from "zod";
21863
+ var webAuthRedeemResponseSchema = z36.object({
21864
+ path: z36.string(),
21865
+ organizationId: z36.string().nullable(),
21866
+ session: z36.object({ access_token: z36.string(), refresh_token: z36.string(), user: z36.object({ id: z36.string(), email: z36.string() }) }).nullable()
21755
21867
  });
21756
21868
 
21757
21869
  // ../shared/src/routes/client-state.ts
@@ -21776,104 +21888,104 @@ var promptHistoryClientStateKey = orgUserClientStateKey(PROMPT_HISTORY_CLIENT_ST
21776
21888
  var workspaceSearchOpensClientStateKey = orgUserClientStateKey(WORKSPACE_SEARCH_OPENS_CLIENT_STATE_KEY_PREFIX);
21777
21889
 
21778
21890
  // ../shared/src/routes/workspace-events.ts
21779
- import { z as z37 } from "zod";
21891
+ import { z as z38 } from "zod";
21780
21892
 
21781
21893
  // ../shared/src/routes/presence.ts
21782
- import { z as z36 } from "zod";
21783
- var presenceStatusSchema = z36.enum(["online", "typing"]);
21784
- var presenceLocationSchema = z36.object({
21785
- workspaceId: z36.string().optional()
21894
+ import { z as z37 } from "zod";
21895
+ var presenceStatusSchema = z37.enum(["online", "typing"]);
21896
+ var presenceLocationSchema = z37.object({
21897
+ workspaceId: z37.string().optional()
21786
21898
  });
21787
- var presenceEntrySchema = z36.object({
21788
- userId: z36.string(),
21899
+ var presenceEntrySchema = z37.object({
21900
+ userId: z37.string(),
21789
21901
  status: presenceStatusSchema,
21790
21902
  location: presenceLocationSchema,
21791
- ts: z36.string()
21903
+ ts: z37.string()
21792
21904
  });
21793
- var updatePresenceRequestSchema = z36.object({
21905
+ var updatePresenceRequestSchema = z37.object({
21794
21906
  status: presenceStatusSchema,
21795
21907
  location: presenceLocationSchema.optional()
21796
21908
  });
21797
21909
 
21798
21910
  // ../shared/src/routes/workspace-events.ts
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()
21911
+ var workspaceTurnCompletionSchema = z38.object({
21912
+ workspaceName: z38.string(),
21913
+ completedAt: z38.string(),
21914
+ processing: z38.boolean().optional(),
21915
+ pullRequestFeedback: z38.boolean().optional(),
21916
+ attention: z38.object({ reason: z38.enum(CHAT_ATTENTION_REASONS), userId: z38.string() }).optional()
21805
21917
  });
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(),
21918
+ var workspaceEventSchemaByType = z38.discriminatedUnion("type", [
21919
+ z38.object({
21920
+ type: z38.literal("workspace.changed"),
21921
+ workspaceId: z38.string(),
21922
+ accessChangedFor: z38.string().optional(),
21923
+ accessChangedForOrg: z38.literal(true).optional(),
21924
+ workspace: z38.object({ status: z38.enum(WORKSPACE_STATUSES), last_activity_at: z38.string().nullable() }).optional(),
21925
+ name: z38.string().optional(),
21814
21926
  completion: workspaceTurnCompletionSchema.optional(),
21815
- ts: z37.string()
21927
+ ts: z38.string()
21816
21928
  }),
21817
- z37.object({
21818
- type: z37.literal("workspace.chat.changed"),
21819
- workspaceId: z37.string(),
21820
- chatId: z37.string(),
21821
- ts: z37.string()
21929
+ z38.object({
21930
+ type: z38.literal("workspace.chat.changed"),
21931
+ workspaceId: z38.string(),
21932
+ chatId: z38.string(),
21933
+ ts: z38.string()
21822
21934
  }),
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()
21935
+ z38.object({
21936
+ type: z38.literal("workspace.chat.advanced"),
21937
+ workspaceId: z38.string(),
21938
+ chatId: z38.string(),
21939
+ afterCursor: z38.string().optional(),
21940
+ processing: z38.boolean(),
21941
+ ts: z38.string()
21830
21942
  }),
21831
- z37.object({
21832
- type: z37.literal("mobile-testing.changed"),
21833
- workspaceId: z37.string(),
21834
- ts: z37.string()
21943
+ z38.object({
21944
+ type: z38.literal("mobile-testing.changed"),
21945
+ workspaceId: z38.string(),
21946
+ ts: z38.string()
21835
21947
  }),
21836
- z37.object({
21837
- type: z37.literal("variable-request.changed"),
21838
- workspaceId: z37.string(),
21839
- ts: z37.string()
21948
+ z38.object({
21949
+ type: z38.literal("variable-request.changed"),
21950
+ workspaceId: z38.string(),
21951
+ ts: z38.string()
21840
21952
  }),
21841
- z37.object({
21842
- type: z37.literal("local-control-request.changed"),
21843
- workspaceId: z37.string(),
21844
- ts: z37.string()
21953
+ z38.object({
21954
+ type: z38.literal("local-control-request.changed"),
21955
+ workspaceId: z38.string(),
21956
+ ts: z38.string()
21845
21957
  }),
21846
- z37.object({
21847
- type: z37.literal("pull-request.changed"),
21848
- prUrl: z37.string(),
21849
- ts: z37.string()
21958
+ z38.object({
21959
+ type: z38.literal("pull-request.changed"),
21960
+ prUrl: z38.string(),
21961
+ ts: z38.string()
21850
21962
  }),
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()
21963
+ z38.object({
21964
+ type: z38.literal("mothership.subagent.changed"),
21965
+ workspaceId: z38.string(),
21966
+ subagent: z38.object({ id: z38.string(), name: z38.string(), prUrl: z38.string().nullable() }),
21967
+ ts: z38.string()
21856
21968
  }),
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()
21969
+ z38.object({ type: z38.literal("mothership.board.changed"), workspaceId: z38.string(), ts: z38.string() }),
21970
+ z38.object({ type: z38.literal("needs-you.changed"), workspaceId: z38.string().nullable(), userId: z38.string().optional(), ts: z38.string() }),
21971
+ z38.object({
21972
+ type: z38.literal("workspace.shared"),
21973
+ workspaceId: z38.string(),
21974
+ workspaceName: z38.string(),
21975
+ sharedWithUserId: z38.string(),
21976
+ sharedByName: z38.string(),
21977
+ ts: z38.string()
21866
21978
  })
21867
21979
  ]);
21868
- var workspaceChangedEventSchema = z37.union([
21980
+ var workspaceChangedEventSchema = z38.union([
21869
21981
  workspaceEventSchemaByType,
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() })
21982
+ z38.object({ type: z38.literal("presence.changed"), userId: z38.string(), entry: presenceEntrySchema.nullable(), ts: z38.string() }),
21983
+ z38.object({ type: z38.literal("presence.changed"), ts: z38.string() })
21872
21984
  ]);
21873
21985
 
21874
21986
  // ../shared/src/routes/review-messages.ts
21875
- import { z as z38 } from "zod";
21876
- var sendPullRequestReviewMessageRequestSchema = z38.object({
21987
+ import { z as z39 } from "zod";
21988
+ var sendPullRequestReviewMessageRequestSchema = z39.object({
21877
21989
  ...sendChatMessageRequestSchema.pick({
21878
21990
  message: true,
21879
21991
  messageId: true,
@@ -21886,8 +21998,8 @@ var sendPullRequestReviewMessageRequestSchema = z38.object({
21886
21998
  ultrafastMode: true
21887
21999
  }).shape,
21888
22000
  /** Starts a new chat instead of continuing the PR's review chat. The provider only applies to a new chat. */
21889
- newChat: z38.boolean().optional(),
21890
- provider: z38.enum(VALID_AGENT_PROVIDERS).optional()
22001
+ newChat: z39.boolean().optional(),
22002
+ provider: z39.enum(VALID_AGENT_PROVIDERS).optional()
21891
22003
  });
21892
22004
 
21893
22005
  // ../shared/src/audit-log.ts
@@ -22550,40 +22662,40 @@ function isSkillRegistryManifest(value) {
22550
22662
  }
22551
22663
 
22552
22664
  // ../shared/src/routes/variable-requests.ts
22553
- import { z as z39 } from "zod";
22665
+ import { z as z40 } from "zod";
22554
22666
  var VARIABLE_REQUEST_WAIT = { defaultMs: 10 * 6e4, maxMs: 30 * 6e4, pollMs: 3e3, waiterStaleMs: 15e3 };
22555
22667
  var VARIABLE_REQUEST_DESTINATIONS = ["environment", "workspace"];
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()
22668
+ var requestedVariableSchema = z40.object({
22669
+ key: z40.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name").max(ENVIRONMENT_SETUP_LIMITS.variableKeyChars),
22670
+ required: z40.boolean(),
22671
+ replace: z40.boolean().optional()
22560
22672
  });
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({
22673
+ var requestedVariablesSchema = z40.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");
22674
+ var createVariableRequestSchema = z40.object({
22563
22675
  variables: requestedVariablesSchema,
22564
- reason: z39.string().trim().max(500).nullish().transform((value) => value || null),
22565
- wait: z39.boolean().default(true)
22676
+ reason: z40.string().trim().max(500).nullish().transform((value) => value || null),
22677
+ wait: z40.boolean().default(true)
22566
22678
  });
22567
- var respondVariableRequestSchema = z39.discriminatedUnion("action", [
22568
- z39.object({
22569
- action: z39.literal("provide"),
22570
- destination: z39.enum(VARIABLE_REQUEST_DESTINATIONS),
22679
+ var respondVariableRequestSchema = z40.discriminatedUnion("action", [
22680
+ z40.object({
22681
+ action: z40.literal("provide"),
22682
+ destination: z40.enum(VARIABLE_REQUEST_DESTINATIONS),
22571
22683
  /** Defaults to the workspace's environment, so older clients keep saving there. */
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())
22684
+ environment_ids: z40.array(z40.string().uuid()).optional(),
22685
+ overwrite: z40.boolean().optional(),
22686
+ values: z40.record(z40.string().regex(VARIABLE_KEY_RE), z40.string())
22575
22687
  }),
22576
- z39.object({ action: z39.literal("skip") })
22688
+ z40.object({ action: z40.literal("skip") })
22577
22689
  ]);
22578
22690
 
22579
22691
  // ../shared/src/routes/local-control-requests.ts
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)
22692
+ import { z as z41 } from "zod";
22693
+ var createLocalControlRequestSchema = z41.object({
22694
+ reason: z41.string().trim().max(500).optional().transform((value) => value || null),
22695
+ wait: z41.boolean().default(true)
22584
22696
  });
22585
- var respondLocalControlRequestSchema = z40.object({ action: z40.enum(["allow", "dismiss"]) });
22586
- var setLocalControlSchema = z40.object({ enabled: z40.boolean() });
22697
+ var respondLocalControlRequestSchema = z41.object({ action: z41.enum(["allow", "dismiss"]) });
22698
+ var setLocalControlSchema = z41.object({ enabled: z41.boolean() });
22587
22699
 
22588
22700
  export {
22589
22701
  ENGINE_SEND_MESSAGE_FAILED_ERROR,
@@ -22883,6 +22995,19 @@ export {
22883
22995
  serializeMuseAuthFile,
22884
22996
  isVersionBelow,
22885
22997
  hasChatStarted,
22998
+ EXEC_SOCKET_PATH,
22999
+ EXEC_PROTOCOL_VERSION,
23000
+ EXEC_PING_INTERVAL_MS,
23001
+ EXEC_SILENCE_TIMEOUT_MS,
23002
+ EXEC_MAX_FRAME_BYTES,
23003
+ EXEC_DEFAULT_READ_BYTES,
23004
+ EXEC_PROCESS_BUFFER_BYTES,
23005
+ EXEC_DEFAULT_IDLE_TTL_MS,
23006
+ EXEC_FRAME,
23007
+ encodeExecFrame,
23008
+ decodeExecFrame,
23009
+ EXEC_ERROR_CODES,
23010
+ execRequestSchema,
22886
23011
  CODEX_AUTH_ENV_KEYS,
22887
23012
  codexAuthEnvFromResponse,
22888
23013
  CODEX_AUTH_ENV_KEYS_BY_METHOD,