replicas-cli 0.2.50 → 0.2.52

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-N5J5JUYL.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.52";
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") {
@@ -1487,6 +1488,11 @@ import { Fragment as Fragment3, jsx as jsx7, jsxs as jsxs7 } from "@opentui/reac
1487
1488
  var WEB_APP_URL = process.env.REPLICAS_WEB_URL || "https://replicas.dev";
1488
1489
  function buildInteractiveItems(workspaceId, status, previews, wakingWorkspaceId) {
1489
1490
  const items = [];
1491
+ const hasAnyPr = status.repoStatuses?.some((repo) => repo.prUrl);
1492
+ const githubConfigured = status.environmentDetails?.githubAccessConfigured;
1493
+ if (workspaceId && status.status === "active" && !hasAnyPr && githubConfigured) {
1494
+ items.push({ type: "createPr" });
1495
+ }
1490
1496
  if (workspaceId) {
1491
1497
  items.push({ type: "dashboard", workspaceId });
1492
1498
  }
@@ -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
  {
@@ -1742,6 +1757,15 @@ function WorkspaceInfo({ status, workspaceName, workspaceId, focused, loading, e
1742
1757
  ] })
1743
1758
  ] })
1744
1759
  ] }) }),
1760
+ createPrItem && /* @__PURE__ */ jsx7(
1761
+ InteractiveRow,
1762
+ {
1763
+ label: getItemLabel(createPrItem),
1764
+ highlighted: isHighlighted(createPrItem),
1765
+ disabled: isPlanMode,
1766
+ onClick: () => handleAction(createPrItem)
1767
+ }
1768
+ ),
1745
1769
  dashboardItem && /* @__PURE__ */ jsx7(
1746
1770
  InteractiveRow,
1747
1771
  {
@@ -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.52",
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": {