replicas-engine 0.1.1571 → 0.1.1573

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 z38 = void 0;
1119
+ let z39 = 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
- z38 = offsetZ;
1126
+ z39 = offsetZ;
1127
1127
  this.dt = dt;
1128
1128
  } else {
1129
- z38 = "UTC";
1129
+ z39 = "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
- z38 = dt.zone.name;
1139
+ z39 = dt.zone.name;
1140
1140
  } else {
1141
- z38 = "UTC";
1141
+ z39 = "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 || z38;
1150
+ intlOpts.timeZone = intlOpts.timeZone || z39;
1151
1151
  this.dtf = getCachedDTF(intl, intlOpts);
1152
1152
  }
1153
1153
  format() {
@@ -9304,7 +9304,7 @@ function getProviderDisplayName(provider2, variant = "short") {
9304
9304
  }
9305
9305
 
9306
9306
  // ../shared/src/routes/mothership.ts
9307
- import { z as z2 } from "zod";
9307
+ import { z as z4 } from "zod";
9308
9308
 
9309
9309
  // ../shared/src/routes/pull-requests.ts
9310
9310
  import { z } from "zod";
@@ -9466,32 +9466,78 @@ var mergePullRequestRequestSchema = z.object({
9466
9466
  bypassRules: z.boolean().optional()
9467
9467
  });
9468
9468
 
9469
+ // ../shared/src/automations/linear/index.ts
9470
+ import { z as z3 } from "zod";
9471
+
9472
+ // ../shared/src/routes/linear.ts
9473
+ import { z as z2 } from "zod";
9474
+ var linearSessionMetadataSchema = z2.object({
9475
+ via_mothership: z2.boolean().optional(),
9476
+ attached: z2.boolean().optional(),
9477
+ routing_chat_id: z2.string().optional(),
9478
+ issue_id: z2.string(),
9479
+ issue_identifier: z2.string(),
9480
+ issue_title: z2.string(),
9481
+ issue_description: z2.string(),
9482
+ issue_url: z2.string(),
9483
+ comment_id: z2.string(),
9484
+ comment_body: z2.string(),
9485
+ triggered_by_id: z2.string().optional(),
9486
+ triggered_by_name: z2.string().optional(),
9487
+ triggered_by_email: z2.string().optional(),
9488
+ linear_workspace_id: z2.string().optional(),
9489
+ creator_id: z2.string().optional(),
9490
+ creator_name: z2.string().optional(),
9491
+ creator_email: z2.string().optional(),
9492
+ assignee_id: z2.string().optional(),
9493
+ assignee_name: z2.string().optional(),
9494
+ assignee_email: z2.string().optional(),
9495
+ issue_state: z2.string().optional(),
9496
+ parent_issue: z2.object({
9497
+ id: z2.string(),
9498
+ identifier: z2.string(),
9499
+ title: z2.string(),
9500
+ description: z2.string().nullable()
9501
+ }).optional(),
9502
+ workspace: z2.object({
9503
+ id: z2.string(),
9504
+ coding_agent: z2.custom((value) => typeof value === "string" && isValidAgentProvider(value)),
9505
+ task_description: z2.string(),
9506
+ created_at: z2.string()
9507
+ }).optional()
9508
+ });
9509
+ var LINEAR_WORKFLOW_STATE_TYPES = ["triage", "backlog", "unstarted", "started", "completed", "canceled", "duplicate"];
9510
+
9511
+ // ../shared/src/automations/linear/index.ts
9512
+ var LINEAR_ISSUE_STATE_CHANGED_EVENT = "issue.state_changed";
9513
+ var LINEAR_ISSUE_MATCHED_EVENT = "issue.matched";
9514
+ var linearIssueFiltersSchema = z3.object({
9515
+ current_cycle: z3.boolean().optional(),
9516
+ label_ids: z3.array(z3.string().min(1)).min(1).optional(),
9517
+ project_id: z3.string().min(1).optional(),
9518
+ assignee_id: z3.string().min(1).optional()
9519
+ });
9520
+ var LINEAR_STATE_TYPES = LINEAR_WORKFLOW_STATE_TYPES.filter((type) => type !== "duplicate");
9521
+
9469
9522
  // ../shared/src/routes/mothership.ts
9470
- var linearRuleFields = z2.object({
9471
- team_id: z2.string().min(1),
9472
- current_cycle: z2.boolean().optional(),
9473
- label_ids: z2.array(z2.string().min(1)).min(1).optional(),
9474
- project_id: z2.string().min(1).optional(),
9475
- assignee_id: z2.string().min(1).optional()
9476
- }).strict();
9523
+ var linearRuleFields = linearIssueFiltersSchema.extend({ team_id: z4.string().min(1) }).strict();
9477
9524
  var withLabelIds = (value) => {
9478
9525
  if (!isRecord(value) || typeof value.label_id !== "string") return value;
9479
9526
  const { label_id, ...rest } = value;
9480
9527
  return { ...rest, label_ids: [label_id] };
9481
9528
  };
9482
- var mothershipLinearRuleSchema = z2.preprocess(withLabelIds, linearRuleFields);
9483
- var storedMothershipLinearRuleSchema = z2.preprocess(withLabelIds, linearRuleFields.extend({ linked_at: z2.string() }));
9529
+ var mothershipLinearRuleSchema = z4.preprocess(withLabelIds, linearRuleFields);
9484
9530
  var SUBAGENT_SERVICE_TIERS = ["default", "fast", "ultrafast"];
9485
9531
  function serviceTierRequestFields(tier) {
9486
9532
  return { fastMode: tier !== "default", ...tier === "ultrafast" ? { ultrafastMode: true } : {} };
9487
9533
  }
9488
- var mothershipSubagentSettingsSchema = z2.object({
9489
- coding_agent: z2.enum(VALID_AGENT_PROVIDERS),
9490
- model: z2.string().nullable(),
9491
- thinking_level: z2.enum(VALID_THINKING_LEVELS).nullable(),
9492
- service_tier: z2.enum(SUBAGENT_SERVICE_TIERS),
9493
- goal_mode: z2.boolean(),
9494
- plan_mode: z2.boolean()
9534
+ var mothershipSubagentSettingsSchema = z4.object({
9535
+ coding_agent: z4.enum(VALID_AGENT_PROVIDERS),
9536
+ model: z4.string().nullable(),
9537
+ thinking_level: z4.enum(VALID_THINKING_LEVELS).nullable(),
9538
+ service_tier: z4.enum(SUBAGENT_SERVICE_TIERS),
9539
+ goal_mode: z4.boolean(),
9540
+ plan_mode: z4.boolean()
9495
9541
  });
9496
9542
  var QUEUE_SECTIONS = [
9497
9543
  { label: "Open PRs", groups: ["needs_you", "ready_to_merge", "ready_to_review"] },
@@ -9502,22 +9548,22 @@ var MOTHERSHIP_QUEUE_GROUPS = QUEUE_SECTIONS.flatMap((section) => section.groups
9502
9548
  var MOTHERSHIP_SHIPPING_LOOKBACK_MS = 3 * 24 * 60 * 6e4;
9503
9549
 
9504
9550
  // ../shared/src/models-dev.ts
9505
- import { z as z3 } from "zod";
9551
+ import { z as z5 } from "zod";
9506
9552
  var MODELS_DEV_API_URL = "https://models.dev/api.json";
9507
9553
  var MODELS_DEV_CACHE_MS = 5 * 6e4;
9508
9554
  var MODELS_DEV_TIMEOUT_MS = 5e3;
9509
- var modelsDevCatalogSchema = z3.record(z3.string(), z3.object({
9510
- models: z3.record(z3.string(), z3.object({
9511
- id: z3.string().optional(),
9512
- name: z3.string(),
9513
- description: z3.string().optional(),
9514
- status: z3.enum(["alpha", "beta", "deprecated"]).optional(),
9515
- provider: z3.object({ npm: z3.string().optional() }).optional(),
9516
- cost: z3.object({
9517
- input: z3.number().finite().nonnegative().optional(),
9518
- output: z3.number().finite().nonnegative().optional(),
9519
- cache_read: z3.number().finite().nonnegative().optional(),
9520
- cache_write: z3.number().finite().nonnegative().optional()
9555
+ var modelsDevCatalogSchema = z5.record(z5.string(), z5.object({
9556
+ models: z5.record(z5.string(), z5.object({
9557
+ id: z5.string().optional(),
9558
+ name: z5.string(),
9559
+ description: z5.string().optional(),
9560
+ status: z5.enum(["alpha", "beta", "deprecated"]).optional(),
9561
+ provider: z5.object({ npm: z5.string().optional() }).optional(),
9562
+ cost: z5.object({
9563
+ input: z5.number().finite().nonnegative().optional(),
9564
+ output: z5.number().finite().nonnegative().optional(),
9565
+ cache_read: z5.number().finite().nonnegative().optional(),
9566
+ cache_write: z5.number().finite().nonnegative().optional()
9521
9567
  }).optional()
9522
9568
  }))
9523
9569
  }));
@@ -9585,7 +9631,7 @@ function withCamelCaseKeys(body) {
9585
9631
  }
9586
9632
 
9587
9633
  // ../shared/src/engine/types.ts
9588
- import { z as z5 } from "zod";
9634
+ import { z as z7 } from "zod";
9589
9635
 
9590
9636
  // ../shared/src/aster.ts
9591
9637
  var ASTER_PROVIDER = "aster";
@@ -9616,40 +9662,40 @@ function getChatKind(chat) {
9616
9662
  }
9617
9663
 
9618
9664
  // ../shared/src/routes/reviews.ts
9619
- import { z as z4 } from "zod";
9665
+ import { z as z6 } from "zod";
9620
9666
  var PULL_REQUEST_COMMENT_DESTINATIONS = ["comment", "review", "agent"];
9621
- var diffSideSchema = z4.enum(["additions", "deletions"]);
9622
- var createPullRequestCommentRequestSchema = z4.object({
9623
- body: z4.string().trim().min(1).max(65536),
9624
- destination: z4.enum(PULL_REQUEST_COMMENT_DESTINATIONS),
9625
- quote: z4.string().optional(),
9626
- target: z4.union([
9627
- z4.object({
9628
- path: z4.string().min(1),
9629
- line: z4.number().int().positive(),
9667
+ var diffSideSchema = z6.enum(["additions", "deletions"]);
9668
+ var createPullRequestCommentRequestSchema = z6.object({
9669
+ body: z6.string().trim().min(1).max(65536),
9670
+ destination: z6.enum(PULL_REQUEST_COMMENT_DESTINATIONS),
9671
+ quote: z6.string().optional(),
9672
+ target: z6.union([
9673
+ z6.object({
9674
+ path: z6.string().min(1),
9675
+ line: z6.number().int().positive(),
9630
9676
  side: diffSideSchema,
9631
- startLine: z4.number().int().positive().optional(),
9677
+ startLine: z6.number().int().positive().optional(),
9632
9678
  startSide: diffSideSchema.optional()
9633
9679
  }),
9634
- z4.object({ replyTo: z4.string().min(1) })
9680
+ z6.object({ replyTo: z6.string().min(1) })
9635
9681
  ])
9636
9682
  });
9637
9683
  var PULL_REQUEST_REVIEW_EVENTS = ["comment", "approve", "request_changes"];
9638
- var submitPullRequestReviewRequestSchema = z4.object({
9639
- event: z4.enum(PULL_REQUEST_REVIEW_EVENTS),
9640
- body: z4.string().trim().max(65536).default("")
9684
+ var submitPullRequestReviewRequestSchema = z6.object({
9685
+ event: z6.enum(PULL_REQUEST_REVIEW_EVENTS),
9686
+ body: z6.string().trim().max(65536).default("")
9641
9687
  });
9642
- var text = z4.string().trim().catch("");
9643
- var optionalText = z4.string().trim().min(1).optional().catch(void 0);
9644
- var pullRequestTourSchema = z4.object({
9688
+ var text = z6.string().trim().catch("");
9689
+ var optionalText = z6.string().trim().min(1).optional().catch(void 0);
9690
+ var pullRequestTourSchema = z6.object({
9645
9691
  /** The tour chat that wrote this file, so a rerun doesn't show the previous run's tour as in progress. */
9646
9692
  runId: optionalText,
9647
9693
  headSha: optionalText,
9648
- status: z4.enum(["writing", "done"]).catch("writing"),
9694
+ status: z6.enum(["writing", "done"]).catch("writing"),
9649
9695
  summary: text,
9650
9696
  diagram: optionalText,
9651
- files: z4.array(z4.object({ path: text, explanation: text })).catch([]),
9652
- skip: z4.array(z4.object({ path: text, note: text })).catch([])
9697
+ files: z6.array(z6.object({ path: text, explanation: text })).catch([]),
9698
+ skip: z6.array(z6.object({ path: text, note: text })).catch([])
9653
9699
  });
9654
9700
 
9655
9701
  // ../shared/src/languages.ts
@@ -10097,37 +10143,37 @@ var MODEL_LABELS = {
10097
10143
  "kimi-k2.5": "Kimi K2.5"
10098
10144
  };
10099
10145
  var IMAGE_MEDIA_TYPES = ["image/png", "image/jpeg", "image/gif", "image/webp"];
10100
- var resourcePressure = z5.number().min(0).max(100).nullable();
10101
- var sandboxResourceMinuteSchema = z5.object({
10102
- minute: z5.iso.datetime(),
10103
- samples: z5.number().int().min(1).max(255),
10104
- cpuCount: z5.number().int().min(1),
10105
- memoryTotalMb: z5.number().min(0),
10106
- cpuBusyAvg: z5.number().min(0),
10107
- cpuBusyMax: z5.number().min(0),
10108
- memoryUsedAvgMb: z5.number().min(0),
10109
- memoryUsedMaxMb: z5.number().min(0),
10110
- memoryCacheAvgMb: z5.number().min(0),
10111
- memoryAvailableMinMb: z5.number().min(0),
10146
+ var resourcePressure = z7.number().min(0).max(100).nullable();
10147
+ var sandboxResourceMinuteSchema = z7.object({
10148
+ minute: z7.iso.datetime(),
10149
+ samples: z7.number().int().min(1).max(255),
10150
+ cpuCount: z7.number().int().min(1),
10151
+ memoryTotalMb: z7.number().min(0),
10152
+ cpuBusyAvg: z7.number().min(0),
10153
+ cpuBusyMax: z7.number().min(0),
10154
+ memoryUsedAvgMb: z7.number().min(0),
10155
+ memoryUsedMaxMb: z7.number().min(0),
10156
+ memoryCacheAvgMb: z7.number().min(0),
10157
+ memoryAvailableMinMb: z7.number().min(0),
10112
10158
  cpuPressureSomeMax: resourcePressure,
10113
10159
  cpuPressureFullMax: resourcePressure,
10114
10160
  memoryPressureSomeMax: resourcePressure,
10115
10161
  memoryPressureFullMax: resourcePressure,
10116
10162
  ioPressureSomeMax: resourcePressure,
10117
10163
  ioPressureFullMax: resourcePressure,
10118
- oomKills: z5.number().int().min(0)
10164
+ oomKills: z7.number().int().min(0)
10119
10165
  });
10120
10166
  var MAX_PENDING_RESOURCE_MINUTES = 120;
10121
- var sandboxResourceMinutesSchema = z5.array(sandboxResourceMinuteSchema).max(MAX_PENDING_RESOURCE_MINUTES);
10122
- var sandboxMemorySampleSchema = z5.object({
10123
- at: z5.iso.datetime(),
10124
- memoryTotalMb: z5.number().min(0),
10125
- memoryUsedMb: z5.number().min(0),
10167
+ var sandboxResourceMinutesSchema = z7.array(sandboxResourceMinuteSchema).max(MAX_PENDING_RESOURCE_MINUTES);
10168
+ var sandboxMemorySampleSchema = z7.object({
10169
+ at: z7.iso.datetime(),
10170
+ memoryTotalMb: z7.number().min(0),
10171
+ memoryUsedMb: z7.number().min(0),
10126
10172
  memoryPressureSome: resourcePressure
10127
10173
  });
10128
- var engineUpdateProgressSchema = z5.discriminatedUnion("state", [
10129
- z5.object({ state: z5.enum(["updating", "updated"]), from: z5.string(), to: z5.string() }),
10130
- z5.object({ state: z5.literal("failed"), from: z5.string(), to: z5.string(), reason: z5.string() })
10174
+ var engineUpdateProgressSchema = z7.discriminatedUnion("state", [
10175
+ z7.object({ state: z7.enum(["updating", "updated"]), from: z7.string(), to: z7.string() }),
10176
+ z7.object({ state: z7.literal("failed"), from: z7.string(), to: z7.string(), reason: z7.string() })
10131
10177
  ]);
10132
10178
  var MAX_CANVAS_FILE_BYTES = 100 * 1024 * 1024;
10133
10179
  var MAX_CANVAS_PREVIEW_BYTES = 5 * 1024 * 1024;
@@ -10261,7 +10307,7 @@ function detectAgentQuotaLimit(text4) {
10261
10307
  }
10262
10308
 
10263
10309
  // ../shared/src/analytics/types.ts
10264
- import { z as z6 } from "zod";
10310
+ import { z as z8 } from "zod";
10265
10311
 
10266
10312
  // ../shared/src/external-api-host.ts
10267
10313
  function validateExternalApiHost(url, providerLabel) {
@@ -10729,19 +10775,19 @@ function hasAgentChatActivityFields(value) {
10729
10775
  function isAgentChatActivityRecord(value) {
10730
10776
  return hasAgentChatActivityFields(value) && typeof value.provider === "string" && isValidAgentProvider(value.provider);
10731
10777
  }
10732
- var credentialAccountSchema = z6.object({
10733
- ownerName: z6.string().optional(),
10734
- email: z6.string().optional(),
10778
+ var credentialAccountSchema = z8.object({
10779
+ ownerName: z8.string().optional(),
10780
+ email: z8.string().optional(),
10735
10781
  /** 1-based place in the owner's account pool, set only when the pool holds several accounts. */
10736
- ordinal: z6.number().int().positive().optional()
10782
+ ordinal: z8.number().int().positive().optional()
10737
10783
  });
10738
- var agentCredentialSnapshotSchema = z6.object({
10739
- method: z6.enum(CREDENTIAL_METHOD),
10740
- scope: z6.enum(CREDENTIAL_SCOPE),
10741
- revision: z6.string().optional(),
10784
+ var agentCredentialSnapshotSchema = z8.object({
10785
+ method: z8.enum(CREDENTIAL_METHOD),
10786
+ scope: z8.enum(CREDENTIAL_SCOPE),
10787
+ revision: z8.string().optional(),
10742
10788
  account: credentialAccountSchema.optional(),
10743
10789
  /** The `credentials` row, which tells apart accounts pooled under one method and scope. */
10744
- credentialId: z6.string().optional()
10790
+ credentialId: z8.string().optional()
10745
10791
  });
10746
10792
  function isSameCredential(a, b) {
10747
10793
  return a.method === b.method && a.scope === b.scope && a.credentialId === b.credentialId;
@@ -10897,7 +10943,7 @@ function parseCodexTurnRetryPayload(payload) {
10897
10943
  var CONTEXT_USAGE_EVENT_TYPE = "context-usage";
10898
10944
 
10899
10945
  // ../shared/src/engine/v1.ts
10900
- import { z as z7 } from "zod";
10946
+ import { z as z9 } from "zod";
10901
10947
  var MERGED_MESSAGE_SEPARATOR = "\n\n<!-- replicas:merged -->\n\n";
10902
10948
  var ENGINE_STREAM_LAST_EVENT_ID_HEADER = "Last-Event-ID";
10903
10949
  var ENGINE_HEALTH_WAIT_HEADER = "X-Replicas-Health-Wait";
@@ -10905,107 +10951,107 @@ var ENGINE_HEALTH_WAIT_QUERY_PARAM = "wait_ms";
10905
10951
  var ENGINE_HEALTH_MAX_WAIT_MS = 2e3;
10906
10952
  var ENGINE_ACTIVATE_PATH = "/lifecycle/activate";
10907
10953
  var ENGINE_SLEEP_PATH = "/lifecycle/sleep";
10908
- var updateChatDisplayNameRequestSchema = z7.object({
10909
- displayName: z7.string().trim().min(1).max(100)
10954
+ var updateChatDisplayNameRequestSchema = z9.object({
10955
+ displayName: z9.string().trim().min(1).max(100)
10910
10956
  });
10911
- var createChatRequestSchema = z7.object({
10912
- id: z7.string().uuid().optional(),
10913
- createdAt: z7.string().datetime().optional(),
10914
- provider: z7.enum(VALID_AGENT_PROVIDERS),
10915
- title: z7.string().min(1).optional(),
10916
- parentChatId: z7.string().uuid().optional(),
10917
- forkSourceChatId: z7.string().uuid().optional(),
10918
- pullRequestNotesPath: z7.string().min(1).optional(),
10919
- kind: z7.enum(CHAT_KINDS).optional(),
10920
- sideChat: z7.boolean().optional(),
10921
- clientRequestId: z7.string().min(1).max(128).optional()
10957
+ var createChatRequestSchema = z9.object({
10958
+ id: z9.string().uuid().optional(),
10959
+ createdAt: z9.string().datetime().optional(),
10960
+ provider: z9.enum(VALID_AGENT_PROVIDERS),
10961
+ title: z9.string().min(1).optional(),
10962
+ parentChatId: z9.string().uuid().optional(),
10963
+ forkSourceChatId: z9.string().uuid().optional(),
10964
+ pullRequestNotesPath: z9.string().min(1).optional(),
10965
+ kind: z9.enum(CHAT_KINDS).optional(),
10966
+ sideChat: z9.boolean().optional(),
10967
+ clientRequestId: z9.string().min(1).max(128).optional()
10922
10968
  }).refine((request) => !request.sideChat || request.forkSourceChatId !== void 0 && request.parentChatId === request.forkSourceChatId, {
10923
10969
  message: "A side chat must fork its parent chat"
10924
10970
  });
10925
- var spawnSubagentRequestSchema = z7.object({
10926
- provider: z7.enum(VALID_AGENT_PROVIDERS),
10927
- prompt: z7.string().min(1),
10928
- forkTurns: z7.string().regex(/^(all|none|[1-9]\d*)$/).refine(
10971
+ var spawnSubagentRequestSchema = z9.object({
10972
+ provider: z9.enum(VALID_AGENT_PROVIDERS),
10973
+ prompt: z9.string().min(1),
10974
+ forkTurns: z9.string().regex(/^(all|none|[1-9]\d*)$/).refine(
10929
10975
  (value) => value === "all" || value === "none" || Number.isSafeInteger(Number(value)),
10930
10976
  "Expected all, none, or a positive safe integer string"
10931
10977
  ).default("all"),
10932
- model: z7.string().min(1).optional(),
10933
- thinkingLevel: z7.enum(VALID_THINKING_LEVELS).optional(),
10934
- fastMode: z7.boolean().optional(),
10935
- ultrafastMode: z7.boolean().optional(),
10936
- title: z7.string().min(1).optional()
10978
+ model: z9.string().min(1).optional(),
10979
+ thinkingLevel: z9.enum(VALID_THINKING_LEVELS).optional(),
10980
+ fastMode: z9.boolean().optional(),
10981
+ ultrafastMode: z9.boolean().optional(),
10982
+ title: z9.string().min(1).optional()
10937
10983
  });
10938
- var messageSubagentRequestSchema = z7.object({
10939
- message: z7.string().min(1),
10940
- model: z7.string().min(1).optional(),
10941
- thinkingLevel: z7.enum(VALID_THINKING_LEVELS).optional(),
10942
- fastMode: z7.boolean().optional(),
10943
- ultrafastMode: z7.boolean().optional()
10984
+ var messageSubagentRequestSchema = z9.object({
10985
+ message: z9.string().min(1),
10986
+ model: z9.string().min(1).optional(),
10987
+ thinkingLevel: z9.enum(VALID_THINKING_LEVELS).optional(),
10988
+ fastMode: z9.boolean().optional(),
10989
+ ultrafastMode: z9.boolean().optional()
10944
10990
  });
10945
- var waitSubagentRequestSchema = z7.object({
10946
- timeoutMinutes: z7.coerce.number().positive().max(1440).optional()
10991
+ var waitSubagentRequestSchema = z9.object({
10992
+ timeoutMinutes: z9.coerce.number().positive().max(1440).optional()
10947
10993
  });
10948
- var subagentResponseSchema = z7.object({
10949
- chatId: z7.string().uuid(),
10950
- status: z7.enum(["working", "completed"]),
10951
- response: z7.string().optional(),
10952
- timedOut: z7.literal(true).optional(),
10953
- interruptedByUserMessage: z7.literal(true).optional()
10994
+ var subagentResponseSchema = z9.object({
10995
+ chatId: z9.string().uuid(),
10996
+ status: z9.enum(["working", "completed"]),
10997
+ response: z9.string().optional(),
10998
+ timedOut: z9.literal(true).optional(),
10999
+ interruptedByUserMessage: z9.literal(true).optional()
10954
11000
  });
10955
- var integrationErrorNotificationTargetSchema = z7.discriminatedUnion("type", [
10956
- z7.object({
10957
- type: z7.literal("slack"),
10958
- conversation: z7.object({
10959
- channelId: z7.string().min(1),
10960
- threadTs: z7.string().min(1)
11001
+ var integrationErrorNotificationTargetSchema = z9.discriminatedUnion("type", [
11002
+ z9.object({
11003
+ type: z9.literal("slack"),
11004
+ conversation: z9.object({
11005
+ channelId: z9.string().min(1),
11006
+ threadTs: z9.string().min(1)
10961
11007
  }).optional()
10962
11008
  }),
10963
- z7.object({ type: z7.literal("linear"), sessionId: z7.string().min(1) }),
10964
- z7.object({
10965
- type: z7.literal("code_host"),
10966
- provider: z7.enum(["github", "gitlab"]),
10967
- resource: z7.enum(["issue", "pull_request"]),
10968
- repositoryId: z7.string().min(1),
10969
- resourceNumber: z7.number().int().positive()
11009
+ z9.object({ type: z9.literal("linear"), sessionId: z9.string().min(1) }),
11010
+ z9.object({
11011
+ type: z9.literal("code_host"),
11012
+ provider: z9.enum(["github", "gitlab"]),
11013
+ resource: z9.enum(["issue", "pull_request"]),
11014
+ repositoryId: z9.string().min(1),
11015
+ resourceNumber: z9.number().int().positive()
10970
11016
  }),
10971
- z7.object({ type: z7.literal("automation"), executionId: z7.string().min(1) })
11017
+ z9.object({ type: z9.literal("automation"), executionId: z9.string().min(1) })
10972
11018
  ]);
10973
- var sendChatMessageRequestSchema = z7.object({
10974
- messageId: z7.string().min(1).optional(),
10975
- submittedAt: z7.string().datetime().optional(),
10976
- message: z7.string().min(1),
10977
- provider: z7.enum(VALID_AGENT_PROVIDERS).optional(),
10978
- model: z7.string().optional(),
10979
- customInstructions: z7.string().optional(),
10980
- planMode: z7.boolean().optional(),
10981
- images: z7.array(z7.object({
10982
- type: z7.literal("image"),
10983
- source: z7.discriminatedUnion("type", [
10984
- z7.object({ type: z7.literal("base64"), media_type: z7.enum(IMAGE_MEDIA_TYPES), data: z7.string().min(1) }),
10985
- z7.object({ type: z7.literal("url"), url: z7.string().url() })
11019
+ var sendChatMessageRequestSchema = z9.object({
11020
+ messageId: z9.string().min(1).optional(),
11021
+ submittedAt: z9.string().datetime().optional(),
11022
+ message: z9.string().min(1),
11023
+ provider: z9.enum(VALID_AGENT_PROVIDERS).optional(),
11024
+ model: z9.string().optional(),
11025
+ customInstructions: z9.string().optional(),
11026
+ planMode: z9.boolean().optional(),
11027
+ images: z9.array(z9.object({
11028
+ type: z9.literal("image"),
11029
+ source: z9.discriminatedUnion("type", [
11030
+ z9.object({ type: z9.literal("base64"), media_type: z9.enum(IMAGE_MEDIA_TYPES), data: z9.string().min(1) }),
11031
+ z9.object({ type: z9.literal("url"), url: z9.string().url() })
10986
11032
  ])
10987
11033
  })).optional(),
10988
- canvasUploadIds: z7.array(z7.string().min(1)).optional(),
10989
- thinkingLevel: z7.enum(VALID_THINKING_LEVELS).optional(),
10990
- inheritThinkingLevel: z7.boolean().optional(),
10991
- goalMode: z7.boolean().optional(),
10992
- fastMode: z7.boolean().optional(),
10993
- ultrafastMode: z7.boolean().optional(),
10994
- source: z7.enum(MESSAGE_SOURCES).optional(),
10995
- enableInteractiveTools: z7.boolean().optional(),
10996
- type: z7.string().min(1).optional(),
10997
- merge: z7.boolean().optional(),
10998
- idempotencyKey: z7.string().min(1).max(128).optional(),
10999
- automationId: z7.string().optional(),
11000
- environmentId: z7.string().min(1).optional(),
11001
- senderUserId: z7.string().optional(),
11002
- senderEmail: z7.string().optional(),
11003
- senderDisplayName: z7.string().optional(),
11004
- senderAvatarUrl: z7.string().optional(),
11034
+ canvasUploadIds: z9.array(z9.string().min(1)).optional(),
11035
+ thinkingLevel: z9.enum(VALID_THINKING_LEVELS).optional(),
11036
+ inheritThinkingLevel: z9.boolean().optional(),
11037
+ goalMode: z9.boolean().optional(),
11038
+ fastMode: z9.boolean().optional(),
11039
+ ultrafastMode: z9.boolean().optional(),
11040
+ source: z9.enum(MESSAGE_SOURCES).optional(),
11041
+ enableInteractiveTools: z9.boolean().optional(),
11042
+ type: z9.string().min(1).optional(),
11043
+ merge: z9.boolean().optional(),
11044
+ idempotencyKey: z9.string().min(1).max(128).optional(),
11045
+ automationId: z9.string().optional(),
11046
+ environmentId: z9.string().min(1).optional(),
11047
+ senderUserId: z9.string().optional(),
11048
+ senderEmail: z9.string().optional(),
11049
+ senderDisplayName: z9.string().optional(),
11050
+ senderAvatarUrl: z9.string().optional(),
11005
11051
  errorNotificationTarget: integrationErrorNotificationTargetSchema.optional(),
11006
- errorNotificationTargets: z7.array(integrationErrorNotificationTargetSchema).optional(),
11007
- replacesMessageId: z7.string().min(1).max(256).optional(),
11008
- steer: z7.union([z7.boolean(), z7.literal("alone")]).optional()
11052
+ errorNotificationTargets: z9.array(integrationErrorNotificationTargetSchema).optional(),
11053
+ replacesMessageId: z9.string().min(1).max(256).optional(),
11054
+ steer: z9.union([z9.boolean(), z9.literal("alone")]).optional()
11009
11055
  }).passthrough();
11010
11056
  function isChatMessageSender(value) {
11011
11057
  return isRecord(value) && (value.messageId === void 0 || typeof value.messageId === "string") && typeof value.senderUserId === "string" && typeof value.senderEmail === "string" && typeof value.recordedAt === "string";
@@ -11196,18 +11242,18 @@ async function steerQueuedInOrder(queue, messageId, steer) {
11196
11242
  }
11197
11243
  return true;
11198
11244
  }
11199
- var sendChatMessageResponseSchema = z7.object({
11200
- messageId: z7.string(),
11201
- queued: z7.boolean(),
11202
- position: z7.number(),
11203
- chatId: z7.string().optional(),
11204
- steered: z7.boolean().optional()
11245
+ var sendChatMessageResponseSchema = z9.object({
11246
+ messageId: z9.string(),
11247
+ queued: z9.boolean(),
11248
+ position: z9.number(),
11249
+ chatId: z9.string().optional(),
11250
+ steered: z9.boolean().optional()
11205
11251
  });
11206
- var interruptChatRequestSchema = z7.object({ stoppedAt: z7.string().datetime().optional() });
11207
- var respondToolInputRequestSchema = z7.object({
11208
- requestId: z7.string().min(1),
11209
- selectionId: z7.string().min(1),
11210
- source: z7.enum(CLIENT_MESSAGE_SOURCES).optional()
11252
+ var interruptChatRequestSchema = z9.object({ stoppedAt: z9.string().datetime().optional() });
11253
+ var respondToolInputRequestSchema = z9.object({
11254
+ requestId: z9.string().min(1),
11255
+ selectionId: z9.string().min(1),
11256
+ source: z9.enum(CLIENT_MESSAGE_SOURCES).optional()
11211
11257
  });
11212
11258
  function isLatestChatHistoryPage(params) {
11213
11259
  return params.beforeCursor === void 0 && params.beforeEvent === void 0 && params.beforeTurn === void 0;
@@ -11286,104 +11332,104 @@ function isSubagentMcpServerName(server) {
11286
11332
  }
11287
11333
 
11288
11334
  // ../shared/src/workspace-identity.ts
11289
- import { z as z8 } from "zod";
11335
+ import { z as z10 } from "zod";
11290
11336
  var WORKSPACE_IDENTITY_AUDIENCE = "replicas:workspace";
11291
11337
  var AWS_SOURCE_IDENTITY_CLAIM = "https://aws.amazon.com/source_identity";
11292
11338
  var WORKSPACE_TOKEN_TTL_SECONDS = 15 * 60;
11293
11339
  var IDENTITY_PROXY_PORT = 17323;
11294
11340
  var IDENTITY_TOKEN_PATH = "/token";
11295
- var workspaceAudienceSchema = z8.string().min(1).max(255).regex(/^[\x21-\x7e]+$/, "Audience must be a single printable token without spaces");
11296
- var workspaceTokenRequestSchema = z8.object({
11341
+ var workspaceAudienceSchema = z10.string().min(1).max(255).regex(/^[\x21-\x7e]+$/, "Audience must be a single printable token without spaces");
11342
+ var workspaceTokenRequestSchema = z10.object({
11297
11343
  audience: workspaceAudienceSchema.optional(),
11298
- aws_source_identity: z8.boolean().optional()
11344
+ aws_source_identity: z10.boolean().optional()
11299
11345
  });
11300
- var workspaceTokenClaimsSchema = z8.object({
11301
- iss: z8.string(),
11302
- sub: z8.string(),
11303
- aud: z8.string(),
11304
- iat: z8.number().int(),
11305
- nbf: z8.number().int(),
11306
- exp: z8.number().int(),
11307
- jti: z8.string(),
11308
- organization_id: z8.string().uuid(),
11309
- workspace_id: z8.string().uuid(),
11310
- environment_id: z8.string().uuid(),
11311
- creator_id: z8.string().uuid().nullable(),
11312
- creator_email: z8.string().nullable().default(null),
11313
- [AWS_SOURCE_IDENTITY_CLAIM]: z8.string().uuid().optional()
11346
+ var workspaceTokenClaimsSchema = z10.object({
11347
+ iss: z10.string(),
11348
+ sub: z10.string(),
11349
+ aud: z10.string(),
11350
+ iat: z10.number().int(),
11351
+ nbf: z10.number().int(),
11352
+ exp: z10.number().int(),
11353
+ jti: z10.string(),
11354
+ organization_id: z10.string().uuid(),
11355
+ workspace_id: z10.string().uuid(),
11356
+ environment_id: z10.string().uuid(),
11357
+ creator_id: z10.string().uuid().nullable(),
11358
+ creator_email: z10.string().nullable().default(null),
11359
+ [AWS_SOURCE_IDENTITY_CLAIM]: z10.string().uuid().optional()
11314
11360
  }).passthrough();
11315
- var workspaceTokenResponseSchema = z8.object({
11316
- issuer: z8.string(),
11317
- audience: z8.string(),
11318
- token: z8.string(),
11319
- expires_at: z8.string()
11361
+ var workspaceTokenResponseSchema = z10.object({
11362
+ issuer: z10.string(),
11363
+ audience: z10.string(),
11364
+ token: z10.string(),
11365
+ expires_at: z10.string()
11320
11366
  });
11321
- var legacyWorkspaceTokenBundleSchema = z8.object({
11322
- version: z8.literal(1),
11323
- issuer: z8.string(),
11324
- default_audience: z8.string(),
11325
- tokens: z8.record(z8.string(), z8.object({ token: z8.string(), expires_at: z8.string() }))
11367
+ var legacyWorkspaceTokenBundleSchema = z10.object({
11368
+ version: z10.literal(1),
11369
+ issuer: z10.string(),
11370
+ default_audience: z10.string(),
11371
+ tokens: z10.record(z10.string(), z10.object({ token: z10.string(), expires_at: z10.string() }))
11326
11372
  });
11327
- var mcpWorkloadAuthSchema = z8.strictObject({
11328
- type: z8.literal("workspace_identity"),
11373
+ var mcpWorkloadAuthSchema = z10.strictObject({
11374
+ type: z10.literal("workspace_identity"),
11329
11375
  audience: workspaceAudienceSchema
11330
11376
  });
11331
- var mcpAuthSchema = z8.discriminatedUnion("type", [
11377
+ var mcpAuthSchema = z10.discriminatedUnion("type", [
11332
11378
  mcpWorkloadAuthSchema,
11333
- z8.strictObject({ type: z8.literal("oauth") })
11379
+ z10.strictObject({ type: z10.literal("oauth") })
11334
11380
  ]);
11335
- var engineMcpOAuthTokenRequestSchema = z8.object({
11336
- environment_mcp_id: z8.string().uuid(),
11337
- force_refresh: z8.boolean().optional()
11381
+ var engineMcpOAuthTokenRequestSchema = z10.object({
11382
+ environment_mcp_id: z10.string().uuid(),
11383
+ force_refresh: z10.boolean().optional()
11338
11384
  });
11339
- var engineMcpOAuthTokenResponseSchema = z8.object({
11340
- url: z8.string(),
11341
- access_token: z8.string(),
11342
- expires_at: z8.string().nullable()
11385
+ var engineMcpOAuthTokenResponseSchema = z10.object({
11386
+ url: z10.string(),
11387
+ access_token: z10.string(),
11388
+ expires_at: z10.string().nullable()
11343
11389
  });
11344
11390
 
11345
11391
  // ../shared/src/routes/environment.ts
11346
- import { z as z9 } from "zod";
11392
+ import { z as z11 } from "zod";
11347
11393
  var ENVIRONMENT_MCP_TRANSPORTS = ["stdio", "http", "sse"];
11348
- var stringMap = z9.record(z9.string(), z9.string());
11349
- var createEnvironmentMcpRequestSchema = z9.object({
11350
- name: z9.string(),
11351
- transport: z9.enum(ENVIRONMENT_MCP_TRANSPORTS),
11352
- config: z9.union([
11353
- z9.object({ command: z9.string().min(1), args: z9.array(z9.string()).optional(), env: stringMap.optional() }),
11354
- z9.object({ url: z9.url(), headers: stringMap.optional(), auth: mcpAuthSchema.optional() })
11394
+ var stringMap = z11.record(z11.string(), z11.string());
11395
+ var createEnvironmentMcpRequestSchema = z11.object({
11396
+ name: z11.string(),
11397
+ transport: z11.enum(ENVIRONMENT_MCP_TRANSPORTS),
11398
+ config: z11.union([
11399
+ z11.object({ command: z11.string().min(1), args: z11.array(z11.string()).optional(), env: stringMap.optional() }),
11400
+ z11.object({ url: z11.url(), headers: stringMap.optional(), auth: mcpAuthSchema.optional() })
11355
11401
  ]).describe("stdio: `{ command, args, env }`. http/sse: `{ url, headers }`.")
11356
11402
  });
11357
11403
  var updateEnvironmentMcpRequestSchema = createEnvironmentMcpRequestSchema.partial();
11358
- var screenPasswordSchema = z9.string().min(1, "Enter the screen password").max(256).describe('Screen Sharing password, for `replicas computer screen`. On a Mac, the "VNC viewers may control screen with password" password. Never returned.');
11359
- var hostSchema = z9.string().max(253).regex(/^(?:[A-Za-z0-9](?:[A-Za-z0-9.-]*[A-Za-z0-9])?|[0-9A-Fa-f:]+)$/, "Enter a hostname or IP address");
11360
- var createEnvironmentDeviceRequestSchema = z9.object({
11361
- name: z9.string().regex(/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/, "Use lowercase letters, numbers and dashes").describe("SSH alias in workspaces, e.g. `mac-mini` for `ssh mac-mini`."),
11404
+ var screenPasswordSchema = z11.string().min(1, "Enter the screen password").max(256).describe('Screen Sharing password, for `replicas computer screen`. On a Mac, the "VNC viewers may control screen with password" password. Never returned.');
11405
+ var hostSchema = z11.string().max(253).regex(/^(?:[A-Za-z0-9](?:[A-Za-z0-9.-]*[A-Za-z0-9])?|[0-9A-Fa-f:]+)$/, "Enter a hostname or IP address");
11406
+ var createEnvironmentDeviceRequestSchema = z11.object({
11407
+ name: z11.string().regex(/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/, "Use lowercase letters, numbers and dashes").describe("SSH alias in workspaces, e.g. `mac-mini` for `ssh mac-mini`."),
11362
11408
  host: hostSchema.optional().describe("Hostname or IP, such as a Tailscale MagicDNS name (`mac-mini`) or a public address. Leave it out when the device connects to Replicas itself with `replicas device connect`."),
11363
- port: z9.number().int().min(1).max(65535).optional().describe("SSH port on the device. Defaults to 22."),
11364
- username: z9.string().regex(/^[A-Za-z0-9_][A-Za-z0-9._-]{0,63}$/, "Enter the account name on the device").describe("Account the agent signs in as."),
11409
+ port: z11.number().int().min(1).max(65535).optional().describe("SSH port on the device. Defaults to 22."),
11410
+ username: z11.string().regex(/^[A-Za-z0-9_][A-Za-z0-9._-]{0,63}$/, "Enter the account name on the device").describe("Account the agent signs in as."),
11365
11411
  screen_password: screenPasswordSchema.optional()
11366
11412
  });
11367
11413
  var updateEnvironmentDeviceRequestSchema = createEnvironmentDeviceRequestSchema.partial().extend({
11368
- host: z9.union([hostSchema, z9.literal("")]).optional().describe("New hostname or IP, or an empty string for a device that connects to Replicas itself."),
11369
- screen_password: z9.union([screenPasswordSchema, z9.literal("")]).optional().describe("New Screen Sharing password, or an empty string to remove it.")
11414
+ host: z11.union([hostSchema, z11.literal("")]).optional().describe("New hostname or IP, or an empty string for a device that connects to Replicas itself."),
11415
+ screen_password: z11.union([screenPasswordSchema, z11.literal("")]).optional().describe("New Screen Sharing password, or an empty string to remove it.")
11370
11416
  });
11371
- var deviceConnectionResponseSchema = z9.object({
11372
- name: z9.string(),
11373
- port: z9.number(),
11374
- workspace_ids: z9.array(z9.string())
11417
+ var deviceConnectionResponseSchema = z11.object({
11418
+ name: z11.string(),
11419
+ port: z11.number(),
11420
+ workspace_ids: z11.array(z11.string())
11375
11421
  });
11376
- var deviceHostKeysRequestSchema = z9.object({
11377
- host_keys: z9.array(z9.string().max(2048).regex(/^[a-z0-9@.-]+ [A-Za-z0-9+/]+={0,3}$/, "Each host key must be `<type> <base64>`")).min(1).max(8).transform((keys) => [...new Set(keys)].sort())
11422
+ var deviceHostKeysRequestSchema = z11.object({
11423
+ host_keys: z11.array(z11.string().max(2048).regex(/^[a-z0-9@.-]+ [A-Za-z0-9+/]+={0,3}$/, "Each host key must be `<type> <base64>`")).min(1).max(8).transform((keys) => [...new Set(keys)].sort())
11378
11424
  });
11379
11425
  var DEVICE_HOST_KEYS_HEADER = "x-replicas-device-host-keys";
11380
- var provisionedDeviceSchema = z9.object({
11381
- name: z9.string(),
11382
- host: z9.string().nullable(),
11383
- port: z9.number(),
11384
- username: z9.string(),
11385
- private_key: z9.string(),
11386
- screen_password: z9.string().optional()
11426
+ var provisionedDeviceSchema = z11.object({
11427
+ name: z11.string(),
11428
+ host: z11.string().nullable(),
11429
+ port: z11.number(),
11430
+ username: z11.string(),
11431
+ private_key: z11.string(),
11432
+ screen_password: z11.string().optional()
11387
11433
  });
11388
11434
 
11389
11435
  // ../shared/src/runtime-env.ts
@@ -11606,19 +11652,19 @@ function gitIdentityConfigCommands(identity, scope = "global") {
11606
11652
  }
11607
11653
 
11608
11654
  // ../shared/src/headless-agent.ts
11609
- import { z as z10 } from "zod";
11610
- var headlessAgentRequestSchema = z10.object({
11611
- mode: z10.literal("structured"),
11612
- agent: z10.custom(
11655
+ import { z as z12 } from "zod";
11656
+ var headlessAgentRequestSchema = z12.object({
11657
+ mode: z12.literal("structured"),
11658
+ agent: z12.custom(
11613
11659
  (value) => typeof value === "string" && isValidAgentProvider(value)
11614
11660
  ),
11615
- model: z10.string().min(1),
11616
- prompt: z10.string(),
11617
- workingDirectory: z10.string().min(1),
11618
- timeoutSeconds: z10.number().int().min(1).max(1800).default(300),
11619
- thinkingLevel: z10.enum(STANDARD_THINKING_LEVELS).optional(),
11620
- codexOauthTokens: z10.object({ accessToken: z10.string(), accountId: z10.string() }).optional(),
11621
- outputSchema: z10.record(z10.string(), z10.json())
11661
+ model: z12.string().min(1),
11662
+ prompt: z12.string(),
11663
+ workingDirectory: z12.string().min(1),
11664
+ timeoutSeconds: z12.number().int().min(1).max(1800).default(300),
11665
+ thinkingLevel: z12.enum(STANDARD_THINKING_LEVELS).optional(),
11666
+ codexOauthTokens: z12.object({ accessToken: z12.string(), accountId: z12.string() }).optional(),
11667
+ outputSchema: z12.record(z12.string(), z12.json())
11622
11668
  });
11623
11669
  var headlessAgentUsagePath = (outputPath) => `${outputPath}.usage`;
11624
11670
 
@@ -11706,15 +11752,15 @@ var SEARCH_OPEN_DEDUPE_MS = 10 * 60 * 1e3;
11706
11752
  var PICK_WINDOW_MS = 21 * DAY_MS;
11707
11753
 
11708
11754
  // ../shared/src/routes/workspaces.ts
11709
- import { z as z12 } from "zod";
11755
+ import { z as z14 } from "zod";
11710
11756
 
11711
11757
  // ../shared/src/workspace-credentials.ts
11712
- import { z as z11 } from "zod";
11758
+ import { z as z13 } from "zod";
11713
11759
  var WORKSPACE_CREDENTIAL_PROVIDERS = ["claude", "codex"];
11714
- var workspaceCredentialProviderSchema = z11.enum(WORKSPACE_CREDENTIAL_PROVIDERS);
11760
+ var workspaceCredentialProviderSchema = z13.enum(WORKSPACE_CREDENTIAL_PROVIDERS);
11715
11761
  var workspaceCredentialSelectionSchema = agentCredentialSnapshotSchema.omit({ revision: true, account: true, credentialId: true });
11716
11762
  var createWorkspaceCredentialSchema = workspaceCredentialSelectionSchema.extend({
11717
- provider: z11.enum(VALID_AGENT_PROVIDERS)
11763
+ provider: z13.enum(VALID_AGENT_PROVIDERS)
11718
11764
  }).refine(({ provider: provider2, method }) => agentCredentialMethods(provider2).includes(method), {
11719
11765
  message: "This inference provider is not supported by this agent"
11720
11766
  });
@@ -11748,16 +11794,16 @@ var DEFAULT_WORKSPACE_FILTERS = {
11748
11794
  activity: "any"
11749
11795
  };
11750
11796
  var ONE_DAY_MS = 24 * 60 * 60 * 1e3;
11751
- var workspaceExecRequestSchema = z12.object({
11752
- command: z12.string().regex(/\S/, "command is required"),
11753
- timeout_seconds: z12.number().int().min(1).max(50).optional().describe("Default: 30")
11797
+ var workspaceExecRequestSchema = z14.object({
11798
+ command: z14.string().regex(/\S/, "command is required"),
11799
+ timeout_seconds: z14.number().int().min(1).max(50).optional().describe("Default: 30")
11754
11800
  });
11755
- var terminalRtcCandidateSchema = z12.object({ type: z12.literal("rtc-candidate"), candidate: z12.string(), mid: z12.string() });
11756
- var terminalSocketServerMessageSchema = z12.discriminatedUnion("type", [
11757
- z12.object({ type: z12.literal("output"), data: z12.string() }),
11758
- z12.object({ type: z12.literal("rtc-answer"), sdp: z12.string() }),
11801
+ var terminalRtcCandidateSchema = z14.object({ type: z14.literal("rtc-candidate"), candidate: z14.string(), mid: z14.string() });
11802
+ var terminalSocketServerMessageSchema = z14.discriminatedUnion("type", [
11803
+ z14.object({ type: z14.literal("output"), data: z14.string() }),
11804
+ z14.object({ type: z14.literal("rtc-answer"), sdp: z14.string() }),
11759
11805
  terminalRtcCandidateSchema,
11760
- z12.object({ type: z12.literal("rtc-switch") })
11806
+ z14.object({ type: z14.literal("rtc-switch") })
11761
11807
  ]);
11762
11808
  var TERMINAL_RTC_ICE_SERVER = "stun:stun.l.google.com:19302";
11763
11809
 
@@ -11798,62 +11844,62 @@ function describeAuthFallback(payload) {
11798
11844
  }
11799
11845
 
11800
11846
  // ../shared/src/chat-fork.ts
11801
- import { z as z14 } from "zod";
11847
+ import { z as z16 } from "zod";
11802
11848
 
11803
11849
  // ../shared/src/fallback-chains.ts
11804
- import { z as z13 } from "zod";
11805
- var fallbackHarnessStepSchema = z13.object({
11806
- kind: z13.literal("harness"),
11807
- provider: z13.enum(VALID_AGENT_PROVIDERS),
11808
- model: z13.string().min(1),
11809
- thinkingLevel: z13.enum(VALID_THINKING_LEVELS).optional().catch(void 0)
11850
+ import { z as z15 } from "zod";
11851
+ var fallbackHarnessStepSchema = z15.object({
11852
+ kind: z15.literal("harness"),
11853
+ provider: z15.enum(VALID_AGENT_PROVIDERS),
11854
+ model: z15.string().min(1),
11855
+ thinkingLevel: z15.enum(VALID_THINKING_LEVELS).optional().catch(void 0)
11810
11856
  });
11811
- var fallbackPlanStepSchema = z13.discriminatedUnion("kind", [
11812
- z13.object({
11813
- kind: z13.literal("credentials"),
11857
+ var fallbackPlanStepSchema = z15.discriminatedUnion("kind", [
11858
+ z15.object({
11859
+ kind: z15.literal("credentials"),
11814
11860
  // An empty list would allow every method.
11815
- methods: z13.array(z13.unknown()).transform((methods) => methods.filter(isAuthMethod)).refine((methods) => methods.length > 0),
11816
- models: z13.record(z13.string(), z13.string().min(1)).optional()
11861
+ methods: z15.array(z15.unknown()).transform((methods) => methods.filter(isAuthMethod)).refine((methods) => methods.length > 0),
11862
+ models: z15.record(z15.string(), z15.string().min(1)).optional()
11817
11863
  }),
11818
11864
  fallbackHarnessStepSchema
11819
11865
  ]);
11820
- var fallbackPlanResponseSchema = z13.object({
11821
- steps: z13.array(z13.unknown()).transform((steps) => steps.flatMap((step) => fallbackPlanStepSchema.safeParse(step).data ?? []))
11866
+ var fallbackPlanResponseSchema = z15.object({
11867
+ steps: z15.array(z15.unknown()).transform((steps) => steps.flatMap((step) => fallbackPlanStepSchema.safeParse(step).data ?? []))
11822
11868
  });
11823
11869
 
11824
11870
  // ../shared/src/chat-fork.ts
11825
- var fallbackReasonSchema = z14.enum(AGENT_FALLBACK_REASONS);
11826
- var chatForkInfoSchema = z14.object({
11827
- source: z14.object({
11828
- chatId: z14.string().min(1),
11829
- provider: z14.enum(VALID_AGENT_PROVIDERS),
11830
- title: z14.string()
11871
+ var fallbackReasonSchema = z16.enum(AGENT_FALLBACK_REASONS);
11872
+ var chatForkInfoSchema = z16.object({
11873
+ source: z16.object({
11874
+ chatId: z16.string().min(1),
11875
+ provider: z16.enum(VALID_AGENT_PROVIDERS),
11876
+ title: z16.string()
11831
11877
  }),
11832
- trigger: z14.enum(["manual", "auto", "side", "switch"]),
11878
+ trigger: z16.enum(["manual", "auto", "side", "switch"]),
11833
11879
  reason: fallbackReasonSchema.optional(),
11834
- state: z14.enum(["preparing", "ready", "failed"]),
11835
- error: z14.string().optional(),
11836
- startedAt: z14.string(),
11837
- completedAt: z14.string().optional()
11880
+ state: z16.enum(["preparing", "ready", "failed"]),
11881
+ error: z16.string().optional(),
11882
+ startedAt: z16.string(),
11883
+ completedAt: z16.string().optional()
11838
11884
  });
11839
11885
  function coerceChatForkInfo(value) {
11840
11886
  const parsed = chatForkInfoSchema.safeParse(value);
11841
11887
  return parsed.success ? parsed.data : null;
11842
11888
  }
11843
- var forkChatRequestSchema = z14.object({
11844
- provider: z14.enum(VALID_AGENT_PROVIDERS),
11845
- model: z14.string().min(1).optional(),
11846
- thinkingLevel: z14.enum(VALID_THINKING_LEVELS).optional(),
11847
- title: z14.string().min(1).max(200).optional(),
11848
- message: z14.string().trim().optional(),
11849
- id: z14.string().uuid().optional(),
11850
- clientRequestId: z14.string().min(1).max(128).optional(),
11851
- enableInteractiveTools: z14.boolean().optional(),
11889
+ var forkChatRequestSchema = z16.object({
11890
+ provider: z16.enum(VALID_AGENT_PROVIDERS),
11891
+ model: z16.string().min(1).optional(),
11892
+ thinkingLevel: z16.enum(VALID_THINKING_LEVELS).optional(),
11893
+ title: z16.string().min(1).max(200).optional(),
11894
+ message: z16.string().trim().optional(),
11895
+ id: z16.string().uuid().optional(),
11896
+ clientRequestId: z16.string().min(1).max(128).optional(),
11897
+ enableInteractiveTools: z16.boolean().optional(),
11852
11898
  // Server-injected by the monolith from the authenticated request; never trusted from clients.
11853
- senderUserId: z14.string().optional(),
11854
- senderEmail: z14.string().optional(),
11855
- senderDisplayName: z14.string().optional(),
11856
- senderAvatarUrl: z14.string().optional()
11899
+ senderUserId: z16.string().optional(),
11900
+ senderEmail: z16.string().optional(),
11901
+ senderDisplayName: z16.string().optional(),
11902
+ senderAvatarUrl: z16.string().optional()
11857
11903
  });
11858
11904
  function describeQuotaLimit(reason) {
11859
11905
  if (reason === "auth_failed") return "could not authenticate";
@@ -11865,10 +11911,10 @@ function describeChatForkReason(reason, provider2) {
11865
11911
  return reason ? `${getProviderDisplayName(provider2)} ${describeQuotaLimit(reason)}` : null;
11866
11912
  }
11867
11913
  var AGENT_QUOTA_EXHAUSTED_EVENT_TYPE = "agent-quota-exhausted";
11868
- var agentQuotaExhaustedPayloadSchema = z14.object({
11869
- provider: z14.enum(VALID_AGENT_PROVIDERS),
11914
+ var agentQuotaExhaustedPayloadSchema = z16.object({
11915
+ provider: z16.enum(VALID_AGENT_PROVIDERS),
11870
11916
  reason: fallbackReasonSchema,
11871
- detail: z14.string().optional(),
11917
+ detail: z16.string().optional(),
11872
11918
  forkTo: fallbackHarnessStepSchema.optional()
11873
11919
  });
11874
11920
  function defaultForkChatTitle(source, provider2) {
@@ -11903,21 +11949,21 @@ function getChatThreadSources(chats, chat) {
11903
11949
  }
11904
11950
 
11905
11951
  // ../shared/src/credential-refresh.ts
11906
- import { z as z15 } from "zod";
11907
- var engineCredentialRefreshFailureSchema = z15.object({
11908
- code: z15.string(),
11952
+ import { z as z17 } from "zod";
11953
+ var engineCredentialRefreshFailureSchema = z17.object({
11954
+ code: z17.string(),
11909
11955
  credential: workspaceCredentialSelectionSchema.optional()
11910
11956
  });
11911
11957
 
11912
11958
  // ../shared/src/credential-pool.ts
11913
- import { z as z16 } from "zod";
11959
+ import { z as z18 } from "zod";
11914
11960
  var MAX_CREDENTIAL_POOL_ACCOUNTS = 10;
11915
- var reorderCredentialPoolSchema = z16.object({
11916
- credential_ids: z16.array(z16.string().uuid()).min(1).max(MAX_CREDENTIAL_POOL_ACCOUNTS)
11961
+ var reorderCredentialPoolSchema = z18.object({
11962
+ credential_ids: z18.array(z18.string().uuid()).min(1).max(MAX_CREDENTIAL_POOL_ACCOUNTS)
11917
11963
  });
11918
11964
 
11919
11965
  // ../shared/src/mothership-events.ts
11920
- import { z as z24 } from "zod";
11966
+ import { z as z25 } from "zod";
11921
11967
 
11922
11968
  // ../shared/src/design-tokens.ts
11923
11969
  var plain = {
@@ -12084,53 +12130,10 @@ var LINEAR_ICON_DEFINITION = {
12084
12130
  };
12085
12131
 
12086
12132
  // ../shared/src/replicas-mcp.ts
12087
- import { z as z19 } from "zod";
12088
-
12089
- // ../shared/src/routes/linear.ts
12090
- import { z as z17 } from "zod";
12091
- var linearSessionMetadataSchema = z17.object({
12092
- via_mothership: z17.boolean().optional(),
12093
- attached: z17.boolean().optional(),
12094
- routing_chat_id: z17.string().optional(),
12095
- issue_id: z17.string(),
12096
- issue_identifier: z17.string(),
12097
- issue_title: z17.string(),
12098
- issue_description: z17.string(),
12099
- issue_url: z17.string(),
12100
- comment_id: z17.string(),
12101
- comment_body: z17.string(),
12102
- triggered_by_id: z17.string().optional(),
12103
- triggered_by_name: z17.string().optional(),
12104
- triggered_by_email: z17.string().optional(),
12105
- linear_workspace_id: z17.string().optional(),
12106
- creator_id: z17.string().optional(),
12107
- creator_name: z17.string().optional(),
12108
- creator_email: z17.string().optional(),
12109
- assignee_id: z17.string().optional(),
12110
- assignee_name: z17.string().optional(),
12111
- assignee_email: z17.string().optional(),
12112
- issue_state: z17.string().optional(),
12113
- parent_issue: z17.object({
12114
- id: z17.string(),
12115
- identifier: z17.string(),
12116
- title: z17.string(),
12117
- description: z17.string().nullable()
12118
- }).optional(),
12119
- workspace: z17.object({
12120
- id: z17.string(),
12121
- coding_agent: z17.custom((value) => typeof value === "string" && isValidAgentProvider(value)),
12122
- task_description: z17.string(),
12123
- created_at: z17.string()
12124
- }).optional()
12125
- });
12126
- var LINEAR_WORKFLOW_STATE_TYPES = ["triage", "backlog", "unstarted", "started", "completed", "canceled", "duplicate"];
12127
-
12128
- // ../shared/src/automations/linear/index.ts
12129
- var LINEAR_ISSUE_STATE_CHANGED_EVENT = "issue.state_changed";
12130
- var LINEAR_STATE_TYPES = LINEAR_WORKFLOW_STATE_TYPES.filter((type) => type !== "duplicate");
12133
+ import { z as z20 } from "zod";
12131
12134
 
12132
12135
  // ../shared/src/automations/trigger-schemas.ts
12133
- import { z as z18 } from "zod";
12136
+ import { z as z19 } from "zod";
12134
12137
 
12135
12138
  // ../shared/src/uuid.ts
12136
12139
  function createUuidFromHex(value) {
@@ -12147,31 +12150,37 @@ function getReviewerLoginsError(event, logins) {
12147
12150
  if (isReviewRequested === !!logins?.some((login) => login.trim().replace(/^@+/, ""))) return null;
12148
12151
  return isReviewRequested ? "The PR review requested trigger needs at least one GitHub username" : "Requested reviewers only apply to the PR review requested trigger";
12149
12152
  }
12150
- var repositoryTriggerConfigSchema = z18.object({
12151
- event: z18.string(),
12152
- repository_ids: z18.array(z18.string().regex(UUID_RE, "must be a repository id")).optional(),
12153
- group_pr_events: z18.boolean().optional(),
12154
- excluded_actors: z18.array(z18.string()).optional(),
12155
- reviewer_logins: z18.array(z18.string()).optional()
12153
+ var repositoryTriggerConfigSchema = z19.object({
12154
+ event: z19.string(),
12155
+ repository_ids: z19.array(z19.string().regex(UUID_RE, "must be a repository id")).optional(),
12156
+ group_pr_events: z19.boolean().optional(),
12157
+ excluded_actors: z19.array(z19.string()).optional(),
12158
+ reviewer_logins: z19.array(z19.string()).optional()
12156
12159
  });
12157
- var cronTriggerSchema = z18.object({ type: z18.literal("cron"), config: z18.object({ schedule: z18.string(), timezone: z18.string().optional() }) });
12158
- var githubTriggerSchema = z18.object({
12159
- type: z18.literal("github"),
12160
+ var cronTriggerSchema = z19.object({ type: z19.literal("cron"), config: z19.object({ schedule: z19.string(), timezone: z19.string().optional() }) });
12161
+ var githubTriggerSchema = z19.object({
12162
+ type: z19.literal("github"),
12160
12163
  config: repositoryTriggerConfigSchema.superRefine((config, ctx) => {
12161
12164
  const message2 = getReviewerLoginsError(config.event, config.reviewer_logins);
12162
12165
  if (message2) ctx.addIssue({ code: "custom", message: message2, path: ["reviewer_logins"] });
12163
12166
  })
12164
12167
  });
12165
- var gitlabTriggerSchema = z18.object({ type: z18.literal("gitlab"), config: repositoryTriggerConfigSchema });
12166
- var linearTriggerConfigSchema = z18.object({ event: z18.string(), team_ids: z18.array(z18.string()).optional(), state_types: z18.array(z18.enum(LINEAR_STATE_TYPES)).optional() });
12167
- var automationTriggerSchema = z18.discriminatedUnion("type", [
12168
+ var gitlabTriggerSchema = z19.object({ type: z19.literal("gitlab"), config: repositoryTriggerConfigSchema });
12169
+ var linearTriggerConfigSchema = linearIssueFiltersSchema.extend({
12170
+ event: z19.string(),
12171
+ team_ids: z19.array(z19.string()).optional(),
12172
+ state_types: z19.array(z19.enum(LINEAR_STATE_TYPES)).optional()
12173
+ }).superRefine((config, ctx) => {
12174
+ if (config.event === LINEAR_ISSUE_MATCHED_EVENT && config.team_ids?.length !== 1) ctx.addIssue({ code: "custom", message: "The Linear issue matches trigger needs exactly one team", path: ["team_ids"] });
12175
+ });
12176
+ var automationTriggerSchema = z19.discriminatedUnion("type", [
12168
12177
  cronTriggerSchema,
12169
12178
  githubTriggerSchema,
12170
12179
  gitlabTriggerSchema,
12171
- z18.object({ type: z18.literal("slack"), config: z18.object({ event: z18.string(), channel_ids: z18.array(z18.string()).optional(), group_thread_replies: z18.boolean().optional() }) }),
12172
- z18.object({ type: z18.literal("sentry"), config: z18.object({ event: z18.string(), project_slugs: z18.array(z18.string()).optional(), min_level: z18.string().optional() }) }),
12173
- z18.object({ type: z18.literal("linear"), config: linearTriggerConfigSchema }),
12174
- z18.object({ type: z18.literal("custom"), config: z18.object({}) })
12180
+ z19.object({ type: z19.literal("slack"), config: z19.object({ event: z19.string(), channel_ids: z19.array(z19.string()).optional(), group_thread_replies: z19.boolean().optional() }) }),
12181
+ z19.object({ type: z19.literal("sentry"), config: z19.object({ event: z19.string(), project_slugs: z19.array(z19.string()).optional(), min_level: z19.string().optional() }) }),
12182
+ z19.object({ type: z19.literal("linear"), config: linearTriggerConfigSchema }),
12183
+ z19.object({ type: z19.literal("custom"), config: z19.object({}) })
12175
12184
  ]);
12176
12185
 
12177
12186
  // ../shared/src/automations/types.ts
@@ -12251,55 +12260,55 @@ var REPLICAS_MCP_TOOLS = {
12251
12260
  deleteChat: "delete_chat",
12252
12261
  listRepositories: "list_repositories"
12253
12262
  };
12254
- var automationToolInputSchema = z19.object({
12255
- name: z19.string().describe("Short automation name."),
12256
- prompt: z19.string().describe("Prompt each automation run starts with."),
12257
- environment_id: z19.string().describe(`Environment id from \`${REPLICAS_MCP_TOOLS.listEnvironments}\`.`),
12258
- triggers: z19.array(automationTriggerSchema).min(1).describe(
12263
+ var automationToolInputSchema = z20.object({
12264
+ name: z20.string().describe("Short automation name."),
12265
+ prompt: z20.string().describe("Prompt each automation run starts with."),
12266
+ environment_id: z20.string().describe(`Environment id from \`${REPLICAS_MCP_TOOLS.listEnvironments}\`.`),
12267
+ triggers: z20.array(automationTriggerSchema).min(1).describe(
12259
12268
  `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"] } }\`.`
12260
12269
  ),
12261
- description: z19.string().optional().describe("One-line summary shown in the dashboard."),
12262
- plan_mode: z19.boolean().optional(),
12263
- goal_mode: z19.boolean().optional(),
12264
- fast_mode: z19.boolean().optional(),
12265
- workspace_lifecycle_policy: z19.enum(AUTOMATION_LIFECYCLE_POLICIES).optional().describe(
12270
+ description: z20.string().optional().describe("One-line summary shown in the dashboard."),
12271
+ plan_mode: z20.boolean().optional(),
12272
+ goal_mode: z20.boolean().optional(),
12273
+ fast_mode: z20.boolean().optional(),
12274
+ workspace_lifecycle_policy: z20.enum(AUTOMATION_LIFECYCLE_POLICIES).optional().describe(
12266
12275
  "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."
12267
12276
  )
12268
12277
  });
12269
12278
  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.`;
12270
- var automationBackgroundSchema = z19.boolean().optional().describe(
12279
+ var automationBackgroundSchema = z20.boolean().optional().describe(
12271
12280
  "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."
12272
12281
  );
12273
12282
  var automationCreateToolInputSchema = automationToolInputSchema.extend({
12274
- credential_user_id: z19.string().optional().describe(`${credentialUserIdDescription} Omit to use the organization's.`),
12283
+ credential_user_id: z20.string().optional().describe(`${credentialUserIdDescription} Omit to use the organization's.`),
12275
12284
  background: automationBackgroundSchema,
12276
- scope: z19.enum(["org", "user"]).optional().describe("`org` (default) or `user` for a personal automation, which needs a personal API key.")
12285
+ scope: z20.enum(["org", "user"]).optional().describe("`org` (default) or `user` for a personal automation, which needs a personal API key.")
12277
12286
  });
12278
12287
  var automationUpdateToolInputSchema = automationToolInputSchema.partial().extend({
12279
- automation_id: z19.string().describe("Automation ID"),
12280
- enabled: z19.boolean().optional(),
12281
- agent_provider: z19.enum(AGENT).nullable().optional(),
12282
- model: z19.string().nullable().optional(),
12283
- thinking_level: z19.enum(VALID_THINKING_LEVELS).nullable().optional(),
12284
- workspace_size: z19.enum(WORKSPACE_SIZES).optional(),
12285
- credential_user_id: z19.string().nullable().optional().describe(`${credentialUserIdDescription} Null switches back to the organization's.`),
12288
+ automation_id: z20.string().describe("Automation ID"),
12289
+ enabled: z20.boolean().optional(),
12290
+ agent_provider: z20.enum(AGENT).nullable().optional(),
12291
+ model: z20.string().nullable().optional(),
12292
+ thinking_level: z20.enum(VALID_THINKING_LEVELS).nullable().optional(),
12293
+ workspace_size: z20.enum(WORKSPACE_SIZES).optional(),
12294
+ credential_user_id: z20.string().nullable().optional().describe(`${credentialUserIdDescription} Null switches back to the organization's.`),
12286
12295
  background: automationBackgroundSchema,
12287
- scope: z19.literal("org").optional().describe("`org` moves a personal automation to the organization so teammates can see and edit it. It cannot be moved back.")
12296
+ scope: z20.literal("org").optional().describe("`org` moves a personal automation to the organization so teammates can see and edit it. It cannot be moved back.")
12288
12297
  });
12289
- var chatPath = { id: z19.string().describe("Workspace ID"), chat_id: z19.string().describe("Chat ID") };
12298
+ var chatPath = { id: z20.string().describe("Workspace ID"), chat_id: z20.string().describe("Chat ID") };
12290
12299
  var { provider, model, thinkingLevel, title, message } = forkChatRequestSchema.shape;
12291
- var createChatToolInputSchema = z19.object({ id: chatPath.id, provider, title: createChatRequestSchema.shape.title });
12292
- var forkChatToolInputSchema = z19.object({ ...chatPath, provider, model, thinking_level: thinkingLevel, title, message });
12293
- var renameChatToolInputSchema = z19.object({ ...chatPath, display_name: updateChatDisplayNameRequestSchema.shape.displayName });
12294
- var runCommandToolInputSchema = z19.object({ id: chatPath.id, ...workspaceExecRequestSchema.shape });
12295
- var environmentMcpPath = { environment_id: z19.string().describe("Environment ID") };
12296
- var createEnvironmentMcpToolInputSchema = z19.object({ ...environmentMcpPath, ...createEnvironmentMcpRequestSchema.shape });
12297
- var updateEnvironmentMcpToolInputSchema = z19.object({
12300
+ var createChatToolInputSchema = z20.object({ id: chatPath.id, provider, title: createChatRequestSchema.shape.title });
12301
+ var forkChatToolInputSchema = z20.object({ ...chatPath, provider, model, thinking_level: thinkingLevel, title, message });
12302
+ var renameChatToolInputSchema = z20.object({ ...chatPath, display_name: updateChatDisplayNameRequestSchema.shape.displayName });
12303
+ var runCommandToolInputSchema = z20.object({ id: chatPath.id, ...workspaceExecRequestSchema.shape });
12304
+ var environmentMcpPath = { environment_id: z20.string().describe("Environment ID") };
12305
+ var createEnvironmentMcpToolInputSchema = z20.object({ ...environmentMcpPath, ...createEnvironmentMcpRequestSchema.shape });
12306
+ var updateEnvironmentMcpToolInputSchema = z20.object({
12298
12307
  ...environmentMcpPath,
12299
- mcp_id: z19.string().describe("MCP ID"),
12308
+ mcp_id: z20.string().describe("MCP ID"),
12300
12309
  ...updateEnvironmentMcpRequestSchema.shape
12301
12310
  });
12302
- var createEnvironmentDeviceToolInputSchema = z19.object({ ...environmentMcpPath, ...createEnvironmentDeviceRequestSchema.shape });
12311
+ var createEnvironmentDeviceToolInputSchema = z20.object({ ...environmentMcpPath, ...createEnvironmentDeviceRequestSchema.shape });
12303
12312
 
12304
12313
  // ../shared/src/scout.ts
12305
12314
  var SCOUT_SOURCE_TYPES = ["slack", "linear"];
@@ -12371,63 +12380,63 @@ When someone accepts an offer to automate a repeated request, set it up here ins
12371
12380
  `;
12372
12381
 
12373
12382
  // ../shared/src/routes/preferences.ts
12374
- import { z as z23 } from "zod";
12383
+ import { z as z24 } from "zod";
12375
12384
 
12376
12385
  // ../shared/src/routes/push.ts
12377
- import { z as z20 } from "zod";
12386
+ import { z as z21 } from "zod";
12378
12387
 
12379
12388
  // ../shared/src/workspace-attention.ts
12380
12389
  var WORKSPACE_ATTENTION_REASONS = ["question", "plan", "variables", "blocked", "setup", "deploy_failed"];
12381
12390
  var CHAT_ATTENTION_REASONS = ["question", "blocked"];
12382
12391
 
12383
12392
  // ../shared/src/routes/push.ts
12384
- var registerPushDeviceRequestSchema = z20.discriminatedUnion("platform", [
12385
- z20.object({
12386
- platform: z20.literal("ios"),
12387
- token: z20.string().regex(/^[0-9a-f]{64,200}$/i),
12388
- appId: z20.string().min(1).max(255),
12389
- apnsEnvironment: z20.enum(["sandbox", "production"])
12393
+ var registerPushDeviceRequestSchema = z21.discriminatedUnion("platform", [
12394
+ z21.object({
12395
+ platform: z21.literal("ios"),
12396
+ token: z21.string().regex(/^[0-9a-f]{64,200}$/i),
12397
+ appId: z21.string().min(1).max(255),
12398
+ apnsEnvironment: z21.enum(["sandbox", "production"])
12390
12399
  }),
12391
- z20.object({
12392
- platform: z20.literal("android"),
12393
- token: z20.string().min(1).max(4096),
12394
- appId: z20.string().min(1).max(255)
12400
+ z21.object({
12401
+ platform: z21.literal("android"),
12402
+ token: z21.string().min(1).max(4096),
12403
+ appId: z21.string().min(1).max(255)
12395
12404
  })
12396
12405
  ]);
12397
12406
  var PUSH_HOLD_MINUTES = 5;
12398
- var chatRefSchema = z20.object({ workspaceId: z20.string().uuid(), chatId: z20.string().min(1).max(100) });
12399
- var recordPushActivityRequestSchema = z20.object({
12400
- organizationId: z20.string().uuid(),
12407
+ var chatRefSchema = z21.object({ workspaceId: z21.string().uuid(), chatId: z21.string().min(1).max(100) });
12408
+ var recordPushActivityRequestSchema = z21.object({
12409
+ organizationId: z21.string().uuid(),
12401
12410
  /** Seconds since the last keyboard or mouse input on this computer. A phone leaves it out: it only reports what it has open. */
12402
- idleSeconds: z20.number().min(0).optional(),
12403
- seenWorkspaceIds: z20.array(z20.string().uuid()).max(20),
12404
- seenChats: z20.array(chatRefSchema).max(20).optional()
12411
+ idleSeconds: z21.number().min(0).optional(),
12412
+ seenWorkspaceIds: z21.array(z21.string().uuid()).max(20),
12413
+ seenChats: z21.array(chatRefSchema).max(20).optional()
12405
12414
  });
12406
12415
  var PUSH_NOTIFICATION_KINDS = [...WORKSPACE_ATTENTION_REASONS, "finished"];
12407
12416
  var PUSH_OPTION_LABEL_MAX = 60;
12408
12417
  var PUSH_OPTIONS_MAX = 4;
12409
- var pushQuestionSchema = z20.object({ id: z20.string().max(64), allowCustom: z20.boolean().optional(), options: z20.array(z20.object({ id: z20.string().max(64), label: z20.string().min(1).max(PUSH_OPTION_LABEL_MAX) })).min(1).max(PUSH_OPTIONS_MAX) });
12410
- var pushNotificationDataSchema = z20.object({
12411
- organizationId: z20.string(),
12412
- workspaceId: z20.string(),
12413
- chatId: z20.string().nullable(),
12414
- kind: z20.enum(PUSH_NOTIFICATION_KINDS),
12415
- completedAt: z20.string(),
12416
- toolRequestId: z20.string().optional(),
12418
+ var pushQuestionSchema = z21.object({ id: z21.string().max(64), allowCustom: z21.boolean().optional(), options: z21.array(z21.object({ id: z21.string().max(64), label: z21.string().min(1).max(PUSH_OPTION_LABEL_MAX) })).min(1).max(PUSH_OPTIONS_MAX) });
12419
+ var pushNotificationDataSchema = z21.object({
12420
+ organizationId: z21.string(),
12421
+ workspaceId: z21.string(),
12422
+ chatId: z21.string().nullable(),
12423
+ kind: z21.enum(PUSH_NOTIFICATION_KINDS),
12424
+ completedAt: z21.string(),
12425
+ toolRequestId: z21.string().optional(),
12417
12426
  question: pushQuestionSchema.optional()
12418
12427
  });
12419
- var workspaceSharedPushDataSchema = pushNotificationDataSchema.pick({ organizationId: true, workspaceId: true, chatId: true, completedAt: true }).extend({ kind: z20.literal("shared") });
12428
+ var workspaceSharedPushDataSchema = pushNotificationDataSchema.pick({ organizationId: true, workspaceId: true, chatId: true, completedAt: true }).extend({ kind: z21.literal("shared") });
12420
12429
  var registerLiveActivityRequestSchema = chatRefSchema.extend({
12421
- deviceId: z20.string().uuid(),
12430
+ deviceId: z21.string().uuid(),
12422
12431
  /** The iOS activity's push token. Android leaves it out and gets FCM data messages on the device token. */
12423
- pushToken: z20.string().regex(/^[0-9a-f]{64,400}$/i).optional(),
12432
+ pushToken: z21.string().regex(/^[0-9a-f]{64,400}$/i).optional(),
12424
12433
  /** iOS only: when the card's turn started, in seconds. Cards keep their order by it. */
12425
- startedAt: z20.number().positive().optional()
12434
+ startedAt: z21.number().positive().optional()
12426
12435
  });
12427
- var syncLiveActivitiesRequestSchema = z20.object({
12428
- activities: z20.array(chatRefSchema).max(100)
12436
+ var syncLiveActivitiesRequestSchema = z21.object({
12437
+ activities: z21.array(chatRefSchema).max(100)
12429
12438
  });
12430
- var setLiveActivityStartTokenRequestSchema = z20.object({ token: z20.string().regex(/^[0-9a-f]{64,400}$/i) });
12439
+ var setLiveActivityStartTokenRequestSchema = z21.object({ token: z21.string().regex(/^[0-9a-f]{64,400}$/i) });
12431
12440
 
12432
12441
  // ../shared/src/default-skills/replicas-agent/abilities/computer.ts
12433
12442
  var SECTION = `### Computer use (Linux desktop control)
@@ -12439,7 +12448,8 @@ Use this when:
12439
12448
  - A task requires interacting with a website, web app, or desktop application that has no usable API
12440
12449
  - You want the user to watch the agent work - they can open the \`Desktop\` tab, or you can share the URL from \`replicas computer info\`
12441
12450
  - You're testing UI changes in a browser before reporting them as done
12442
- - You want to record a screen capture of a task as proof to share back`;
12451
+ - You want to record a screen capture of a task as proof to share back
12452
+ - You need to open or use an app on the user's Mac: use \`replicas computer mac\`, never \`ssh\` with \`open\` or AppleScript, which can switch the user's view`;
12443
12453
  var REFERENCE = `# Computer use (Linux desktop control)
12444
12454
 
12445
12455
  Every Replicas workspace boots with a full Linux desktop stack - Xvfb (1920\xD71080), openbox, tint2, PulseAudio, ffmpeg, and Google Chrome. The engine auto-registers the H.264 and Opus viewer (port 6080) as an authenticated preview at startup, so the dashboard \`Desktop\` tab is live the moment the workspace is up. You drive the desktop through the \`replicas computer\` CLI.
@@ -12708,7 +12718,7 @@ var DOCKER_ABILITY = {
12708
12718
  };
12709
12719
 
12710
12720
  // ../shared/src/routes/environment-setups.ts
12711
- import { z as z21 } from "zod";
12721
+ import { z as z22 } from "zod";
12712
12722
  var ENVIRONMENT_SETUP_STEPS = [
12713
12723
  { key: "understand", label: "Understand the codebase" },
12714
12724
  { key: "install", label: "Install dependencies and run the app" },
@@ -12741,17 +12751,17 @@ var ENVIRONMENT_SETUP_LIMITS = {
12741
12751
  repositories: 20
12742
12752
  };
12743
12753
  var VARIABLE_KEY_RE = /^[A-Za-z_][A-Za-z0-9_]*$/;
12744
- var text2 = (max) => max === void 0 ? z21.string().trim() : z21.string().trim().max(max);
12754
+ var text2 = (max) => max === void 0 ? z22.string().trim() : z22.string().trim().max(max);
12745
12755
  var requiredText = (max) => text2(max).min(1, "must not be empty");
12746
12756
  var optionalText2 = (max) => text2(max).nullish().transform((value) => value || null);
12747
12757
  var clearableText = (max) => text2(max).nullish().transform((value) => value === void 0 ? void 0 : value || null);
12748
- var list = (item, max) => max === void 0 ? z21.array(item) : z21.array(item).max(max);
12758
+ var list = (item, max) => max === void 0 ? z22.array(item) : z22.array(item).max(max);
12749
12759
  var ENVIRONMENT_SETUP_AUTHORED_TRIGGER_TYPES = ["cron", "github", "gitlab"];
12750
12760
  function isEnvironmentSetupAuthoredTriggerType(type) {
12751
12761
  return ENVIRONMENT_SETUP_AUTHORED_TRIGGER_TYPES.some((authored) => authored === type);
12752
12762
  }
12753
- var proposalTriggerSchema = z21.discriminatedUnion("type", [cronTriggerSchema, githubTriggerSchema, gitlabTriggerSchema]);
12754
- var existingTriggerSchema = z21.custom(
12763
+ var proposalTriggerSchema = z22.discriminatedUnion("type", [cronTriggerSchema, githubTriggerSchema, gitlabTriggerSchema]);
12764
+ var existingTriggerSchema = z22.custom(
12755
12765
  (value) => isRecord(value) && typeof value.type === "string" && isRecord(value.config),
12756
12766
  "must be an automation trigger"
12757
12767
  );
@@ -12759,17 +12769,17 @@ var carriedTriggerSchema = existingTriggerSchema.refine(
12759
12769
  (trigger) => !isEnvironmentSetupAuthoredTriggerType(trigger.type)
12760
12770
  );
12761
12771
  function automationSchema(limits) {
12762
- const authored = z21.object({
12772
+ const authored = z22.object({
12763
12773
  name: text2(limits.nameChars),
12764
12774
  description: text2(limits.descriptionChars),
12765
12775
  prompt: text2(limits.automationPromptChars),
12766
12776
  triggers: list(proposalTriggerSchema, limits.automationTriggers)
12767
12777
  });
12768
- const updated = authored.extend({ triggers: list(z21.union([proposalTriggerSchema, carriedTriggerSchema]), limits.automationTriggers) });
12769
- return z21.object({
12778
+ const updated = authored.extend({ triggers: list(z22.union([proposalTriggerSchema, carriedTriggerSchema]), limits.automationTriggers) });
12779
+ return z22.object({
12770
12780
  key: requiredText(limits.automationKeyChars),
12771
- action: z21.enum(ENVIRONMENT_SETUP_AUTOMATION_ACTIONS).default("create"),
12772
- automation_id: z21.string().regex(UUID_RE, "must be an automation id").nullable().default(null),
12781
+ action: z22.enum(ENVIRONMENT_SETUP_AUTOMATION_ACTIONS).default("create"),
12782
+ automation_id: z22.string().regex(UUID_RE, "must be an automation id").nullable().default(null),
12773
12783
  name: text2().default(""),
12774
12784
  description: optionalText2().transform((value) => value ?? ""),
12775
12785
  prompt: text2().default(""),
@@ -12792,7 +12802,7 @@ function automationSchema(limits) {
12792
12802
  const content = (automation.action === "update" ? updated : authored).safeParse(automation);
12793
12803
  if (content.success) return { ...automation, ...content.data };
12794
12804
  for (const issue of content.error.issues) ctx.addIssue({ ...issue, code: "custom" });
12795
- return z21.NEVER;
12805
+ return z22.NEVER;
12796
12806
  });
12797
12807
  }
12798
12808
  function automationListSchema(limits) {
@@ -12810,7 +12820,7 @@ function automationListSchema(limits) {
12810
12820
  });
12811
12821
  }
12812
12822
  function environmentSchema(limits) {
12813
- return z21.object({
12823
+ return z22.object({
12814
12824
  name: optionalText2(limits.nameChars).transform((value) => value ?? void 0),
12815
12825
  description: clearableText(limits.descriptionChars),
12816
12826
  system_prompt: clearableText(limits.systemPromptChars),
@@ -12819,41 +12829,41 @@ function environmentSchema(limits) {
12819
12829
  });
12820
12830
  }
12821
12831
  function proposalSchema(limits) {
12822
- return z21.object({
12832
+ return z22.object({
12823
12833
  summary: requiredText(limits.summaryChars),
12824
12834
  stack: list(text2(), limits.stackItems).default([]).transform((items) => items.filter(Boolean)),
12825
12835
  environment: environmentSchema(limits),
12826
- variables: list(z21.object({
12827
- key: z21.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name").max(limits.variableKeyChars ?? Number.POSITIVE_INFINITY),
12836
+ variables: list(z22.object({
12837
+ key: z22.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name").max(limits.variableKeyChars ?? Number.POSITIVE_INFINITY),
12828
12838
  description: optionalText2(limits.variableDescriptionChars).transform((value) => value ?? ""),
12829
- required: z21.boolean().default(false)
12839
+ required: z22.boolean().default(false)
12830
12840
  }), limits.variables).default([]),
12831
12841
  automations: automationListSchema(limits),
12832
- verification: list(z21.object({
12842
+ verification: list(z22.object({
12833
12843
  label: requiredText(limits.nameChars),
12834
- status: z21.enum(ENVIRONMENT_SETUP_VERIFICATION_STATUSES),
12844
+ status: z22.enum(ENVIRONMENT_SETUP_VERIFICATION_STATUSES),
12835
12845
  detail: optionalText2(limits.verificationDetailChars).transform((value) => value ?? void 0)
12836
12846
  }), limits.verificationItems).default([]),
12837
- media: list(z21.object({
12838
- media_id: z21.string().regex(UUID_RE, "must be a media id"),
12847
+ media: list(z22.object({
12848
+ media_id: z22.string().regex(UUID_RE, "must be a media id"),
12839
12849
  title: requiredText(limits.nameChars)
12840
12850
  }), limits.mediaItems).default([])
12841
12851
  });
12842
12852
  }
12843
12853
  var environmentSetupProposalSchema = proposalSchema({});
12844
12854
  var environmentSetupProposalSubmissionSchema = proposalSchema(ENVIRONMENT_SETUP_LIMITS);
12845
- var environmentSetupRunStateSchema = z21.object({
12846
- status: z21.enum(ENVIRONMENT_SETUP_RUN_STATUSES),
12847
- steps: z21.partialRecord(z21.enum(ENVIRONMENT_SETUP_STEPS.map((step) => step.key)), z21.enum(ENVIRONMENT_SETUP_STEP_STATUSES)).default({}),
12855
+ var environmentSetupRunStateSchema = z22.object({
12856
+ status: z22.enum(ENVIRONMENT_SETUP_RUN_STATUSES),
12857
+ steps: z22.partialRecord(z22.enum(ENVIRONMENT_SETUP_STEPS.map((step) => step.key)), z22.enum(ENVIRONMENT_SETUP_STEP_STATUSES)).default({}),
12848
12858
  proposal: environmentSetupProposalSchema.nullable().default(null),
12849
- applied: z21.object({
12850
- applied_at: z21.string(),
12851
- automation_ids: z21.array(z21.string())
12859
+ applied: z22.object({
12860
+ applied_at: z22.string(),
12861
+ automation_ids: z22.array(z22.string())
12852
12862
  }).nullable().default(null)
12853
12863
  });
12854
- var applyEnvironmentSetupRequestSchema = z21.object({
12864
+ var applyEnvironmentSetupRequestSchema = z22.object({
12855
12865
  environment: environmentSchema(ENVIRONMENT_SETUP_LIMITS).extend({ name: requiredText(ENVIRONMENT_SETUP_LIMITS.nameChars) }),
12856
- variables: list(z21.object({ key: z21.string().regex(VARIABLE_KEY_RE), value: z21.string() }), ENVIRONMENT_SETUP_LIMITS.variables).default([]).refine((variables) => new Set(variables.map((variable) => variable.key)).size === variables.length, "must have unique keys").transform((variables) => variables.filter((variable) => variable.value.length > 0)),
12866
+ variables: list(z22.object({ key: z22.string().regex(VARIABLE_KEY_RE), value: z22.string() }), ENVIRONMENT_SETUP_LIMITS.variables).default([]).refine((variables) => new Set(variables.map((variable) => variable.key)).size === variables.length, "must have unique keys").transform((variables) => variables.filter((variable) => variable.value.length > 0)),
12857
12867
  automations: automationListSchema(ENVIRONMENT_SETUP_LIMITS)
12858
12868
  });
12859
12869
 
@@ -13328,7 +13338,7 @@ var GITLAB_ABILITY = {
13328
13338
  };
13329
13339
 
13330
13340
  // ../shared/src/routes/compute.ts
13331
- import { z as z22 } from "zod";
13341
+ import { z as z23 } from "zod";
13332
13342
  var COMPUTE_SANDBOX_KINDS = ["gpu"];
13333
13343
  var GPU_TYPES = ["T4", "L4", "A10G", "L40S", "A100", "A100-80GB", "H100", "H200", "B200"];
13334
13344
  var DEFAULT_GPU_TYPE = "L4";
@@ -13345,27 +13355,27 @@ var COMPUTE_SANDBOX_LIMITS = {
13345
13355
  maxIdleTimeoutMinutes: 60,
13346
13356
  maxTransferBytes: 1024 ** 3
13347
13357
  };
13348
- var computeEnvSchema = z22.record(z22.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128), z22.string().max(32768)).refine((env) => Object.keys(env).length <= 64, "At most 64 environment variables are allowed");
13349
- var createComputeSandboxRequestSchema = z22.object({
13350
- kind: z22.enum(COMPUTE_SANDBOX_KINDS),
13351
- gpu: z22.string().trim().optional(),
13352
- image: z22.string().trim().min(1).max(256).regex(/^\S+$/, "Image must not contain whitespace").optional(),
13353
- timeoutMinutes: z22.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxTimeoutMinutes).optional(),
13354
- idleTimeoutMinutes: z22.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxIdleTimeoutMinutes).optional(),
13355
- ports: z22.array(z22.number().int().min(1).max(65535)).max(COMPUTE_SANDBOX_LIMITS.maxPorts).optional(),
13358
+ var computeEnvSchema = z23.record(z23.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/).max(128), z23.string().max(32768)).refine((env) => Object.keys(env).length <= 64, "At most 64 environment variables are allowed");
13359
+ var createComputeSandboxRequestSchema = z23.object({
13360
+ kind: z23.enum(COMPUTE_SANDBOX_KINDS),
13361
+ gpu: z23.string().trim().optional(),
13362
+ image: z23.string().trim().min(1).max(256).regex(/^\S+$/, "Image must not contain whitespace").optional(),
13363
+ timeoutMinutes: z23.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxTimeoutMinutes).optional(),
13364
+ idleTimeoutMinutes: z23.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxIdleTimeoutMinutes).optional(),
13365
+ ports: z23.array(z23.number().int().min(1).max(65535)).max(COMPUTE_SANDBOX_LIMITS.maxPorts).optional(),
13356
13366
  env: computeEnvSchema.optional()
13357
13367
  });
13358
- var computeExecRequestSchema = z22.object({
13359
- command: z22.string().min(1).max(1e5),
13360
- workdir: z22.string().min(1).max(4096).optional(),
13368
+ var computeExecRequestSchema = z23.object({
13369
+ command: z23.string().min(1).max(1e5),
13370
+ workdir: z23.string().min(1).max(4096).optional(),
13361
13371
  env: computeEnvSchema.optional(),
13362
- detach: z22.boolean().optional()
13372
+ detach: z23.boolean().optional()
13363
13373
  });
13364
- var computeUploadRequestSchema = z22.object({
13365
- size: z22.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxTransferBytes)
13374
+ var computeUploadRequestSchema = z23.object({
13375
+ size: z23.number().int().min(1).max(COMPUTE_SANDBOX_LIMITS.maxTransferBytes)
13366
13376
  });
13367
- var computeTransferPathSchema = z22.object({
13368
- path: z22.string().min(1).max(4096).optional()
13377
+ var computeTransferPathSchema = z23.object({
13378
+ path: z23.string().min(1).max(4096).optional()
13369
13379
  });
13370
13380
 
13371
13381
  // ../shared/src/default-skills/replicas-agent/abilities/gpu.ts
@@ -13553,7 +13563,7 @@ var LINEAR_ABILITY = {
13553
13563
 
13554
13564
  // ../shared/src/default-skills/replicas-agent/abilities/local-computer.ts
13555
13565
  var SECTION8 = `### The user's computer
13556
- Run commands on the user's own Mac or Linux computer over \`ssh <name>\`, such as an Xcode build, a simulator, or a tool that only exists there. Your instructions name the computers this workspace can reach, either through the desktop app's local control or as devices. With none, ask the user for theirs with \`replicas local-control request\`.
13566
+ Run commands on the user's own Mac or Linux computer over \`ssh <name>\`, such as an Xcode build, a simulator, or a tool that only exists there. Your instructions name the computers this workspace can reach, either through the desktop app's local control or as devices. With none, ask the user for theirs with \`replicas local-control request\`. To open or use an app on their Mac, use \`replicas computer mac\` instead (\`references/COMPUTER-USE.md\`), so the user's view never switches.
13557
13567
 
13558
13568
  **Reference:** \`references/LOCAL-COMPUTER.md\`
13559
13569
 
@@ -13576,7 +13586,13 @@ replicas local-control request --reason "Build and run the iOS app in the Simula
13576
13586
 
13577
13587
  It asks the user above the chat composer to let this workspace use their computer and to open the desktop app, waits until their computer connects, and prints its name. If it stops waiting first, end your turn and say what you need the computer for; you get a message when the user answers.
13578
13588
 
13579
- It is a personal machine with the user's files, accounts and running apps. Change only what the task needs, keep your files in one folder, and ask before anything destructive, slow to undo, or visible on their screen (opening apps, booting a simulator window, changing settings).
13589
+ It is a personal machine with the user's files, accounts and running apps. Change only what the task needs, keep your files in one folder, and ask before anything destructive, slow to undo, or visible on their screen (bringing an app to the front, booting a simulator window, changing settings).
13590
+
13591
+ ## Apps on a Mac: use \`replicas computer mac\`, not \`ssh\`
13592
+
13593
+ To open or use an app (launch it, click, type, play music, read its window), use \`replicas computer mac\` (see \`references/COMPUTER-USE.md\`). It keeps the app in the background, so the user's front window and focus stay theirs, and the user sees what you do in Replicas. It takes no host: it drives the Mac connected through the desktop app (a \`desktop-*\` host). When you're working on a different computer, ask the user before using it. \`open\`, \`osascript\` and other commands over \`ssh\` can bring an app to the front and switch the user's view, and they don't show up in Replicas.
13594
+
13595
+ Use \`ssh\` when it makes more sense: files, shell commands, builds, the Simulator through \`xcrun simctl\`, and quick read-only checks (\`osascript\` asking an app what it is doing) that change nothing on screen.
13580
13596
 
13581
13597
  ## Running commands
13582
13598
 
@@ -13633,7 +13649,7 @@ ssh mac 'xcodebuild -version; xcrun simctl list runtimes; xcrun simctl list devi
13633
13649
  var LOCAL_COMPUTER_ABILITY = {
13634
13650
  label: "User's computer",
13635
13651
  description: "Run commands, builds and simulators on the user's own Mac or Linux computer over `ssh`.",
13636
- bullet: "- Running commands on the user's own computer (`ssh <name>`), such as a local Xcode build or the iOS Simulator",
13652
+ bullet: "- Running commands on the user's own computer (`ssh <name>`), such as a local Xcode build or the iOS Simulator, or opening and using an app on their Mac in the background (`replicas computer mac`, never `ssh` with `open` or AppleScript)",
13637
13653
  section: SECTION8,
13638
13654
  referenceFile: { name: "LOCAL-COMPUTER.md", content: REFERENCE8 }
13639
13655
  };
@@ -15110,9 +15126,9 @@ var DEFAULT_DEFAULT_SKILLS = {
15110
15126
  }
15111
15127
  };
15112
15128
  var LINEAR_ROUTING_SKILL_MAX_LENGTH = 5e4;
15113
- var linearRoutingSkillSchema = z23.union([
15114
- z23.object({ name: z23.string().min(1), content: z23.string().trim().min(1).max(LINEAR_ROUTING_SKILL_MAX_LENGTH) }),
15115
- z23.object({ name: z23.string().min(1), repository_id: z23.string().regex(UUID_RE), path: z23.string().min(1) })
15129
+ var linearRoutingSkillSchema = z24.union([
15130
+ z24.object({ name: z24.string().min(1), content: z24.string().trim().min(1).max(LINEAR_ROUTING_SKILL_MAX_LENGTH) }),
15131
+ z24.object({ name: z24.string().min(1), repository_id: z24.string().regex(UUID_RE), path: z24.string().min(1) })
15116
15132
  ]);
15117
15133
 
15118
15134
  // ../shared/src/prompts.ts
@@ -15291,18 +15307,18 @@ var UNKNOWN_EVENT_KIND = "update";
15291
15307
  var MOTHERSHIP_TURN_ERROR_SUMMARY = "Turn ended with an error.";
15292
15308
  var MOTHERSHIP_EVENT_TYPE = "multitask-event";
15293
15309
  var MOTHERSHIP_EVENT_MESSAGE_TYPE = "multitask_event";
15294
- var mothershipEventSchema = z24.object({
15295
- id: z24.string(),
15296
- at: z24.string(),
15297
- kind: z24.enum([...MOTHERSHIP_EVENT_KINDS, UNKNOWN_EVENT_KIND]),
15298
- agentId: z24.string(),
15299
- agentName: z24.string(),
15300
- summary: z24.string(),
15301
- detail: z24.string().optional(),
15310
+ var mothershipEventSchema = z25.object({
15311
+ id: z25.string(),
15312
+ at: z25.string(),
15313
+ kind: z25.enum([...MOTHERSHIP_EVENT_KINDS, UNKNOWN_EVENT_KIND]),
15314
+ agentId: z25.string(),
15315
+ agentName: z25.string(),
15316
+ summary: z25.string(),
15317
+ detail: z25.string().optional(),
15302
15318
  // Set when the subagent is a chat in this workspace rather than a ship; agentId is then that chat's id.
15303
- chatId: z24.string().optional(),
15319
+ chatId: z25.string().optional(),
15304
15320
  // Set on events recorded before every kind woke the orchestrator, which were shown as a row when they happened.
15305
- noticed: z24.boolean().optional()
15321
+ noticed: z25.boolean().optional()
15306
15322
  });
15307
15323
  var TAG = "multitask_event";
15308
15324
  var BLOCK = new RegExp(`<${TAG}((?:\\s+\\w+="[^"]*")*)>\\n?([\\s\\S]*?)\\n?</${TAG}>`, "g");
@@ -16346,7 +16362,7 @@ function subagentReport(output) {
16346
16362
  }
16347
16363
 
16348
16364
  // ../shared/src/learned-skills.ts
16349
- import { z as z25 } from "zod";
16365
+ import { z as z26 } from "zod";
16350
16366
 
16351
16367
  // ../shared/src/frontmatter.ts
16352
16368
  import { parse as parseYaml } from "yaml";
@@ -16369,20 +16385,20 @@ function parseFrontmatter(content) {
16369
16385
  var LEARNED_SKILLS_ROOT = `${SANDBOX_PATHS.REPLICAS_DIR}/learned-skills`;
16370
16386
  var LEARNED_SKILLS_MANIFEST_PATH = `${LEARNED_SKILLS_ROOT}/manifest.json`;
16371
16387
  var LEARNED_SKILL_DIR_PREFIX = "replicas-learned__";
16372
- var learnedSkillsManifestSchema = z25.object({
16373
- skills: z25.array(z25.object({ name: z25.string(), sha256: z25.string() }))
16388
+ var learnedSkillsManifestSchema = z26.object({
16389
+ skills: z26.array(z26.object({ name: z26.string(), sha256: z26.string() }))
16374
16390
  });
16375
- var dreamVerdictChecksSchema = z25.object({
16376
- repeatable: z25.boolean(),
16377
- realInstruction: z25.boolean(),
16378
- noContradiction: z25.boolean(),
16379
- formatExact: z25.boolean(),
16380
- humanOnly: z25.boolean(),
16381
- actionable: z25.boolean(),
16382
- durable: z25.boolean()
16391
+ var dreamVerdictChecksSchema = z26.object({
16392
+ repeatable: z26.boolean(),
16393
+ realInstruction: z26.boolean(),
16394
+ noContradiction: z26.boolean(),
16395
+ formatExact: z26.boolean(),
16396
+ humanOnly: z26.boolean(),
16397
+ actionable: z26.boolean(),
16398
+ durable: z26.boolean()
16383
16399
  });
16384
16400
  var DREAM_VERDICT_CHECKS = dreamVerdictChecksSchema.keyof().options;
16385
- var dreamVerdictSchema = dreamVerdictChecksSchema.extend({ approve: z25.boolean(), reason: z25.string() });
16401
+ var dreamVerdictSchema = dreamVerdictChecksSchema.extend({ approve: z26.boolean(), reason: z26.string() });
16386
16402
  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."`;
16387
16403
 
16388
16404
  // ../shared/src/terminal.ts
@@ -16413,7 +16429,7 @@ function workspaceTargetFromToolOutput(output) {
16413
16429
  }
16414
16430
 
16415
16431
  // ../shared/src/mothership-board.ts
16416
- import { z as z26 } from "zod";
16432
+ import { z as z27 } from "zod";
16417
16433
  var MOTHERSHIP_TICKET_LIMITS = {
16418
16434
  title: 80,
16419
16435
  task: 1e3,
@@ -16432,63 +16448,63 @@ var MOTHERSHIP_TICKET_LIMITS = {
16432
16448
  };
16433
16449
  var L = MOTHERSHIP_TICKET_LIMITS;
16434
16450
  var tooLong = (max) => `At most ${max} characters. Keep it short; the user should take it in at a glance`;
16435
- var text3 = (max) => z26.string().trim().min(1).max(max, tooLong(max));
16436
- var clearable = (schema) => z26.union([schema, z26.literal("")]).optional();
16437
- var httpsUrl = z26.url({ protocol: /^https$/, error: "Must be an https URL" });
16451
+ var text3 = (max) => z27.string().trim().min(1).max(max, tooLong(max));
16452
+ var clearable = (schema) => z27.union([schema, z27.literal("")]).optional();
16453
+ var httpsUrl = z27.url({ protocol: /^https$/, error: "Must be an https URL" });
16438
16454
  var inlineMarkdown = "Markdown: **bold**, *italics*, `code`, [links](https://... or an absolute file path)";
16439
16455
  var markdown = `${inlineMarkdown} and line breaks.`;
16440
- var linearIdentifier = z26.string().regex(/^[A-Za-z][A-Za-z0-9]{0,9}-\d{1,7}$/, "Use a Linear identifier such as REP-123");
16441
- var mediaSchema = z26.object({
16456
+ var linearIdentifier = z27.string().regex(/^[A-Za-z][A-Za-z0-9]{0,9}-\d{1,7}$/, "Use a Linear identifier such as REP-123");
16457
+ var mediaSchema = z27.object({
16442
16458
  url: httpsUrl.describe("The URL `replicas media upload` printed."),
16443
16459
  caption: text3(L.caption).describe('What it shows, such as "After: the list stays pinned".'),
16444
- kind: z26.enum(["image", "video"]).describe("video for recordings, image for screenshots and GIFs.")
16460
+ kind: z27.enum(["image", "video"]).describe("video for recordings, image for screenshots and GIFs.")
16445
16461
  });
16446
- var questionSchema = z26.object({
16462
+ var questionSchema = z27.object({
16447
16463
  question: text3(L.question).describe("One question, with the context needed to answer it."),
16448
- options: z26.array(text3(L.option)).max(L.options).optional().describe("Up to three answers to pick from, recommended first. The user can always write their own.")
16464
+ options: z27.array(text3(L.option)).max(L.options).optional().describe("Up to three answers to pick from, recommended first. The user can always write their own.")
16449
16465
  });
16450
16466
  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.`);
16451
16467
  var mothershipTicketTaskSchema = text3(L.task);
16452
- var mothershipTicketMediaSchema = z26.array(mediaSchema);
16453
- var mothershipTicketQuestionsSchema = z26.array(questionSchema.extend({ id: z26.string() }));
16468
+ var mothershipTicketMediaSchema = z27.array(mediaSchema);
16469
+ var mothershipTicketQuestionsSchema = z27.array(questionSchema.extend({ id: z27.string() }));
16454
16470
  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.`);
16455
16471
  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.`);
16456
- var updateMothershipTicketRequestSchema = z26.object({
16472
+ var updateMothershipTicketRequestSchema = z27.object({
16457
16473
  title: mothershipTicketTitleSchema.optional(),
16458
16474
  issue: issueSchema,
16459
16475
  fix: fixSchema,
16460
- media: z26.array(mediaSchema).max(L.media).optional().describe(`Screenshots and recordings that show the result, uploaded with \`replicas media upload\`, at most ${L.media}. Replaces the ticket's media.`),
16461
- questions: z26.array(questionSchema).max(L.questions).optional().describe(`Questions only the user can answer, at most ${L.questions}. Replaces the open ones; pass [] once they are answered. Their answer comes back to you in this chat.`),
16476
+ media: z27.array(mediaSchema).max(L.media).optional().describe(`Screenshots and recordings that show the result, uploaded with \`replicas media upload\`, at most ${L.media}. Replaces the ticket's media.`),
16477
+ questions: z27.array(questionSchema).max(L.questions).optional().describe(`Questions only the user can answer, at most ${L.questions}. Replaces the open ones; pass [] once they are answered. Their answer comes back to you in this chat.`),
16462
16478
  blocked: clearable(text3(L.blocked)).describe('Why you cannot go on without the user, such as missing access. "" once unblocked.')
16463
16479
  });
16464
- var updateMothershipBoardRequestSchema = z26.object({
16480
+ var updateMothershipBoardRequestSchema = z27.object({
16465
16481
  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.`),
16466
- tickets: z26.array(z26.object({
16467
- id: z26.uuid(),
16482
+ tickets: z27.array(z27.object({
16483
+ id: z27.uuid(),
16468
16484
  title: mothershipTicketTitleSchema.optional(),
16469
16485
  issue: issueSchema,
16470
16486
  fix: fixSchema,
16471
- pull_requests: z26.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."),
16487
+ pull_requests: z27.array(httpsUrl).max(20).optional().describe("Pull request URLs that came out of this ticket's task. They move here from any other ticket. Each pull request is filed under the ticket its ship was working on when it opened it, so pass this only to correct that."),
16472
16488
  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.`),
16473
16489
  linear: clearable(linearIdentifier).describe('The Linear issue this ticket is for, such as REP-123. "" removes it.'),
16474
- archived: z26.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.")
16490
+ archived: z27.boolean().optional().describe("true takes it off the board for good: closes its open pull requests without merging, stops their automatic fixes, and archives its ships unless they still have other tickets. false puts it back on the board.")
16475
16491
  })).max(50).optional().describe("Changes to existing tickets."),
16476
- order: z26.array(z26.uuid()).optional().describe("Ticket ids, most important first. Tickets left out keep their order after these."),
16477
- create: z26.array(z26.object({
16492
+ order: z27.array(z27.uuid()).optional().describe("Ticket ids, most important first. Tickets left out keep their order after these."),
16493
+ create: z27.array(z27.object({
16478
16494
  title: mothershipTicketTitleSchema,
16479
16495
  task: mothershipTicketTaskSchema.optional(),
16480
16496
  issue: text3(L.issue).optional(),
16481
- questions: z26.array(questionSchema).max(L.questions).optional(),
16497
+ questions: z27.array(questionSchema).max(L.questions).optional(),
16482
16498
  note: text3(L.note).optional()
16483
16499
  })).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.")
16484
16500
  });
16485
- var answerMothershipTicketRequestSchema = z26.object({
16486
- questionId: z26.string().min(1),
16501
+ var answerMothershipTicketRequestSchema = z27.object({
16502
+ questionId: z27.string().min(1),
16487
16503
  answer: text3(L.answer)
16488
16504
  });
16489
- var mothershipTicketAnswerRefSchema = z26.object({ mothershipId: z26.uuid(), ticketId: z26.uuid(), questionId: z26.string().min(1) });
16505
+ var mothershipTicketAnswerRefSchema = z27.object({ mothershipId: z27.uuid(), ticketId: z27.uuid(), questionId: z27.string().min(1) });
16490
16506
  var LINEAR_ISSUE_SUMMARIES_MAX = 50;
16491
- var linearIssueSummariesRequestSchema = z26.object({ identifiers: z26.array(linearIdentifier).min(1).max(LINEAR_ISSUE_SUMMARIES_MAX) });
16507
+ var linearIssueSummariesRequestSchema = z27.object({ identifiers: z27.array(linearIdentifier).min(1).max(LINEAR_ISSUE_SUMMARIES_MAX) });
16492
16508
 
16493
16509
  // ../shared/src/user-message-matching.ts
16494
16510
  var parsedTimestamps = /* @__PURE__ */ new Map();
@@ -16856,10 +16872,10 @@ function currentStepLabel(messages, earlierPlainStep) {
16856
16872
  }
16857
16873
 
16858
16874
  // ../shared/src/user-message-attachments.ts
16859
- import { z as z27 } from "zod";
16875
+ import { z as z28 } from "zod";
16860
16876
  var ATTACHMENT_PLACEHOLDER_REGEX = /^\[\d+ (?:(?:images?|files?)(?: and \d+ files?)? attached|(?:image )?attachments?)\]$/;
16861
16877
  var withoutAttachmentPlaceholder = (content, attached) => attached && ATTACHMENT_PLACEHOLDER_REGEX.test(content) ? "" : content;
16862
- var annotationLinesSchema = z27.object({ path: z27.string(), start: z27.number(), end: z27.number() });
16878
+ var annotationLinesSchema = z28.object({ path: z28.string(), start: z28.number(), end: z28.number() });
16863
16879
  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".';
16864
16880
  var ANNOTATIONS_NOTE_REGEX = /(?:^|\n\n)<replicas_annotations>\n([\s\S]*?)\n<\/replicas_annotations>$/;
16865
16881
  var ANNOTATION_HEADER_REGEX = /^Annotation \d+$/m;
@@ -20156,7 +20172,7 @@ var VOICE_WAVEFORM = {
20156
20172
  };
20157
20173
 
20158
20174
  // ../shared/src/e2b.ts
20159
- var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-11-14-v26";
20175
+ var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-11-14-v28";
20160
20176
 
20161
20177
  // ../shared/src/e2b-retry.ts
20162
20178
  var DEFAULT_BACKOFFS_MS = [2e3, 5e3];
@@ -20629,10 +20645,10 @@ function hasChatStarted(chat) {
20629
20645
  }
20630
20646
 
20631
20647
  // ../shared/src/routes/billing.ts
20632
- import { z as z28 } from "zod";
20648
+ import { z as z29 } from "zod";
20633
20649
  var SOURCE_LIMIT_SOURCES = ["limrun", "modal"];
20634
- var usageLimitCentsSchema = z28.number().int().min(100).max(1e8);
20635
- var sourceLimitsCentsSchema = z28.partialRecord(z28.enum(SOURCE_LIMIT_SOURCES), usageLimitCentsSchema);
20650
+ var usageLimitCentsSchema = z29.number().int().min(100).max(1e8);
20651
+ var sourceLimitsCentsSchema = z29.partialRecord(z29.enum(SOURCE_LIMIT_SOURCES), usageLimitCentsSchema);
20636
20652
 
20637
20653
  // ../shared/src/routes/codex.ts
20638
20654
  var CODEX_AUTH_ENV_KEYS = [
@@ -20786,7 +20802,7 @@ var CLAUDE_AUTH_ENV_KEYS_BY_METHOD = {
20786
20802
  };
20787
20803
 
20788
20804
  // ../shared/src/routes/command-protection.ts
20789
- import { z as z29 } from "zod";
20805
+ import { z as z30 } from "zod";
20790
20806
 
20791
20807
  // ../shared/src/git-invocations.ts
20792
20808
  var COMMIT_VALUE_OPTIONS = /* @__PURE__ */ new Set(["message", "file", "trailer", "reuse-message", "reedit-message", "fixup", "squash", "template", "author", "date", "cleanup", "pathspec-from-file"]);
@@ -20877,27 +20893,27 @@ function findCheckoutTarget(args) {
20877
20893
  }
20878
20894
 
20879
20895
  // ../shared/src/routes/command-protection.ts
20880
- var commandProtectionRepoStateSchema = z29.object({
20881
- branch: z29.string().nullable(),
20882
- defaultBranch: z29.string().nullable(),
20883
- pushBranch: z29.string().nullable(),
20884
- pushConfig: z29.string().nullable(),
20885
- headMessage: z29.string().nullable(),
20886
- mergeInProgress: z29.boolean().optional()
20896
+ var commandProtectionRepoStateSchema = z30.object({
20897
+ branch: z30.string().nullable(),
20898
+ defaultBranch: z30.string().nullable(),
20899
+ pushBranch: z30.string().nullable(),
20900
+ pushConfig: z30.string().nullable(),
20901
+ headMessage: z30.string().nullable(),
20902
+ mergeInProgress: z30.boolean().optional()
20887
20903
  });
20888
- var commandProtectionEvaluateRequestSchema = z29.object({
20889
- provider: z29.enum(["claude", "codex", "cursor", "opencode", "pi"]),
20890
- source: z29.enum(["claude_pre_tool_use", "codex_approval_request", "cursor_pre_tool_use", "opencode_pre_tool_use", "pi_tool_call"]),
20891
- toolName: z29.string(),
20892
- toolInput: z29.unknown(),
20893
- command: z29.string().nullish(),
20894
- cwd: z29.string().nullish(),
20895
- toolUseId: z29.string().nullish(),
20904
+ var commandProtectionEvaluateRequestSchema = z30.object({
20905
+ provider: z30.enum(["claude", "codex", "cursor", "opencode", "pi"]),
20906
+ source: z30.enum(["claude_pre_tool_use", "codex_approval_request", "cursor_pre_tool_use", "opencode_pre_tool_use", "pi_tool_call"]),
20907
+ toolName: z30.string(),
20908
+ toolInput: z30.unknown(),
20909
+ command: z30.string().nullish(),
20910
+ cwd: z30.string().nullish(),
20911
+ toolUseId: z30.string().nullish(),
20896
20912
  // Read by the engine before the command runs, keyed by absolute path, so the
20897
20913
  // policy can see branches and commit messages the command text only references.
20898
- gitContext: z29.object({
20899
- repos: z29.record(z29.string(), commandProtectionRepoStateSchema),
20900
- messageFiles: z29.record(z29.string(), z29.string())
20914
+ gitContext: z30.object({
20915
+ repos: z30.record(z30.string(), commandProtectionRepoStateSchema),
20916
+ messageFiles: z30.record(z30.string(), z30.string())
20901
20917
  }).optional()
20902
20918
  });
20903
20919
  var COMMAND_PROTECTION_COMMAND_KEYS = ["command", "cmd", "script", "query", "endpoint", "path", "url", "mutation"];
@@ -21118,119 +21134,119 @@ function shouldRefreshPullRequests(toolName, toolInput) {
21118
21134
  }
21119
21135
 
21120
21136
  // ../shared/src/routes/scout.ts
21121
- import { z as z30 } from "zod";
21137
+ import { z as z31 } from "zod";
21122
21138
  var SCOUT_LINEAR_ACTIONS = ["ask", "start"];
21123
- var scoutLinearSessionIntentRequestSchema = z30.object({
21124
- comment_id: z30.string().trim().min(1).describe("Id of the Linear comment the session will be created on."),
21125
- action: z30.enum(SCOUT_LINEAR_ACTIONS).describe("`ask` when the comment is a clarifying question, `start` when it hands off the task.")
21139
+ var scoutLinearSessionIntentRequestSchema = z31.object({
21140
+ comment_id: z31.string().trim().min(1).describe("Id of the Linear comment the session will be created on."),
21141
+ action: z31.enum(SCOUT_LINEAR_ACTIONS).describe("`ask` when the comment is a clarifying question, `start` when it hands off the task.")
21126
21142
  });
21127
- var scoutLinearStartRequestSchema = z30.object({
21128
- issue_id: z30.string().describe("Linear issue id from the envelope's `issue_id`."),
21129
- agent_session_id: z30.string().describe("Existing Linear agent session id from the envelope's `agent_session_id`."),
21130
- prompt: z30.string().trim().min(1).describe("The latest request, in its author's words. The workspace already receives the issue and its comments.")
21143
+ var scoutLinearStartRequestSchema = z31.object({
21144
+ issue_id: z31.string().describe("Linear issue id from the envelope's `issue_id`."),
21145
+ agent_session_id: z31.string().describe("Existing Linear agent session id from the envelope's `agent_session_id`."),
21146
+ prompt: z31.string().trim().min(1).describe("The latest request, in its author's words. The workspace already receives the issue and its comments.")
21131
21147
  });
21132
- var scoutRouteLinearTicketRequestSchema = z30.object({
21133
- agent_session_id: z30.string().trim().min(1).describe("The ticket's `agent_session_id` from the envelope."),
21134
- environment_id: z30.string().trim().min(1).optional().describe("Start the ticket in this environment."),
21135
- mothership_id: z30.string().trim().min(1).optional().describe("Hand the ticket to this Mothership instead.")
21148
+ var scoutRouteLinearTicketRequestSchema = z31.object({
21149
+ agent_session_id: z31.string().trim().min(1).describe("The ticket's `agent_session_id` from the envelope."),
21150
+ environment_id: z31.string().trim().min(1).optional().describe("Start the ticket in this environment."),
21151
+ mothership_id: z31.string().trim().min(1).optional().describe("Hand the ticket to this Mothership instead.")
21136
21152
  }).refine((args) => !(args.environment_id && args.mothership_id), "Pass environment_id or mothership_id, not both.");
21137
- var slackChannelIdSchema = z30.string().describe("Slack channel id from the envelope's `channel_id`.");
21138
- var slackThreadTsSchema = z30.string().describe("Slack thread timestamp from the envelope's `thread_ts`.");
21139
- var scoutSlackMessageReferenceSchema = z30.object({
21153
+ var slackChannelIdSchema = z31.string().describe("Slack channel id from the envelope's `channel_id`.");
21154
+ var slackThreadTsSchema = z31.string().describe("Slack thread timestamp from the envelope's `thread_ts`.");
21155
+ var scoutSlackMessageReferenceSchema = z31.object({
21140
21156
  channel_id: slackChannelIdSchema,
21141
21157
  thread_ts: slackThreadTsSchema,
21142
- message_ts: z30.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
21143
- user_id: z30.string().describe("Slack user id of that message's author (the envelope's `user_id`).")
21158
+ message_ts: z31.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
21159
+ user_id: z31.string().describe("Slack user id of that message's author (the envelope's `user_id`).")
21144
21160
  });
21145
- var scoutSlackSpawnRequestSchema = z30.object({
21161
+ var scoutSlackSpawnRequestSchema = z31.object({
21146
21162
  channel_id: slackChannelIdSchema,
21147
21163
  thread_ts: slackThreadTsSchema,
21148
- message_ts: z30.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."),
21149
- user_id: z30.string().describe("Slack user id of that message's author (the envelope's `user_id`). The workspace is attributed to them."),
21150
- prompt: z30.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."),
21151
- acknowledgement_ts: z30.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."),
21152
- environment_id: z30.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.`)
21164
+ message_ts: z31.string().describe("Timestamp of the Slack message that asked for the work (the envelope's `message_ts`). The server verifies this message and its author."),
21165
+ user_id: z31.string().describe("Slack user id of that message's author (the envelope's `user_id`). The workspace is attributed to them."),
21166
+ prompt: z31.string().describe("The person's request in their own words, quoting earlier messages only when it points to them. The workspace already receives the Slack thread, so add no research, plan, or guesses."),
21167
+ acknowledgement_ts: z31.string().optional().describe("`ts` of the one-line reply you posted in this thread before spawning. The server appends the workspace link to it and tells the workspace not to acknowledge again."),
21168
+ environment_id: z31.string().optional().describe(`Environment id from \`${REPLICAS_MCP_TOOLS.listEnvironments}\`. Pass it only when clearly confident it fits; omit it to let routing choose. If routing cannot choose, the call fails and nothing is posted, so pick one or ask the person.`)
21153
21169
  });
21154
21170
  var scoutSlackSpawnInNewThreadRequestSchema = scoutSlackSpawnRequestSchema.extend({
21155
- title: z30.string().trim().min(1).max(500).describe("One or two sentences stating the task, posted as the new top-level message."),
21156
- prompt: z30.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."),
21157
- acknowledgement_ts: z30.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.")
21171
+ title: z31.string().trim().min(1).max(500).describe("One or two sentences stating the task, posted as the new top-level message."),
21172
+ prompt: z31.string().describe("The person's request in their own words. The full source thread is attached as background, so add no summary, research, plan, or guesses."),
21173
+ acknowledgement_ts: z31.string().optional().describe("`ts` of the one-line reply you posted in this thread before spawning. The server appends the new thread's link to it.")
21158
21174
  });
21159
- var scoutSlackRelayRequestSchema = z30.object({
21175
+ var scoutSlackRelayRequestSchema = z31.object({
21160
21176
  channel_id: slackChannelIdSchema,
21161
21177
  thread_ts: slackThreadTsSchema,
21162
- message: z30.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."),
21163
- user_id: z30.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`."),
21164
- queue: z30.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."),
21165
- workspace_id: z30.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.`),
21166
- message_ts: z30.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.")
21178
+ message: z31.string().describe("The follow-up to deliver: every fresh message that belongs to this update, in its author's words, with no research, plan, or guesses added. When forwarding to a `workspace_id` other than the thread's own workspace, also quote exactly the thread messages the request points to (\"forward this\"), since that workspace gets only this message."),
21179
+ user_id: z31.string().optional().describe("Slack user id of the follow-up's author (the envelope's `user_id`), so it is attributed to them. Defaults to the thread's original requester. Required with `workspace_id`."),
21180
+ queue: z31.boolean().optional().describe("Set true only when the person explicitly asked for this to happen after the current task finishes. Delivers behind the active turn instead of interrupting it."),
21181
+ workspace_id: z31.string().optional().describe(`Existing workspace id, from \`${REPLICAS_MCP_TOOLS.listWorkspaces}\` or a workspace link in the thread, to bind a thread without a workspace to before relaying. The author must be able to see it. Binding a Mothership gives it the person's own Slack message and the thread instead of \`message\`. In a thread already bound to a different workspace, or in a Mothership's channel, nothing is bound: the workspace or Mothership gets only \`message\`, once, with a link back to Slack, and the thread stays where it is. Omit to relay into the thread's own workspace.`),
21182
+ message_ts: z31.string().optional().describe("Timestamp of the Slack message that led to this relay (the envelope's `message_ts`). Required with `workspace_id`; the server verifies this message and its author.")
21167
21183
  });
21168
- var scoutSlackSetThreadMutedRequestSchema = z30.object({
21184
+ var scoutSlackSetThreadMutedRequestSchema = z31.object({
21169
21185
  channel_id: slackChannelIdSchema,
21170
21186
  thread_ts: slackThreadTsSchema,
21171
- muted: z30.boolean().describe("true to mute Replicas in this thread, false to unmute it.")
21187
+ muted: z31.boolean().describe("true to mute Replicas in this thread, false to unmute it.")
21172
21188
  });
21173
21189
  var scoutSlackStopWorkspaceRequestSchema = scoutSlackMessageReferenceSchema.extend({
21174
- archive: z30.boolean().describe("true only when the person also asked to close or archive the workspace.")
21190
+ archive: z31.boolean().describe("true only when the person also asked to close or archive the workspace.")
21175
21191
  });
21176
- var scoutListWorkspacesRequestSchema = z30.object({
21192
+ var scoutListWorkspacesRequestSchema = z31.object({
21177
21193
  channel_id: slackChannelIdSchema,
21178
21194
  thread_ts: slackThreadTsSchema,
21179
- message_ts: z30.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
21180
- user_id: z30.string().describe("Slack user id of that message's author (the envelope's `user_id`). Only workspaces they can see are listed."),
21181
- query: z30.string().trim().min(1).optional().describe("Case-insensitive text to match against workspace and Mothership names and pull request URLs.")
21195
+ message_ts: z31.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
21196
+ user_id: z31.string().describe("Slack user id of that message's author (the envelope's `user_id`). Only workspaces they can see are listed."),
21197
+ query: z31.string().trim().min(1).optional().describe("Case-insensitive text to match against workspace and Mothership names and pull request URLs.")
21182
21198
  });
21183
- var scoutSlackConfirmationSchema = z30.object({
21184
- confirmation_channel_id: z30.string().describe("`channel_id` from the envelope of the Slack message that asked for or accepted this."),
21185
- confirmation_thread_ts: z30.string().describe("`thread_ts` from that message's envelope."),
21186
- confirmation_message_ts: z30.string().describe("`message_ts` from that message's envelope."),
21187
- confirmation_user_id: z30.string().describe("`user_id` from that message's envelope.")
21199
+ var scoutSlackConfirmationSchema = z31.object({
21200
+ confirmation_channel_id: z31.string().describe("`channel_id` from the envelope of the Slack message that asked for or accepted this."),
21201
+ confirmation_thread_ts: z31.string().describe("`thread_ts` from that message's envelope."),
21202
+ confirmation_message_ts: z31.string().describe("`message_ts` from that message's envelope."),
21203
+ confirmation_user_id: z31.string().describe("`user_id` from that message's envelope.")
21188
21204
  });
21189
21205
  var scoutAutomationToolInputSchema = automationToolInputSchema.extend(scoutSlackConfirmationSchema.shape);
21190
21206
  var scoutSaveChannelPresetToolInputSchema = scoutSlackConfirmationSchema.extend({
21191
- preset_id: z30.string().optional().describe(`Id of the preset to update, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`. Omit to create a new preset.`),
21192
- name: z30.string().trim().min(1).max(SCOUT_PRESET_NAME_MAX_LENGTH).optional().describe("Preset name. Required when creating."),
21193
- description: z30.string().optional().describe("One-line summary shown in settings."),
21194
- icon: z30.enum(SCOUT_PRESET_ICONS).optional(),
21195
- instructions: z30.string().optional().describe("Complete preset instructions; replaces the existing text. Required when creating.")
21207
+ preset_id: z31.string().optional().describe(`Id of the preset to update, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`. Omit to create a new preset.`),
21208
+ name: z31.string().trim().min(1).max(SCOUT_PRESET_NAME_MAX_LENGTH).optional().describe("Preset name. Required when creating."),
21209
+ description: z31.string().optional().describe("One-line summary shown in settings."),
21210
+ icon: z31.enum(SCOUT_PRESET_ICONS).optional(),
21211
+ instructions: z31.string().optional().describe("Complete preset instructions; replaces the existing text. Required when creating.")
21196
21212
  });
21197
21213
  var scoutUpdateChannelSettingsToolInputSchema = scoutSlackConfirmationSchema.extend({
21198
- source: z30.enum(SCOUT_SOURCE_TYPES).optional().describe("Defaults to `slack`."),
21199
- external_id: z30.string().describe("Slack channel id or Linear team id."),
21200
- monitored: z30.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."),
21201
- preset_id: z30.string().nullable().optional().describe("Preset to assign; `null` removes the preset. Omit to keep it."),
21202
- instructions: z30.string().nullable().optional().describe("Complete channel-specific instructions, applied after the preset; replaces the existing text. `null` clears them. Omit to keep them."),
21203
- proactivity: z30.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."),
21204
- muted: z30.enum(["on", "off", "default"]).optional().describe(`Slack only, organization admins only: \`on\` mutes Replicas in this channel, \`off\` unmutes it here, \`default\` follows the Slack Connect default from \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\`. Omit to keep it.`)
21214
+ source: z31.enum(SCOUT_SOURCE_TYPES).optional().describe("Defaults to `slack`."),
21215
+ external_id: z31.string().describe("Slack channel id or Linear team id."),
21216
+ monitored: z31.boolean().optional().describe("Linear: `true` starts monitoring the team (organization admins only), `false` stops. Slack: kept for older callers; prefer `proactivity`. `false` means `tagged`, and `true` lifts a `tagged` channel back to the organization's level. Omit to keep it."),
21217
+ preset_id: z31.string().nullable().optional().describe("Preset to assign; `null` removes the preset. Omit to keep it."),
21218
+ instructions: z31.string().nullable().optional().describe("Complete channel-specific instructions, applied after the preset; replaces the existing text. `null` clears them. Omit to keep them."),
21219
+ proactivity: z31.enum([...SCOUT_PROACTIVITY_LEVELS, "organization"]).optional().describe("Slack only: this channel's or group DM's own level, overriding the organization's here alone. `organization` makes it follow the organization's level again. Omit to keep it. 1:1 DMs are always addressed to Replicas, so they take no level."),
21220
+ muted: z31.enum(["on", "off", "default"]).optional().describe(`Slack only, organization admins only: \`on\` mutes Replicas in this channel, \`off\` unmutes it here, \`default\` follows the Slack Connect default from \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\`. Omit to keep it.`)
21205
21221
  });
21206
21222
  var scoutSetSlackConnectMutedToolInputSchema = scoutSlackConfirmationSchema.extend({
21207
- muted: z30.boolean().describe("`true` mutes Replicas in every Slack Connect channel without its own setting; `false` lets them follow their levels again.")
21223
+ muted: z31.boolean().describe("`true` mutes Replicas in every Slack Connect channel without its own setting; `false` lets them follow their levels again.")
21208
21224
  });
21209
21225
  var scoutSetSlackConnectDefaultsToolInputSchema = scoutSetSlackConnectMutedToolInputSchema.partial({ muted: true }).extend({
21210
- preset_id: z30.string().optional().describe("Preset for every Slack Connect channel without its own preset or instructions; an empty string removes it. Omit to keep it."),
21211
- instructions: z30.string().optional().describe("Complete default instructions, applied after that preset; replaces the existing text. An empty string clears them. Omit to keep them."),
21212
- proactivity: z30.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.")
21226
+ preset_id: z31.string().optional().describe("Preset for every Slack Connect channel without its own preset or instructions; an empty string removes it. Omit to keep it."),
21227
+ instructions: z31.string().optional().describe("Complete default instructions, applied after that preset; replaces the existing text. An empty string clears them. Omit to keep them."),
21228
+ proactivity: z31.enum([...SCOUT_PROACTIVITY_LEVELS, "default"]).optional().describe("Level for every Slack Connect channel without its own level. `default` returns them to `tagged`. Omit to keep it.")
21213
21229
  });
21214
21230
  var scoutSetOrganizationProactivityToolInputSchema = scoutSlackConfirmationSchema.extend({
21215
- proactivity: z30.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.`)
21231
+ proactivity: z31.enum(SCOUT_PROACTIVITY_LEVELS).describe(`The level every Slack channel and group DM follows unless it has its own. Slack Connect channels without their own level follow the shared-channel default from \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\` instead.`)
21216
21232
  });
21217
21233
  var scoutDeleteChannelPresetToolInputSchema = scoutSlackConfirmationSchema.extend({
21218
- preset_id: z30.string().describe(`Id of the preset to delete, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`.`)
21234
+ preset_id: z31.string().describe(`Id of the preset to delete, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`.`)
21219
21235
  });
21220
21236
  var RESET_TO_DEFAULT = "default";
21221
- var resettable = (schema, description) => z30.union([schema, z30.literal(RESET_TO_DEFAULT)]).optional().describe(`${description} \`${RESET_TO_DEFAULT}\` falls back to the organization default. Omit to keep it.`);
21237
+ var resettable = (schema, description) => z31.union([schema, z31.literal(RESET_TO_DEFAULT)]).optional().describe(`${description} \`${RESET_TO_DEFAULT}\` falls back to the organization default. Omit to keep it.`);
21222
21238
  var scoutSetSlackAgentDefaultsToolInputSchema = scoutSlackConfirmationSchema.extend({
21223
- agent_provider: resettable(z30.enum(AGENT), "Agent for Slack-triggered workspaces. Changing it without `model` resets the model to that agent's default."),
21224
- model: resettable(z30.string(), "Model id for that agent; the default is the agent's own."),
21225
- thinking_level: resettable(z30.enum(VALID_THINKING_LEVELS), "Thinking level."),
21226
- goal_mode: resettable(z30.boolean(), "Goal mode."),
21227
- fast_mode: resettable(z30.boolean(), "Fast mode.")
21239
+ agent_provider: resettable(z31.enum(AGENT), "Agent for Slack-triggered workspaces. Changing it without `model` resets the model to that agent's default."),
21240
+ model: resettable(z31.string(), "Model id for that agent; the default is the agent's own."),
21241
+ thinking_level: resettable(z31.enum(VALID_THINKING_LEVELS), "Thinking level."),
21242
+ goal_mode: resettable(z31.boolean(), "Goal mode."),
21243
+ fast_mode: resettable(z31.boolean(), "Fast mode.")
21228
21244
  });
21229
- var scoutClaimSettingsOfferToolInputSchema = z30.object({
21245
+ var scoutClaimSettingsOfferToolInputSchema = z31.object({
21230
21246
  channel_id: slackChannelIdSchema,
21231
- kind: z30.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."),
21232
- user_id: z30.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."),
21233
- declined: z30.boolean().optional().describe("true when the person declined an offer you already made, so it is not made again.")
21247
+ kind: z31.enum(SCOUT_SETTINGS_OFFERS).describe("`proactivity`: offering a lower level after frustration. `raise_proactivity`: offering a higher level after someone had to @mention you. `instructions`: offering channel instructions or a preset. `organization_proactivity` and `raise_organization_proactivity`: offering to lower or raise the workspace default; only decline them, the server claims them for you."),
21248
+ user_id: z31.string().optional().describe("The envelope's `user_id`. Required for `proactivity` and `raise_proactivity`, so the server can say whether they are an organization admin."),
21249
+ declined: z31.boolean().optional().describe("true when the person declined an offer you already made, so it is not made again.")
21234
21250
  });
21235
21251
 
21236
21252
  // ../shared/src/routes/plugin-catalog.ts
@@ -21588,22 +21604,22 @@ var PLUGIN_CATALOG = [
21588
21604
  ].map((plugin) => ({ ...plugin, readOnlyScopes: READ_ONLY_SCOPES[plugin.id] }));
21589
21605
 
21590
21606
  // ../shared/src/routes/sentry.ts
21591
- import { z as z31 } from "zod";
21592
- var sentrySelfHostedConnectRequestSchema = z31.object({
21593
- baseUrl: z31.string().min(1),
21594
- token: z31.string().trim().min(1),
21595
- webhookSecret: z31.string().trim().optional()
21607
+ import { z as z32 } from "zod";
21608
+ var sentrySelfHostedConnectRequestSchema = z32.object({
21609
+ baseUrl: z32.string().min(1),
21610
+ token: z32.string().trim().min(1),
21611
+ webhookSecret: z32.string().trim().optional()
21596
21612
  });
21597
21613
 
21598
21614
  // ../shared/src/routes/user.ts
21599
21615
  var PROFILE_AVATAR_MAX_SIZE_BYTES = 5 * 1024 * 1024;
21600
21616
 
21601
21617
  // ../shared/src/routes/web-auth.ts
21602
- import { z as z32 } from "zod";
21603
- var webAuthRedeemResponseSchema = z32.object({
21604
- path: z32.string(),
21605
- organizationId: z32.string().nullable(),
21606
- session: z32.object({ access_token: z32.string(), refresh_token: z32.string(), user: z32.object({ id: z32.string(), email: z32.string() }) }).nullable()
21618
+ import { z as z33 } from "zod";
21619
+ var webAuthRedeemResponseSchema = z33.object({
21620
+ path: z33.string(),
21621
+ organizationId: z33.string().nullable(),
21622
+ session: z33.object({ access_token: z33.string(), refresh_token: z33.string(), user: z33.object({ id: z33.string(), email: z33.string() }) }).nullable()
21607
21623
  });
21608
21624
 
21609
21625
  // ../shared/src/routes/client-state.ts
@@ -21628,104 +21644,104 @@ var promptHistoryClientStateKey = orgUserClientStateKey(PROMPT_HISTORY_CLIENT_ST
21628
21644
  var workspaceSearchOpensClientStateKey = orgUserClientStateKey(WORKSPACE_SEARCH_OPENS_CLIENT_STATE_KEY_PREFIX);
21629
21645
 
21630
21646
  // ../shared/src/routes/workspace-events.ts
21631
- import { z as z34 } from "zod";
21647
+ import { z as z35 } from "zod";
21632
21648
 
21633
21649
  // ../shared/src/routes/presence.ts
21634
- import { z as z33 } from "zod";
21635
- var presenceStatusSchema = z33.enum(["online", "typing"]);
21636
- var presenceLocationSchema = z33.object({
21637
- workspaceId: z33.string().optional()
21650
+ import { z as z34 } from "zod";
21651
+ var presenceStatusSchema = z34.enum(["online", "typing"]);
21652
+ var presenceLocationSchema = z34.object({
21653
+ workspaceId: z34.string().optional()
21638
21654
  });
21639
- var presenceEntrySchema = z33.object({
21640
- userId: z33.string(),
21655
+ var presenceEntrySchema = z34.object({
21656
+ userId: z34.string(),
21641
21657
  status: presenceStatusSchema,
21642
21658
  location: presenceLocationSchema,
21643
- ts: z33.string()
21659
+ ts: z34.string()
21644
21660
  });
21645
- var updatePresenceRequestSchema = z33.object({
21661
+ var updatePresenceRequestSchema = z34.object({
21646
21662
  status: presenceStatusSchema,
21647
21663
  location: presenceLocationSchema.optional()
21648
21664
  });
21649
21665
 
21650
21666
  // ../shared/src/routes/workspace-events.ts
21651
- var workspaceTurnCompletionSchema = z34.object({
21652
- workspaceName: z34.string(),
21653
- completedAt: z34.string(),
21654
- processing: z34.boolean().optional(),
21655
- pullRequestFeedback: z34.boolean().optional(),
21656
- attention: z34.object({ reason: z34.enum(CHAT_ATTENTION_REASONS), userId: z34.string() }).optional()
21667
+ var workspaceTurnCompletionSchema = z35.object({
21668
+ workspaceName: z35.string(),
21669
+ completedAt: z35.string(),
21670
+ processing: z35.boolean().optional(),
21671
+ pullRequestFeedback: z35.boolean().optional(),
21672
+ attention: z35.object({ reason: z35.enum(CHAT_ATTENTION_REASONS), userId: z35.string() }).optional()
21657
21673
  });
21658
- var workspaceEventSchemaByType = z34.discriminatedUnion("type", [
21659
- z34.object({
21660
- type: z34.literal("workspace.changed"),
21661
- workspaceId: z34.string(),
21662
- accessChangedFor: z34.string().optional(),
21663
- accessChangedForOrg: z34.literal(true).optional(),
21664
- workspace: z34.object({ status: z34.enum(WORKSPACE_STATUSES), last_activity_at: z34.string().nullable() }).optional(),
21665
- name: z34.string().optional(),
21674
+ var workspaceEventSchemaByType = z35.discriminatedUnion("type", [
21675
+ z35.object({
21676
+ type: z35.literal("workspace.changed"),
21677
+ workspaceId: z35.string(),
21678
+ accessChangedFor: z35.string().optional(),
21679
+ accessChangedForOrg: z35.literal(true).optional(),
21680
+ workspace: z35.object({ status: z35.enum(WORKSPACE_STATUSES), last_activity_at: z35.string().nullable() }).optional(),
21681
+ name: z35.string().optional(),
21666
21682
  completion: workspaceTurnCompletionSchema.optional(),
21667
- ts: z34.string()
21683
+ ts: z35.string()
21668
21684
  }),
21669
- z34.object({
21670
- type: z34.literal("workspace.chat.changed"),
21671
- workspaceId: z34.string(),
21672
- chatId: z34.string(),
21673
- ts: z34.string()
21685
+ z35.object({
21686
+ type: z35.literal("workspace.chat.changed"),
21687
+ workspaceId: z35.string(),
21688
+ chatId: z35.string(),
21689
+ ts: z35.string()
21674
21690
  }),
21675
- z34.object({
21676
- type: z34.literal("workspace.chat.advanced"),
21677
- workspaceId: z34.string(),
21678
- chatId: z34.string(),
21679
- afterCursor: z34.string().optional(),
21680
- processing: z34.boolean(),
21681
- ts: z34.string()
21691
+ z35.object({
21692
+ type: z35.literal("workspace.chat.advanced"),
21693
+ workspaceId: z35.string(),
21694
+ chatId: z35.string(),
21695
+ afterCursor: z35.string().optional(),
21696
+ processing: z35.boolean(),
21697
+ ts: z35.string()
21682
21698
  }),
21683
- z34.object({
21684
- type: z34.literal("mobile-testing.changed"),
21685
- workspaceId: z34.string(),
21686
- ts: z34.string()
21699
+ z35.object({
21700
+ type: z35.literal("mobile-testing.changed"),
21701
+ workspaceId: z35.string(),
21702
+ ts: z35.string()
21687
21703
  }),
21688
- z34.object({
21689
- type: z34.literal("variable-request.changed"),
21690
- workspaceId: z34.string(),
21691
- ts: z34.string()
21704
+ z35.object({
21705
+ type: z35.literal("variable-request.changed"),
21706
+ workspaceId: z35.string(),
21707
+ ts: z35.string()
21692
21708
  }),
21693
- z34.object({
21694
- type: z34.literal("local-control-request.changed"),
21695
- workspaceId: z34.string(),
21696
- ts: z34.string()
21709
+ z35.object({
21710
+ type: z35.literal("local-control-request.changed"),
21711
+ workspaceId: z35.string(),
21712
+ ts: z35.string()
21697
21713
  }),
21698
- z34.object({
21699
- type: z34.literal("pull-request.changed"),
21700
- prUrl: z34.string(),
21701
- ts: z34.string()
21714
+ z35.object({
21715
+ type: z35.literal("pull-request.changed"),
21716
+ prUrl: z35.string(),
21717
+ ts: z35.string()
21702
21718
  }),
21703
- z34.object({
21704
- type: z34.literal("mothership.subagent.changed"),
21705
- workspaceId: z34.string(),
21706
- subagent: z34.object({ id: z34.string(), name: z34.string(), prUrl: z34.string().nullable() }),
21707
- ts: z34.string()
21719
+ z35.object({
21720
+ type: z35.literal("mothership.subagent.changed"),
21721
+ workspaceId: z35.string(),
21722
+ subagent: z35.object({ id: z35.string(), name: z35.string(), prUrl: z35.string().nullable() }),
21723
+ ts: z35.string()
21708
21724
  }),
21709
- z34.object({ type: z34.literal("mothership.board.changed"), workspaceId: z34.string(), ts: z34.string() }),
21710
- z34.object({ type: z34.literal("needs-you.changed"), workspaceId: z34.string().nullable(), userId: z34.string().optional(), ts: z34.string() }),
21711
- z34.object({
21712
- type: z34.literal("workspace.shared"),
21713
- workspaceId: z34.string(),
21714
- workspaceName: z34.string(),
21715
- sharedWithUserId: z34.string(),
21716
- sharedByName: z34.string(),
21717
- ts: z34.string()
21725
+ z35.object({ type: z35.literal("mothership.board.changed"), workspaceId: z35.string(), ts: z35.string() }),
21726
+ z35.object({ type: z35.literal("needs-you.changed"), workspaceId: z35.string().nullable(), userId: z35.string().optional(), ts: z35.string() }),
21727
+ z35.object({
21728
+ type: z35.literal("workspace.shared"),
21729
+ workspaceId: z35.string(),
21730
+ workspaceName: z35.string(),
21731
+ sharedWithUserId: z35.string(),
21732
+ sharedByName: z35.string(),
21733
+ ts: z35.string()
21718
21734
  })
21719
21735
  ]);
21720
- var workspaceChangedEventSchema = z34.union([
21736
+ var workspaceChangedEventSchema = z35.union([
21721
21737
  workspaceEventSchemaByType,
21722
- z34.object({ type: z34.literal("presence.changed"), userId: z34.string(), entry: presenceEntrySchema.nullable(), ts: z34.string() }),
21723
- z34.object({ type: z34.literal("presence.changed"), ts: z34.string() })
21738
+ z35.object({ type: z35.literal("presence.changed"), userId: z35.string(), entry: presenceEntrySchema.nullable(), ts: z35.string() }),
21739
+ z35.object({ type: z35.literal("presence.changed"), ts: z35.string() })
21724
21740
  ]);
21725
21741
 
21726
21742
  // ../shared/src/routes/review-messages.ts
21727
- import { z as z35 } from "zod";
21728
- var sendPullRequestReviewMessageRequestSchema = z35.object({
21743
+ import { z as z36 } from "zod";
21744
+ var sendPullRequestReviewMessageRequestSchema = z36.object({
21729
21745
  ...sendChatMessageRequestSchema.pick({
21730
21746
  message: true,
21731
21747
  messageId: true,
@@ -21738,8 +21754,8 @@ var sendPullRequestReviewMessageRequestSchema = z35.object({
21738
21754
  ultrafastMode: true
21739
21755
  }).shape,
21740
21756
  /** Starts a new chat instead of continuing the PR's review chat. The provider only applies to a new chat. */
21741
- newChat: z35.boolean().optional(),
21742
- provider: z35.enum(VALID_AGENT_PROVIDERS).optional()
21757
+ newChat: z36.boolean().optional(),
21758
+ provider: z36.enum(VALID_AGENT_PROVIDERS).optional()
21743
21759
  });
21744
21760
 
21745
21761
  // ../shared/src/audit-log.ts
@@ -22402,40 +22418,40 @@ function isSkillRegistryManifest(value) {
22402
22418
  }
22403
22419
 
22404
22420
  // ../shared/src/routes/variable-requests.ts
22405
- import { z as z36 } from "zod";
22421
+ import { z as z37 } from "zod";
22406
22422
  var VARIABLE_REQUEST_WAIT = { defaultMs: 10 * 6e4, maxMs: 30 * 6e4, pollMs: 3e3, waiterStaleMs: 15e3 };
22407
22423
  var VARIABLE_REQUEST_DESTINATIONS = ["environment", "workspace"];
22408
- var requestedVariableSchema = z36.object({
22409
- key: z36.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name").max(ENVIRONMENT_SETUP_LIMITS.variableKeyChars),
22410
- required: z36.boolean(),
22411
- replace: z36.boolean().optional()
22424
+ var requestedVariableSchema = z37.object({
22425
+ key: z37.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name").max(ENVIRONMENT_SETUP_LIMITS.variableKeyChars),
22426
+ required: z37.boolean(),
22427
+ replace: z37.boolean().optional()
22412
22428
  });
22413
- var requestedVariablesSchema = z36.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");
22414
- var createVariableRequestSchema = z36.object({
22429
+ var requestedVariablesSchema = z37.array(requestedVariableSchema).min(1, "must not be empty").max(ENVIRONMENT_SETUP_LIMITS.variables).refine((variables) => new Set(variables.map((variable) => variable.key)).size === variables.length, "must have unique keys");
22430
+ var createVariableRequestSchema = z37.object({
22415
22431
  variables: requestedVariablesSchema,
22416
- reason: z36.string().trim().max(500).nullish().transform((value) => value || null),
22417
- wait: z36.boolean().default(true)
22432
+ reason: z37.string().trim().max(500).nullish().transform((value) => value || null),
22433
+ wait: z37.boolean().default(true)
22418
22434
  });
22419
- var respondVariableRequestSchema = z36.discriminatedUnion("action", [
22420
- z36.object({
22421
- action: z36.literal("provide"),
22422
- destination: z36.enum(VARIABLE_REQUEST_DESTINATIONS),
22435
+ var respondVariableRequestSchema = z37.discriminatedUnion("action", [
22436
+ z37.object({
22437
+ action: z37.literal("provide"),
22438
+ destination: z37.enum(VARIABLE_REQUEST_DESTINATIONS),
22423
22439
  /** Defaults to the workspace's environment, so older clients keep saving there. */
22424
- environment_ids: z36.array(z36.string().uuid()).optional(),
22425
- overwrite: z36.boolean().optional(),
22426
- values: z36.record(z36.string().regex(VARIABLE_KEY_RE), z36.string())
22440
+ environment_ids: z37.array(z37.string().uuid()).optional(),
22441
+ overwrite: z37.boolean().optional(),
22442
+ values: z37.record(z37.string().regex(VARIABLE_KEY_RE), z37.string())
22427
22443
  }),
22428
- z36.object({ action: z36.literal("skip") })
22444
+ z37.object({ action: z37.literal("skip") })
22429
22445
  ]);
22430
22446
 
22431
22447
  // ../shared/src/routes/local-control-requests.ts
22432
- import { z as z37 } from "zod";
22433
- var createLocalControlRequestSchema = z37.object({
22434
- reason: z37.string().trim().max(500).optional().transform((value) => value || null),
22435
- wait: z37.boolean().default(true)
22448
+ import { z as z38 } from "zod";
22449
+ var createLocalControlRequestSchema = z38.object({
22450
+ reason: z38.string().trim().max(500).optional().transform((value) => value || null),
22451
+ wait: z38.boolean().default(true)
22436
22452
  });
22437
- var respondLocalControlRequestSchema = z37.object({ action: z37.enum(["allow", "dismiss"]) });
22438
- var setLocalControlSchema = z37.object({ enabled: z37.boolean() });
22453
+ var respondLocalControlRequestSchema = z38.object({ action: z38.enum(["allow", "dismiss"]) });
22454
+ var setLocalControlSchema = z38.object({ enabled: z38.boolean() });
22439
22455
 
22440
22456
  export {
22441
22457
  ENGINE_SEND_MESSAGE_FAILED_ERROR,