replicas-cli 0.2.149 → 0.2.151
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.
|
@@ -8452,6 +8452,60 @@ function trimBlankEdges(lines) {
|
|
|
8452
8452
|
return lines.slice(start, end);
|
|
8453
8453
|
}
|
|
8454
8454
|
|
|
8455
|
+
// ../shared/src/user-message-parser/inline-diff-comments.ts
|
|
8456
|
+
var INLINE_DIFF_COMMENTS_HEADER = "Inline diff comments for the current changes:";
|
|
8457
|
+
var INLINE_DIFF_COMMENT_BLOCK_HEADER_REGEX = /^Inline diff comment \d+\s*$/;
|
|
8458
|
+
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;
|
|
8459
|
+
function parseInlineDiffComments(content) {
|
|
8460
|
+
const headerIndex = content.indexOf(INLINE_DIFF_COMMENTS_HEADER);
|
|
8461
|
+
if (headerIndex === -1) return null;
|
|
8462
|
+
const leadingText = content.slice(0, headerIndex).trim();
|
|
8463
|
+
const body = content.slice(headerIndex + INLINE_DIFF_COMMENTS_HEADER.length).trim();
|
|
8464
|
+
const comments = [];
|
|
8465
|
+
for (const match of body.matchAll(INLINE_DIFF_COMMENT_BLOCK_START_REGEX)) {
|
|
8466
|
+
const comment = parseInlineDiffCommentBlock(match[1].trim());
|
|
8467
|
+
if (comment) comments.push(comment);
|
|
8468
|
+
}
|
|
8469
|
+
if (comments.length === 0) return null;
|
|
8470
|
+
return {
|
|
8471
|
+
source: "inline_diff_comments",
|
|
8472
|
+
comments,
|
|
8473
|
+
leadingText,
|
|
8474
|
+
leadingPlanQuote: parsePlanQuote(leadingText) ?? void 0
|
|
8475
|
+
};
|
|
8476
|
+
}
|
|
8477
|
+
function parseInlineDiffCommentBlock(block) {
|
|
8478
|
+
const lines = block.split("\n");
|
|
8479
|
+
if (!INLINE_DIFF_COMMENT_BLOCK_HEADER_REGEX.test(lines[0] ?? "")) return null;
|
|
8480
|
+
const location = readInlineDiffCommentField(block, "File");
|
|
8481
|
+
const side = readInlineDiffCommentField(block, "Side");
|
|
8482
|
+
const commentMarker = "\nComment:\n";
|
|
8483
|
+
const commentIndex = block.indexOf(commentMarker);
|
|
8484
|
+
if (!location || !side || commentIndex === -1) return null;
|
|
8485
|
+
const parsedLocation = parseInlineDiffCommentLocation(location);
|
|
8486
|
+
const codeMatch = block.match(/\nCode on that line:\n```(?:[^\n]*)?\n([\s\S]*?)\n```/);
|
|
8487
|
+
return {
|
|
8488
|
+
path: parsedLocation.path,
|
|
8489
|
+
lineNumber: parsedLocation.lineNumber,
|
|
8490
|
+
location,
|
|
8491
|
+
side,
|
|
8492
|
+
lineText: codeMatch?.[1]?.trimEnd() ?? "",
|
|
8493
|
+
body: block.slice(commentIndex + commentMarker.length).trim()
|
|
8494
|
+
};
|
|
8495
|
+
}
|
|
8496
|
+
function readInlineDiffCommentField(block, label) {
|
|
8497
|
+
const match = block.match(new RegExp(`^${label}:\\s*(.+)$`, "m"));
|
|
8498
|
+
return match?.[1]?.trim() ?? "";
|
|
8499
|
+
}
|
|
8500
|
+
function parseInlineDiffCommentLocation(location) {
|
|
8501
|
+
const match = location.match(/^(.*):(\d+)$/);
|
|
8502
|
+
if (!match) return { path: location, lineNumber: 0 };
|
|
8503
|
+
return {
|
|
8504
|
+
path: match[1],
|
|
8505
|
+
lineNumber: parseInt(match[2], 10)
|
|
8506
|
+
};
|
|
8507
|
+
}
|
|
8508
|
+
|
|
8455
8509
|
// ../shared/src/user-message-parser/parsers.ts
|
|
8456
8510
|
function parseCIFailure(content) {
|
|
8457
8511
|
if (!content.startsWith("# CI/CD Workflow Failed")) return null;
|
|
@@ -8715,7 +8769,7 @@ function parseAutomationTriggered(content) {
|
|
|
8715
8769
|
}
|
|
8716
8770
|
function parseUserMessage(rawContent) {
|
|
8717
8771
|
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 };
|
|
8772
|
+
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
8773
|
}
|
|
8720
8774
|
|
|
8721
8775
|
// ../shared/src/user-message-parser/source-config.ts
|
|
@@ -8730,7 +8784,8 @@ var SOURCE_CONFIG = {
|
|
|
8730
8784
|
github_pr_existing_general: { label: "GitHub PR", color: "#8b949e" },
|
|
8731
8785
|
slack_task: { label: "Slack", color: "#BF6CC2" },
|
|
8732
8786
|
automation_triggered: { label: "Automation", color: "#f59e0b" },
|
|
8733
|
-
plan_quote: { label: "Plan", color: "#66bb6a" }
|
|
8787
|
+
plan_quote: { label: "Plan", color: "#66bb6a" },
|
|
8788
|
+
inline_diff_comments: { label: "Diff Comments", color: "#66bb6a" }
|
|
8734
8789
|
};
|
|
8735
8790
|
|
|
8736
8791
|
// ../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-
|
|
23
|
+
} from "./chunk-DS332SPG.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-
|
|
2557
|
+
const { launchInteractive } = await import("./interactive-CY6A5PLK.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.
|
|
2931
|
+
var CLI_VERSION = "0.2.151";
|
|
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-
|
|
16
|
+
} from "./chunk-DS332SPG.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}
|