replicas-engine 0.1.1437 → 0.1.1439

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-V4T4E227.js";
12
- import "./chunk-FQV2HJH6.js";
13
- import "./chunk-X5AP6KN6.js";
14
- import "./chunk-GTEK55CB.js";
11
+ } from "./chunk-PLN56LA5.js";
12
+ import "./chunk-CL4X2AS5.js";
13
+ import "./chunk-EJ6YBNEJ.js";
14
+ import "./chunk-SNCGBKDP.js";
15
15
  import "./chunk-UZSNFLDQ.js";
16
- import "./chunk-FLB2IR7V.js";
16
+ import "./chunk-VMUHW24C.js";
17
17
  import "./chunk-VEQXQN22.js";
18
18
  export {
19
19
  CODEX_ULTRAFAST_SERVICE_TIER,
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  SUBPROCESS_MAX_BUFFER,
6
6
  execFileAsync
7
- } from "./chunk-GTEK55CB.js";
7
+ } from "./chunk-SNCGBKDP.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-FLB2IR7V.js";
24
+ } from "./chunk-VMUHW24C.js";
25
25
 
26
26
  // src/runtime-env-loader.ts
27
27
  import { readFileSync } from "fs";
@@ -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-GTEK55CB.js";
6
+ } from "./chunk-SNCGBKDP.js";
7
7
  import {
8
8
  isVersionBelow
9
- } from "./chunk-FLB2IR7V.js";
9
+ } from "./chunk-VMUHW24C.js";
10
10
 
11
11
  // src/utils/codex-agent-env.ts
12
12
  function buildCodexAgentEnv(source = process.env) {
@@ -10,15 +10,15 @@ import {
10
10
  resolveDiffBase,
11
11
  runGitCommand,
12
12
  setAgentCredentialSnapshot
13
- } from "./chunk-FQV2HJH6.js";
13
+ } from "./chunk-CL4X2AS5.js";
14
14
  import {
15
15
  AppServerProcess,
16
16
  buildCodexAgentEnv
17
- } from "./chunk-X5AP6KN6.js";
17
+ } from "./chunk-EJ6YBNEJ.js";
18
18
  import {
19
19
  SUBPROCESS_MAX_BUFFER,
20
20
  execFileAsync
21
- } from "./chunk-GTEK55CB.js";
21
+ } from "./chunk-SNCGBKDP.js";
22
22
  import {
23
23
  isRecord
24
24
  } from "./chunk-UZSNFLDQ.js";
@@ -56,7 +56,7 @@ import {
56
56
  resolveOpenAICompatibleModelsUrl,
57
57
  splitMothershipInstructions,
58
58
  withTimeout
59
- } from "./chunk-FLB2IR7V.js";
59
+ } from "./chunk-VMUHW24C.js";
60
60
 
61
61
  // src/managers/codex-token-manager.ts
62
62
  import { promises as fs } from "fs";
@@ -319,7 +319,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
319
319
  await this.applyCredentialUpdate(++this.credentialGeneration, async () => {
320
320
  await this.applyCredentialsResponse(data);
321
321
  setAgentCredentialSnapshot("codex", data);
322
- const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-OYJEXADP.js");
322
+ const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-C6LQOUCS.js");
323
323
  await restartCodexAspHostIfRunning2();
324
324
  });
325
325
  await this.start(true);
@@ -341,7 +341,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
341
341
  const accountChanged = ENGINE_ENV.REPLICAS_AGENT_CREDENTIALS.codex?.credentialId !== data.credentialId;
342
342
  await this.applyCredentialsResponse(data);
343
343
  if (restartOnChange && (accountChanged || CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index]))) {
344
- const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-OYJEXADP.js");
344
+ const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-C6LQOUCS.js");
345
345
  await restartCodexAspHostIfRunning2();
346
346
  }
347
347
  setAgentCredentialSnapshot("codex", data);
@@ -5,7 +5,7 @@ import {
5
5
  extractCommandProtectionCommandText,
6
6
  isRecord,
7
7
  parseCodeHostPrUrl
8
- } from "./chunk-FLB2IR7V.js";
8
+ } from "./chunk-VMUHW24C.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-FLB2IR7V.js";
6
+ } from "./chunk-VMUHW24C.js";
7
7
 
8
8
  // src/utils/exec.ts
9
9
  import { exec, execFile } from "child_process";
@@ -6,7 +6,7 @@ import {
6
6
  getOriginDefaultBranch,
7
7
  monolithRequest,
8
8
  runGitCommand
9
- } from "./chunk-FQV2HJH6.js";
9
+ } from "./chunk-CL4X2AS5.js";
10
10
  import {
11
11
  extractCommandProtectionCommandText,
12
12
  findCommandProtectionGitLookups,
@@ -14,7 +14,7 @@ import {
14
14
  findPrMergeSignals,
15
15
  findScoutRepoWriteSignals,
16
16
  parseCommandProtectionRequest
17
- } from "./chunk-FLB2IR7V.js";
17
+ } from "./chunk-VMUHW24C.js";
18
18
 
19
19
  // src/services/command-protection-service.ts
20
20
  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-X5AP6KN6.js";
6
+ } from "./chunk-EJ6YBNEJ.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-FLB2IR7V.js";
18
+ } from "./chunk-VMUHW24C.js";
19
19
 
20
20
  // src/managers/codex-asp/notification-dispatch.ts
21
21
  var TURN_STARTED_METHOD = "turn/started";
@@ -11105,7 +11105,8 @@ var sendChatMessageResponseSchema = z5.object({
11105
11105
  });
11106
11106
  var respondToolInputRequestSchema = z5.object({
11107
11107
  requestId: z5.string().min(1),
11108
- selectionId: z5.string().min(1)
11108
+ selectionId: z5.string().min(1),
11109
+ source: z5.enum(CLIENT_MESSAGE_SOURCES).optional()
11109
11110
  });
11110
11111
  function isLatestChatHistoryPage(params) {
11111
11112
  return params.beforeCursor === void 0 && params.beforeEvent === void 0 && params.beforeTurn === void 0;
@@ -12230,7 +12231,8 @@ var recordPushActivityRequestSchema = z20.object({
12230
12231
  organizationId: z20.string().uuid(),
12231
12232
  /** Seconds since the last keyboard or mouse input on this computer. A phone leaves it out: it only reports what it has open. */
12232
12233
  idleSeconds: z20.number().min(0).optional(),
12233
- seenWorkspaceIds: z20.array(z20.string().uuid()).max(20)
12234
+ seenWorkspaceIds: z20.array(z20.string().uuid()).max(20),
12235
+ seenChats: z20.array(z20.object({ workspaceId: z20.string().uuid(), chatId: z20.string().min(1).max(100) })).max(20).optional()
12234
12236
  });
12235
12237
  var PUSH_NOTIFICATION_KINDS = [...WORKSPACE_ATTENTION_REASONS, "finished"];
12236
12238
  var pushQuestionSchema = z20.object({ id: z20.string().max(64), options: z20.array(z20.object({ id: z20.string().max(64), label: z20.string().min(1).max(60) })).min(1).max(4) });
@@ -14785,6 +14787,7 @@ var DEFAULT_USER_PREFERENCES = {
14785
14787
  appshot_destination: "automatic",
14786
14788
  appshot_sound: true,
14787
14789
  mothership_tour_seen: false,
14790
+ mothership_board_opened: false,
14788
14791
  follow_up_mode: "steer",
14789
14792
  memory_enabled: null,
14790
14793
  subagent_mcp_enabled: null,
@@ -15990,6 +15993,119 @@ function workspaceTargetFromToolOutput(output) {
15990
15993
  }
15991
15994
  }
15992
15995
 
15996
+ // ../shared/src/mothership-board.ts
15997
+ import { z as z26 } from "zod";
15998
+ var MOTHERSHIP_BOARD_TONES = ["neutral", "needs_you", "warning", "success", "danger", "working"];
15999
+ var label = (max) => z26.string().trim().min(1).max(max);
16000
+ var tone = z26.enum(MOTHERSHIP_BOARD_TONES);
16001
+ var blockId = z26.string().regex(/^[\w.:-]{1,64}$/, "Use 1-64 letters, digits, _, -, . or :");
16002
+ var httpsUrl = z26.url({ protocol: /^https$/, error: "Must be an https URL" });
16003
+ var prUrl = httpsUrl.refine((url) => parseCodeHostPrUrl(url) !== null, "Must be a GitHub pull request or GitLab merge request URL");
16004
+ 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");
16005
+ var action = z26.discriminatedUnion("type", [
16006
+ z26.object({ type: z26.literal("open_ship"), workspace_id: z26.uuid() }),
16007
+ z26.object({ type: z26.literal("message_ship"), workspace_id: z26.uuid(), message: label(4e3) }),
16008
+ z26.object({ type: z26.literal("open_pr"), url: prUrl }),
16009
+ z26.object({ type: z26.literal("merge_pr"), url: prUrl }),
16010
+ z26.object({ type: z26.literal("message_mothership"), message: label(4e3) }),
16011
+ z26.object({ type: z26.literal("open_link"), url: httpsUrl })
16012
+ ]);
16013
+ var text3 = z26.object({ type: z26.literal("text"), id: blockId.optional(), text: label(2e3) });
16014
+ var badge = z26.object({ type: z26.literal("badge"), id: blockId.optional(), label: label(40), tone: tone.optional() });
16015
+ var pr = z26.object({ type: z26.literal("pr"), id: blockId.optional(), url: prUrl });
16016
+ var ship = z26.object({ type: z26.literal("ship"), id: blockId.optional(), workspace_id: z26.uuid() });
16017
+ var linear = z26.object({ type: z26.literal("linear"), id: blockId.optional(), identifier: linearIdentifier });
16018
+ var button = z26.object({ type: z26.literal("button"), id: blockId.optional(), label: label(60), action, variant: z26.enum(["primary", "outline", "warning", "destructive"]).optional(), resolves: blockId.optional() });
16019
+ var steps = z26.object({
16020
+ type: z26.literal("steps"),
16021
+ id: blockId.optional(),
16022
+ steps: z26.array(z26.object({ label: label(30), state: z26.enum(["done", "current", "pending", "failed"]) })).min(1).max(8)
16023
+ });
16024
+ var inline = z26.discriminatedUnion("type", [text3, badge, pr, ship, linear, button, steps]);
16025
+ var row = z26.object({ type: z26.literal("row"), id: blockId.optional(), cells: z26.array(z26.union([label(500), inline])).min(1).max(6) });
16026
+ var blockTypes = {
16027
+ text: text3,
16028
+ badge,
16029
+ pr,
16030
+ ship,
16031
+ linear,
16032
+ button,
16033
+ steps,
16034
+ stat: z26.object({ type: z26.literal("stat"), id: blockId.optional(), label: label(40), value: label(40), tone: tone.optional() }),
16035
+ divider: z26.object({ type: z26.literal("divider"), id: blockId.optional() }),
16036
+ updated_at: z26.object({ type: z26.literal("updated_at"), id: blockId.optional() }),
16037
+ choice: z26.object({
16038
+ type: z26.literal("choice"),
16039
+ id: blockId.optional(),
16040
+ question: label(500),
16041
+ options: z26.array(z26.object({ label: label(60), message: label(2e3).optional() })).min(2).max(6),
16042
+ resolves: blockId.optional()
16043
+ }),
16044
+ button_group: z26.object({ type: z26.literal("button_group"), id: blockId.optional(), children: z26.array(button).min(1).max(8) }),
16045
+ table: z26.object({ type: z26.literal("table"), id: blockId.optional(), columns: z26.array(label(40)).min(1).max(6), children: z26.array(row).max(100) }),
16046
+ callout: z26.object({
16047
+ type: z26.literal("callout"),
16048
+ id: blockId.optional(),
16049
+ tone,
16050
+ title: label(120).optional(),
16051
+ get children() {
16052
+ return z26.array(block).max(20).optional();
16053
+ }
16054
+ }),
16055
+ list: z26.object({
16056
+ type: z26.literal("list"),
16057
+ id: blockId.optional(),
16058
+ ordered: z26.boolean().optional(),
16059
+ get children() {
16060
+ return z26.array(block).max(100);
16061
+ }
16062
+ }),
16063
+ section: z26.object({
16064
+ type: z26.literal("section"),
16065
+ id: blockId.optional(),
16066
+ title: label(120),
16067
+ tone: tone.optional(),
16068
+ collapsed: z26.boolean().optional(),
16069
+ get children() {
16070
+ return z26.array(block).max(100);
16071
+ }
16072
+ })
16073
+ };
16074
+ var blockSchemas = [text3, ...Object.values(blockTypes).filter((schema) => schema !== text3)];
16075
+ var block = z26.discriminatedUnion("type", blockSchemas);
16076
+ var MOTHERSHIP_BOARD_CONTAINER_TYPES = Object.entries(blockTypes).filter(([, schema]) => "children" in schema.shape).map(([type]) => type);
16077
+ var mothershipBoardBlocksSchema = z26.array(block).max(100).superRefine((blocks, ctx) => {
16078
+ const seen = /* @__PURE__ */ new Set();
16079
+ const visit = (node, path) => {
16080
+ if (typeof node === "string") return;
16081
+ if (node.id) {
16082
+ if (seen.has(node.id)) ctx.addIssue({ code: "custom", path: [...path, "id"], message: `Duplicate block id "${node.id}"` });
16083
+ seen.add(node.id);
16084
+ }
16085
+ if (node.type === "table") {
16086
+ node.children.forEach((child, index) => {
16087
+ if (child.cells.length > node.columns.length) ctx.addIssue({ code: "custom", path: [...path, "children", index, "cells"], message: `Row has ${child.cells.length} cells but the table has ${node.columns.length} columns` });
16088
+ });
16089
+ }
16090
+ if (node.type === "row") node.cells.forEach((cell, index) => visit(cell, [...path, "cells", index]));
16091
+ else if ("children" in node) node.children?.forEach((child, index) => visit(child, [...path, "children", index]));
16092
+ };
16093
+ blocks.forEach((node, index) => visit(node, [index]));
16094
+ });
16095
+ var mothershipBoardOperationsSchema = z26.array(z26.discriminatedUnion("op", [
16096
+ z26.object({ op: z26.literal("replace"), blocks: z26.array(block) }),
16097
+ z26.object({
16098
+ op: z26.literal("upsert"),
16099
+ block: z26.discriminatedUnion("type", [row, ...blockSchemas]).refine((value) => Boolean(value.id), { message: "Give the block an id", path: ["id"] }),
16100
+ parent_id: blockId.optional(),
16101
+ position: z26.number().int().min(0).optional()
16102
+ }),
16103
+ z26.object({ op: z26.literal("remove"), id: blockId })
16104
+ ])).min(1).max(50);
16105
+ var mothershipBoardItemRefSchema = z26.object({ mothershipId: z26.uuid(), block, occurrence: z26.number().int().min(0).optional() });
16106
+ var LINEAR_ISSUE_SUMMARIES_MAX = 50;
16107
+ var linearIssueSummariesRequestSchema = z26.object({ identifiers: z26.array(linearIdentifier).min(1).max(LINEAR_ISSUE_SUMMARIES_MAX) });
16108
+
15993
16109
  // ../shared/src/user-message-matching.ts
15994
16110
  var parsedTimestamps = /* @__PURE__ */ new Map();
15995
16111
  function parseTimestampMs(timestamp) {
@@ -19657,10 +19773,10 @@ function hasChatStarted(chat) {
19657
19773
  }
19658
19774
 
19659
19775
  // ../shared/src/routes/billing.ts
19660
- import { z as z26 } from "zod";
19776
+ import { z as z27 } from "zod";
19661
19777
  var SOURCE_LIMIT_SOURCES = ["limrun", "modal"];
19662
- var usageLimitCentsSchema = z26.number().int().min(100).max(1e8);
19663
- var sourceLimitsCentsSchema = z26.partialRecord(z26.enum(SOURCE_LIMIT_SOURCES), usageLimitCentsSchema);
19778
+ var usageLimitCentsSchema = z27.number().int().min(100).max(1e8);
19779
+ var sourceLimitsCentsSchema = z27.partialRecord(z27.enum(SOURCE_LIMIT_SOURCES), usageLimitCentsSchema);
19664
19780
 
19665
19781
  // ../shared/src/routes/codex.ts
19666
19782
  var CODEX_AUTH_ENV_KEYS = [
@@ -19814,7 +19930,7 @@ var CLAUDE_AUTH_ENV_KEYS_BY_METHOD = {
19814
19930
  };
19815
19931
 
19816
19932
  // ../shared/src/routes/command-protection.ts
19817
- import { z as z27 } from "zod";
19933
+ import { z as z28 } from "zod";
19818
19934
 
19819
19935
  // ../shared/src/git-invocations.ts
19820
19936
  var COMMIT_VALUE_OPTIONS = /* @__PURE__ */ new Set(["message", "file", "trailer", "reuse-message", "reedit-message", "fixup", "squash", "template", "author", "date", "cleanup", "pathspec-from-file"]);
@@ -19905,27 +20021,27 @@ function findCheckoutTarget(args) {
19905
20021
  }
19906
20022
 
19907
20023
  // ../shared/src/routes/command-protection.ts
19908
- var commandProtectionRepoStateSchema = z27.object({
19909
- branch: z27.string().nullable(),
19910
- defaultBranch: z27.string().nullable(),
19911
- pushBranch: z27.string().nullable(),
19912
- pushConfig: z27.string().nullable(),
19913
- headMessage: z27.string().nullable(),
19914
- mergeInProgress: z27.boolean().optional()
20024
+ var commandProtectionRepoStateSchema = z28.object({
20025
+ branch: z28.string().nullable(),
20026
+ defaultBranch: z28.string().nullable(),
20027
+ pushBranch: z28.string().nullable(),
20028
+ pushConfig: z28.string().nullable(),
20029
+ headMessage: z28.string().nullable(),
20030
+ mergeInProgress: z28.boolean().optional()
19915
20031
  });
19916
- var commandProtectionEvaluateRequestSchema = z27.object({
19917
- provider: z27.enum(["claude", "codex", "cursor", "opencode", "pi"]),
19918
- source: z27.enum(["claude_pre_tool_use", "codex_approval_request", "cursor_pre_tool_use", "opencode_pre_tool_use", "pi_tool_call"]),
19919
- toolName: z27.string(),
19920
- toolInput: z27.unknown(),
19921
- command: z27.string().nullish(),
19922
- cwd: z27.string().nullish(),
19923
- toolUseId: z27.string().nullish(),
20032
+ var commandProtectionEvaluateRequestSchema = z28.object({
20033
+ provider: z28.enum(["claude", "codex", "cursor", "opencode", "pi"]),
20034
+ source: z28.enum(["claude_pre_tool_use", "codex_approval_request", "cursor_pre_tool_use", "opencode_pre_tool_use", "pi_tool_call"]),
20035
+ toolName: z28.string(),
20036
+ toolInput: z28.unknown(),
20037
+ command: z28.string().nullish(),
20038
+ cwd: z28.string().nullish(),
20039
+ toolUseId: z28.string().nullish(),
19924
20040
  // Read by the engine before the command runs, keyed by absolute path, so the
19925
20041
  // policy can see branches and commit messages the command text only references.
19926
- gitContext: z27.object({
19927
- repos: z27.record(z27.string(), commandProtectionRepoStateSchema),
19928
- messageFiles: z27.record(z27.string(), z27.string())
20042
+ gitContext: z28.object({
20043
+ repos: z28.record(z28.string(), commandProtectionRepoStateSchema),
20044
+ messageFiles: z28.record(z28.string(), z28.string())
19929
20045
  }).optional()
19930
20046
  });
19931
20047
  var COMMAND_PROTECTION_COMMAND_KEYS = ["command", "cmd", "script", "query", "endpoint", "path", "url", "mutation"];
@@ -20145,119 +20261,119 @@ function shouldRefreshPullRequests(toolName, toolInput) {
20145
20261
  }
20146
20262
 
20147
20263
  // ../shared/src/routes/scout.ts
20148
- import { z as z28 } from "zod";
20264
+ import { z as z29 } from "zod";
20149
20265
  var SCOUT_LINEAR_ACTIONS = ["ask", "start"];
20150
- var scoutLinearSessionIntentRequestSchema = z28.object({
20151
- comment_id: z28.string().trim().min(1).describe("Id of the Linear comment the session will be created on."),
20152
- action: z28.enum(SCOUT_LINEAR_ACTIONS).describe("`ask` when the comment is a clarifying question, `start` when it hands off the task.")
20266
+ var scoutLinearSessionIntentRequestSchema = z29.object({
20267
+ comment_id: z29.string().trim().min(1).describe("Id of the Linear comment the session will be created on."),
20268
+ action: z29.enum(SCOUT_LINEAR_ACTIONS).describe("`ask` when the comment is a clarifying question, `start` when it hands off the task.")
20153
20269
  });
20154
- var scoutLinearStartRequestSchema = z28.object({
20155
- issue_id: z28.string().describe("Linear issue id from the envelope's `issue_id`."),
20156
- agent_session_id: z28.string().describe("Existing Linear agent session id from the envelope's `agent_session_id`."),
20157
- prompt: z28.string().trim().min(1).describe("The latest request, in its author's words. The workspace already receives the issue and its comments.")
20270
+ var scoutLinearStartRequestSchema = z29.object({
20271
+ issue_id: z29.string().describe("Linear issue id from the envelope's `issue_id`."),
20272
+ agent_session_id: z29.string().describe("Existing Linear agent session id from the envelope's `agent_session_id`."),
20273
+ prompt: z29.string().trim().min(1).describe("The latest request, in its author's words. The workspace already receives the issue and its comments.")
20158
20274
  });
20159
- var scoutRouteLinearTicketRequestSchema = z28.object({
20160
- agent_session_id: z28.string().trim().min(1).describe("The ticket's `agent_session_id` from the envelope."),
20161
- environment_id: z28.string().trim().min(1).optional().describe("Start the ticket in this environment."),
20162
- mothership_id: z28.string().trim().min(1).optional().describe("Hand the ticket to this Mothership instead.")
20275
+ var scoutRouteLinearTicketRequestSchema = z29.object({
20276
+ agent_session_id: z29.string().trim().min(1).describe("The ticket's `agent_session_id` from the envelope."),
20277
+ environment_id: z29.string().trim().min(1).optional().describe("Start the ticket in this environment."),
20278
+ mothership_id: z29.string().trim().min(1).optional().describe("Hand the ticket to this Mothership instead.")
20163
20279
  }).refine((args) => !(args.environment_id && args.mothership_id), "Pass environment_id or mothership_id, not both.");
20164
- var slackChannelIdSchema = z28.string().describe("Slack channel id from the envelope's `channel_id`.");
20165
- var slackThreadTsSchema = z28.string().describe("Slack thread timestamp from the envelope's `thread_ts`.");
20166
- var scoutSlackMessageReferenceSchema = z28.object({
20280
+ var slackChannelIdSchema = z29.string().describe("Slack channel id from the envelope's `channel_id`.");
20281
+ var slackThreadTsSchema = z29.string().describe("Slack thread timestamp from the envelope's `thread_ts`.");
20282
+ var scoutSlackMessageReferenceSchema = z29.object({
20167
20283
  channel_id: slackChannelIdSchema,
20168
20284
  thread_ts: slackThreadTsSchema,
20169
- message_ts: z28.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
20170
- user_id: z28.string().describe("Slack user id of that message's author (the envelope's `user_id`).")
20285
+ message_ts: z29.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
20286
+ user_id: z29.string().describe("Slack user id of that message's author (the envelope's `user_id`).")
20171
20287
  });
20172
- var scoutSlackSpawnRequestSchema = z28.object({
20288
+ var scoutSlackSpawnRequestSchema = z29.object({
20173
20289
  channel_id: slackChannelIdSchema,
20174
20290
  thread_ts: slackThreadTsSchema,
20175
- message_ts: z28.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."),
20176
- user_id: z28.string().describe("Slack user id of that message's author (the envelope's `user_id`). The workspace is attributed to them."),
20177
- prompt: z28.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."),
20178
- acknowledgement_ts: z28.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."),
20179
- environment_id: z28.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.`)
20291
+ message_ts: z29.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."),
20292
+ user_id: z29.string().describe("Slack user id of that message's author (the envelope's `user_id`). The workspace is attributed to them."),
20293
+ prompt: z29.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."),
20294
+ acknowledgement_ts: z29.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."),
20295
+ environment_id: z29.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.`)
20180
20296
  });
20181
20297
  var scoutSlackSpawnInNewThreadRequestSchema = scoutSlackSpawnRequestSchema.extend({
20182
- title: z28.string().trim().min(1).max(500).describe("One or two sentences stating the task, posted as the new top-level message."),
20183
- prompt: z28.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."),
20184
- acknowledgement_ts: z28.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.")
20298
+ title: z29.string().trim().min(1).max(500).describe("One or two sentences stating the task, posted as the new top-level message."),
20299
+ prompt: z29.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."),
20300
+ acknowledgement_ts: z29.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.")
20185
20301
  });
20186
- var scoutSlackRelayRequestSchema = z28.object({
20302
+ var scoutSlackRelayRequestSchema = z29.object({
20187
20303
  channel_id: slackChannelIdSchema,
20188
20304
  thread_ts: slackThreadTsSchema,
20189
- message: z28.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."),
20190
- user_id: z28.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`."),
20191
- queue: z28.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."),
20192
- workspace_id: z28.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.`),
20193
- message_ts: z28.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.")
20305
+ message: z29.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."),
20306
+ user_id: z29.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`."),
20307
+ queue: z29.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."),
20308
+ workspace_id: z29.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.`),
20309
+ message_ts: z29.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.")
20194
20310
  });
20195
- var scoutSlackSetThreadMutedRequestSchema = z28.object({
20311
+ var scoutSlackSetThreadMutedRequestSchema = z29.object({
20196
20312
  channel_id: slackChannelIdSchema,
20197
20313
  thread_ts: slackThreadTsSchema,
20198
- muted: z28.boolean().describe("true to mute Replicas in this thread, false to unmute it.")
20314
+ muted: z29.boolean().describe("true to mute Replicas in this thread, false to unmute it.")
20199
20315
  });
20200
20316
  var scoutSlackStopWorkspaceRequestSchema = scoutSlackMessageReferenceSchema.extend({
20201
- archive: z28.boolean().describe("true only when the person also asked to close or archive the workspace.")
20317
+ archive: z29.boolean().describe("true only when the person also asked to close or archive the workspace.")
20202
20318
  });
20203
- var scoutListWorkspacesRequestSchema = z28.object({
20319
+ var scoutListWorkspacesRequestSchema = z29.object({
20204
20320
  channel_id: slackChannelIdSchema,
20205
20321
  thread_ts: slackThreadTsSchema,
20206
- message_ts: z28.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
20207
- user_id: z28.string().describe("Slack user id of that message's author (the envelope's `user_id`). Only workspaces they can see are listed."),
20208
- query: z28.string().trim().min(1).optional().describe("Case-insensitive text to match against workspace and Mothership names and pull request URLs.")
20322
+ message_ts: z29.string().describe("The envelope's `message_ts`. The server verifies this message and its author."),
20323
+ user_id: z29.string().describe("Slack user id of that message's author (the envelope's `user_id`). Only workspaces they can see are listed."),
20324
+ query: z29.string().trim().min(1).optional().describe("Case-insensitive text to match against workspace and Mothership names and pull request URLs.")
20209
20325
  });
20210
- var scoutSlackConfirmationSchema = z28.object({
20211
- confirmation_channel_id: z28.string().describe("`channel_id` from the envelope of the Slack message that asked for or accepted this."),
20212
- confirmation_thread_ts: z28.string().describe("`thread_ts` from that message's envelope."),
20213
- confirmation_message_ts: z28.string().describe("`message_ts` from that message's envelope."),
20214
- confirmation_user_id: z28.string().describe("`user_id` from that message's envelope.")
20326
+ var scoutSlackConfirmationSchema = z29.object({
20327
+ confirmation_channel_id: z29.string().describe("`channel_id` from the envelope of the Slack message that asked for or accepted this."),
20328
+ confirmation_thread_ts: z29.string().describe("`thread_ts` from that message's envelope."),
20329
+ confirmation_message_ts: z29.string().describe("`message_ts` from that message's envelope."),
20330
+ confirmation_user_id: z29.string().describe("`user_id` from that message's envelope.")
20215
20331
  });
20216
20332
  var scoutAutomationToolInputSchema = automationToolInputSchema.extend(scoutSlackConfirmationSchema.shape);
20217
20333
  var scoutSaveChannelPresetToolInputSchema = scoutSlackConfirmationSchema.extend({
20218
- preset_id: z28.string().optional().describe(`Id of the preset to update, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`. Omit to create a new preset.`),
20219
- name: z28.string().trim().min(1).max(SCOUT_PRESET_NAME_MAX_LENGTH).optional().describe("Preset name. Required when creating."),
20220
- description: z28.string().optional().describe("One-line summary shown in settings."),
20221
- icon: z28.enum(SCOUT_PRESET_ICONS).optional(),
20222
- instructions: z28.string().optional().describe("Complete preset instructions; replaces the existing text. Required when creating.")
20334
+ preset_id: z29.string().optional().describe(`Id of the preset to update, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`. Omit to create a new preset.`),
20335
+ name: z29.string().trim().min(1).max(SCOUT_PRESET_NAME_MAX_LENGTH).optional().describe("Preset name. Required when creating."),
20336
+ description: z29.string().optional().describe("One-line summary shown in settings."),
20337
+ icon: z29.enum(SCOUT_PRESET_ICONS).optional(),
20338
+ instructions: z29.string().optional().describe("Complete preset instructions; replaces the existing text. Required when creating.")
20223
20339
  });
20224
20340
  var scoutUpdateChannelSettingsToolInputSchema = scoutSlackConfirmationSchema.extend({
20225
- source: z28.enum(SCOUT_SOURCE_TYPES).optional().describe("Defaults to `slack`."),
20226
- external_id: z28.string().describe("Slack channel id or Linear team id."),
20227
- monitored: z28.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."),
20228
- preset_id: z28.string().nullable().optional().describe("Preset to assign; `null` removes the preset. Omit to keep it."),
20229
- instructions: z28.string().nullable().optional().describe("Complete channel-specific instructions, applied after the preset; replaces the existing text. `null` clears them. Omit to keep them."),
20230
- proactivity: z28.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."),
20231
- muted: z28.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.`)
20341
+ source: z29.enum(SCOUT_SOURCE_TYPES).optional().describe("Defaults to `slack`."),
20342
+ external_id: z29.string().describe("Slack channel id or Linear team id."),
20343
+ monitored: z29.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."),
20344
+ preset_id: z29.string().nullable().optional().describe("Preset to assign; `null` removes the preset. Omit to keep it."),
20345
+ instructions: z29.string().nullable().optional().describe("Complete channel-specific instructions, applied after the preset; replaces the existing text. `null` clears them. Omit to keep them."),
20346
+ proactivity: z29.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."),
20347
+ muted: z29.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.`)
20232
20348
  });
20233
20349
  var scoutSetSlackConnectMutedToolInputSchema = scoutSlackConfirmationSchema.extend({
20234
- muted: z28.boolean().describe("`true` mutes Replicas in every Slack Connect channel without its own setting; `false` lets them follow their levels again.")
20350
+ muted: z29.boolean().describe("`true` mutes Replicas in every Slack Connect channel without its own setting; `false` lets them follow their levels again.")
20235
20351
  });
20236
20352
  var scoutSetSlackConnectDefaultsToolInputSchema = scoutSetSlackConnectMutedToolInputSchema.partial({ muted: true }).extend({
20237
- preset_id: z28.string().optional().describe("Preset for every Slack Connect channel without its own preset or instructions; an empty string removes it. Omit to keep it."),
20238
- instructions: z28.string().optional().describe("Complete default instructions, applied after that preset; replaces the existing text. An empty string clears them. Omit to keep them."),
20239
- proactivity: z28.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.")
20353
+ preset_id: z29.string().optional().describe("Preset for every Slack Connect channel without its own preset or instructions; an empty string removes it. Omit to keep it."),
20354
+ instructions: z29.string().optional().describe("Complete default instructions, applied after that preset; replaces the existing text. An empty string clears them. Omit to keep them."),
20355
+ proactivity: z29.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.")
20240
20356
  });
20241
20357
  var scoutSetOrganizationProactivityToolInputSchema = scoutSlackConfirmationSchema.extend({
20242
- proactivity: z28.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.`)
20358
+ proactivity: z29.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.`)
20243
20359
  });
20244
20360
  var scoutDeleteChannelPresetToolInputSchema = scoutSlackConfirmationSchema.extend({
20245
- preset_id: z28.string().describe(`Id of the preset to delete, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`.`)
20361
+ preset_id: z29.string().describe(`Id of the preset to delete, from \`${REPLICAS_MCP_TOOLS.listChannelSettings}\`.`)
20246
20362
  });
20247
20363
  var RESET_TO_DEFAULT = "default";
20248
- var resettable = (schema, description) => z28.union([schema, z28.literal(RESET_TO_DEFAULT)]).optional().describe(`${description} \`${RESET_TO_DEFAULT}\` falls back to the organization default. Omit to keep it.`);
20364
+ var resettable = (schema, description) => z29.union([schema, z29.literal(RESET_TO_DEFAULT)]).optional().describe(`${description} \`${RESET_TO_DEFAULT}\` falls back to the organization default. Omit to keep it.`);
20249
20365
  var scoutSetSlackAgentDefaultsToolInputSchema = scoutSlackConfirmationSchema.extend({
20250
- agent_provider: resettable(z28.enum(AGENT), "Agent for Slack-triggered workspaces. Changing it without `model` resets the model to that agent's default."),
20251
- model: resettable(z28.string(), "Model id for that agent; the default is the agent's own."),
20252
- thinking_level: resettable(z28.enum(VALID_THINKING_LEVELS), "Thinking level."),
20253
- goal_mode: resettable(z28.boolean(), "Goal mode."),
20254
- fast_mode: resettable(z28.boolean(), "Fast mode.")
20366
+ agent_provider: resettable(z29.enum(AGENT), "Agent for Slack-triggered workspaces. Changing it without `model` resets the model to that agent's default."),
20367
+ model: resettable(z29.string(), "Model id for that agent; the default is the agent's own."),
20368
+ thinking_level: resettable(z29.enum(VALID_THINKING_LEVELS), "Thinking level."),
20369
+ goal_mode: resettable(z29.boolean(), "Goal mode."),
20370
+ fast_mode: resettable(z29.boolean(), "Fast mode.")
20255
20371
  });
20256
- var scoutClaimSettingsOfferToolInputSchema = z28.object({
20372
+ var scoutClaimSettingsOfferToolInputSchema = z29.object({
20257
20373
  channel_id: slackChannelIdSchema,
20258
- kind: z28.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."),
20259
- user_id: z28.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."),
20260
- declined: z28.boolean().optional().describe("true when the person declined an offer you already made, so it is not made again.")
20374
+ kind: z29.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."),
20375
+ user_id: z29.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."),
20376
+ declined: z29.boolean().optional().describe("true when the person declined an offer you already made, so it is not made again.")
20261
20377
  });
20262
20378
 
20263
20379
  // ../shared/src/routes/plugin-catalog.ts
@@ -20615,22 +20731,22 @@ var PLUGIN_CATALOG = [
20615
20731
  ].map((plugin) => ({ ...plugin, readOnlyScopes: READ_ONLY_SCOPES[plugin.id] }));
20616
20732
 
20617
20733
  // ../shared/src/routes/sentry.ts
20618
- import { z as z29 } from "zod";
20619
- var sentrySelfHostedConnectRequestSchema = z29.object({
20620
- baseUrl: z29.string().min(1),
20621
- token: z29.string().trim().min(1),
20622
- webhookSecret: z29.string().trim().optional()
20734
+ import { z as z30 } from "zod";
20735
+ var sentrySelfHostedConnectRequestSchema = z30.object({
20736
+ baseUrl: z30.string().min(1),
20737
+ token: z30.string().trim().min(1),
20738
+ webhookSecret: z30.string().trim().optional()
20623
20739
  });
20624
20740
 
20625
20741
  // ../shared/src/routes/user.ts
20626
20742
  var PROFILE_AVATAR_MAX_SIZE_BYTES = 5 * 1024 * 1024;
20627
20743
 
20628
20744
  // ../shared/src/routes/web-auth.ts
20629
- import { z as z30 } from "zod";
20630
- var webAuthRedeemResponseSchema = z30.object({
20631
- path: z30.string(),
20632
- organizationId: z30.string().nullable(),
20633
- session: z30.object({ access_token: z30.string(), refresh_token: z30.string(), user: z30.object({ id: z30.string(), email: z30.string() }) }).nullable()
20745
+ import { z as z31 } from "zod";
20746
+ var webAuthRedeemResponseSchema = z31.object({
20747
+ path: z31.string(),
20748
+ organizationId: z31.string().nullable(),
20749
+ session: z31.object({ access_token: z31.string(), refresh_token: z31.string(), user: z31.object({ id: z31.string(), email: z31.string() }) }).nullable()
20634
20750
  });
20635
20751
 
20636
20752
  // ../shared/src/routes/client-state.ts
@@ -20653,81 +20769,81 @@ var promptHistoryClientStateKey = orgUserClientStateKey(PROMPT_HISTORY_CLIENT_ST
20653
20769
  var workspaceSearchOpensClientStateKey = orgUserClientStateKey(WORKSPACE_SEARCH_OPENS_CLIENT_STATE_KEY_PREFIX);
20654
20770
 
20655
20771
  // ../shared/src/routes/workspace-events.ts
20656
- import { z as z31 } from "zod";
20657
- var workspaceTurnCompletionSchema = z31.object({
20658
- workspaceName: z31.string(),
20659
- completedAt: z31.string(),
20660
- processing: z31.boolean().optional(),
20661
- pullRequestFeedback: z31.boolean().optional(),
20662
- attention: z31.object({ reason: z31.enum(CHAT_ATTENTION_REASONS), userId: z31.string() }).optional()
20772
+ import { z as z32 } from "zod";
20773
+ var workspaceTurnCompletionSchema = z32.object({
20774
+ workspaceName: z32.string(),
20775
+ completedAt: z32.string(),
20776
+ processing: z32.boolean().optional(),
20777
+ pullRequestFeedback: z32.boolean().optional(),
20778
+ attention: z32.object({ reason: z32.enum(CHAT_ATTENTION_REASONS), userId: z32.string() }).optional()
20663
20779
  });
20664
- var workspaceChangedEventSchema = z31.discriminatedUnion("type", [
20665
- z31.object({
20666
- type: z31.literal("workspace.changed"),
20667
- workspaceId: z31.string(),
20668
- workspace: z31.object({ status: z31.enum(WORKSPACE_STATUSES), last_activity_at: z31.string().nullable() }).optional(),
20780
+ var workspaceChangedEventSchema = z32.discriminatedUnion("type", [
20781
+ z32.object({
20782
+ type: z32.literal("workspace.changed"),
20783
+ workspaceId: z32.string(),
20784
+ workspace: z32.object({ status: z32.enum(WORKSPACE_STATUSES), last_activity_at: z32.string().nullable() }).optional(),
20669
20785
  completion: workspaceTurnCompletionSchema.optional(),
20670
- ts: z31.string()
20786
+ ts: z32.string()
20671
20787
  }),
20672
- z31.object({
20673
- type: z31.literal("workspace.chat.changed"),
20674
- workspaceId: z31.string(),
20675
- chatId: z31.string(),
20676
- ts: z31.string()
20788
+ z32.object({
20789
+ type: z32.literal("workspace.chat.changed"),
20790
+ workspaceId: z32.string(),
20791
+ chatId: z32.string(),
20792
+ ts: z32.string()
20677
20793
  }),
20678
- z31.object({
20679
- type: z31.literal("workspace.chat.advanced"),
20680
- workspaceId: z31.string(),
20681
- chatId: z31.string(),
20682
- afterCursor: z31.string().optional(),
20683
- processing: z31.boolean(),
20684
- ts: z31.string()
20794
+ z32.object({
20795
+ type: z32.literal("workspace.chat.advanced"),
20796
+ workspaceId: z32.string(),
20797
+ chatId: z32.string(),
20798
+ afterCursor: z32.string().optional(),
20799
+ processing: z32.boolean(),
20800
+ ts: z32.string()
20685
20801
  }),
20686
- z31.object({ type: z31.literal("presence.changed"), ts: z31.string() }),
20687
- z31.object({
20688
- type: z31.literal("mobile-testing.changed"),
20689
- workspaceId: z31.string(),
20690
- ts: z31.string()
20802
+ z32.object({ type: z32.literal("presence.changed"), ts: z32.string() }),
20803
+ z32.object({
20804
+ type: z32.literal("mobile-testing.changed"),
20805
+ workspaceId: z32.string(),
20806
+ ts: z32.string()
20691
20807
  }),
20692
- z31.object({
20693
- type: z31.literal("variable-request.changed"),
20694
- workspaceId: z31.string(),
20695
- ts: z31.string()
20808
+ z32.object({
20809
+ type: z32.literal("variable-request.changed"),
20810
+ workspaceId: z32.string(),
20811
+ ts: z32.string()
20696
20812
  }),
20697
- z31.object({
20698
- type: z31.literal("pull-request.changed"),
20699
- prUrl: z31.string(),
20700
- ts: z31.string()
20813
+ z32.object({
20814
+ type: z32.literal("pull-request.changed"),
20815
+ prUrl: z32.string(),
20816
+ ts: z32.string()
20701
20817
  }),
20702
- z31.object({
20703
- type: z31.literal("mothership.subagent.changed"),
20704
- workspaceId: z31.string(),
20705
- subagent: z31.object({ id: z31.string(), name: z31.string(), prUrl: z31.string().nullable() }),
20706
- ts: z31.string()
20818
+ z32.object({
20819
+ type: z32.literal("mothership.subagent.changed"),
20820
+ workspaceId: z32.string(),
20821
+ subagent: z32.object({ id: z32.string(), name: z32.string(), prUrl: z32.string().nullable() }),
20822
+ ts: z32.string()
20707
20823
  }),
20708
- z31.object({ type: z31.literal("needs-you.changed"), workspaceId: z31.string().nullable(), ts: z31.string() })
20824
+ z32.object({ type: z32.literal("needs-you.changed"), workspaceId: z32.string().nullable(), ts: z32.string() })
20709
20825
  ]);
20710
20826
 
20711
20827
  // ../shared/src/routes/presence.ts
20712
- import { z as z32 } from "zod";
20713
- var presenceStatusSchema = z32.enum(["online", "typing"]);
20714
- var presenceLocationSchema = z32.object({
20715
- workspaceId: z32.string().optional()
20828
+ import { z as z33 } from "zod";
20829
+ var presenceStatusSchema = z33.enum(["online", "typing"]);
20830
+ var presenceLocationSchema = z33.object({
20831
+ workspaceId: z33.string().optional()
20716
20832
  });
20717
- var presenceEntrySchema = z32.object({
20718
- userId: z32.string(),
20833
+ var presenceEntrySchema = z33.object({
20834
+ userId: z33.string(),
20719
20835
  status: presenceStatusSchema,
20720
20836
  location: presenceLocationSchema,
20721
- ts: z32.string()
20837
+ ts: z33.string()
20722
20838
  });
20723
- var updatePresenceRequestSchema = z32.object({
20839
+ var updatePresenceRequestSchema = z33.object({
20724
20840
  status: presenceStatusSchema,
20725
20841
  location: presenceLocationSchema.optional()
20726
20842
  });
20727
20843
 
20728
20844
  // ../shared/src/routes/review-messages.ts
20729
- import { z as z33 } from "zod";
20730
- var sendPullRequestReviewMessageRequestSchema = z33.object({
20845
+ import { z as z34 } from "zod";
20846
+ var sendPullRequestReviewMessageRequestSchema = z34.object({
20731
20847
  ...sendChatMessageRequestSchema.pick({
20732
20848
  message: true,
20733
20849
  messageId: true,
@@ -20740,8 +20856,8 @@ var sendPullRequestReviewMessageRequestSchema = z33.object({
20740
20856
  ultrafastMode: true
20741
20857
  }).shape,
20742
20858
  /** Starts a new chat instead of continuing the PR's review chat. The provider only applies to a new chat. */
20743
- newChat: z33.boolean().optional(),
20744
- provider: z33.enum(VALID_AGENT_PROVIDERS).optional()
20859
+ newChat: z34.boolean().optional(),
20860
+ provider: z34.enum(VALID_AGENT_PROVIDERS).optional()
20745
20861
  });
20746
20862
 
20747
20863
  // ../shared/src/audit-log.ts
@@ -20962,145 +21078,32 @@ function isSkillRegistryManifest(value) {
20962
21078
  }
20963
21079
 
20964
21080
  // ../shared/src/routes/variable-requests.ts
20965
- import { z as z34 } from "zod";
21081
+ import { z as z35 } from "zod";
20966
21082
  var VARIABLE_REQUEST_WAIT = { defaultMs: 10 * 6e4, maxMs: 30 * 6e4, pollMs: 3e3, waiterStaleMs: 15e3 };
20967
21083
  var VARIABLE_REQUEST_DESTINATIONS = ["environment", "workspace"];
20968
- var requestedVariableSchema = z34.object({
20969
- key: z34.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name").max(ENVIRONMENT_SETUP_LIMITS.variableKeyChars),
20970
- required: z34.boolean(),
20971
- replace: z34.boolean().optional()
21084
+ var requestedVariableSchema = z35.object({
21085
+ key: z35.string().regex(VARIABLE_KEY_RE, "must be a valid environment variable name").max(ENVIRONMENT_SETUP_LIMITS.variableKeyChars),
21086
+ required: z35.boolean(),
21087
+ replace: z35.boolean().optional()
20972
21088
  });
20973
- var requestedVariablesSchema = z34.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");
20974
- var createVariableRequestSchema = z34.object({
21089
+ var requestedVariablesSchema = z35.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");
21090
+ var createVariableRequestSchema = z35.object({
20975
21091
  variables: requestedVariablesSchema,
20976
- reason: z34.string().trim().max(500).nullish().transform((value) => value || null),
20977
- wait: z34.boolean().default(true)
21092
+ reason: z35.string().trim().max(500).nullish().transform((value) => value || null),
21093
+ wait: z35.boolean().default(true)
20978
21094
  });
20979
- var respondVariableRequestSchema = z34.discriminatedUnion("action", [
20980
- z34.object({
20981
- action: z34.literal("provide"),
20982
- destination: z34.enum(VARIABLE_REQUEST_DESTINATIONS),
21095
+ var respondVariableRequestSchema = z35.discriminatedUnion("action", [
21096
+ z35.object({
21097
+ action: z35.literal("provide"),
21098
+ destination: z35.enum(VARIABLE_REQUEST_DESTINATIONS),
20983
21099
  /** Defaults to the workspace's environment, so older clients keep saving there. */
20984
- environment_ids: z34.array(z34.string().uuid()).optional(),
20985
- overwrite: z34.boolean().optional(),
20986
- values: z34.record(z34.string().regex(VARIABLE_KEY_RE), z34.string())
21100
+ environment_ids: z35.array(z35.string().uuid()).optional(),
21101
+ overwrite: z35.boolean().optional(),
21102
+ values: z35.record(z35.string().regex(VARIABLE_KEY_RE), z35.string())
20987
21103
  }),
20988
- z34.object({ action: z34.literal("skip") })
21104
+ z35.object({ action: z35.literal("skip") })
20989
21105
  ]);
20990
21106
 
20991
- // ../shared/src/mothership-board.ts
20992
- import { z as z35 } from "zod";
20993
- var MOTHERSHIP_BOARD_TONES = ["neutral", "needs_you", "warning", "success", "danger", "working"];
20994
- var label = (max) => z35.string().trim().min(1).max(max);
20995
- var tone = z35.enum(MOTHERSHIP_BOARD_TONES);
20996
- var blockId = z35.string().regex(/^[\w.:-]{1,64}$/, "Use 1-64 letters, digits, _, -, . or :");
20997
- var httpsUrl = z35.url({ protocol: /^https$/, error: "Must be an https URL" });
20998
- var prUrl = httpsUrl.refine((url) => parseCodeHostPrUrl(url) !== null, "Must be a GitHub pull request or GitLab merge request URL");
20999
- var linearIdentifier = z35.string().regex(/^[A-Za-z][A-Za-z0-9]{0,9}-\d{1,7}$/, "Use a Linear identifier such as REP-123");
21000
- var action = z35.discriminatedUnion("type", [
21001
- z35.object({ type: z35.literal("open_ship"), workspace_id: z35.uuid() }),
21002
- z35.object({ type: z35.literal("message_ship"), workspace_id: z35.uuid(), message: label(4e3) }),
21003
- z35.object({ type: z35.literal("open_pr"), url: prUrl }),
21004
- z35.object({ type: z35.literal("merge_pr"), url: prUrl }),
21005
- z35.object({ type: z35.literal("message_mothership"), message: label(4e3) }),
21006
- z35.object({ type: z35.literal("open_link"), url: httpsUrl })
21007
- ]);
21008
- var text3 = z35.object({ type: z35.literal("text"), id: blockId.optional(), text: label(2e3) });
21009
- var badge = z35.object({ type: z35.literal("badge"), id: blockId.optional(), label: label(40), tone: tone.optional() });
21010
- var pr = z35.object({ type: z35.literal("pr"), id: blockId.optional(), url: prUrl });
21011
- var ship = z35.object({ type: z35.literal("ship"), id: blockId.optional(), workspace_id: z35.uuid() });
21012
- var linear = z35.object({ type: z35.literal("linear"), id: blockId.optional(), identifier: linearIdentifier });
21013
- var button = z35.object({ type: z35.literal("button"), id: blockId.optional(), label: label(60), action, variant: z35.enum(["primary", "outline", "warning", "destructive"]).optional(), resolves: blockId.optional() });
21014
- var steps = z35.object({
21015
- type: z35.literal("steps"),
21016
- id: blockId.optional(),
21017
- steps: z35.array(z35.object({ label: label(30), state: z35.enum(["done", "current", "pending", "failed"]) })).min(1).max(8)
21018
- });
21019
- var inline = z35.discriminatedUnion("type", [text3, badge, pr, ship, linear, button, steps]);
21020
- var row = z35.object({ type: z35.literal("row"), id: blockId.optional(), cells: z35.array(z35.union([label(500), inline])).min(1).max(6) });
21021
- var blockTypes = {
21022
- text: text3,
21023
- badge,
21024
- pr,
21025
- ship,
21026
- linear,
21027
- button,
21028
- steps,
21029
- stat: z35.object({ type: z35.literal("stat"), id: blockId.optional(), label: label(40), value: label(40), tone: tone.optional() }),
21030
- divider: z35.object({ type: z35.literal("divider"), id: blockId.optional() }),
21031
- updated_at: z35.object({ type: z35.literal("updated_at"), id: blockId.optional() }),
21032
- choice: z35.object({
21033
- type: z35.literal("choice"),
21034
- id: blockId.optional(),
21035
- question: label(500),
21036
- options: z35.array(z35.object({ label: label(60), message: label(2e3).optional() })).min(2).max(6),
21037
- resolves: blockId.optional()
21038
- }),
21039
- button_group: z35.object({ type: z35.literal("button_group"), id: blockId.optional(), children: z35.array(button).min(1).max(8) }),
21040
- table: z35.object({ type: z35.literal("table"), id: blockId.optional(), columns: z35.array(label(40)).min(1).max(6), children: z35.array(row).max(100) }),
21041
- callout: z35.object({
21042
- type: z35.literal("callout"),
21043
- id: blockId.optional(),
21044
- tone,
21045
- title: label(120).optional(),
21046
- get children() {
21047
- return z35.array(block).max(20).optional();
21048
- }
21049
- }),
21050
- list: z35.object({
21051
- type: z35.literal("list"),
21052
- id: blockId.optional(),
21053
- ordered: z35.boolean().optional(),
21054
- get children() {
21055
- return z35.array(block).max(100);
21056
- }
21057
- }),
21058
- section: z35.object({
21059
- type: z35.literal("section"),
21060
- id: blockId.optional(),
21061
- title: label(120),
21062
- tone: tone.optional(),
21063
- collapsed: z35.boolean().optional(),
21064
- get children() {
21065
- return z35.array(block).max(100);
21066
- }
21067
- })
21068
- };
21069
- var blockSchemas = [text3, ...Object.values(blockTypes).filter((schema) => schema !== text3)];
21070
- var block = z35.discriminatedUnion("type", blockSchemas);
21071
- var MOTHERSHIP_BOARD_CONTAINER_TYPES = Object.entries(blockTypes).filter(([, schema]) => "children" in schema.shape).map(([type]) => type);
21072
- var mothershipBoardBlocksSchema = z35.array(block).max(100).superRefine((blocks, ctx) => {
21073
- const seen = /* @__PURE__ */ new Set();
21074
- const visit = (node, path) => {
21075
- if (typeof node === "string") return;
21076
- if (node.id) {
21077
- if (seen.has(node.id)) ctx.addIssue({ code: "custom", path: [...path, "id"], message: `Duplicate block id "${node.id}"` });
21078
- seen.add(node.id);
21079
- }
21080
- if (node.type === "table") {
21081
- node.children.forEach((child, index) => {
21082
- if (child.cells.length > node.columns.length) ctx.addIssue({ code: "custom", path: [...path, "children", index, "cells"], message: `Row has ${child.cells.length} cells but the table has ${node.columns.length} columns` });
21083
- });
21084
- }
21085
- if (node.type === "row") node.cells.forEach((cell, index) => visit(cell, [...path, "cells", index]));
21086
- else if ("children" in node) node.children?.forEach((child, index) => visit(child, [...path, "children", index]));
21087
- };
21088
- blocks.forEach((node, index) => visit(node, [index]));
21089
- });
21090
- var mothershipBoardOperationsSchema = z35.array(z35.discriminatedUnion("op", [
21091
- z35.object({ op: z35.literal("replace"), blocks: z35.array(block) }),
21092
- z35.object({
21093
- op: z35.literal("upsert"),
21094
- block: z35.discriminatedUnion("type", [row, ...blockSchemas]).refine((value) => Boolean(value.id), { message: "Give the block an id", path: ["id"] }),
21095
- parent_id: blockId.optional(),
21096
- position: z35.number().int().min(0).optional()
21097
- }),
21098
- z35.object({ op: z35.literal("remove"), id: blockId })
21099
- ])).min(1).max(50);
21100
- var mothershipBoardItemRefSchema = z35.object({ mothershipId: z35.uuid(), block, occurrence: z35.number().int().min(0).optional() });
21101
- var LINEAR_ISSUE_SUMMARIES_MAX = 50;
21102
- var linearIssueSummariesRequestSchema = z35.object({ identifiers: z35.array(linearIdentifier).min(1).max(LINEAR_ISSUE_SUMMARIES_MAX) });
21103
-
21104
21107
  export {
21105
21108
  ENGINE_SEND_MESSAGE_FAILED_ERROR,
21106
21109
  isRecord,
@@ -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-MSZUJKIX.js";
7
- import "./chunk-FQV2HJH6.js";
8
- import "./chunk-GTEK55CB.js";
6
+ } from "./chunk-SQAPHXYM.js";
7
+ import "./chunk-CL4X2AS5.js";
8
+ import "./chunk-SNCGBKDP.js";
9
9
  import {
10
10
  isRecord
11
11
  } from "./chunk-UZSNFLDQ.js";
12
- import "./chunk-FLB2IR7V.js";
12
+ import "./chunk-VMUHW24C.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-PPI7EQGY.js";
17
+ } from "./chunk-UGHOT7Y3.js";
18
18
  import {
19
19
  AppServerProcess,
20
20
  buildCodexAgentEnv
21
- } from "./chunk-X5AP6KN6.js";
22
- import "./chunk-GTEK55CB.js";
21
+ } from "./chunk-EJ6YBNEJ.js";
22
+ import "./chunk-SNCGBKDP.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-FLB2IR7V.js";
32
+ } from "./chunk-VMUHW24C.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-MSZUJKIX.js";
30
+ } from "./chunk-SQAPHXYM.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-PPI7EQGY.js";
68
+ } from "./chunk-UGHOT7Y3.js";
69
69
  import {
70
70
  publishedPullRequestUrls
71
- } from "./chunk-X5C5KK3Q.js";
71
+ } from "./chunk-Q6OCEIPE.js";
72
72
  import {
73
73
  ACCOUNT_RATE_LIMITS_READ_METHOD,
74
74
  AsyncLock,
@@ -143,7 +143,7 @@ import {
143
143
  timestampFromSeconds,
144
144
  upsertCredentialFileLines,
145
145
  writeSecureCredentialFile
146
- } from "./chunk-V4T4E227.js";
146
+ } from "./chunk-PLN56LA5.js";
147
147
  import {
148
148
  ENGINE_ENV,
149
149
  monolithRequest,
@@ -153,15 +153,15 @@ import {
153
153
  resolveDiffBase,
154
154
  setAgentCredentialSnapshot,
155
155
  setLinearSessionId
156
- } from "./chunk-FQV2HJH6.js";
156
+ } from "./chunk-CL4X2AS5.js";
157
157
  import {
158
158
  getCodexModelProvider
159
- } from "./chunk-X5AP6KN6.js";
159
+ } from "./chunk-EJ6YBNEJ.js";
160
160
  import {
161
161
  SUBPROCESS_MAX_BUFFER,
162
162
  execAsync,
163
163
  execFileAsync
164
- } from "./chunk-GTEK55CB.js";
164
+ } from "./chunk-SNCGBKDP.js";
165
165
  import {
166
166
  isRecord as isRecord2
167
167
  } from "./chunk-UZSNFLDQ.js";
@@ -433,7 +433,7 @@ import {
433
433
  workspaceTokenRequestSchema,
434
434
  workspaceTokenResponseSchema,
435
435
  wrapInTag
436
- } from "./chunk-FLB2IR7V.js";
436
+ } from "./chunk-VMUHW24C.js";
437
437
  import {
438
438
  cloneMcpConfig,
439
439
  ensureCompatibilityImports,
@@ -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-X5C5KK3Q.js";
6
+ } from "./chunk-Q6OCEIPE.js";
7
7
  import {
8
8
  isRecord
9
9
  } from "./chunk-UZSNFLDQ.js";
10
10
  import {
11
11
  shouldRefreshPullRequests
12
- } from "./chunk-FLB2IR7V.js";
12
+ } from "./chunk-VMUHW24C.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-FLB2IR7V.js";
14
+ } from "./chunk-VMUHW24C.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.1437",
3
+ "version": "0.1.1439",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",