replicas-cli 0.2.150 → 0.2.152

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.
@@ -8066,6 +8066,37 @@ function parseClaudeEvents(events, parentToolUseId) {
8066
8066
  }
8067
8067
  }
8068
8068
  });
8069
+ filteredEvents.forEach((event) => {
8070
+ if (event.type === "replicas-tool-input-request") {
8071
+ const payload = event.payload;
8072
+ if (!payload.toolUseId || !payload.requestId) return;
8073
+ if (!Array.isArray(payload.options) && !Array.isArray(payload.questions)) return;
8074
+ const toolInfo = toolCallMap.get(payload.toolUseId);
8075
+ if (!toolInfo) return;
8076
+ const message = messages[toolInfo.messageIndex];
8077
+ if (!message || message.type !== "tool_call") return;
8078
+ message.inputRequest = {
8079
+ requestId: payload.requestId,
8080
+ status: "pending",
8081
+ options: payload.options,
8082
+ questions: payload.questions
8083
+ };
8084
+ }
8085
+ if (event.type === "replicas-tool-input-resolved") {
8086
+ const payload = event.payload;
8087
+ if (!payload.toolUseId || !payload.selectionId) return;
8088
+ const toolInfo = toolCallMap.get(payload.toolUseId);
8089
+ if (!toolInfo) return;
8090
+ const message = messages[toolInfo.messageIndex];
8091
+ if (!message || message.type !== "tool_call" || !message.inputRequest) return;
8092
+ message.inputRequest = {
8093
+ ...message.inputRequest,
8094
+ status: payload.selectionId === "aborted" ? "aborted" : "resolved",
8095
+ selectionId: payload.selectionId,
8096
+ selectionSummary: payload.selectionSummary
8097
+ };
8098
+ }
8099
+ });
8069
8100
  filteredEvents.forEach((event) => {
8070
8101
  if (event.type === "claude-user") {
8071
8102
  const content = event.payload.message?.content || [];
@@ -8452,6 +8483,60 @@ function trimBlankEdges(lines) {
8452
8483
  return lines.slice(start, end);
8453
8484
  }
8454
8485
 
8486
+ // ../shared/src/user-message-parser/inline-diff-comments.ts
8487
+ var INLINE_DIFF_COMMENTS_HEADER = "Inline diff comments for the current changes:";
8488
+ var INLINE_DIFF_COMMENT_BLOCK_HEADER_REGEX = /^Inline diff comment \d+\s*$/;
8489
+ var INLINE_DIFF_COMMENT_BLOCK_START_REGEX = /(?:^|\n\n)(Inline diff comment \d+\s*\n[\s\S]*?)(?=\n\nInline diff comment \d+\s*\n|$)/g;
8490
+ function parseInlineDiffComments(content) {
8491
+ const headerIndex = content.indexOf(INLINE_DIFF_COMMENTS_HEADER);
8492
+ if (headerIndex === -1) return null;
8493
+ const leadingText = content.slice(0, headerIndex).trim();
8494
+ const body = content.slice(headerIndex + INLINE_DIFF_COMMENTS_HEADER.length).trim();
8495
+ const comments = [];
8496
+ for (const match of body.matchAll(INLINE_DIFF_COMMENT_BLOCK_START_REGEX)) {
8497
+ const comment = parseInlineDiffCommentBlock(match[1].trim());
8498
+ if (comment) comments.push(comment);
8499
+ }
8500
+ if (comments.length === 0) return null;
8501
+ return {
8502
+ source: "inline_diff_comments",
8503
+ comments,
8504
+ leadingText,
8505
+ leadingPlanQuote: parsePlanQuote(leadingText) ?? void 0
8506
+ };
8507
+ }
8508
+ function parseInlineDiffCommentBlock(block) {
8509
+ const lines = block.split("\n");
8510
+ if (!INLINE_DIFF_COMMENT_BLOCK_HEADER_REGEX.test(lines[0] ?? "")) return null;
8511
+ const location = readInlineDiffCommentField(block, "File");
8512
+ const side = readInlineDiffCommentField(block, "Side");
8513
+ const commentMarker = "\nComment:\n";
8514
+ const commentIndex = block.indexOf(commentMarker);
8515
+ if (!location || !side || commentIndex === -1) return null;
8516
+ const parsedLocation = parseInlineDiffCommentLocation(location);
8517
+ const codeMatch = block.match(/\nCode on that line:\n```(?:[^\n]*)?\n([\s\S]*?)\n```/);
8518
+ return {
8519
+ path: parsedLocation.path,
8520
+ lineNumber: parsedLocation.lineNumber,
8521
+ location,
8522
+ side,
8523
+ lineText: codeMatch?.[1]?.trimEnd() ?? "",
8524
+ body: block.slice(commentIndex + commentMarker.length).trim()
8525
+ };
8526
+ }
8527
+ function readInlineDiffCommentField(block, label) {
8528
+ const match = block.match(new RegExp(`^${label}:\\s*(.+)$`, "m"));
8529
+ return match?.[1]?.trim() ?? "";
8530
+ }
8531
+ function parseInlineDiffCommentLocation(location) {
8532
+ const match = location.match(/^(.*):(\d+)$/);
8533
+ if (!match) return { path: location, lineNumber: 0 };
8534
+ return {
8535
+ path: match[1],
8536
+ lineNumber: parseInt(match[2], 10)
8537
+ };
8538
+ }
8539
+
8455
8540
  // ../shared/src/user-message-parser/parsers.ts
8456
8541
  function parseCIFailure(content) {
8457
8542
  if (!content.startsWith("# CI/CD Workflow Failed")) return null;
@@ -8715,7 +8800,7 @@ function parseAutomationTriggered(content) {
8715
8800
  }
8716
8801
  function parseUserMessage(rawContent) {
8717
8802
  const content = removeReplicasInstructions(rawContent).trim();
8718
- return parseCIFailure(content) ?? parseGitHubIssueNew(content) ?? parseGitHubIssueExisting(content) ?? parseGitHubPRNew(content) ?? parseGitHubPRExistingPRReview(content) ?? parseGitHubPRExistingReview(content) ?? parseGitHubPRExistingGeneral(content) ?? parseSlackTask(content) ?? parseLinearIssue(content) ?? parseAutomationTriggered(content) ?? parsePlanQuote(content) ?? { source: "raw", content };
8803
+ return parseCIFailure(content) ?? parseGitHubIssueNew(content) ?? parseGitHubIssueExisting(content) ?? parseGitHubPRNew(content) ?? parseGitHubPRExistingPRReview(content) ?? parseGitHubPRExistingReview(content) ?? parseGitHubPRExistingGeneral(content) ?? parseSlackTask(content) ?? parseLinearIssue(content) ?? parseAutomationTriggered(content) ?? parseInlineDiffComments(content) ?? parsePlanQuote(content) ?? { source: "raw", content };
8719
8804
  }
8720
8805
 
8721
8806
  // ../shared/src/user-message-parser/source-config.ts
@@ -8730,7 +8815,8 @@ var SOURCE_CONFIG = {
8730
8815
  github_pr_existing_general: { label: "GitHub PR", color: "#8b949e" },
8731
8816
  slack_task: { label: "Slack", color: "#BF6CC2" },
8732
8817
  automation_triggered: { label: "Automation", color: "#f59e0b" },
8733
- plan_quote: { label: "Plan", color: "#66bb6a" }
8818
+ plan_quote: { label: "Plan", color: "#66bb6a" },
8819
+ inline_diff_comments: { label: "Diff Comments", color: "#66bb6a" }
8734
8820
  };
8735
8821
 
8736
8822
  // ../shared/src/sse.ts
package/dist/index.mjs CHANGED
@@ -20,7 +20,7 @@ import {
20
20
  setIdeCommand,
21
21
  setOrganizationId,
22
22
  writeConfig
23
- } from "./chunk-GUVQ6J5E.mjs";
23
+ } from "./chunk-J347A33R.mjs";
24
24
  import "./chunk-FFDYI4OH.mjs";
25
25
 
26
26
  // src/index.ts
@@ -2554,7 +2554,7 @@ async function interactiveCommand() {
2554
2554
  );
2555
2555
  }
2556
2556
  console.log(chalk19.gray("Starting interactive mode..."));
2557
- const { launchInteractive } = await import("./interactive-TO4C2LYF.mjs");
2557
+ const { launchInteractive } = await import("./interactive-C6JPUJ4R.mjs");
2558
2558
  await launchInteractive();
2559
2559
  }
2560
2560
 
@@ -2928,7 +2928,7 @@ Deleted file ${pathOrId}.
2928
2928
  }
2929
2929
 
2930
2930
  // src/index.ts
2931
- var CLI_VERSION = "0.2.150";
2931
+ var CLI_VERSION = "0.2.152";
2932
2932
  var program = new Command();
2933
2933
  program.name("replicas").description("CLI for managing Replicas workspaces").version(CLI_VERSION);
2934
2934
  program.command("login").description("Authenticate with your Replicas account").action(async () => {
@@ -13,7 +13,7 @@ import {
13
13
  parseAgentEvents,
14
14
  parseSseChunk,
15
15
  parseUserMessage
16
- } from "./chunk-GUVQ6J5E.mjs";
16
+ } from "./chunk-J347A33R.mjs";
17
17
  import "./chunk-FFDYI4OH.mjs";
18
18
 
19
19
  // src/interactive/index.tsx
@@ -1507,6 +1507,26 @@ function SlackTaskMessage({ data }) {
1507
1507
  hasDistinctContext && /* @__PURE__ */ jsx5(ExpandableSection, { label: "Thread context", children: data.threadContext })
1508
1508
  ] });
1509
1509
  }
1510
+ function InlineDiffCommentsMessage({ data }) {
1511
+ return /* @__PURE__ */ jsxs5("box", { flexDirection: "column", gap: 0, children: [
1512
+ /* @__PURE__ */ jsxs5("box", { flexDirection: "row", gap: 1, children: [
1513
+ /* @__PURE__ */ jsx5(SourceBadge, { source: "inline_diff_comments" }),
1514
+ /* @__PURE__ */ jsx5(MetadataPill, { label: "Comments", value: `${data.comments.length}` }),
1515
+ data.comments[0] && /* @__PURE__ */ jsx5(MetadataPill, { label: "File", value: data.comments[0].location })
1516
+ ] }),
1517
+ data.leadingPlanQuote ? /* @__PURE__ */ jsx5(MessageBody, { children: data.leadingPlanQuote.blocks.map((b) => `> ${b.quotedText}
1518
+ ${b.replyText}`).join("\n\n") }) : data.leadingText && /* @__PURE__ */ jsx5(MessageBody, { children: data.leadingText }),
1519
+ data.comments.map((comment, index) => /* @__PURE__ */ jsxs5("box", { flexDirection: "column", paddingLeft: 1, children: [
1520
+ /* @__PURE__ */ jsxs5("text", { fg: "#888888", children: [
1521
+ comment.location,
1522
+ " (",
1523
+ comment.side,
1524
+ ")"
1525
+ ] }),
1526
+ /* @__PURE__ */ jsx5(MessageBody, { children: comment.body })
1527
+ ] }, `${comment.location}-${index}`))
1528
+ ] });
1529
+ }
1510
1530
  function StructuredUserMessage({ parsed }) {
1511
1531
  switch (parsed.source) {
1512
1532
  case "ci_failure":
@@ -1527,6 +1547,8 @@ function StructuredUserMessage({ parsed }) {
1527
1547
  return /* @__PURE__ */ jsx5(GitHubPRGeneralMessage, { data: parsed });
1528
1548
  case "slack_task":
1529
1549
  return /* @__PURE__ */ jsx5(SlackTaskMessage, { data: parsed });
1550
+ case "inline_diff_comments":
1551
+ return /* @__PURE__ */ jsx5(InlineDiffCommentsMessage, { data: parsed });
1530
1552
  case "automation_triggered":
1531
1553
  case "plan_quote":
1532
1554
  return /* @__PURE__ */ jsx5("text", { fg: "#cccccc", selectable: true, children: parsed.source === "plan_quote" ? parsed.blocks.map((b) => `> ${b.quotedText}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.2.150",
3
+ "version": "0.2.152",
4
4
  "description": "CLI for managing Replicas workspaces - SSH into cloud dev environments with automatic port forwarding",
5
5
  "main": "dist/index.mjs",
6
6
  "bin": {