replicas-engine 0.1.1600 → 0.1.1601

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.
@@ -8,12 +8,12 @@ import {
8
8
  listCodexModelsForDetails,
9
9
  restartCodexAspHost,
10
10
  restartCodexAspHostIfRunning
11
- } from "./chunk-2KSEOMCI.js";
12
- import "./chunk-6WSVDW2W.js";
13
- import "./chunk-ZDOSFRWB.js";
14
- import "./chunk-5M22SZHQ.js";
11
+ } from "./chunk-LM3GPSH5.js";
12
+ import "./chunk-LAVIBP35.js";
13
+ import "./chunk-E5U45B5E.js";
14
+ import "./chunk-6DGCGNRD.js";
15
15
  import "./chunk-UZSNFLDQ.js";
16
- import "./chunk-GN2YE77J.js";
16
+ import "./chunk-Z744SRUU.js";
17
17
  import "./chunk-VEQXQN22.js";
18
18
  export {
19
19
  CODEX_ULTRAFAST_SERVICE_TIER,
@@ -5,7 +5,7 @@ import {
5
5
  extractCommandProtectionCommandText,
6
6
  isRecord,
7
7
  parseCodeHostPrUrl
8
- } from "./chunk-GN2YE77J.js";
8
+ } from "./chunk-Z744SRUU.js";
9
9
 
10
10
  // src/services/published-pull-request-urls.ts
11
11
  function publishedPullRequestUrls(result) {
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from 'node:module';
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  HOOK_EXEC_MAX_BUFFER_BYTES
6
- } from "./chunk-GN2YE77J.js";
6
+ } from "./chunk-Z744SRUU.js";
7
7
 
8
8
  // src/utils/exec.ts
9
9
  import { exec, execFile } from "child_process";
@@ -3,10 +3,10 @@ import { createRequire as __createRequire } from 'node:module';
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  execFileAsync
6
- } from "./chunk-5M22SZHQ.js";
6
+ } from "./chunk-6DGCGNRD.js";
7
7
  import {
8
8
  isVersionBelow
9
- } from "./chunk-GN2YE77J.js";
9
+ } from "./chunk-Z744SRUU.js";
10
10
 
11
11
  // src/utils/codex-agent-env.ts
12
12
  function buildCodexAgentEnv(source = process.env) {
@@ -240,7 +240,7 @@ function getCodexModelProvider(method) {
240
240
  if (method === "foundry") return "azure";
241
241
  return method === "ollama" || method === "openai-compatible" ? "replicas_openai_compatible" : "openai";
242
242
  }
243
- var ENGINE_PACKAGE_VERSION = "0.1.1600";
243
+ var ENGINE_PACKAGE_VERSION = "0.1.1601";
244
244
  var INITIALIZE_METHOD = "initialize";
245
245
  var INITIALIZED_NOTIFICATION = "initialized";
246
246
  var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  SUBPROCESS_MAX_BUFFER,
6
6
  execFileAsync
7
- } from "./chunk-5M22SZHQ.js";
7
+ } from "./chunk-6DGCGNRD.js";
8
8
  import {
9
9
  isRecord as isRecord2
10
10
  } from "./chunk-UZSNFLDQ.js";
@@ -21,7 +21,7 @@ import {
21
21
  provisionedDeviceSchema,
22
22
  readReplicasRuntimeEnv,
23
23
  serializePosixEnvFile
24
- } from "./chunk-GN2YE77J.js";
24
+ } from "./chunk-Z744SRUU.js";
25
25
 
26
26
  // src/runtime-env-loader.ts
27
27
  import { readFileSync } from "fs";
@@ -12,15 +12,15 @@ import {
12
12
  resolveDiffBase,
13
13
  runGitCommand,
14
14
  setAgentCredentialSnapshot
15
- } from "./chunk-6WSVDW2W.js";
15
+ } from "./chunk-LAVIBP35.js";
16
16
  import {
17
17
  AppServerProcess,
18
18
  buildCodexAgentEnv
19
- } from "./chunk-ZDOSFRWB.js";
19
+ } from "./chunk-E5U45B5E.js";
20
20
  import {
21
21
  SUBPROCESS_MAX_BUFFER,
22
22
  execFileAsync
23
- } from "./chunk-5M22SZHQ.js";
23
+ } from "./chunk-6DGCGNRD.js";
24
24
  import {
25
25
  isRecord
26
26
  } from "./chunk-UZSNFLDQ.js";
@@ -61,7 +61,7 @@ import {
61
61
  shrunkImageSize,
62
62
  splitMothershipInstructions,
63
63
  withTimeout
64
- } from "./chunk-GN2YE77J.js";
64
+ } from "./chunk-Z744SRUU.js";
65
65
 
66
66
  // src/managers/codex-token-manager.ts
67
67
  import { promises as fs } from "fs";
@@ -461,7 +461,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
461
461
  await this.applyCredentialUpdate(++this.credentialGeneration, async () => {
462
462
  await this.applyCredentialsResponse(data);
463
463
  setAgentCredentialSnapshot("codex", data);
464
- const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-HR3U7S5P.js");
464
+ const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-OTRP5WWS.js");
465
465
  await restartCodexAspHostIfRunning2();
466
466
  });
467
467
  await this.start(true);
@@ -483,7 +483,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
483
483
  const accountChanged = ENGINE_ENV.REPLICAS_AGENT_CREDENTIALS.codex?.credentialId !== data.credentialId;
484
484
  await this.applyCredentialsResponse(data);
485
485
  if (restartOnChange && (accountChanged || CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index]))) {
486
- const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-HR3U7S5P.js");
486
+ const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-OTRP5WWS.js");
487
487
  await restartCodexAspHostIfRunning2();
488
488
  }
489
489
  setAgentCredentialSnapshot("codex", data);
@@ -6,7 +6,7 @@ import {
6
6
  getOriginDefaultBranch,
7
7
  monolithRequest,
8
8
  runGitCommand
9
- } from "./chunk-6WSVDW2W.js";
9
+ } from "./chunk-LAVIBP35.js";
10
10
  import {
11
11
  extractCommandProtectionCommandText,
12
12
  findCommandProtectionGitLookups,
@@ -15,7 +15,7 @@ import {
15
15
  findScoutRepoWriteSignals,
16
16
  parseCommandProtectionRequest,
17
17
  withE2BRetry
18
- } from "./chunk-GN2YE77J.js";
18
+ } from "./chunk-Z744SRUU.js";
19
19
 
20
20
  // src/services/command-protection-service.ts
21
21
  import { readFile, stat } from "fs/promises";
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from 'node:module';
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  AspClient
6
- } from "./chunk-ZDOSFRWB.js";
6
+ } from "./chunk-E5U45B5E.js";
7
7
  import {
8
8
  ASTER_BASE_URL,
9
9
  ASTER_PROVIDER,
@@ -15,7 +15,7 @@ import {
15
15
  isRecord,
16
16
  readOllamaAuthEnv,
17
17
  readOpenAICompatibleAuthEnv
18
- } from "./chunk-GN2YE77J.js";
18
+ } from "./chunk-Z744SRUU.js";
19
19
 
20
20
  // src/managers/codex-asp/notification-dispatch.ts
21
21
  var TURN_STARTED_METHOD = "turn/started";
@@ -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 z43 = void 0;
1119
+ let z44 = 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
- z43 = offsetZ;
1126
+ z44 = offsetZ;
1127
1127
  this.dt = dt;
1128
1128
  } else {
1129
- z43 = "UTC";
1129
+ z44 = "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
- z43 = dt.zone.name;
1139
+ z44 = dt.zone.name;
1140
1140
  } else {
1141
- z43 = "UTC";
1141
+ z44 = "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 || z43;
1150
+ intlOpts.timeZone = intlOpts.timeZone || z44;
1151
1151
  this.dtf = getCachedDTF(intl, intlOpts);
1152
1152
  }
1153
1153
  format() {
@@ -20476,7 +20476,7 @@ var VOICE_WAVEFORM = {
20476
20476
  };
20477
20477
 
20478
20478
  // ../shared/src/e2b.ts
20479
- var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-11-16-v15";
20479
+ var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-11-16-v16";
20480
20480
 
20481
20481
  // ../shared/src/e2b-retry.ts
20482
20482
  var DEFAULT_BACKOFFS_MS = [2e3, 5e3];
@@ -21046,6 +21046,64 @@ function parseProxyRouteCheck(output) {
21046
21046
  return { device: route.match(/\bdev (\S+)/)?.[1] ?? null, firewallRules: lines.filter((line) => line.startsWith("-")) };
21047
21047
  }
21048
21048
 
21049
+ // ../shared/src/harness/types.ts
21050
+ import { z as z32 } from "zod";
21051
+ var HARNESS_THREAD_STATUSES = ["idle", "working", "error"];
21052
+ var textSchema = z32.looseObject({ type: z32.literal("text"), text: z32.string() });
21053
+ var imageSchema = z32.looseObject({ type: z32.literal("image"), data: z32.string(), mimeType: z32.string() });
21054
+ var userMessageSchema = z32.looseObject({
21055
+ role: z32.literal("user"),
21056
+ content: z32.union([z32.string(), z32.array(z32.discriminatedUnion("type", [textSchema, imageSchema]))]),
21057
+ timestamp: z32.number()
21058
+ });
21059
+ var assistantMessageSchema = z32.looseObject({
21060
+ role: z32.literal("assistant"),
21061
+ content: z32.array(z32.discriminatedUnion("type", [
21062
+ textSchema,
21063
+ z32.looseObject({ type: z32.literal("thinking"), thinking: z32.string() }),
21064
+ z32.looseObject({ type: z32.literal("toolCall"), id: z32.string(), name: z32.string(), arguments: z32.record(z32.string(), z32.json()) })
21065
+ ])),
21066
+ api: z32.string(),
21067
+ provider: z32.string(),
21068
+ model: z32.string(),
21069
+ usage: z32.looseObject({
21070
+ input: z32.number(),
21071
+ output: z32.number(),
21072
+ cacheRead: z32.number(),
21073
+ cacheWrite: z32.number(),
21074
+ totalTokens: z32.number(),
21075
+ cost: z32.looseObject({ input: z32.number(), output: z32.number(), cacheRead: z32.number(), cacheWrite: z32.number(), total: z32.number() })
21076
+ }),
21077
+ stopReason: z32.enum(["pending", "stop", "length", "toolUse", "error", "aborted", "deferred"]),
21078
+ timestamp: z32.number()
21079
+ });
21080
+ var toolResultMessageSchema = z32.looseObject({
21081
+ role: z32.literal("toolResult"),
21082
+ toolCallId: z32.string(),
21083
+ toolName: z32.string(),
21084
+ content: z32.array(z32.discriminatedUnion("type", [textSchema, imageSchema])),
21085
+ isError: z32.boolean(),
21086
+ timestamp: z32.number()
21087
+ });
21088
+ var harnessInboxPayloadSchemas = {
21089
+ message: z32.looseObject({
21090
+ message: userMessageSchema,
21091
+ userId: z32.string().nullable(),
21092
+ messageId: z32.string().optional(),
21093
+ model: z32.string().optional(),
21094
+ thinkingLevel: z32.enum(VALID_THINKING_LEVELS).optional()
21095
+ }),
21096
+ interrupt: z32.looseObject({ userId: z32.string().nullable() })
21097
+ };
21098
+ var harnessEventBodySchema = z32.discriminatedUnion("type", [
21099
+ z32.object({ type: z32.literal("user_message"), payload: harnessInboxPayloadSchemas.message }),
21100
+ /** Saved before its tool calls run. */
21101
+ z32.object({ type: z32.literal("assistant_message"), payload: z32.looseObject({ message: assistantMessageSchema }) }),
21102
+ z32.object({ type: z32.literal("tool_result"), payload: z32.looseObject({ message: toolResultMessageSchema }) }),
21103
+ z32.object({ type: z32.literal("status"), payload: z32.looseObject({ status: z32.enum(HARNESS_THREAD_STATUSES) }) }),
21104
+ z32.object({ type: z32.literal("error"), payload: z32.looseObject({ message: z32.string() }) })
21105
+ ]);
21106
+
21049
21107
  // ../shared/src/auth-errors.ts
21050
21108
  var AUTHENTICATION_ERROR_PATTERNS = [
21051
21109
  /unauthorized/,
@@ -21108,10 +21166,10 @@ var RECONNECT_GIVE_UP_MS = 2 * 6e4;
21108
21166
  var encoder3 = new TextEncoder();
21109
21167
 
21110
21168
  // ../shared/src/routes/billing.ts
21111
- import { z as z32 } from "zod";
21169
+ import { z as z33 } from "zod";
21112
21170
  var SOURCE_LIMIT_SOURCES = ["limrun", "modal"];
21113
- var usageLimitCentsSchema = z32.number().int().min(100).max(1e8);
21114
- var sourceLimitsCentsSchema = z32.partialRecord(z32.enum(SOURCE_LIMIT_SOURCES), usageLimitCentsSchema);
21171
+ var usageLimitCentsSchema = z33.number().int().min(100).max(1e8);
21172
+ var sourceLimitsCentsSchema = z33.partialRecord(z33.enum(SOURCE_LIMIT_SOURCES), usageLimitCentsSchema);
21115
21173
 
21116
21174
  // ../shared/src/routes/codex.ts
21117
21175
  var CODEX_AUTH_ENV_KEYS = [
@@ -21265,7 +21323,7 @@ var CLAUDE_AUTH_ENV_KEYS_BY_METHOD = {
21265
21323
  };
21266
21324
 
21267
21325
  // ../shared/src/routes/command-protection.ts
21268
- import { z as z33 } from "zod";
21326
+ import { z as z34 } from "zod";
21269
21327
 
21270
21328
  // ../shared/src/git-invocations.ts
21271
21329
  var COMMIT_VALUE_OPTIONS = /* @__PURE__ */ new Set(["message", "file", "trailer", "reuse-message", "reedit-message", "fixup", "squash", "template", "author", "date", "cleanup", "pathspec-from-file"]);
@@ -21356,27 +21414,27 @@ function findCheckoutTarget(args) {
21356
21414
  }
21357
21415
 
21358
21416
  // ../shared/src/routes/command-protection.ts
21359
- var commandProtectionRepoStateSchema = z33.object({
21360
- branch: z33.string().nullable(),
21361
- defaultBranch: z33.string().nullable(),
21362
- pushBranch: z33.string().nullable(),
21363
- pushConfig: z33.string().nullable(),
21364
- headMessage: z33.string().nullable(),
21365
- mergeInProgress: z33.boolean().optional()
21417
+ var commandProtectionRepoStateSchema = z34.object({
21418
+ branch: z34.string().nullable(),
21419
+ defaultBranch: z34.string().nullable(),
21420
+ pushBranch: z34.string().nullable(),
21421
+ pushConfig: z34.string().nullable(),
21422
+ headMessage: z34.string().nullable(),
21423
+ mergeInProgress: z34.boolean().optional()
21366
21424
  });
21367
- var commandProtectionEvaluateRequestSchema = z33.object({
21368
- provider: z33.enum(["claude", "codex", "cursor", "opencode", "pi"]),
21369
- source: z33.enum(["claude_pre_tool_use", "codex_approval_request", "cursor_pre_tool_use", "opencode_pre_tool_use", "pi_tool_call"]),
21370
- toolName: z33.string(),
21371
- toolInput: z33.unknown(),
21372
- command: z33.string().nullish(),
21373
- cwd: z33.string().nullish(),
21374
- toolUseId: z33.string().nullish(),
21425
+ var commandProtectionEvaluateRequestSchema = z34.object({
21426
+ provider: z34.enum(["claude", "codex", "cursor", "opencode", "pi"]),
21427
+ source: z34.enum(["claude_pre_tool_use", "codex_approval_request", "cursor_pre_tool_use", "opencode_pre_tool_use", "pi_tool_call"]),
21428
+ toolName: z34.string(),
21429
+ toolInput: z34.unknown(),
21430
+ command: z34.string().nullish(),
21431
+ cwd: z34.string().nullish(),
21432
+ toolUseId: z34.string().nullish(),
21375
21433
  // Read by the engine before the command runs, keyed by absolute path, so the
21376
21434
  // policy can see branches and commit messages the command text only references.
21377
- gitContext: z33.object({
21378
- repos: z33.record(z33.string(), commandProtectionRepoStateSchema),
21379
- messageFiles: z33.record(z33.string(), z33.string())
21435
+ gitContext: z34.object({
21436
+ repos: z34.record(z34.string(), commandProtectionRepoStateSchema),
21437
+ messageFiles: z34.record(z34.string(), z34.string())
21380
21438
  }).optional()
21381
21439
  });
21382
21440
  var COMMAND_PROTECTION_COMMAND_KEYS = ["command", "cmd", "script", "query", "endpoint", "path", "url", "mutation"];
@@ -21597,125 +21655,125 @@ function shouldRefreshPullRequests(toolName, toolInput) {
21597
21655
  }
21598
21656
 
21599
21657
  // ../shared/src/routes/scout.ts
21600
- import { z as z34 } from "zod";
21658
+ import { z as z35 } from "zod";
21601
21659
  var SCOUT_LINEAR_ACTIONS = ["ask", "start"];
21602
- var scoutLinearSessionIntentRequestSchema = z34.object({
21603
- comment_id: z34.string().trim().min(1).describe("Id of the Linear comment the session will be created on."),
21604
- action: z34.enum(SCOUT_LINEAR_ACTIONS).describe("`ask` when the comment is a clarifying question, `start` when it hands off the task.")
21660
+ var scoutLinearSessionIntentRequestSchema = z35.object({
21661
+ comment_id: z35.string().trim().min(1).describe("Id of the Linear comment the session will be created on."),
21662
+ action: z35.enum(SCOUT_LINEAR_ACTIONS).describe("`ask` when the comment is a clarifying question, `start` when it hands off the task.")
21605
21663
  });
21606
- var scoutLinearStartRequestSchema = z34.object({
21607
- issue_id: z34.string().describe("Linear issue id from the envelope's `issue_id`."),
21608
- agent_session_id: z34.string().describe("Existing Linear agent session id from the envelope's `agent_session_id`."),
21609
- prompt: z34.string().trim().min(1).describe("The latest request, in its author's words. The workspace already receives the issue and its comments.")
21664
+ var scoutLinearStartRequestSchema = z35.object({
21665
+ issue_id: z35.string().describe("Linear issue id from the envelope's `issue_id`."),
21666
+ agent_session_id: z35.string().describe("Existing Linear agent session id from the envelope's `agent_session_id`."),
21667
+ prompt: z35.string().trim().min(1).describe("The latest request, in its author's words. The workspace already receives the issue and its comments.")
21610
21668
  });
21611
- var scoutRouteLinearTicketRequestSchema = z34.object({
21612
- agent_session_id: z34.string().trim().min(1).describe("The ticket's `agent_session_id` from the envelope."),
21613
- environment_id: z34.string().trim().min(1).optional().describe("Start the ticket in this environment."),
21614
- mothership_id: z34.string().trim().min(1).optional().describe("Hand the ticket to this Mothership instead.")
21669
+ var scoutRouteLinearTicketRequestSchema = z35.object({
21670
+ agent_session_id: z35.string().trim().min(1).describe("The ticket's `agent_session_id` from the envelope."),
21671
+ environment_id: z35.string().trim().min(1).optional().describe("Start the ticket in this environment."),
21672
+ mothership_id: z35.string().trim().min(1).optional().describe("Hand the ticket to this Mothership instead.")
21615
21673
  }).refine((args) => !(args.environment_id && args.mothership_id), "Pass environment_id or mothership_id, not both.");
21616
- var slackChannelIdSchema = z34.string().describe("Slack channel id from the envelope's `channel_id`.");
21617
- var slackThreadTsSchema = z34.string().describe("Slack thread timestamp from the envelope's `thread_ts`.");
21618
- var scoutSlackMessageReferenceSchema = z34.object({
21674
+ var slackChannelIdSchema = z35.string().describe("Slack channel id from the envelope's `channel_id`.");
21675
+ var slackThreadTsSchema = z35.string().describe("Slack thread timestamp from the envelope's `thread_ts`.");
21676
+ var scoutSlackMessageReferenceSchema = z35.object({
21619
21677
  channel_id: slackChannelIdSchema,
21620
21678
  thread_ts: slackThreadTsSchema,
21621
- message_ts: z34.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
21622
- user_id: z34.string().describe("Slack user id of that message's author (the envelope's `user_id`).")
21679
+ message_ts: z35.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
21680
+ user_id: z35.string().describe("Slack user id of that message's author (the envelope's `user_id`).")
21623
21681
  });
21624
- var scoutSlackSpawnRequestSchema = z34.object({
21682
+ var scoutSlackSpawnRequestSchema = z35.object({
21625
21683
  channel_id: slackChannelIdSchema,
21626
21684
  thread_ts: slackThreadTsSchema,
21627
- message_ts: z34.string().describe("Timestamp of the Slack message that asked for the work (the envelope's `message_ts`). The server verifies this message and its author."),
21628
- user_id: z34.string().describe("Slack user id of that message's author (the envelope's `user_id`). The workspace is attributed to them."),
21629
- prompt: z34.string().describe("The person's request in their own words, quoting earlier messages only when it points to them. The workspace already receives the Slack thread, so add no research, plan, or guesses."),
21630
- acknowledgement_ts: z34.string().optional().describe("`ts` of the one-line reply you posted in this thread before spawning. The server appends the workspace link to it and tells the workspace not to acknowledge again."),
21631
- environment_id: z34.string().optional().describe(`Environment id from \`${REPLICAS_MCP_TOOLS.listEnvironments}\`. Pass it only when clearly confident it fits; omit it to let routing choose. If routing cannot choose, the call fails and nothing is posted, so pick one or ask the person.`)
21685
+ message_ts: z35.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."),
21686
+ user_id: z35.string().describe("Slack user id of that message's author (the envelope's `user_id`). The workspace is attributed to them."),
21687
+ prompt: z35.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."),
21688
+ acknowledgement_ts: z35.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."),
21689
+ environment_id: z35.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.`)
21632
21690
  });
21633
21691
  var scoutSlackSpawnInNewThreadRequestSchema = scoutSlackSpawnRequestSchema.extend({
21634
- title: z34.string().trim().min(1).max(500).describe("One or two sentences stating the task, posted as the new top-level message."),
21635
- prompt: z34.string().describe("The person's request in their own words. The full source thread is attached as background, so add no summary, research, plan, or guesses."),
21636
- acknowledgement_ts: z34.string().optional().describe("`ts` of the one-line reply you posted in this thread before spawning. The server appends the new thread's link to it.")
21692
+ title: z35.string().trim().min(1).max(500).describe("One or two sentences stating the task, posted as the new top-level message."),
21693
+ prompt: z35.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."),
21694
+ acknowledgement_ts: z35.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.")
21637
21695
  });
21638
- var scoutSlackRelayRequestSchema = z34.object({
21696
+ var scoutSlackRelayRequestSchema = z35.object({
21639
21697
  channel_id: slackChannelIdSchema,
21640
21698
  thread_ts: slackThreadTsSchema,
21641
- message: z34.string().describe("The follow-up to deliver: every fresh message that belongs to this update, in its author's words, with no research, plan, or guesses added. When forwarding to a `workspace_id` other than the thread's own workspace, also quote exactly the thread messages the request points to (\"forward this\"), since that workspace gets only this message."),
21642
- user_id: z34.string().optional().describe("Slack user id of the follow-up's author (the envelope's `user_id`), so it is attributed to them. Defaults to the thread's original requester. Required with `workspace_id`."),
21643
- queue: z34.boolean().optional().describe("Set true only when the person explicitly asked for this to happen after the current task finishes. Delivers behind the active turn instead of interrupting it."),
21644
- workspace_id: z34.string().optional().describe(`Existing workspace id, from \`${REPLICAS_MCP_TOOLS.listWorkspaces}\` or a workspace link in the thread, to bind a thread without a workspace to before relaying. The author must be able to see it. Binding a Mothership gives it the person's own Slack message and the thread instead of \`message\`. In a thread already bound to a different workspace, or in a Mothership's channel, nothing is bound: the workspace or Mothership gets only \`message\`, once, with a link back to Slack, and the thread stays where it is. Omit to relay into the thread's own workspace.`),
21645
- message_ts: z34.string().optional().describe("Timestamp of the Slack message that led to this relay (the envelope's `message_ts`). Required with `workspace_id`; the server verifies this message and its author.")
21699
+ message: z35.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."),
21700
+ user_id: z35.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`."),
21701
+ queue: z35.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."),
21702
+ workspace_id: z35.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.`),
21703
+ message_ts: z35.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.")
21646
21704
  });
21647
- var scoutSlackSetThreadMutedRequestSchema = z34.object({
21705
+ var scoutSlackSetThreadMutedRequestSchema = z35.object({
21648
21706
  channel_id: slackChannelIdSchema,
21649
21707
  thread_ts: slackThreadTsSchema,
21650
- muted: z34.boolean().describe("true to mute Replicas in this thread, false to unmute it.")
21708
+ muted: z35.boolean().describe("true to mute Replicas in this thread, false to unmute it.")
21651
21709
  });
21652
21710
  var scoutSlackStopWorkspaceRequestSchema = scoutSlackMessageReferenceSchema.extend({
21653
- archive: z34.boolean().describe("true only when the person also asked to close or archive the workspace.")
21711
+ archive: z35.boolean().describe("true only when the person also asked to close or archive the workspace.")
21654
21712
  });
21655
- var scoutListWorkspacesRequestSchema = z34.object({
21713
+ var scoutListWorkspacesRequestSchema = z35.object({
21656
21714
  channel_id: slackChannelIdSchema,
21657
21715
  thread_ts: slackThreadTsSchema,
21658
- message_ts: z34.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
21659
- user_id: z34.string().describe("Slack user id of that message's author (the envelope's `user_id`). Only workspaces they can see are listed."),
21660
- query: z34.string().trim().min(1).optional().describe("Case-insensitive text to match against workspace and Mothership names and pull request URLs.")
21716
+ message_ts: z35.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
21717
+ user_id: z35.string().describe("Slack user id of that message's author (the envelope's `user_id`). Only workspaces they can see are listed."),
21718
+ query: z35.string().trim().min(1).optional().describe("Case-insensitive text to match against workspace and Mothership names and pull request URLs.")
21661
21719
  });
21662
- var scoutSlackConfirmationSchema = z34.object({
21663
- confirmation_channel_id: z34.string().describe("`channel_id` from the envelope of the Slack message that asked for or accepted this."),
21664
- confirmation_thread_ts: z34.string().describe("`thread_ts` from that message's envelope."),
21665
- confirmation_message_ts: z34.string().describe("`message_ts` from that message's envelope."),
21666
- confirmation_user_id: z34.string().describe("`user_id` from that message's envelope.")
21720
+ var scoutSlackConfirmationSchema = z35.object({
21721
+ confirmation_channel_id: z35.string().describe("`channel_id` from the envelope of the Slack message that asked for or accepted this."),
21722
+ confirmation_thread_ts: z35.string().describe("`thread_ts` from that message's envelope."),
21723
+ confirmation_message_ts: z35.string().describe("`message_ts` from that message's envelope."),
21724
+ confirmation_user_id: z35.string().describe("`user_id` from that message's envelope.")
21667
21725
  });
21668
21726
  var scoutAutomationToolInputSchema = automationToolInputSchema.extend(scoutSlackConfirmationSchema.shape);
21669
21727
  var scoutSaveChannelPresetToolInputSchema = scoutSlackConfirmationSchema.extend({
21670
- preset_id: z34.string().optional().describe(`Id of the preset to update, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`. Omit to create a new preset.`),
21671
- name: z34.string().trim().min(1).max(SCOUT_PRESET_NAME_MAX_LENGTH).optional().describe("Preset name. Required when creating."),
21672
- description: z34.string().optional().describe("One-line summary of what the preset is for."),
21673
- icon: z34.enum(SCOUT_PRESET_ICONS).optional(),
21674
- instructions: z34.string().optional().describe("Complete preset instructions; replaces the existing text. Required when creating.")
21728
+ preset_id: z35.string().optional().describe(`Id of the preset to update, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`. Omit to create a new preset.`),
21729
+ name: z35.string().trim().min(1).max(SCOUT_PRESET_NAME_MAX_LENGTH).optional().describe("Preset name. Required when creating."),
21730
+ description: z35.string().optional().describe("One-line summary of what the preset is for."),
21731
+ icon: z35.enum(SCOUT_PRESET_ICONS).optional(),
21732
+ instructions: z35.string().optional().describe("Complete preset instructions; replaces the existing text. Required when creating.")
21675
21733
  });
21676
21734
  var scoutUpdateChannelSettingsToolInputSchema = scoutSlackConfirmationSchema.extend({
21677
- source: z34.enum(SCOUT_SOURCE_TYPES).optional().describe("Defaults to `slack`."),
21678
- external_id: z34.string().describe("Slack channel id or Linear team id."),
21679
- monitored: z34.boolean().optional().describe("Linear: `true` starts monitoring the team (organization admins only), `false` stops. Slack: kept for older callers; prefer `proactivity`. `false` means `tagged`, and `true` lifts a `tagged` channel back to the organization's level. Omit to keep it."),
21680
- preset_id: z34.string().nullable().optional().describe("Preset to assign; `null` removes the preset. Omit to keep it."),
21681
- instructions: z34.string().nullable().optional().describe("Complete channel-specific instructions, applied after the preset; replaces the existing text. `null` clears them. Omit to keep them."),
21682
- proactivity: z34.enum([...SCOUT_PROACTIVITY_LEVELS, "organization"]).optional().describe("Slack only: this channel's or group DM's own level, overriding the organization's here alone. `organization` makes it follow the organization's level again. Omit to keep it. 1:1 DMs are always addressed to Replicas, so they take no level."),
21683
- silent: z34.enum(["on", "off", "default"]).optional().describe(`Slack only, organization admins only: \`on\` puts this channel in silent mode, where Replicas reads it and follows its instructions but never posts, reacts, or starts work there. \`off\` turns silent mode off here, \`default\` follows the Slack Connect default from \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\`. Omit to keep it.`),
21684
- muted: z34.enum(["on", "off", "default"]).optional().describe("Kept for older callers; prefer `silent`.")
21735
+ source: z35.enum(SCOUT_SOURCE_TYPES).optional().describe("Defaults to `slack`."),
21736
+ external_id: z35.string().describe("Slack channel id or Linear team id."),
21737
+ monitored: z35.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."),
21738
+ preset_id: z35.string().nullable().optional().describe("Preset to assign; `null` removes the preset. Omit to keep it."),
21739
+ instructions: z35.string().nullable().optional().describe("Complete channel-specific instructions, applied after the preset; replaces the existing text. `null` clears them. Omit to keep them."),
21740
+ proactivity: z35.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."),
21741
+ silent: z35.enum(["on", "off", "default"]).optional().describe(`Slack only, organization admins only: \`on\` puts this channel in silent mode, where Replicas reads it and follows its instructions but never posts, reacts, or starts work there. \`off\` turns silent mode off here, \`default\` follows the Slack Connect default from \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\`. Omit to keep it.`),
21742
+ muted: z35.enum(["on", "off", "default"]).optional().describe("Kept for older callers; prefer `silent`.")
21685
21743
  });
21686
21744
  var mothershipSlackChannelLevelToolInputSchema = scoutSlackConfirmationSchema.extend({
21687
21745
  proactivity: scoutUpdateChannelSettingsToolInputSchema.shape.proactivity.unwrap().describe("This channel's own level. `organization` makes it follow the organization's level again, which a Mothership's channel raises to at least `balanced`.")
21688
21746
  });
21689
21747
  var scoutSetSlackConnectMutedToolInputSchema = scoutSlackConfirmationSchema.extend({
21690
- muted: z34.boolean().describe("`true` puts every Slack Connect channel without its own setting in silent mode; `false` lets them follow their levels again.")
21748
+ muted: z35.boolean().describe("`true` puts every Slack Connect channel without its own setting in silent mode; `false` lets them follow their levels again.")
21691
21749
  });
21692
21750
  var scoutSetSlackConnectDefaultsToolInputSchema = scoutSlackConfirmationSchema.extend({
21693
- silent: z34.boolean().optional().describe("`true` puts every Slack Connect channel without its own setting in silent mode; `false` lets them follow their levels again. Omit to keep it."),
21694
- muted: z34.boolean().optional().describe("Kept for older callers; prefer `silent`."),
21695
- preset_id: z34.string().optional().describe("Preset for every Slack Connect channel without its own preset or instructions; an empty string removes it. Omit to keep it."),
21696
- instructions: z34.string().optional().describe("Complete default instructions, applied after that preset; replaces the existing text. An empty string clears them. Omit to keep them."),
21697
- proactivity: z34.enum([...SCOUT_PROACTIVITY_LEVELS, "default"]).optional().describe("Level for every Slack Connect channel without its own level. `default` returns them to `tagged`. Omit to keep it.")
21751
+ silent: z35.boolean().optional().describe("`true` puts every Slack Connect channel without its own setting in silent mode; `false` lets them follow their levels again. Omit to keep it."),
21752
+ muted: z35.boolean().optional().describe("Kept for older callers; prefer `silent`."),
21753
+ preset_id: z35.string().optional().describe("Preset for every Slack Connect channel without its own preset or instructions; an empty string removes it. Omit to keep it."),
21754
+ instructions: z35.string().optional().describe("Complete default instructions, applied after that preset; replaces the existing text. An empty string clears them. Omit to keep them."),
21755
+ proactivity: z35.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.")
21698
21756
  });
21699
21757
  var scoutSetOrganizationProactivityToolInputSchema = scoutSlackConfirmationSchema.extend({
21700
- proactivity: z34.enum(SCOUT_PROACTIVITY_LEVELS).describe(`The level every Slack channel and group DM follows unless it has its own. Slack Connect channels without their own level follow the shared-channel default from \`${REPLICAS_MCP_TOOLS.setSlackConnectDefaults}\` instead.`)
21758
+ proactivity: z35.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.`)
21701
21759
  });
21702
21760
  var scoutDeleteChannelPresetToolInputSchema = scoutSlackConfirmationSchema.extend({
21703
- preset_id: z34.string().describe(`Id of the preset to delete, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`.`)
21761
+ preset_id: z35.string().describe(`Id of the preset to delete, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`.`)
21704
21762
  });
21705
21763
  var RESET_TO_DEFAULT = "default";
21706
- var resettable = (schema, description) => z34.union([schema, z34.literal(RESET_TO_DEFAULT)]).optional().describe(`${description} \`${RESET_TO_DEFAULT}\` falls back to the organization default. Omit to keep it.`);
21764
+ var resettable = (schema, description) => z35.union([schema, z35.literal(RESET_TO_DEFAULT)]).optional().describe(`${description} \`${RESET_TO_DEFAULT}\` falls back to the organization default. Omit to keep it.`);
21707
21765
  var scoutSetSlackAgentDefaultsToolInputSchema = scoutSlackConfirmationSchema.extend({
21708
- agent_provider: resettable(z34.enum(ENGINE_AGENT_PROVIDERS), "Agent for Slack-triggered workspaces. Changing it without `model` resets the model to that agent's default."),
21709
- model: resettable(z34.string(), "Model id for that agent; the default is the agent's own."),
21710
- thinking_level: resettable(z34.enum(VALID_THINKING_LEVELS), "Thinking level."),
21711
- goal_mode: resettable(z34.boolean(), "Goal mode."),
21712
- fast_mode: resettable(z34.boolean(), "Fast mode.")
21766
+ agent_provider: resettable(z35.enum(ENGINE_AGENT_PROVIDERS), "Agent for Slack-triggered workspaces. Changing it without `model` resets the model to that agent's default."),
21767
+ model: resettable(z35.string(), "Model id for that agent; the default is the agent's own."),
21768
+ thinking_level: resettable(z35.enum(VALID_THINKING_LEVELS), "Thinking level."),
21769
+ goal_mode: resettable(z35.boolean(), "Goal mode."),
21770
+ fast_mode: resettable(z35.boolean(), "Fast mode.")
21713
21771
  });
21714
- var scoutClaimSettingsOfferToolInputSchema = z34.object({
21772
+ var scoutClaimSettingsOfferToolInputSchema = z35.object({
21715
21773
  channel_id: slackChannelIdSchema,
21716
- kind: z34.enum(SCOUT_SETTINGS_OFFERS).describe("`proactivity`: offering a lower level after frustration. `raise_proactivity`: offering a higher level after someone had to @mention you. `instructions`: offering channel instructions or a preset. `organization_proactivity` and `raise_organization_proactivity`: offering to lower or raise the workspace default; only decline them, the server claims them for you."),
21717
- user_id: z34.string().optional().describe("The envelope's `user_id`. Required for `proactivity` and `raise_proactivity`, so the server can say whether they are an organization admin."),
21718
- declined: z34.boolean().optional().describe("true when the person declined an offer you already made, so it is not made again.")
21774
+ kind: z35.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."),
21775
+ user_id: z35.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."),
21776
+ declined: z35.boolean().optional().describe("true when the person declined an offer you already made, so it is not made again.")
21719
21777
  });
21720
21778
 
21721
21779
  // ../shared/src/routes/plugin-catalog.ts
@@ -22073,27 +22131,27 @@ var PLUGIN_CATALOG = [
22073
22131
  ].map((plugin) => ({ ...plugin, readOnlyScopes: READ_ONLY_SCOPES[plugin.id] }));
22074
22132
 
22075
22133
  // ../shared/src/routes/sentry.ts
22076
- import { z as z35 } from "zod";
22077
- var sentrySelfHostedConnectRequestSchema = z35.object({
22078
- baseUrl: z35.string().min(1),
22079
- token: z35.string().trim().min(1),
22080
- webhookSecret: z35.string().trim().optional()
22134
+ import { z as z36 } from "zod";
22135
+ var sentrySelfHostedConnectRequestSchema = z36.object({
22136
+ baseUrl: z36.string().min(1),
22137
+ token: z36.string().trim().min(1),
22138
+ webhookSecret: z36.string().trim().optional()
22081
22139
  });
22082
22140
 
22083
22141
  // ../shared/src/routes/user.ts
22084
22142
  var PROFILE_AVATAR_MAX_SIZE_BYTES = 5 * 1024 * 1024;
22085
22143
 
22086
22144
  // ../shared/src/routes/web-auth.ts
22087
- import { z as z36 } from "zod";
22088
- var webAuthRedeemResponseSchema = z36.object({
22089
- path: z36.string(),
22090
- organizationId: z36.string().nullable(),
22091
- session: z36.object({ access_token: z36.string(), refresh_token: z36.string(), user: z36.object({ id: z36.string(), email: z36.string() }) }).nullable()
22145
+ import { z as z37 } from "zod";
22146
+ var webAuthRedeemResponseSchema = z37.object({
22147
+ path: z37.string(),
22148
+ organizationId: z37.string().nullable(),
22149
+ session: z37.object({ access_token: z37.string(), refresh_token: z37.string(), user: z37.object({ id: z37.string(), email: z37.string() }) }).nullable()
22092
22150
  });
22093
22151
 
22094
22152
  // ../shared/src/routes/themes.ts
22095
- import { z as z37 } from "zod";
22096
- var updateThemeRequestSchema = z37.object({ theme: z37.string(), palette: z37.string(), accent: z37.string(), code: z37.string() }).partial();
22153
+ import { z as z38 } from "zod";
22154
+ var updateThemeRequestSchema = z38.object({ theme: z38.string(), palette: z38.string(), accent: z38.string(), code: z38.string() }).partial();
22097
22155
 
22098
22156
  // ../shared/src/routes/client-state.ts
22099
22157
  var MAX_CLIENT_STATE_REQUEST_BYTES = 5 * 1024 * 1024;
@@ -22117,105 +22175,105 @@ var promptHistoryClientStateKey = orgUserClientStateKey(PROMPT_HISTORY_CLIENT_ST
22117
22175
  var workspaceSearchOpensClientStateKey = orgUserClientStateKey(WORKSPACE_SEARCH_OPENS_CLIENT_STATE_KEY_PREFIX);
22118
22176
 
22119
22177
  // ../shared/src/routes/workspace-events.ts
22120
- import { z as z39 } from "zod";
22178
+ import { z as z40 } from "zod";
22121
22179
 
22122
22180
  // ../shared/src/routes/presence.ts
22123
- import { z as z38 } from "zod";
22124
- var presenceStatusSchema = z38.enum(["online", "typing"]);
22125
- var presenceLocationSchema = z38.object({
22126
- workspaceId: z38.string().optional()
22181
+ import { z as z39 } from "zod";
22182
+ var presenceStatusSchema = z39.enum(["online", "typing"]);
22183
+ var presenceLocationSchema = z39.object({
22184
+ workspaceId: z39.string().optional()
22127
22185
  });
22128
- var presenceEntrySchema = z38.object({
22129
- userId: z38.string(),
22186
+ var presenceEntrySchema = z39.object({
22187
+ userId: z39.string(),
22130
22188
  status: presenceStatusSchema,
22131
22189
  location: presenceLocationSchema,
22132
- ts: z38.string()
22190
+ ts: z39.string()
22133
22191
  });
22134
- var updatePresenceRequestSchema = z38.object({
22192
+ var updatePresenceRequestSchema = z39.object({
22135
22193
  status: presenceStatusSchema,
22136
22194
  location: presenceLocationSchema.optional()
22137
22195
  });
22138
22196
 
22139
22197
  // ../shared/src/routes/workspace-events.ts
22140
- var workspaceTurnCompletionSchema = z39.object({
22141
- workspaceName: z39.string(),
22142
- completedAt: z39.string(),
22143
- processing: z39.boolean().optional(),
22144
- pullRequestFeedback: z39.boolean().optional(),
22145
- attention: z39.object({ reason: z39.enum(CHAT_ATTENTION_REASONS), userId: z39.string() }).optional()
22198
+ var workspaceTurnCompletionSchema = z40.object({
22199
+ workspaceName: z40.string(),
22200
+ completedAt: z40.string(),
22201
+ processing: z40.boolean().optional(),
22202
+ pullRequestFeedback: z40.boolean().optional(),
22203
+ attention: z40.object({ reason: z40.enum(CHAT_ATTENTION_REASONS), userId: z40.string() }).optional()
22146
22204
  });
22147
- var workspaceEventSchemaByType = z39.discriminatedUnion("type", [
22148
- z39.object({
22149
- type: z39.literal("workspace.changed"),
22150
- workspaceId: z39.string(),
22151
- accessChangedFor: z39.string().optional(),
22152
- accessChangedForOrg: z39.literal(true).optional(),
22153
- workspace: z39.object({ status: z39.enum(WORKSPACE_STATUSES), last_activity_at: z39.string().nullable() }).optional(),
22154
- name: z39.string().optional(),
22205
+ var workspaceEventSchemaByType = z40.discriminatedUnion("type", [
22206
+ z40.object({
22207
+ type: z40.literal("workspace.changed"),
22208
+ workspaceId: z40.string(),
22209
+ accessChangedFor: z40.string().optional(),
22210
+ accessChangedForOrg: z40.literal(true).optional(),
22211
+ workspace: z40.object({ status: z40.enum(WORKSPACE_STATUSES), last_activity_at: z40.string().nullable() }).optional(),
22212
+ name: z40.string().optional(),
22155
22213
  completion: workspaceTurnCompletionSchema.optional(),
22156
- ts: z39.string()
22214
+ ts: z40.string()
22157
22215
  }),
22158
- z39.object({
22159
- type: z39.literal("workspace.chat.changed"),
22160
- workspaceId: z39.string(),
22161
- chatId: z39.string(),
22162
- ts: z39.string()
22216
+ z40.object({
22217
+ type: z40.literal("workspace.chat.changed"),
22218
+ workspaceId: z40.string(),
22219
+ chatId: z40.string(),
22220
+ ts: z40.string()
22163
22221
  }),
22164
- z39.object({
22165
- type: z39.literal("workspace.chat.advanced"),
22166
- workspaceId: z39.string(),
22167
- chatId: z39.string(),
22168
- afterCursor: z39.string().optional(),
22169
- processing: z39.boolean(),
22170
- ts: z39.string()
22222
+ z40.object({
22223
+ type: z40.literal("workspace.chat.advanced"),
22224
+ workspaceId: z40.string(),
22225
+ chatId: z40.string(),
22226
+ afterCursor: z40.string().optional(),
22227
+ processing: z40.boolean(),
22228
+ ts: z40.string()
22171
22229
  }),
22172
- z39.object({
22173
- type: z39.literal("mobile-testing.changed"),
22174
- workspaceId: z39.string(),
22175
- ts: z39.string()
22230
+ z40.object({
22231
+ type: z40.literal("mobile-testing.changed"),
22232
+ workspaceId: z40.string(),
22233
+ ts: z40.string()
22176
22234
  }),
22177
- z39.object({
22178
- type: z39.literal("variable-request.changed"),
22179
- workspaceId: z39.string(),
22180
- ts: z39.string()
22235
+ z40.object({
22236
+ type: z40.literal("variable-request.changed"),
22237
+ workspaceId: z40.string(),
22238
+ ts: z40.string()
22181
22239
  }),
22182
- z39.object({
22183
- type: z39.literal("local-control-request.changed"),
22184
- workspaceId: z39.string(),
22185
- ts: z39.string()
22240
+ z40.object({
22241
+ type: z40.literal("local-control-request.changed"),
22242
+ workspaceId: z40.string(),
22243
+ ts: z40.string()
22186
22244
  }),
22187
- z39.object({
22188
- type: z39.literal("pull-request.changed"),
22189
- prUrl: z39.string(),
22190
- ts: z39.string()
22245
+ z40.object({
22246
+ type: z40.literal("pull-request.changed"),
22247
+ prUrl: z40.string(),
22248
+ ts: z40.string()
22191
22249
  }),
22192
- z39.object({
22193
- type: z39.literal("mothership.subagent.changed"),
22194
- workspaceId: z39.string(),
22195
- subagent: z39.object({ id: z39.string(), name: z39.string(), prUrl: z39.string().nullable() }),
22196
- ts: z39.string()
22250
+ z40.object({
22251
+ type: z40.literal("mothership.subagent.changed"),
22252
+ workspaceId: z40.string(),
22253
+ subagent: z40.object({ id: z40.string(), name: z40.string(), prUrl: z40.string().nullable() }),
22254
+ ts: z40.string()
22197
22255
  }),
22198
- z39.object({ type: z39.literal("mothership.board.changed"), workspaceId: z39.string(), ts: z39.string() }),
22199
- z39.object({ type: z39.literal("needs-you.changed"), workspaceId: z39.string().nullable(), userId: z39.string().optional(), ts: z39.string() }),
22200
- z39.object({
22201
- type: z39.literal("workspace.shared"),
22202
- workspaceId: z39.string(),
22203
- workspaceName: z39.string(),
22204
- sharedWithUserId: z39.string(),
22205
- sharedByName: z39.string(),
22206
- ts: z39.string()
22256
+ z40.object({ type: z40.literal("mothership.board.changed"), workspaceId: z40.string(), ts: z40.string() }),
22257
+ z40.object({ type: z40.literal("needs-you.changed"), workspaceId: z40.string().nullable(), userId: z40.string().optional(), ts: z40.string() }),
22258
+ z40.object({
22259
+ type: z40.literal("workspace.shared"),
22260
+ workspaceId: z40.string(),
22261
+ workspaceName: z40.string(),
22262
+ sharedWithUserId: z40.string(),
22263
+ sharedByName: z40.string(),
22264
+ ts: z40.string()
22207
22265
  }),
22208
- z39.object({ type: z39.literal("client-state.changed"), userId: z39.string(), keys: z39.array(z39.string()), ts: z39.string() })
22266
+ z40.object({ type: z40.literal("client-state.changed"), userId: z40.string(), keys: z40.array(z40.string()), ts: z40.string() })
22209
22267
  ]);
22210
- var workspaceChangedEventSchema = z39.union([
22268
+ var workspaceChangedEventSchema = z40.union([
22211
22269
  workspaceEventSchemaByType,
22212
- z39.object({ type: z39.literal("presence.changed"), userId: z39.string(), entry: presenceEntrySchema.nullable(), ts: z39.string() }),
22213
- z39.object({ type: z39.literal("presence.changed"), ts: z39.string() })
22270
+ z40.object({ type: z40.literal("presence.changed"), userId: z40.string(), entry: presenceEntrySchema.nullable(), ts: z40.string() }),
22271
+ z40.object({ type: z40.literal("presence.changed"), ts: z40.string() })
22214
22272
  ]);
22215
22273
 
22216
22274
  // ../shared/src/routes/review-messages.ts
22217
- import { z as z40 } from "zod";
22218
- var sendPullRequestReviewMessageRequestSchema = z40.object({
22275
+ import { z as z41 } from "zod";
22276
+ var sendPullRequestReviewMessageRequestSchema = z41.object({
22219
22277
  ...sendChatMessageRequestSchema.pick({
22220
22278
  message: true,
22221
22279
  messageId: true,
@@ -22228,8 +22286,8 @@ var sendPullRequestReviewMessageRequestSchema = z40.object({
22228
22286
  ultrafastMode: true
22229
22287
  }).shape,
22230
22288
  /** Starts a new chat instead of continuing the PR's review chat. The provider only applies to a new chat. */
22231
- newChat: z40.boolean().optional(),
22232
- provider: z40.enum(ENGINE_AGENT_PROVIDERS).optional()
22289
+ newChat: z41.boolean().optional(),
22290
+ provider: z41.enum(ENGINE_AGENT_PROVIDERS).optional()
22233
22291
  });
22234
22292
 
22235
22293
  // ../shared/src/audit-log.ts
@@ -22892,40 +22950,40 @@ function isSkillRegistryManifest(value) {
22892
22950
  }
22893
22951
 
22894
22952
  // ../shared/src/routes/variable-requests.ts
22895
- import { z as z41 } from "zod";
22953
+ import { z as z42 } from "zod";
22896
22954
  var VARIABLE_REQUEST_WAIT = { defaultMs: 10 * 6e4, maxMs: 30 * 6e4, pollMs: 3e3, waiterStaleMs: 15e3 };
22897
22955
  var VARIABLE_REQUEST_DESTINATIONS = ["environment", "workspace"];
22898
- var requestedVariableSchema = z41.object({
22899
- key: z41.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name").max(ENVIRONMENT_SETUP_LIMITS.variableKeyChars),
22900
- required: z41.boolean(),
22901
- replace: z41.boolean().optional()
22956
+ var requestedVariableSchema = z42.object({
22957
+ key: z42.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name").max(ENVIRONMENT_SETUP_LIMITS.variableKeyChars),
22958
+ required: z42.boolean(),
22959
+ replace: z42.boolean().optional()
22902
22960
  });
22903
- var requestedVariablesSchema = z41.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");
22904
- var createVariableRequestSchema = z41.object({
22961
+ var requestedVariablesSchema = z42.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");
22962
+ var createVariableRequestSchema = z42.object({
22905
22963
  variables: requestedVariablesSchema,
22906
- reason: z41.string().trim().max(500).nullish().transform((value) => value || null),
22907
- wait: z41.boolean().default(true)
22964
+ reason: z42.string().trim().max(500).nullish().transform((value) => value || null),
22965
+ wait: z42.boolean().default(true)
22908
22966
  });
22909
- var respondVariableRequestSchema = z41.discriminatedUnion("action", [
22910
- z41.object({
22911
- action: z41.literal("provide"),
22912
- destination: z41.enum(VARIABLE_REQUEST_DESTINATIONS),
22967
+ var respondVariableRequestSchema = z42.discriminatedUnion("action", [
22968
+ z42.object({
22969
+ action: z42.literal("provide"),
22970
+ destination: z42.enum(VARIABLE_REQUEST_DESTINATIONS),
22913
22971
  /** Defaults to the workspace's environment, so older clients keep saving there. */
22914
- environment_ids: z41.array(z41.string().uuid()).optional(),
22915
- overwrite: z41.boolean().optional(),
22916
- values: z41.record(z41.string().regex(VARIABLE_KEY_RE), z41.string())
22972
+ environment_ids: z42.array(z42.string().uuid()).optional(),
22973
+ overwrite: z42.boolean().optional(),
22974
+ values: z42.record(z42.string().regex(VARIABLE_KEY_RE), z42.string())
22917
22975
  }),
22918
- z41.object({ action: z41.literal("skip") })
22976
+ z42.object({ action: z42.literal("skip") })
22919
22977
  ]);
22920
22978
 
22921
22979
  // ../shared/src/routes/local-control-requests.ts
22922
- import { z as z42 } from "zod";
22923
- var createLocalControlRequestSchema = z42.object({
22924
- reason: z42.string().trim().max(500).optional().transform((value) => value || null),
22925
- wait: z42.boolean().default(true)
22980
+ import { z as z43 } from "zod";
22981
+ var createLocalControlRequestSchema = z43.object({
22982
+ reason: z43.string().trim().max(500).optional().transform((value) => value || null),
22983
+ wait: z43.boolean().default(true)
22926
22984
  });
22927
- var respondLocalControlRequestSchema = z42.object({ action: z42.enum(["allow", "dismiss"]) });
22928
- var setLocalControlSchema = z42.object({ enabled: z42.boolean() });
22985
+ var respondLocalControlRequestSchema = z43.object({ action: z43.enum(["allow", "dismiss"]) });
22986
+ var setLocalControlSchema = z43.object({ enabled: z43.boolean() });
22929
22987
 
22930
22988
  export {
22931
22989
  ENGINE_SEND_MESSAGE_FAILED_ERROR,
@@ -3,13 +3,13 @@ import { createRequire as __createRequire } from 'node:module';
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  evaluateCommandProtection
6
- } from "./chunk-V4EFZGCN.js";
7
- import "./chunk-6WSVDW2W.js";
8
- import "./chunk-5M22SZHQ.js";
6
+ } from "./chunk-O76HWQZW.js";
7
+ import "./chunk-LAVIBP35.js";
8
+ import "./chunk-6DGCGNRD.js";
9
9
  import {
10
10
  isRecord
11
11
  } from "./chunk-UZSNFLDQ.js";
12
- import "./chunk-GN2YE77J.js";
12
+ import "./chunk-Z744SRUU.js";
13
13
  import "./chunk-VEQXQN22.js";
14
14
 
15
15
  // src/command-protection-hook.ts
@@ -14,12 +14,12 @@ import {
14
14
  recoverCompletedTurn,
15
15
  spawnMuseMsp,
16
16
  startMuseSession
17
- } from "./chunk-23OSWBDM.js";
17
+ } from "./chunk-PUN65MPP.js";
18
18
  import {
19
19
  AppServerProcess,
20
20
  buildCodexAgentEnv
21
- } from "./chunk-ZDOSFRWB.js";
22
- import "./chunk-5M22SZHQ.js";
21
+ } from "./chunk-E5U45B5E.js";
22
+ import "./chunk-6DGCGNRD.js";
23
23
  import {
24
24
  AGENT,
25
25
  OPENCODE_GO_PROVIDER,
@@ -29,7 +29,7 @@ import {
29
29
  headlessAgentUsagePath,
30
30
  isRecord,
31
31
  withTimeout
32
- } from "./chunk-GN2YE77J.js";
32
+ } from "./chunk-Z744SRUU.js";
33
33
  import "./chunk-VEQXQN22.js";
34
34
 
35
35
  // src/headless-agent.ts
package/dist/src/index.js CHANGED
@@ -27,7 +27,7 @@ import {
27
27
  evaluateCommandProtection,
28
28
  extractToolCommand,
29
29
  reportCommandProtectionBlock
30
- } from "./chunk-V4EFZGCN.js";
30
+ } from "./chunk-O76HWQZW.js";
31
31
  import {
32
32
  ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
33
33
  AGENT_MESSAGE_DELTA_METHOD,
@@ -65,10 +65,10 @@ import {
65
65
  spawnMuseMsp,
66
66
  startMuseSession,
67
67
  uuidV7
68
- } from "./chunk-23OSWBDM.js";
68
+ } from "./chunk-PUN65MPP.js";
69
69
  import {
70
70
  publishedPullRequestUrls
71
- } from "./chunk-YZ465CA2.js";
71
+ } from "./chunk-4XXV6XF7.js";
72
72
  import {
73
73
  ACCOUNT_RATE_LIMITS_READ_METHOD,
74
74
  AsyncLock,
@@ -147,7 +147,7 @@ import {
147
147
  transcriptSecrets,
148
148
  upsertCredentialFileLines,
149
149
  writeSecureCredentialFile
150
- } from "./chunk-2KSEOMCI.js";
150
+ } from "./chunk-LM3GPSH5.js";
151
151
  import {
152
152
  ENGINE_ENV,
153
153
  UNQUOTED_PATHS_CONFIG,
@@ -158,16 +158,16 @@ import {
158
158
  resolveDiffBase,
159
159
  setAgentCredentialSnapshot,
160
160
  setLinearSessionId
161
- } from "./chunk-6WSVDW2W.js";
161
+ } from "./chunk-LAVIBP35.js";
162
162
  import {
163
163
  buildCodexAgentEnv,
164
164
  getCodexModelProvider
165
- } from "./chunk-ZDOSFRWB.js";
165
+ } from "./chunk-E5U45B5E.js";
166
166
  import {
167
167
  SUBPROCESS_MAX_BUFFER,
168
168
  execAsync,
169
169
  execFileAsync
170
- } from "./chunk-5M22SZHQ.js";
170
+ } from "./chunk-6DGCGNRD.js";
171
171
  import {
172
172
  isRecord as isRecord2
173
173
  } from "./chunk-UZSNFLDQ.js";
@@ -463,7 +463,7 @@ import {
463
463
  workspaceTokenRequestSchema,
464
464
  workspaceTokenResponseSchema,
465
465
  wrapInTag
466
- } from "./chunk-GN2YE77J.js";
466
+ } from "./chunk-Z744SRUU.js";
467
467
  import {
468
468
  cloneMcpConfig,
469
469
  ensureCompatibilityImports,
@@ -14441,7 +14441,10 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
14441
14441
  env: {
14442
14442
  ...shared.env,
14443
14443
  // A resumed session reports tools from a still-connecting MCP server as removed, so the agent stops using them.
14444
- ...this.sessionId ? { MCP_CONNECTION_NONBLOCKING: "false" } : {},
14444
+ // A new session waits too: tools that connect after its first request stay out of its tool list, so the next process would send a different list and rewrite the whole prompt cache.
14445
+ MCP_CONNECTION_NONBLOCKING: "false",
14446
+ // That wait ends after 5 seconds. Without this, a chat that passes a server of its own would go on waiting for every server still connecting, up to 30 seconds.
14447
+ CLAUDE_CODE_MCP_STARTUP_WAIT_MS: "0",
14445
14448
  ...resolveClaudeAuthMethodForMessage() === "ollama" ? {
14446
14449
  ANTHROPIC_DEFAULT_SONNET_MODEL: resolvedModel,
14447
14450
  ANTHROPIC_DEFAULT_OPUS_MODEL: resolvedModel,
@@ -3,13 +3,13 @@ import { createRequire as __createRequire } from 'node:module';
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  publishedPullRequestUrls
6
- } from "./chunk-YZ465CA2.js";
6
+ } from "./chunk-4XXV6XF7.js";
7
7
  import {
8
8
  isRecord
9
9
  } from "./chunk-UZSNFLDQ.js";
10
10
  import {
11
11
  shouldRefreshPullRequests
12
- } from "./chunk-GN2YE77J.js";
12
+ } from "./chunk-Z744SRUU.js";
13
13
  import "./chunk-VEQXQN22.js";
14
14
 
15
15
  // src/services/post-tool-pr-notifier.ts
@@ -11,7 +11,7 @@ import {
11
11
  spawnSubagentRequestSchema,
12
12
  subagentResponseSchema,
13
13
  waitSubagentRequestSchema
14
- } from "./chunk-GN2YE77J.js";
14
+ } from "./chunk-Z744SRUU.js";
15
15
  import "./chunk-VEQXQN22.js";
16
16
 
17
17
  // src/subagent-mcp.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-engine",
3
- "version": "0.1.1600",
3
+ "version": "0.1.1601",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",