replicas-cli 0.3.258 → 0.3.260

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 +36 -11
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -17171,21 +17171,28 @@ var init_pull_requests = __esm({
17171
17171
  });
17172
17172
 
17173
17173
  // ../shared/src/routes/mothership.ts
17174
- var mothershipLinearRuleSchema, storedMothershipLinearRuleSchema, SUBAGENT_SERVICE_TIERS, mothershipSubagentSettingsSchema, DEPLOYED_SHOWN_MS, MOTHERSHIP_SHIPPING_LOOKBACK_MS;
17174
+ var linearRuleFields, withLabelIds, mothershipLinearRuleSchema, storedMothershipLinearRuleSchema, SUBAGENT_SERVICE_TIERS, mothershipSubagentSettingsSchema, DEPLOYED_SHOWN_MS, MOTHERSHIP_SHIPPING_LOOKBACK_MS;
17175
17175
  var init_mothership = __esm({
17176
17176
  "../shared/src/routes/mothership.ts"() {
17177
17177
  "use strict";
17178
17178
  init_zod();
17179
17179
  init_agent();
17180
17180
  init_pull_requests();
17181
- mothershipLinearRuleSchema = external_exports.object({
17181
+ init_type_guards();
17182
+ linearRuleFields = external_exports.object({
17182
17183
  team_id: external_exports.string().min(1),
17183
17184
  current_cycle: external_exports.boolean().optional(),
17184
- label_id: external_exports.string().min(1).optional(),
17185
+ label_ids: external_exports.array(external_exports.string().min(1)).min(1).optional(),
17185
17186
  project_id: external_exports.string().min(1).optional(),
17186
17187
  assignee_id: external_exports.string().min(1).optional()
17187
17188
  }).strict();
17188
- storedMothershipLinearRuleSchema = mothershipLinearRuleSchema.extend({ linked_at: external_exports.string() });
17189
+ withLabelIds = (value) => {
17190
+ if (!isRecord(value) || typeof value.label_id !== "string") return value;
17191
+ const { label_id, ...rest } = value;
17192
+ return { ...rest, label_ids: [label_id] };
17193
+ };
17194
+ mothershipLinearRuleSchema = external_exports.preprocess(withLabelIds, linearRuleFields);
17195
+ storedMothershipLinearRuleSchema = external_exports.preprocess(withLabelIds, linearRuleFields.extend({ linked_at: external_exports.string() }));
17189
17196
  SUBAGENT_SERVICE_TIERS = ["default", "fast", "ultrafast"];
17190
17197
  mothershipSubagentSettingsSchema = external_exports.object({
17191
17198
  coding_agent: external_exports.enum(VALID_AGENT_PROVIDERS),
@@ -17293,6 +17300,9 @@ var init_replicas_mcp = __esm({
17293
17300
  readSubagent: "read_subagent",
17294
17301
  archiveSubagent: "archive_subagent",
17295
17302
  waitForSubagents: "wait_for_subagents",
17303
+ getLinearRouting: "get_linear_routing",
17304
+ setLinearRouting: "set_linear_routing",
17305
+ clearLinearRouting: "clear_linear_routing",
17296
17306
  createReplica: "create_replica",
17297
17307
  listReplicas: "list_replicas",
17298
17308
  getReplica: "get_replica",
@@ -20976,13 +20986,20 @@ function applyToolInputEvent(event, messages, provider2, state, questionFilter)
20976
20986
  if (event.type === "replicas-tool-input-request" && typeof event.payload.toolUseId === "string" && typeof event.payload.requestId === "string" && (Array.isArray(event.payload.options) || Array.isArray(event.payload.questions))) {
20977
20987
  const previous = state.resolutions.get(event.payload.toolUseId);
20978
20988
  const resolved = previous && (!previous.requestId || previous.requestId === event.payload.requestId) ? previous : void 0;
20989
+ const earlier = state.requests.get(event.payload.toolUseId);
20990
+ const same = earlier?.requestId === event.payload.requestId;
20991
+ if (!same) state.requestedAt.set(event.payload.toolUseId, event.timestamp);
20992
+ const requestedAt = state.requestedAt.get(event.payload.toolUseId) ?? event.timestamp;
20993
+ const answeredNow = resolved && (!same || earlier?.status === "pending");
20979
20994
  const inputRequest = {
20980
20995
  requestId: event.payload.requestId,
20981
20996
  status: resolved?.selectionId === "aborted" || resolved?.selectionId === "declined" ? "aborted" : resolved ? "resolved" : "pending",
20982
20997
  ...Array.isArray(event.payload.options) ? { options: event.payload.options } : {},
20983
20998
  ...Array.isArray(event.payload.questions) ? { questions: questionFilter ? event.payload.questions.filter(questionFilter) : event.payload.questions } : {},
20984
20999
  ...resolved ? { selectionId: resolved.selectionId } : {},
20985
- ...resolved?.selectionSummary ? { selectionSummary: resolved.selectionSummary } : {}
21000
+ ...resolved?.selectionSummary ? { selectionSummary: resolved.selectionSummary } : {},
21001
+ ...resolved ? { resolvedAt: resolved.resolvedAt } : {},
21002
+ waitedMs: (earlier?.waitedMs ?? 0) + (answeredNow ? Math.max(0, parseTimestampMs(resolved.resolvedAt) - parseTimestampMs(requestedAt)) : 0)
20986
21003
  };
20987
21004
  state.requests.set(event.payload.toolUseId, inputRequest);
20988
21005
  const message2 = messages.find((candidate) => candidate.type === "tool_call" && candidate.id === `${provider2}-tool-${event.payload.toolUseId}`);
@@ -20993,7 +21010,8 @@ function applyToolInputEvent(event, messages, provider2, state, questionFilter)
20993
21010
  const resolved = {
20994
21011
  ...typeof event.payload.requestId === "string" ? { requestId: event.payload.requestId } : {},
20995
21012
  selectionId: event.payload.selectionId,
20996
- ...typeof event.payload.selectionSummary === "string" ? { selectionSummary: event.payload.selectionSummary } : {}
21013
+ ...typeof event.payload.selectionSummary === "string" ? { selectionSummary: event.payload.selectionSummary } : {},
21014
+ resolvedAt: event.timestamp
20997
21015
  };
20998
21016
  state.resolutions.set(event.payload.toolUseId, resolved);
20999
21017
  const inputRequest = state.requests.get(event.payload.toolUseId);
@@ -21001,6 +21019,9 @@ function applyToolInputEvent(event, messages, provider2, state, questionFilter)
21001
21019
  inputRequest.status = resolved.selectionId === "aborted" || resolved.selectionId === "declined" ? "aborted" : "resolved";
21002
21020
  inputRequest.selectionId = resolved.selectionId;
21003
21021
  if (resolved.selectionSummary) inputRequest.selectionSummary = resolved.selectionSummary;
21022
+ inputRequest.resolvedAt = resolved.resolvedAt;
21023
+ const requestedAt = state.requestedAt.get(event.payload.toolUseId);
21024
+ if (requestedAt) inputRequest.waitedMs = (inputRequest.waitedMs ?? 0) + Math.max(0, parseTimestampMs(resolved.resolvedAt) - parseTimestampMs(requestedAt));
21004
21025
  }
21005
21026
  return true;
21006
21027
  }
@@ -28648,7 +28669,10 @@ var init_steps = __esm({
28648
28669
  [REPLICAS_MCP_TOOLS.deleteChat]: { icon: "trash", live: "Deleting chat", done: "Deleted chat" },
28649
28670
  [REPLICAS_MCP_TOOLS.listRepositories]: { icon: "folder", live: "Listing repositories", done: "Listed repositories" },
28650
28671
  [REPLICAS_MCP_TOOLS.listEnvironments]: { icon: "list", live: "Listing environments", done: "Listed environments" },
28651
- [REPLICAS_MCP_TOOLS.createAutomation]: { icon: "clock", live: "Creating automation", done: "Created automation" }
28672
+ [REPLICAS_MCP_TOOLS.createAutomation]: { icon: "clock", live: "Creating automation", done: "Created automation" },
28673
+ [REPLICAS_MCP_TOOLS.getLinearRouting]: { icon: "search", live: "Checking Linear routing", done: "Checked Linear routing" },
28674
+ [REPLICAS_MCP_TOOLS.setLinearRouting]: { icon: "wrench", live: "Setting Linear routing", done: "Set Linear routing" },
28675
+ [REPLICAS_MCP_TOOLS.clearLinearRouting]: { icon: "trash", live: "Clearing Linear routing", done: "Cleared Linear routing" }
28652
28676
  };
28653
28677
  }
28654
28678
  });
@@ -29746,7 +29770,7 @@ var init_opencode_parser = __esm({
29746
29770
  function parseMuseEvents(events) {
29747
29771
  const messages = [];
29748
29772
  const deltas = /* @__PURE__ */ new Map();
29749
- const inputState = { requests: /* @__PURE__ */ new Map(), resolutions: /* @__PURE__ */ new Map() };
29773
+ const inputState = { requests: /* @__PURE__ */ new Map(), resolutions: /* @__PURE__ */ new Map(), requestedAt: /* @__PURE__ */ new Map() };
29750
29774
  for (const event of events) {
29751
29775
  const userContent = getUserMessage(event);
29752
29776
  if (userContent !== null) {
@@ -30646,7 +30670,8 @@ function parseClaudeEvents(events, parentToolUseId) {
30646
30670
  ...message2.inputRequest,
30647
30671
  status: payload.selectionId === "aborted" ? "aborted" : "resolved",
30648
30672
  selectionId: payload.selectionId,
30649
- selectionSummary: payload.selectionSummary
30673
+ selectionSummary: payload.selectionSummary,
30674
+ resolvedAt: event.timestamp
30650
30675
  };
30651
30676
  }
30652
30677
  });
@@ -31535,7 +31560,7 @@ var CLI_VERSION;
31535
31560
  var init_cli_version = __esm({
31536
31561
  "../shared/src/cli-version.ts"() {
31537
31562
  "use strict";
31538
- CLI_VERSION = "0.3.258";
31563
+ CLI_VERSION = "0.3.260";
31539
31564
  }
31540
31565
  });
31541
31566
 
@@ -48625,7 +48650,7 @@ var init_src2 = __esm({
48625
48650
  chatQueue.command("edit <id> <chatId> <messageId> <message>").description("Replace the text of a queued message").action(run(chatQueueEditCommand));
48626
48651
  chatQueue.command("move <id> <chatId> <messageId> <position>").description("Move a queued message to a 0-based position").action(run(chatQueueMoveCommand));
48627
48652
  chatQueue.command("steer <id> <chatId> <messageId>").description("Deliver a queued message into the running turn").action(run(chatQueueActionCommand("steer")));
48628
- chatQueue.command("send-now <id> <chatId> <messageId>").description("Interrupt the running turn and send a queued message").action(run(chatQueueActionCommand("send-now")));
48653
+ chatQueue.command("send-now <id> <chatId> <messageId>").description("Get a queued message to the agent sooner; stops the current step only for agents that cannot steer").action(run(chatQueueActionCommand("send-now")));
48629
48654
  share = program.command("share").description("Share a replica with organization members");
48630
48655
  share.command("list <id>").description("List members a replica is shared with").action(run(shareListCommand));
48631
48656
  share.command("add <id> <userId>").description("Share a replica with a member").action(run(shareAddCommand));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.3.258",
3
+ "version": "0.3.260",
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": {