replicas-cli 0.2.50 → 0.2.51

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.
package/dist/index.mjs CHANGED
@@ -1855,12 +1855,12 @@ async function interactiveCommand() {
1855
1855
  );
1856
1856
  }
1857
1857
  console.log(chalk17.gray("Starting interactive mode..."));
1858
- const { launchInteractive } = await import("./interactive-T3IXE7C4.mjs");
1858
+ const { launchInteractive } = await import("./interactive-RO6PZ2XP.mjs");
1859
1859
  await launchInteractive();
1860
1860
  }
1861
1861
 
1862
1862
  // src/index.ts
1863
- var CLI_VERSION = "0.2.50";
1863
+ var CLI_VERSION = "0.2.51";
1864
1864
  var program = new Command();
1865
1865
  program.name("replicas").description("CLI for managing Replicas workspaces").version(CLI_VERSION);
1866
1866
  program.command("login").description("Authenticate with your Replicas account").action(async () => {
@@ -365,6 +365,7 @@ function useWorkspaceEvents(workspaceId, enabled = true) {
365
365
  if (!current) return current;
366
366
  return { ...current, repoStatuses: event.payload.repos };
367
367
  });
368
+ qc.invalidateQueries({ queryKey: ["workspace-status", workspaceId, true] });
368
369
  return;
369
370
  }
370
371
  if (event.type === "preview.changed") {
@@ -1505,6 +1506,11 @@ function buildInteractiveItems(workspaceId, status, previews, wakingWorkspaceId)
1505
1506
  }
1506
1507
  }
1507
1508
  }
1509
+ const hasAnyPr = status.repoStatuses?.some((repo) => repo.prUrl);
1510
+ const githubConfigured = status.environmentDetails?.githubAccessConfigured;
1511
+ if (workspaceId && status.status === "active" && !hasAnyPr && githubConfigured) {
1512
+ items.push({ type: "createPr" });
1513
+ }
1508
1514
  return items;
1509
1515
  }
1510
1516
  function getItemLabel(item) {
@@ -1517,6 +1523,8 @@ function getItemLabel(item) {
1517
1523
  return `\u2197 Preview :${item.port}`;
1518
1524
  case "pr":
1519
1525
  return `\u2197 View PR (${item.repoName})`;
1526
+ case "createPr":
1527
+ return "+ Create PR";
1520
1528
  }
1521
1529
  }
1522
1530
  var AUTH_METHOD_LABELS = {
@@ -1569,7 +1577,10 @@ function DetailList({
1569
1577
  if (rows.length === 0) return null;
1570
1578
  return /* @__PURE__ */ jsx7(Fragment3, { children: rows.map((item, i) => /* @__PURE__ */ jsx7(CardItem, { label: item, status: actualSet.has(item) }, i)) });
1571
1579
  }
1572
- function InteractiveRow({ label, highlighted, onClick }) {
1580
+ function InteractiveRow({ label, highlighted, disabled, onClick }) {
1581
+ if (disabled) {
1582
+ return /* @__PURE__ */ jsx7("box", { paddingX: 1, backgroundColor: "#111111", children: /* @__PURE__ */ jsx7("text", { children: /* @__PURE__ */ jsx7("span", { fg: "#444444", children: label }) }) });
1583
+ }
1573
1584
  return /* @__PURE__ */ jsx7(
1574
1585
  "box",
1575
1586
  {
@@ -1580,7 +1591,7 @@ function InteractiveRow({ label, highlighted, onClick }) {
1580
1591
  }
1581
1592
  );
1582
1593
  }
1583
- function WorkspaceInfo({ status, workspaceName, workspaceId, focused, loading, envConfig, previews, onWakeWorkspace, wakingWorkspaceId }) {
1594
+ function WorkspaceInfo({ status, workspaceName, workspaceId, focused, loading, envConfig, previews, onWakeWorkspace, onCreatePr, isPlanMode, wakingWorkspaceId }) {
1584
1595
  const borderColor = focused ? "#66bb6a" : "#333333";
1585
1596
  const [cursorIndex, setCursorIndex] = useState5(0);
1586
1597
  const interactiveItems = useMemo4(() => {
@@ -1616,9 +1627,12 @@ function WorkspaceInfo({ status, workspaceName, workspaceId, focused, loading, e
1616
1627
  open(item.url).catch(() => {
1617
1628
  });
1618
1629
  break;
1630
+ case "createPr":
1631
+ if (!isPlanMode) onCreatePr();
1632
+ break;
1619
1633
  }
1620
1634
  },
1621
- [onWakeWorkspace]
1635
+ [onWakeWorkspace, onCreatePr]
1622
1636
  );
1623
1637
  useKeyboard3((key) => {
1624
1638
  if (!focused) return;
@@ -1714,6 +1728,7 @@ function WorkspaceInfo({ status, workspaceName, workspaceId, focused, loading, e
1714
1728
  const expectedGlobalFiles = (envConfig.files?.environment_files ?? []).filter((f) => f.scope_type === "global").map((f) => f.path);
1715
1729
  const dashboardItem = findItem("dashboard");
1716
1730
  const wakeItem = findItem("wake");
1731
+ const createPrItem = findItem("createPr");
1717
1732
  return /* @__PURE__ */ jsx7(
1718
1733
  "box",
1719
1734
  {
@@ -1837,6 +1852,15 @@ function WorkspaceInfo({ status, workspaceName, workspaceId, focused, loading, e
1837
1852
  )
1838
1853
  ] }, i);
1839
1854
  }) }),
1855
+ createPrItem && /* @__PURE__ */ jsx7(
1856
+ InteractiveRow,
1857
+ {
1858
+ label: getItemLabel(createPrItem),
1859
+ highlighted: isHighlighted(createPrItem),
1860
+ disabled: isPlanMode,
1861
+ onClick: () => handleAction(createPrItem)
1862
+ }
1863
+ ),
1840
1864
  env && /* @__PURE__ */ jsxs7(Section, { title: "Hooks", children: [
1841
1865
  /* @__PURE__ */ jsx7(CardItem, { label: "Global warm", status: env.globalWarmHookCompleted.status }),
1842
1866
  env.repositories.map((repo, i) => /* @__PURE__ */ jsxs7(React5.Fragment, { children: [
@@ -2307,6 +2331,11 @@ function AppInner() {
2307
2331
  },
2308
2332
  previews,
2309
2333
  onWakeWorkspace: handleWakeWorkspace,
2334
+ onCreatePr: () => {
2335
+ if (!resolvedChatId) return;
2336
+ sendMessageMutation.mutate({ message: "Push changes and create a GitHub PR" });
2337
+ },
2338
+ isPlanMode: taskMode === "plan",
2310
2339
  wakingWorkspaceId
2311
2340
  }
2312
2341
  )
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.2.50",
3
+ "version": "0.2.51",
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": {