replicas-cli 0.2.275 → 0.2.276

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.mjs +76 -30
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -9236,7 +9236,7 @@ var HOOK_EXEC_MAX_BUFFER_BYTES = 10 * 1024 * 1024;
9236
9236
  var REPLICAS_CONFIG_FILENAMES = ["replicas.json", "replicas.yaml", "replicas.yml"];
9237
9237
 
9238
9238
  // ../shared/src/cli-version.ts
9239
- var CLI_VERSION = "0.2.275";
9239
+ var CLI_VERSION = "0.2.276";
9240
9240
 
9241
9241
  // ../shared/src/engine/environment.ts
9242
9242
  var DESKTOP_NOVNC_PORT = 6080;
@@ -10621,6 +10621,8 @@ function parseInlineDiffCommentLocation(location) {
10621
10621
  function parseCIFailure(content) {
10622
10622
  if (!content.startsWith("# CI/CD Workflow Failed")) return null;
10623
10623
  const prMatch = content.match(/Pull Request #(\d+)/);
10624
+ const mrMatch = content.match(/Merge Request !(\d+)/);
10625
+ const requestMatch = prMatch ?? mrMatch;
10624
10626
  const workflowNameMatch = content.match(/\*\*Workflow Name:\*\*\s*(.+)/);
10625
10627
  const workflowFileMatch = content.match(/\*\*Workflow File:\*\*\s*(.+)/);
10626
10628
  const conclusionMatch = content.match(/\*\*Conclusion:\*\*\s*(.+)/);
@@ -10630,10 +10632,11 @@ function parseCIFailure(content) {
10630
10632
  );
10631
10633
  const prUrlMatch = content.match(/\*\*PR URL:\*\*\s*(.+)/);
10632
10634
  const fileUrlMatch = content.match(/\*\*File URL:\*\*\s*(.+)/);
10633
- if (!prMatch) return null;
10635
+ if (!requestMatch) return null;
10634
10636
  return {
10635
10637
  source: "ci_failure",
10636
- prNumber: parseInt(prMatch[1], 10),
10638
+ prNumber: parseInt(requestMatch[1], 10),
10639
+ isMergeRequest: !prMatch && !!mrMatch,
10637
10640
  workflowName: workflowNameMatch?.[1]?.trim() ?? "Unknown",
10638
10641
  workflowFile: workflowFileMatch?.[1]?.trim() ?? "",
10639
10642
  conclusion: conclusionMatch?.[1]?.trim() ?? "failure",
@@ -10644,45 +10647,74 @@ function parseCIFailure(content) {
10644
10647
  };
10645
10648
  }
10646
10649
  function parseGitHubIssueNew(content) {
10647
- const headerMatch = content.match(/^# Task: GitHub Issue #(\d+) - (.+)$/m);
10650
+ const fields = parseIssueNewFields(content, /^# Task: GitHub Issue #(\d+) - (.+)$/m);
10651
+ if (!fields) return null;
10652
+ const userUrlMatch = content.match(/\*\*User URL:\*\*\s*(.+)/);
10653
+ return {
10654
+ source: "github_issue_new",
10655
+ ...fields,
10656
+ userUrl: userUrlMatch?.[1]?.trim()
10657
+ };
10658
+ }
10659
+ function parseGitHubIssueExisting(content) {
10660
+ const fields = parseIssueExistingFields(content, /^You received a new comment on GitHub Issue #(\d+)\./);
10661
+ if (!fields) return null;
10662
+ const userUrlMatch = content.match(/\*\*User URL:\*\*\s*(.+)/);
10663
+ return {
10664
+ source: "github_issue_existing",
10665
+ ...fields,
10666
+ userUrl: userUrlMatch?.[1]?.trim()
10667
+ };
10668
+ }
10669
+ function parseGitLabIssueNew(content) {
10670
+ const fields = parseIssueNewFields(content, /^# Task: GitLab Issue #(\d+) - (.+)$/m);
10671
+ if (!fields) return null;
10672
+ const userUrlMatch = content.match(/\*\*User URL:\*\*\s*(.+)/);
10673
+ return {
10674
+ source: "gitlab_issue_new",
10675
+ ...fields,
10676
+ userUrl: userUrlMatch?.[1]?.trim()
10677
+ };
10678
+ }
10679
+ function parseIssueNewFields(content, headerPattern) {
10680
+ const headerMatch = content.match(headerPattern);
10648
10681
  if (!headerMatch) return null;
10649
- const issueNumber = parseInt(headerMatch[1], 10);
10650
- const issueTitle = headerMatch[2].trim();
10651
10682
  const descMatch = content.match(/## Issue Description\n([\s\S]*?)(?=\n## |$)/);
10652
10683
  const triggerMatch = content.match(
10653
10684
  /## Triggering Comment from @(\S+)\n([\s\S]*?)(?=\n\*\*(?:PR|Issue|User|File) URL:\*\*|\n## |$)/
10654
10685
  );
10655
10686
  const issueUrlMatch = content.match(/\*\*Issue URL:\*\*\s*(.+)/);
10656
- const userUrlMatch = content.match(/\*\*User URL:\*\*\s*(.+)/);
10657
10687
  return {
10658
- source: "github_issue_new",
10659
- issueNumber,
10660
- issueTitle,
10688
+ issueNumber: parseInt(headerMatch[1], 10),
10689
+ issueTitle: headerMatch[2].trim(),
10661
10690
  issueDescription: descMatch?.[1]?.trim() ?? "",
10662
10691
  triggeringUser: triggerMatch?.[1] ?? "",
10663
10692
  triggeringComment: triggerMatch?.[2]?.trim() ?? "",
10664
- issueUrl: issueUrlMatch?.[1]?.trim(),
10693
+ issueUrl: issueUrlMatch?.[1]?.trim()
10694
+ };
10695
+ }
10696
+ function parseGitLabIssueExisting(content) {
10697
+ const fields = parseIssueExistingFields(content, /^You received a new comment on GitLab Issue #(\d+)\./);
10698
+ if (!fields) return null;
10699
+ const userUrlMatch = content.match(/\*\*User URL:\*\*\s*(.+)/);
10700
+ return {
10701
+ source: "gitlab_issue_existing",
10702
+ ...fields,
10665
10703
  userUrl: userUrlMatch?.[1]?.trim()
10666
10704
  };
10667
10705
  }
10668
- function parseGitHubIssueExisting(content) {
10669
- const headerMatch = content.match(
10670
- /^You received a new comment on GitHub Issue #(\d+)\./
10671
- );
10706
+ function parseIssueExistingFields(content, headerPattern) {
10707
+ const headerMatch = content.match(headerPattern);
10672
10708
  if (!headerMatch) return null;
10673
- const issueNumber = parseInt(headerMatch[1], 10);
10674
10709
  const commentMatch = content.match(
10675
10710
  /Comment from @(\S+):\n([\s\S]*?)(?=\n\*\*(?:PR|Issue|User|File) URL:\*\*|\nIMPORTANT INSTRUCTIONS:)/
10676
10711
  );
10677
10712
  const issueUrlMatch = content.match(/\*\*Issue URL:\*\*\s*(.+)/);
10678
- const userUrlMatch = content.match(/\*\*User URL:\*\*\s*(.+)/);
10679
10713
  return {
10680
- source: "github_issue_existing",
10681
- issueNumber,
10714
+ issueNumber: parseInt(headerMatch[1], 10),
10682
10715
  commentUser: commentMatch?.[1] ?? "",
10683
10716
  commentBody: commentMatch?.[2]?.trim() ?? "",
10684
- issueUrl: issueUrlMatch?.[1]?.trim(),
10685
- userUrl: userUrlMatch?.[1]?.trim()
10717
+ issueUrl: issueUrlMatch?.[1]?.trim()
10686
10718
  };
10687
10719
  }
10688
10720
  function parseGitHubPRNew(content) {
@@ -10879,7 +10911,7 @@ function parseAutomationTriggered(content) {
10879
10911
  };
10880
10912
  }
10881
10913
  function parseSingleMessage(content) {
10882
- 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 };
10914
+ return parseCIFailure(content) ?? parseGitHubIssueNew(content) ?? parseGitHubIssueExisting(content) ?? parseGitLabIssueNew(content) ?? parseGitLabIssueExisting(content) ?? parseGitHubPRNew(content) ?? parseGitHubPRExistingPRReview(content) ?? parseGitHubPRExistingReview(content) ?? parseGitHubPRExistingGeneral(content) ?? parseSlackTask(content) ?? parseLinearIssue(content) ?? parseAutomationTriggered(content) ?? parseInlineDiffComments(content) ?? parsePlanQuote(content) ?? { source: "raw", content };
10883
10915
  }
10884
10916
  function parseMerged(content) {
10885
10917
  if (!content.includes(MERGED_MESSAGE_SEPARATOR)) return null;
@@ -10901,6 +10933,8 @@ var SOURCE_CONFIG = {
10901
10933
  linear_issue: { label: "Linear", color: "#5E6AD2" },
10902
10934
  github_issue_new: { label: "GitHub Issue", color: "#8b949e" },
10903
10935
  github_issue_existing: { label: "GitHub Issue", color: "#8b949e" },
10936
+ gitlab_issue_new: { label: "GitLab Issue", color: "#fc6d26" },
10937
+ gitlab_issue_existing: { label: "GitLab Issue", color: "#fc6d26" },
10904
10938
  github_pr_new: { label: "GitHub PR", color: "#8b949e" },
10905
10939
  github_pr_existing_review: { label: "Code Review", color: "#8b949e" },
10906
10940
  github_pr_existing_pr_review: { label: "PR Review", color: "#8b949e" },
@@ -15489,17 +15523,19 @@ function ExpandableDiffSection({ label, diffContent, filePath }) {
15489
15523
  ] });
15490
15524
  }
15491
15525
  function CIFailureMessage({ data }) {
15526
+ const requestLabel = data.isMergeRequest ? "MR" : "PR";
15527
+ const requestRef = `${data.isMergeRequest ? "!" : "#"}${data.prNumber}`;
15492
15528
  return /* @__PURE__ */ jsxs5("box", { flexDirection: "column", gap: 0, children: [
15493
15529
  /* @__PURE__ */ jsxs5("box", { flexDirection: "row", gap: 1, children: [
15494
15530
  /* @__PURE__ */ jsx5(SourceBadge, { source: "ci_failure" }),
15495
- /* @__PURE__ */ jsx5(MetadataPill, { label: "PR", value: `#${data.prNumber}` }),
15531
+ /* @__PURE__ */ jsx5(MetadataPill, { label: requestLabel, value: requestRef }),
15496
15532
  /* @__PURE__ */ jsx5(MetadataPill, { label: "Workflow", value: data.workflowName }),
15497
15533
  /* @__PURE__ */ jsx5(MetadataPill, { label: "Status", value: data.conclusion })
15498
15534
  ] }),
15499
15535
  /* @__PURE__ */ jsxs5("text", { fg: "#ffffff", children: [
15500
15536
  "Workflow ",
15501
15537
  /* @__PURE__ */ jsx5("span", { fg: "#ff4444", children: data.conclusionText }),
15502
- " on PR #" + data.prNumber
15538
+ ` on ${requestLabel} ${requestRef}`
15503
15539
  ] }),
15504
15540
  data.workflowFile && /* @__PURE__ */ jsx5(MetadataPill, { label: "File", value: data.workflowFile }),
15505
15541
  data.runUrl && /* @__PURE__ */ jsx5(MetadataPill, { label: "Run", value: data.runUrl })
@@ -15517,10 +15553,13 @@ function LinearIssueMessage({ data }) {
15517
15553
  data.parentIssue && /* @__PURE__ */ jsx5(ExpandableSection, { label: `Parent: ${data.parentIssue.identifier} - ${data.parentIssue.title}`, children: data.parentIssue.description })
15518
15554
  ] });
15519
15555
  }
15520
- function GitHubIssueNewMessage({ data }) {
15556
+ function HostIssueNewMessage({
15557
+ data,
15558
+ source
15559
+ }) {
15521
15560
  return /* @__PURE__ */ jsxs5("box", { flexDirection: "column", gap: 0, children: [
15522
15561
  /* @__PURE__ */ jsxs5("box", { flexDirection: "row", gap: 1, children: [
15523
- /* @__PURE__ */ jsx5(SourceBadge, { source: "github_issue_new" }),
15562
+ /* @__PURE__ */ jsx5(SourceBadge, { source }),
15524
15563
  /* @__PURE__ */ jsx5(MetadataPill, { label: "Issue", value: `#${data.issueNumber}` }),
15525
15564
  data.triggeringUser && /* @__PURE__ */ jsx5(MetadataPill, { label: "From", value: `@${data.triggeringUser}` })
15526
15565
  ] }),
@@ -15529,10 +15568,13 @@ function GitHubIssueNewMessage({ data }) {
15529
15568
  /* @__PURE__ */ jsx5(ExpandableSection, { label: "Issue description", children: data.issueDescription })
15530
15569
  ] });
15531
15570
  }
15532
- function GitHubIssueExistingMessage({ data }) {
15571
+ function HostIssueExistingMessage({
15572
+ data,
15573
+ source
15574
+ }) {
15533
15575
  return /* @__PURE__ */ jsxs5("box", { flexDirection: "column", gap: 0, children: [
15534
15576
  /* @__PURE__ */ jsxs5("box", { flexDirection: "row", gap: 1, children: [
15535
- /* @__PURE__ */ jsx5(SourceBadge, { source: "github_issue_existing" }),
15577
+ /* @__PURE__ */ jsx5(SourceBadge, { source }),
15536
15578
  /* @__PURE__ */ jsx5(MetadataPill, { label: "Issue", value: `#${data.issueNumber}` }),
15537
15579
  data.commentUser && /* @__PURE__ */ jsx5(MetadataPill, { label: "From", value: `@${data.commentUser}` })
15538
15580
  ] }),
@@ -15624,9 +15666,13 @@ function StructuredUserMessage({ parsed }) {
15624
15666
  case "linear_issue":
15625
15667
  return /* @__PURE__ */ jsx5(LinearIssueMessage, { data: parsed });
15626
15668
  case "github_issue_new":
15627
- return /* @__PURE__ */ jsx5(GitHubIssueNewMessage, { data: parsed });
15669
+ return /* @__PURE__ */ jsx5(HostIssueNewMessage, { data: parsed, source: "github_issue_new" });
15628
15670
  case "github_issue_existing":
15629
- return /* @__PURE__ */ jsx5(GitHubIssueExistingMessage, { data: parsed });
15671
+ return /* @__PURE__ */ jsx5(HostIssueExistingMessage, { data: parsed, source: "github_issue_existing" });
15672
+ case "gitlab_issue_new":
15673
+ return /* @__PURE__ */ jsx5(HostIssueNewMessage, { data: parsed, source: "gitlab_issue_new" });
15674
+ case "gitlab_issue_existing":
15675
+ return /* @__PURE__ */ jsx5(HostIssueExistingMessage, { data: parsed, source: "gitlab_issue_existing" });
15630
15676
  case "github_pr_new":
15631
15677
  return /* @__PURE__ */ jsx5(GitHubPRNewMessage, { data: parsed });
15632
15678
  case "github_pr_existing_review":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.2.275",
3
+ "version": "0.2.276",
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": {