replicas-cli 0.2.765 → 0.2.767

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.
Files changed (2) hide show
  1. package/dist/index.cjs +64 -92
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -7711,29 +7711,19 @@ var AGENT = {
7711
7711
  CURSOR: "cursor",
7712
7712
  MUSE: "muse",
7713
7713
  OPENCODE: "opencode",
7714
- PI: "pi",
7715
- RELAY: "relay"
7714
+ PI: "pi"
7716
7715
  };
7717
7716
  var VALID_AGENT_PROVIDERS = Object.values(AGENT);
7718
- var VALID_RELAY_SUBAGENT_PROVIDERS = VALID_AGENT_PROVIDERS;
7719
- var VALID_RELAY_BASE_PROVIDERS = [
7720
- AGENT.CLAUDE,
7721
- AGENT.CODEX,
7722
- AGENT.OPENCODE,
7723
- AGENT.PI
7724
- ];
7725
- var DEFAULT_RELAY_BASE_PROVIDER = AGENT.CLAUDE;
7726
- var VALID_CODING_AGENT_PROVIDERS = VALID_AGENT_PROVIDERS.filter(
7727
- (provider) => provider !== AGENT.RELAY
7728
- );
7717
+ var SUBAGENT_MCP_HARNESSES = [AGENT.CLAUDE, AGENT.CODEX];
7729
7718
  function isValidAgentProvider(value) {
7730
7719
  return VALID_AGENT_PROVIDERS.some((p) => p === value);
7731
7720
  }
7732
- function isValidCodingAgentProvider(value) {
7733
- return VALID_CODING_AGENT_PROVIDERS.some((provider) => provider === value);
7734
- }
7735
- function isValidRelayBaseProvider(value) {
7736
- return VALID_RELAY_BASE_PROVIDERS.some((provider) => provider === value);
7721
+ var LEGACY_RELAY_BASE_PROVIDERS = [AGENT.CLAUDE, AGENT.CODEX, AGENT.OPENCODE, AGENT.PI];
7722
+ function normalizeLegacyChatProvider(provider, relayBaseProvider) {
7723
+ if (provider === "relay") {
7724
+ return LEGACY_RELAY_BASE_PROVIDERS.find((base) => base === relayBaseProvider) ?? AGENT.CLAUDE;
7725
+ }
7726
+ return isValidAgentProvider(provider) ? provider : null;
7737
7727
  }
7738
7728
  var AGENT_PROVIDER_OPTIONS = [
7739
7729
  {
@@ -7765,11 +7755,6 @@ var AGENT_PROVIDER_OPTIONS = [
7765
7755
  value: "pi",
7766
7756
  label: "Pi",
7767
7757
  description: "Use Pi for tasks"
7768
- },
7769
- {
7770
- value: "relay",
7771
- label: "Relay",
7772
- description: "Orchestrating agent that delegates to other coding agents"
7773
7758
  }
7774
7759
  ];
7775
7760
  var VALID_THINKING_LEVELS = ["low", "medium", "high", "xhigh", "max", "ultra", "ultracode"];
@@ -7780,8 +7765,7 @@ var THINKING_LEVELS_BY_AGENT = {
7780
7765
  cursor: STANDARD_THINKING_LEVELS,
7781
7766
  muse: VALID_THINKING_LEVELS.filter((level) => level !== "max" && level !== "ultracode"),
7782
7767
  opencode: STANDARD_THINKING_LEVELS,
7783
- pi: STANDARD_THINKING_LEVELS,
7784
- relay: [...STANDARD_THINKING_LEVELS, "ultracode"]
7768
+ pi: STANDARD_THINKING_LEVELS
7785
7769
  };
7786
7770
  function getThinkingLevelOptions(provider) {
7787
7771
  return provider ? THINKING_LEVELS_BY_AGENT[provider] : VALID_THINKING_LEVELS;
@@ -7804,14 +7788,12 @@ function getProviderDisplayName(provider, variant = "short") {
7804
7788
  return "Opencode";
7805
7789
  case "pi":
7806
7790
  return "Pi";
7807
- case "relay":
7808
- return "Relay";
7809
7791
  case "claude":
7810
7792
  return variant === "long" ? "Claude Code" : "Claude";
7811
7793
  }
7812
7794
  }
7813
7795
  function getCodingAgentDisplayNames() {
7814
- return VALID_CODING_AGENT_PROVIDERS.map((provider) => getProviderDisplayName(provider)).join(", ");
7796
+ return VALID_AGENT_PROVIDERS.map((provider) => getProviderDisplayName(provider)).join(", ");
7815
7797
  }
7816
7798
 
7817
7799
  // ../shared/src/credentials/types.ts
@@ -22517,7 +22499,7 @@ var WORKSPACE_CREDENTIAL_PROVIDERS = ["claude", "codex"];
22517
22499
  var workspaceCredentialProviderSchema = external_exports.enum(WORKSPACE_CREDENTIAL_PROVIDERS);
22518
22500
  var workspaceCredentialSelectionSchema = agentCredentialSnapshotSchema.omit({ revision: true, account: true });
22519
22501
  var createWorkspaceCredentialSchema = workspaceCredentialSelectionSchema.extend({
22520
- provider: external_exports.enum(VALID_CODING_AGENT_PROVIDERS)
22502
+ provider: external_exports.enum(VALID_AGENT_PROVIDERS)
22521
22503
  }).refine(({ provider, method }) => agentCredentialMethods(provider).includes(method), {
22522
22504
  message: "This inference provider is not supported by this agent"
22523
22505
  });
@@ -22531,7 +22513,6 @@ var switchWorkspaceCredentialSchema = workspaceCredentialSelectionSchema.extend(
22531
22513
  var fallbackHarnessStepSchema = external_exports.object({
22532
22514
  kind: external_exports.literal("harness"),
22533
22515
  provider: external_exports.enum(VALID_AGENT_PROVIDERS),
22534
- relayBaseProvider: external_exports.enum(VALID_RELAY_BASE_PROVIDERS).optional(),
22535
22516
  model: external_exports.string().min(1),
22536
22517
  thinkingLevel: external_exports.enum(VALID_THINKING_LEVELS).optional()
22537
22518
  });
@@ -22710,8 +22691,7 @@ var AGENT_MODELS = {
22710
22691
  ],
22711
22692
  muse: [MUSE_SPARK_1_3_MODEL, DEFAULT_MUSE_MODEL],
22712
22693
  opencode: [...DEFAULT_OPENROUTER_MODELS, ...ASTER_MODELS],
22713
- pi: [...DEFAULT_OPENROUTER_MODELS, ...ASTER_MODELS],
22714
- relay: [CLAUDE_FABLE_5_1_MODEL, CLAUDE_FABLE_5_MODEL, CLAUDE_OPUS_5_5_MODEL, CLAUDE_OPUS_5_MODEL, CLAUDE_OPUS_4_8_MODEL, CLAUDE_SONNET_5_5_MODEL, CLAUDE_SONNET_5_MODEL]
22694
+ pi: [...DEFAULT_OPENROUTER_MODELS, ...ASTER_MODELS]
22715
22695
  };
22716
22696
  var HIDDEN_BY_DEFAULT_MODELS = /* @__PURE__ */ new Set([
22717
22697
  CLAUDE_FABLE_5_MODEL,
@@ -22746,13 +22726,12 @@ var DEFAULT_STATIC_AGENT_MODELS = {
22746
22726
  codex: withoutHiddenByDefault(AGENT_MODELS.codex)
22747
22727
  };
22748
22728
  var DEFAULT_CURSOR_MODELS = withoutHiddenByDefault(AGENT_MODELS.cursor);
22749
- var DEFAULT_RELAY_MODELS = withoutHiddenByDefault(AGENT_MODELS.relay);
22750
22729
  function getAgentModelOptions(provider, overrides) {
22751
22730
  const override = overrides?.[provider];
22752
22731
  if (override?.length) return override;
22753
22732
  if (provider === "claude" || provider === "codex") return DEFAULT_STATIC_AGENT_MODELS[provider];
22754
22733
  if (provider === "cursor") return DEFAULT_CURSOR_MODELS;
22755
- return provider === "relay" ? DEFAULT_RELAY_MODELS : AGENT_MODELS[provider];
22734
+ return AGENT_MODELS[provider];
22756
22735
  }
22757
22736
  var CLAUDE_MODEL_MIN_SANDBOX_IMAGE = {
22758
22737
  [CLAUDE_FABLE_5_1_MODEL]: "replicas-sandbox-2026-09-01-v6",
@@ -22885,7 +22864,7 @@ var quotaLimitKindSchema = external_exports.enum(["rate_limit", "out_of_credits"
22885
22864
  var chatForkInfoSchema = external_exports.object({
22886
22865
  source: external_exports.object({
22887
22866
  chatId: external_exports.string().min(1),
22888
- provider: external_exports.enum(VALID_AGENT_PROVIDERS),
22867
+ provider: external_exports.string().transform((provider, ctx) => normalizeLegacyChatProvider(provider) ?? (ctx.addIssue({ code: "custom" }), external_exports.NEVER)),
22889
22868
  title: external_exports.string()
22890
22869
  }),
22891
22870
  trigger: external_exports.enum(["manual", "auto", "side"]),
@@ -22897,7 +22876,6 @@ var chatForkInfoSchema = external_exports.object({
22897
22876
  });
22898
22877
  var forkChatRequestSchema = external_exports.object({
22899
22878
  provider: external_exports.enum(VALID_AGENT_PROVIDERS),
22900
- relayBaseProvider: external_exports.enum(VALID_RELAY_BASE_PROVIDERS).optional(),
22901
22879
  model: external_exports.string().min(1).optional(),
22902
22880
  thinkingLevel: external_exports.enum(VALID_THINKING_LEVELS).optional(),
22903
22881
  title: external_exports.string().min(1).max(200).optional(),
@@ -22912,7 +22890,7 @@ var forkChatRequestSchema = external_exports.object({
22912
22890
  senderAvatarUrl: external_exports.string().optional()
22913
22891
  });
22914
22892
  var agentQuotaExhaustedPayloadSchema = external_exports.object({
22915
- provider: external_exports.enum(VALID_CODING_AGENT_PROVIDERS),
22893
+ provider: external_exports.enum(VALID_AGENT_PROVIDERS),
22916
22894
  reason: quotaLimitKindSchema,
22917
22895
  detail: external_exports.string().optional(),
22918
22896
  forkTo: fallbackHarnessStepSchema.optional()
@@ -22952,7 +22930,7 @@ function coerceAuthFallbackPayload(payload) {
22952
22930
  const { provider, reason, exhaustedMethod, exhaustedScope, candidateMethod, candidateScope, status, detail } = payload;
22953
22931
  const exhaustedAccount = credentialAccountSchema.safeParse(payload.exhaustedAccount).data;
22954
22932
  const candidateAccount = credentialAccountSchema.safeParse(payload.candidateAccount).data;
22955
- if (typeof provider !== "string" || !isValidCodingAgentProvider(provider) || reason !== "rate_limit" && reason !== "out_of_credits" || !isAuthMethod(exhaustedMethod) || !isAuthMethod(candidateMethod) || !isCredentialScope(candidateScope) || status !== "switched" && status !== "failed") {
22933
+ if (typeof provider !== "string" || !isValidAgentProvider(provider) || reason !== "rate_limit" && reason !== "out_of_credits" || !isAuthMethod(exhaustedMethod) || !isAuthMethod(candidateMethod) || !isCredentialScope(candidateScope) || status !== "switched" && status !== "failed") {
22956
22934
  return null;
22957
22935
  }
22958
22936
  return {
@@ -22973,25 +22951,19 @@ function coerceAuthFallbackPayload(payload) {
22973
22951
  var updateChatDisplayNameRequestSchema = external_exports.object({
22974
22952
  displayName: external_exports.string().trim().min(1).max(100)
22975
22953
  });
22976
- function getChatExecutionProvider(chat) {
22977
- return chat.provider === "relay" ? chat.relayBaseProvider ?? DEFAULT_RELAY_BASE_PROVIDER : chat.provider;
22978
- }
22979
22954
  var createChatRequestSchema = external_exports.object({
22980
22955
  id: external_exports.string().uuid().optional(),
22981
22956
  createdAt: external_exports.string().datetime().optional(),
22982
22957
  provider: external_exports.enum(VALID_AGENT_PROVIDERS),
22983
- relayBaseProvider: external_exports.enum(VALID_CODING_AGENT_PROVIDERS).optional(),
22984
22958
  title: external_exports.string().min(1).optional(),
22985
22959
  parentChatId: external_exports.string().uuid().optional(),
22986
22960
  forkSourceChatId: external_exports.string().uuid().optional(),
22987
22961
  sideChat: external_exports.boolean().optional(),
22988
22962
  clientRequestId: external_exports.string().min(1).max(128).optional()
22989
- }).refine((request) => request.provider === "relay" || request.relayBaseProvider === void 0, {
22990
- message: "relayBaseProvider is only valid for Relay chats"
22991
22963
  }).refine((request) => !request.sideChat || request.forkSourceChatId !== void 0 && request.parentChatId === request.forkSourceChatId, {
22992
22964
  message: "A side chat must fork its parent chat"
22993
22965
  });
22994
- var spawnRelaySubagentRequestSchema = external_exports.object({
22966
+ var spawnSubagentRequestSchema = external_exports.object({
22995
22967
  provider: external_exports.enum(VALID_AGENT_PROVIDERS),
22996
22968
  prompt: external_exports.string().min(1),
22997
22969
  forkTurns: external_exports.string().regex(/^(all|none|[1-9]\d*)$/).refine(
@@ -23002,15 +22974,15 @@ var spawnRelaySubagentRequestSchema = external_exports.object({
23002
22974
  thinkingLevel: external_exports.enum(VALID_THINKING_LEVELS).optional(),
23003
22975
  title: external_exports.string().min(1).optional()
23004
22976
  });
23005
- var messageRelaySubagentRequestSchema = external_exports.object({
22977
+ var messageSubagentRequestSchema = external_exports.object({
23006
22978
  message: external_exports.string().min(1),
23007
22979
  model: external_exports.string().min(1).optional(),
23008
22980
  thinkingLevel: external_exports.enum(VALID_THINKING_LEVELS).optional()
23009
22981
  });
23010
- var waitRelaySubagentRequestSchema = external_exports.object({
22982
+ var waitSubagentRequestSchema = external_exports.object({
23011
22983
  timeoutMinutes: external_exports.coerce.number().positive().max(1440).optional()
23012
22984
  });
23013
- var relaySubagentResponseSchema = external_exports.object({
22985
+ var subagentResponseSchema = external_exports.object({
23014
22986
  chatId: external_exports.string().uuid(),
23015
22987
  status: external_exports.enum(["working", "completed"]),
23016
22988
  response: external_exports.string().optional(),
@@ -23210,7 +23182,7 @@ var WRAPPER_VALUE_OPTIONS = {
23210
23182
  };
23211
23183
  var ANSI_C_ESCAPES = { n: "\n", t: " ", r: "\r", a: "\x07", b: "\b", e: "\x1B", E: "\x1B", f: "\f", v: "\v" };
23212
23184
  function parseShellScript(script, cwd) {
23213
- const scope = { src: script, vars: /* @__PURE__ */ new Map(), dir: cwd, commands: [], depth: 0 };
23185
+ const scope = { src: script, vars: /* @__PURE__ */ new Map(), dir: cwd, commands: [], depth: 0, subshell: false };
23214
23186
  parseUntil(scope, 0, false);
23215
23187
  return scope.commands;
23216
23188
  }
@@ -23310,16 +23282,18 @@ function emit(scope, raw) {
23310
23282
  stdin,
23311
23283
  afterAnd: raw.afterAnd,
23312
23284
  stdinFile: stdinFile ? resolveShellPath(scope.dir, stdinFile.target) : null,
23313
- writes: raw.redirects.flatMap(({ op, target }) => /^(?:1?>|1?>\||1?>>|&>|&>>|>&)$/.test(op) && !/^(?:\d+|-)$/.test(target) ? [{ path: resolveShellPath(scope.dir, target), content: output, append: op.endsWith(">>") }] : []),
23285
+ writes: raw.redirects.flatMap(({ op, target }) => /^(?:1?>|1?>\||1?>>|&>|&>>|>&)$/.test(op) && !/^(?:\d+|-)$/.test(target) ? [{ path: resolveShellPath(scope.dir, target), target, content: output, append: op.endsWith(">>") }] : []),
23314
23286
  wrapper: script !== void 0,
23315
- truncated
23287
+ truncated,
23288
+ piped: raw.pipeFrom !== void 0,
23289
+ subshell: scope.subshell || raw.subshell
23316
23290
  });
23317
23291
  if (name === "cd" || name === "pushd" || name === "popd") {
23318
23292
  scope.dir = name !== "popd" && argv[1] && argv[1] !== "-" ? resolveShellPath(scope.dir, argv[1]) : null;
23319
23293
  } else if (["export", "declare", "local", "readonly"].includes(name)) {
23320
23294
  assign(scope, argv.slice(1).filter((arg) => /^[A-Za-z_]\w*=/.test(arg)));
23321
23295
  }
23322
- if (script && !truncated) parseUntil({ src: script, vars: name === "eval" ? scope.vars : /* @__PURE__ */ new Map(), dir: scope.dir, commands: scope.commands, depth: scope.depth + 1 }, 0, false);
23296
+ if (script && !truncated) parseUntil({ src: script, vars: name === "eval" ? scope.vars : /* @__PURE__ */ new Map(), dir: scope.dir, commands: scope.commands, depth: scope.depth + 1, subshell: scope.subshell || raw.subshell }, 0, false);
23323
23297
  }
23324
23298
  function readHeredocBodies(scope, heredocs, start) {
23325
23299
  const { src } = scope;
@@ -23367,7 +23341,7 @@ function readDoubleQuoted(scope, start, terminator) {
23367
23341
  return { value, end: i };
23368
23342
  }
23369
23343
  function substitute(scope, src, start, closeParen) {
23370
- const child = { src, vars: new Map(scope.vars), dir: scope.dir, commands: [], depth: scope.depth + 1 };
23344
+ const child = { src, vars: new Map(scope.vars), dir: scope.dir, commands: [], depth: scope.depth + 1, subshell: true };
23371
23345
  const end = parseUntil(child, start, closeParen);
23372
23346
  scope.commands.push(...child.commands);
23373
23347
  const [only] = child.commands;
@@ -23412,7 +23386,7 @@ function parseUntil(scope, start, closeParen) {
23412
23386
  const { src } = scope;
23413
23387
  let i = start;
23414
23388
  let line = [];
23415
- let current = { words: [], redirects: [], heredocs: [], afterAnd: false };
23389
+ let current = { words: [], redirects: [], heredocs: [], afterAnd: false, subshell: false };
23416
23390
  let pendingHeredocs = [];
23417
23391
  let word = null;
23418
23392
  let quoted = false;
@@ -23440,7 +23414,8 @@ function parseUntil(scope, start, closeParen) {
23440
23414
  const endCommand = (op) => {
23441
23415
  endWord();
23442
23416
  const done = current;
23443
- current = { words: [], redirects: [], heredocs: [], pipeFrom: op === "|" || op === "|&" ? done : void 0, afterAnd: op === "&&" };
23417
+ if (op === "&") done.subshell = true;
23418
+ current = { words: [], redirects: [], heredocs: [], pipeFrom: op === "|" || op === "|&" ? done : void 0, afterAnd: op === "&&", subshell: parens > 0 };
23444
23419
  if (done.words.length > 0 || done.redirects.length > 0 || done.heredocs.length > 0) line.push(done);
23445
23420
  };
23446
23421
  const flush = () => {
@@ -23617,16 +23592,25 @@ function insertDisplayMessageByTimestamp(messages, message) {
23617
23592
  }
23618
23593
 
23619
23594
  // ../shared/src/display-message/format.ts
23620
- function commandWords(command) {
23621
- const commands = parseShellScript(command, null).filter(({ wrapper }) => !wrapper);
23622
- if (commands.length !== 1) return null;
23623
- const [{ argv, stdin, stdinFile, writes }] = commands;
23624
- return stdin === void 0 && !stdinFile && writes.length === 0 ? argv.map((word) => word.replaceAll(SHELL_OPAQUE, "\u2026")) : null;
23595
+ var SCRIPT_ROOT = "/";
23596
+ var commandName = (argv) => argv[0].split("/").pop() ?? argv[0];
23597
+ var fileWrites = ({ writes }) => writes.filter(({ path: path7 }) => path7 !== "/dev/null");
23598
+ function shellCommands(command) {
23599
+ return parseShellScript(command, SCRIPT_ROOT).filter(({ wrapper }) => !wrapper);
23600
+ }
23601
+ function simpleCommands(command) {
23602
+ const commands = shellCommands(command);
23603
+ const hasRedirectOrSubshell = commands.some((shellCommand) => shellCommand.subshell || shellCommand.stdinFile !== null || !shellCommand.piped && shellCommand.stdin !== void 0 || fileWrites(shellCommand).length > 0);
23604
+ if (commands.length === 0 || hasRedirectOrSubshell) return null;
23605
+ return commands.map((shellCommand) => {
23606
+ const argv = shellCommand.argv.map((word) => word.replaceAll(SHELL_OPAQUE, "\u2026"));
23607
+ return { ...shellCommand, argv, name: commandName(argv) };
23608
+ });
23625
23609
  }
23626
23610
  function skillNamesFromCommand(command) {
23627
- const words = commandWords(command);
23628
- if (!words) return [];
23629
- return Array.from(new Set(words.flatMap((word) => {
23611
+ const commands = simpleCommands(command);
23612
+ if (!commands) return [];
23613
+ return Array.from(new Set(commands.flatMap(({ argv }) => argv).flatMap((word) => {
23630
23614
  const skillName = skillNameFromSkillRootPath(word);
23631
23615
  return skillName ? [skillName] : [];
23632
23616
  })));
@@ -25738,13 +25722,12 @@ var REPLICAS_AGENT_ABILITIES = Object.keys(
25738
25722
  // ../shared/src/routes/preferences.ts
25739
25723
  var EMPTY_AGENT_DEFAULT_SETTINGS = {
25740
25724
  agent_provider: null,
25741
- relay_base_provider: null,
25742
25725
  model: null,
25743
25726
  thinking_level: null,
25744
25727
  goal_mode: null,
25745
25728
  fast_mode: null
25746
25729
  };
25747
- var DEFAULT_RELAY_SUBAGENT_PROVIDERS = [...VALID_RELAY_SUBAGENT_PROVIDERS];
25730
+ var DEFAULT_SUBAGENT_MCP_PROVIDERS = [...VALID_AGENT_PROVIDERS];
25748
25731
  var DEFAULT_USER_PREFERENCES = {
25749
25732
  default_agent: "codex",
25750
25733
  default_model: null,
@@ -25768,6 +25751,7 @@ var DEFAULT_USER_PREFERENCES = {
25768
25751
  open_links_in_desktop_app: false,
25769
25752
  mothership_in_dms: false,
25770
25753
  memory_enabled: null,
25754
+ subagent_mcp_enabled: null,
25771
25755
  default_fast_mode: false,
25772
25756
  agent_defaults: { ...EMPTY_AGENT_DEFAULT_SETTINGS },
25773
25757
  fallback_chains: null
@@ -27610,7 +27594,7 @@ function parseAgentEvents(events, agentType) {
27610
27594
  }
27611
27595
  function parseDisplayMessages(events, agentType, options = {}) {
27612
27596
  events = excludeQueuedAcceptedEvents(events, []);
27613
- const parsedEvents = agentType === "claude" || agentType === "relay" ? parseClaudeEvents(events, options.parentToolUseId) : parseAgentEvents(events, agentType);
27597
+ const parsedEvents = agentType === "claude" ? parseClaudeEvents(events, options.parentToolUseId) : parseAgentEvents(events, agentType);
27614
27598
  const reconciledEvents = [];
27615
27599
  for (const message of parsedEvents) {
27616
27600
  if (message.type === "user") upsertDisplayMessage(reconciledEvents, message);
@@ -27888,7 +27872,7 @@ var SLASH_COMMANDS = [
27888
27872
  command: "/plan",
27889
27873
  description: "Switch to plan mode and optionally send a prompt.",
27890
27874
  argumentHint: "[prompt]",
27891
- providers: ["claude", "codex", "cursor", "muse", "opencode", "pi", "relay"]
27875
+ providers: ["claude", "codex", "cursor", "muse", "opencode", "pi"]
27892
27876
  },
27893
27877
  {
27894
27878
  command: "/fast",
@@ -27938,8 +27922,8 @@ function sanitizeTerminalLine(value) {
27938
27922
  return value.replace(CONTROL_CHARACTERS, " ").trim();
27939
27923
  }
27940
27924
 
27941
- // ../shared/src/relay.ts
27942
- var RELAY_MCP_TOOLS = {
27925
+ // ../shared/src/subagent-mcp.ts
27926
+ var SUBAGENT_MCP_TOOLS = {
27943
27927
  getProviders: "get_providers",
27944
27928
  spawnAgent: "spawn_agent",
27945
27929
  getAgent: "get_agent",
@@ -27947,13 +27931,13 @@ var RELAY_MCP_TOOLS = {
27947
27931
  messageAgent: "message_agent",
27948
27932
  deleteAgent: "delete_agent"
27949
27933
  };
27950
- var RELAY_MCP_TOOL_NAMES = Object.values(RELAY_MCP_TOOLS);
27934
+ var SUBAGENT_MCP_TOOL_NAMES = Object.values(SUBAGENT_MCP_TOOLS);
27951
27935
 
27952
27936
  // ../shared/src/headless-agent.ts
27953
27937
  var headlessAgentRequestSchema = external_exports.object({
27954
27938
  mode: external_exports.literal("structured"),
27955
27939
  agent: external_exports.custom(
27956
- (value) => typeof value === "string" && isValidCodingAgentProvider(value)
27940
+ (value) => typeof value === "string" && isValidAgentProvider(value)
27957
27941
  ),
27958
27942
  model: external_exports.string().min(1),
27959
27943
  prompt: external_exports.string(),
@@ -27964,7 +27948,7 @@ var headlessAgentRequestSchema = external_exports.object({
27964
27948
  });
27965
27949
 
27966
27950
  // ../shared/src/cli-version.ts
27967
- var CLI_VERSION = "0.2.765";
27951
+ var CLI_VERSION = "0.2.767";
27968
27952
 
27969
27953
  // ../shared/src/version.ts
27970
27954
  function compareVersions(v1, v2) {
@@ -28470,20 +28454,8 @@ function validateAgentSelection(body, existing, modelCatalogs = {}) {
28470
28454
  return createErrorResult({ message: `Invalid agent_provider: must be one of ${VALID_AGENT_PROVIDERS.join(", ")}` });
28471
28455
  }
28472
28456
  }
28473
- const effectiveAgent = agentProvider !== void 0 ? agentProvider : existing.agentProvider;
28474
- let relayBaseProvider = body.relay_base_provider;
28475
- if (relayBaseProvider != null && !isValidRelayBaseProvider(relayBaseProvider)) {
28476
- return createErrorResult({ message: `Invalid relay_base_provider: must be one of ${VALID_RELAY_BASE_PROVIDERS.join(", ")}` });
28477
- }
28478
- if (relayBaseProvider && effectiveAgent !== "relay") {
28479
- return createErrorResult({ message: "relay_base_provider is only valid when agent_provider is relay" });
28480
- }
28481
- if (agentProvider !== void 0 && agentProvider !== "relay" && relayBaseProvider === void 0 && existing.relayBaseProvider) {
28482
- relayBaseProvider = null;
28483
- }
28484
- const effectiveRelayBase = relayBaseProvider !== void 0 ? relayBaseProvider : existing.relayBaseProvider;
28485
- const agentChanged = agentProvider !== void 0 && agentProvider !== existing.agentProvider || relayBaseProvider !== void 0 && relayBaseProvider !== (existing.relayBaseProvider ?? null);
28486
- const executionAgent = effectiveAgent ? getChatExecutionProvider({ provider: effectiveAgent, relayBaseProvider: effectiveRelayBase ?? existing.inheritedRelayBaseProvider }) : effectiveAgent;
28457
+ const executionAgent = agentProvider !== void 0 ? agentProvider : existing.agentProvider;
28458
+ const agentChanged = agentProvider !== void 0 && agentProvider !== existing.agentProvider;
28487
28459
  let model = body.model;
28488
28460
  if (agentChanged && model === void 0 && existing.model) {
28489
28461
  model = null;
@@ -28506,7 +28478,7 @@ function validateAgentSelection(body, existing, modelCatalogs = {}) {
28506
28478
  }
28507
28479
  }
28508
28480
  if (thinkingLevel !== void 0 && thinkingLevel !== null) {
28509
- if (!effectiveAgent && isProviderSpecificThinkingLevel(thinkingLevel)) {
28481
+ if (!executionAgent && isProviderSpecificThinkingLevel(thinkingLevel)) {
28510
28482
  return createErrorResult({ message: `Cannot set ${thinkingLevel} without an agent_provider` });
28511
28483
  }
28512
28484
  if (!isValidThinkingLevel(thinkingLevel) || executionAgent && !getThinkingLevelOptions(executionAgent).includes(thinkingLevel)) {
@@ -28514,7 +28486,7 @@ function validateAgentSelection(body, existing, modelCatalogs = {}) {
28514
28486
  return createErrorResult({ message: `Invalid thinking_level: must be one of ${validLevels.join(", ")}` });
28515
28487
  }
28516
28488
  }
28517
- return createSuccessResult({ agentProvider, relayBaseProvider, model, thinkingLevel });
28489
+ return createSuccessResult({ agentProvider, model, thinkingLevel });
28518
28490
  }
28519
28491
 
28520
28492
  // ../shared/src/automations/github/index.ts
@@ -30490,7 +30462,7 @@ var CLI_CODING_AGENT_LABEL = getCodingAgentDisplayNames();
30490
30462
  function parseReplicaAgent(value) {
30491
30463
  if (!value) return void 0;
30492
30464
  const normalized = value.trim().toLowerCase();
30493
- if (isValidCodingAgentProvider(normalized)) {
30465
+ if (isValidAgentProvider(normalized)) {
30494
30466
  return normalized;
30495
30467
  }
30496
30468
  console.log(import_chalk16.default.red(`Invalid coding agent: ${value}. Must be one of: ${CLI_CODING_AGENT_LABEL}`));
@@ -30754,7 +30726,7 @@ async function replicaCreateCommand(name, options) {
30754
30726
  type: "select",
30755
30727
  name: "agent",
30756
30728
  message: "Select coding agent:",
30757
- choices: AGENT_PROVIDER_OPTIONS.filter((option) => option.value !== "relay").map((option) => ({ title: option.label, value: option.value })),
30729
+ choices: AGENT_PROVIDER_OPTIONS.map((option) => ({ title: option.label, value: option.value })),
30758
30730
  initial: 0
30759
30731
  });
30760
30732
  if (!response2.agent) {
@@ -33471,7 +33443,7 @@ automation.command("get <id>").description("Get automation details by ID").actio
33471
33443
  process.exit(1);
33472
33444
  }
33473
33445
  });
33474
- automation.command("create [name]").description("Create a new automation").option("-p, --prompt <prompt>", "Prompt for the automation").option("-e, --environment <environment>", "Environment name or ID").option("--trigger-cron <schedule>", 'Cron schedule expression (e.g. "0 9 * * 1-5")').option("--trigger-cron-timezone <timezone>", "Timezone for cron trigger (default: UTC)").option("--trigger-github <event>", 'GitHub event (e.g. "pull_request.opened")').option("--trigger-github-repos <repos>", "Comma-separated repo names to filter GitHub trigger").option("--trigger-github-exclude-users <users>", "Comma-separated GitHub usernames to exclude from triggering (pass empty string to clear the list)").option("--trigger-gitlab <event>", 'GitLab event (e.g. "merge_request.opened")').option("--trigger-gitlab-repos <repos>", "Comma-separated repo names to filter GitLab trigger").option("--trigger-gitlab-exclude-users <users>", "Comma-separated GitLab usernames to exclude from triggering (pass empty string to clear the list)").option("--github-checks <names>", "Comma-separated GitHub check names to create on matching PRs (requires a PR opened/updated trigger)").option("--lifecycle <policy>", "Workspace lifecycle: archive_when_done, sleep_when_done, default").option("--sleep-when-done", "Sleep automation workspaces as soon as the agent finishes").option("--auto-stop-minutes <minutes>", "Inactivity timeout in minutes (3-1440, requires --lifecycle default)").option("--pr-followups", "Allow follow-up actions on matching PRs").option("--agent-provider <provider>", 'Coding agent to use: claude, codex, cursor, relay (or "none" to inherit org default)').option("--model <model>", 'Model identifier (must be valid for --agent-provider; pass "none" to clear)').option("--thinking-level <level>", 'Thinking/reasoning level: low, medium, high, xhigh, max (or "none" to clear)').option("--plan-mode", "Run automation messages in plan mode").option("--goal-mode", "Set automation messages as goals").option("--fast-mode", "Run automation messages in fast mode").option("--personal", "Create a personal automation owned by the authenticated user").option("--confirmation-channel <id>", "Slack channel containing the Mothership confirmation").option("--confirmation-thread <ts>", "Slack thread containing the Mothership confirmation").option("--confirmation-message-ts <ts>", "Slack timestamp of the Mothership confirmation").option("--confirmation-user <id>", "Slack id of the confirming user").option("--disabled", "Create in disabled state").action(async (name, options) => {
33446
+ automation.command("create [name]").description("Create a new automation").option("-p, --prompt <prompt>", "Prompt for the automation").option("-e, --environment <environment>", "Environment name or ID").option("--trigger-cron <schedule>", 'Cron schedule expression (e.g. "0 9 * * 1-5")').option("--trigger-cron-timezone <timezone>", "Timezone for cron trigger (default: UTC)").option("--trigger-github <event>", 'GitHub event (e.g. "pull_request.opened")').option("--trigger-github-repos <repos>", "Comma-separated repo names to filter GitHub trigger").option("--trigger-github-exclude-users <users>", "Comma-separated GitHub usernames to exclude from triggering (pass empty string to clear the list)").option("--trigger-gitlab <event>", 'GitLab event (e.g. "merge_request.opened")').option("--trigger-gitlab-repos <repos>", "Comma-separated repo names to filter GitLab trigger").option("--trigger-gitlab-exclude-users <users>", "Comma-separated GitLab usernames to exclude from triggering (pass empty string to clear the list)").option("--github-checks <names>", "Comma-separated GitHub check names to create on matching PRs (requires a PR opened/updated trigger)").option("--lifecycle <policy>", "Workspace lifecycle: archive_when_done, sleep_when_done, default").option("--sleep-when-done", "Sleep automation workspaces as soon as the agent finishes").option("--auto-stop-minutes <minutes>", "Inactivity timeout in minutes (3-1440, requires --lifecycle default)").option("--pr-followups", "Allow follow-up actions on matching PRs").option("--agent-provider <provider>", 'Coding agent to use: claude, codex, cursor (or "none" to inherit org default)').option("--model <model>", 'Model identifier (must be valid for --agent-provider; pass "none" to clear)').option("--thinking-level <level>", 'Thinking/reasoning level: low, medium, high, xhigh, max (or "none" to clear)').option("--plan-mode", "Run automation messages in plan mode").option("--goal-mode", "Set automation messages as goals").option("--fast-mode", "Run automation messages in fast mode").option("--personal", "Create a personal automation owned by the authenticated user").option("--confirmation-channel <id>", "Slack channel containing the Mothership confirmation").option("--confirmation-thread <ts>", "Slack thread containing the Mothership confirmation").option("--confirmation-message-ts <ts>", "Slack timestamp of the Mothership confirmation").option("--confirmation-user <id>", "Slack id of the confirming user").option("--disabled", "Create in disabled state").action(async (name, options) => {
33475
33447
  try {
33476
33448
  await automationCreateCommand(name, {
33477
33449
  ...options,
@@ -33486,7 +33458,7 @@ automation.command("create [name]").description("Create a new automation").optio
33486
33458
  process.exit(1);
33487
33459
  }
33488
33460
  });
33489
- automation.command("edit <id>").description("Edit an existing automation").option("-n, --name <name>", "New name").option("-p, --prompt <prompt>", "New prompt").option("-e, --enabled <enabled>", "Enable or disable (true/false)").option("--trigger-cron <schedule>", "Set cron schedule (replaces existing triggers)").option("--trigger-cron-timezone <timezone>", "Timezone for cron trigger").option("--trigger-github <event>", "Set GitHub event (replaces existing triggers)").option("--trigger-github-repos <repos>", "Comma-separated repo names to filter GitHub trigger").option("--trigger-github-exclude-users <users>", "Comma-separated GitHub usernames to exclude from triggering (pass empty string to clear the list)").option("--trigger-gitlab <event>", "Set GitLab event (replaces existing triggers)").option("--trigger-gitlab-repos <repos>", "Comma-separated repo names to filter GitLab trigger").option("--trigger-gitlab-exclude-users <users>", "Comma-separated GitLab usernames to exclude from triggering (pass empty string to clear the list)").option("--github-checks <names>", "Comma-separated GitHub check names to create on matching PRs (replaces the current list; pass empty string to remove them)").option("--add-github-checks <names>", "Comma-separated GitHub check names to add, keeping the ones already configured").option("--environment <environment>", "Environment name or ID").option("--lifecycle <policy>", "Workspace lifecycle: archive_when_done, sleep_when_done, default").option("--sleep-when-done", "Sleep automation workspaces as soon as the agent finishes").option("--auto-stop-minutes <minutes>", "Inactivity timeout in minutes (3-1440, requires --lifecycle default)").option("--pr-followups <enabled>", "Allow follow-up actions on matching PRs (true/false)", parseBooleanOption).option("--agent-provider <provider>", 'Coding agent to use: claude, codex, cursor, relay (or "none" to inherit org default)').option("--model <model>", 'Model identifier (must be valid for --agent-provider; pass "none" to clear)').option("--thinking-level <level>", 'Thinking/reasoning level: low, medium, high, xhigh, max (or "none" to clear)').option("--plan-mode <enabled>", "Run automation messages in plan mode (true/false)", parseBooleanOption).option("--goal-mode <enabled>", "Set automation messages as goals (true/false)", parseBooleanOption).option("--fast-mode <enabled>", "Run automation messages in fast mode (true/false)", parseBooleanOption).action(async (id, options) => {
33461
+ automation.command("edit <id>").description("Edit an existing automation").option("-n, --name <name>", "New name").option("-p, --prompt <prompt>", "New prompt").option("-e, --enabled <enabled>", "Enable or disable (true/false)").option("--trigger-cron <schedule>", "Set cron schedule (replaces existing triggers)").option("--trigger-cron-timezone <timezone>", "Timezone for cron trigger").option("--trigger-github <event>", "Set GitHub event (replaces existing triggers)").option("--trigger-github-repos <repos>", "Comma-separated repo names to filter GitHub trigger").option("--trigger-github-exclude-users <users>", "Comma-separated GitHub usernames to exclude from triggering (pass empty string to clear the list)").option("--trigger-gitlab <event>", "Set GitLab event (replaces existing triggers)").option("--trigger-gitlab-repos <repos>", "Comma-separated repo names to filter GitLab trigger").option("--trigger-gitlab-exclude-users <users>", "Comma-separated GitLab usernames to exclude from triggering (pass empty string to clear the list)").option("--github-checks <names>", "Comma-separated GitHub check names to create on matching PRs (replaces the current list; pass empty string to remove them)").option("--add-github-checks <names>", "Comma-separated GitHub check names to add, keeping the ones already configured").option("--environment <environment>", "Environment name or ID").option("--lifecycle <policy>", "Workspace lifecycle: archive_when_done, sleep_when_done, default").option("--sleep-when-done", "Sleep automation workspaces as soon as the agent finishes").option("--auto-stop-minutes <minutes>", "Inactivity timeout in minutes (3-1440, requires --lifecycle default)").option("--pr-followups <enabled>", "Allow follow-up actions on matching PRs (true/false)", parseBooleanOption).option("--agent-provider <provider>", 'Coding agent to use: claude, codex, cursor (or "none" to inherit org default)').option("--model <model>", 'Model identifier (must be valid for --agent-provider; pass "none" to clear)').option("--thinking-level <level>", 'Thinking/reasoning level: low, medium, high, xhigh, max (or "none" to clear)').option("--plan-mode <enabled>", "Run automation messages in plan mode (true/false)", parseBooleanOption).option("--goal-mode <enabled>", "Set automation messages as goals (true/false)", parseBooleanOption).option("--fast-mode <enabled>", "Run automation messages in fast mode (true/false)", parseBooleanOption).action(async (id, options) => {
33490
33462
  try {
33491
33463
  await automationEditCommand(id, options);
33492
33464
  } catch (error51) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.2.765",
3
+ "version": "0.2.767",
4
4
  "description": "CLI for managing Replicas workspaces - SSH into cloud dev environments with automatic port forwarding",
5
5
  "main": "dist/index.cjs",
6
6
  "bin": {