replicas-cli 0.2.55 → 0.2.57

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.
@@ -8194,7 +8194,9 @@ function createMockWorkspaceRecord(organizationId, name) {
8194
8194
  status: "preparing",
8195
8195
  creation_source: "dashboard",
8196
8196
  creator_email: null,
8197
- soft_delete: false
8197
+ soft_delete: false,
8198
+ lifecycle_policy: "default",
8199
+ auto_stop_minutes: null
8198
8200
  };
8199
8201
  }
8200
8202
 
@@ -8214,7 +8216,7 @@ var PLANS = {
8214
8216
  monthlyPrice: 30,
8215
8217
  seatPriceCents: 3e3,
8216
8218
  creditsIncluded: 0,
8217
- features: ["Unlimited usage", "API access ($1/hr)"]
8219
+ features: ["Unlimited usage", "API access ($0.0166/min)"]
8218
8220
  },
8219
8221
  team: {
8220
8222
  id: "team",
package/dist/index.mjs CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  setIdeCommand,
16
16
  setOrganizationId,
17
17
  writeConfig
18
- } from "./chunk-SDULF4LX.mjs";
18
+ } from "./chunk-NXCEFG2Q.mjs";
19
19
 
20
20
  // src/index.ts
21
21
  import "dotenv/config";
@@ -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-PU7VBDB2.mjs");
1858
+ const { launchInteractive } = await import("./interactive-X3HBRSWO.mjs");
1859
1859
  await launchInteractive();
1860
1860
  }
1861
1861
 
1862
1862
  // src/index.ts
1863
- var CLI_VERSION = "0.2.55";
1863
+ var CLI_VERSION = "0.2.57";
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 () => {
@@ -11,7 +11,7 @@ import {
11
11
  isAgentBackendEvent,
12
12
  parseAgentEvents,
13
13
  parseUserMessage
14
- } from "./chunk-SDULF4LX.mjs";
14
+ } from "./chunk-NXCEFG2Q.mjs";
15
15
 
16
16
  // src/interactive/index.tsx
17
17
  import { createCliRenderer } from "@opentui/core";
@@ -299,6 +299,18 @@ function useWorkspacePreviews(workspaceId) {
299
299
  retry: 2
300
300
  }, auth.queryClient);
301
301
  }
302
+ function useAgentAvailability(workspaceId) {
303
+ const auth = useReplicasAuth();
304
+ const orgFetch = useOrgFetch();
305
+ return useQuery2({
306
+ queryKey: ["agent-availability", workspaceId],
307
+ queryFn: () => orgFetch(`/v1/workspaces/${workspaceId}/agent-availability`),
308
+ enabled: !!workspaceId,
309
+ staleTime: 6e4,
310
+ refetchInterval: 6e4,
311
+ retry: 2
312
+ }, auth.queryClient);
313
+ }
302
314
  function useWorkspaceEvents(workspaceId, enabled = true) {
303
315
  const auth = useReplicasAuth();
304
316
  const rawFetch = useRawOrgFetch();
@@ -1812,7 +1824,9 @@ function ChatArea({
1812
1824
  focusPanel,
1813
1825
  taskMode,
1814
1826
  isProcessing,
1815
- loading
1827
+ loading,
1828
+ agentAvailable,
1829
+ agentLabel
1816
1830
  }) {
1817
1831
  const textareaRef = useRef2(null);
1818
1832
  const scrollboxRef = useRef2(null);
@@ -1962,6 +1976,12 @@ function ChatArea({
1962
1976
  height: 5
1963
1977
  }
1964
1978
  ) }),
1979
+ !agentAvailable && /* @__PURE__ */ jsx7("box", { paddingX: 1, height: 1, children: /* @__PURE__ */ jsx7("text", { children: /* @__PURE__ */ jsxs7("span", { fg: "#d97706", children: [
1980
+ agentLabel,
1981
+ " is not connected. Run `replicas ",
1982
+ agentLabel === "Codex" ? "codex-auth" : "claude-auth",
1983
+ "` to connect."
1984
+ ] }) }) }),
1965
1985
  /* @__PURE__ */ jsxs7(
1966
1986
  "box",
1967
1987
  {
@@ -2162,7 +2182,7 @@ function ViewModeRow({
2162
2182
  }
2163
2183
  );
2164
2184
  }
2165
- function WorkspaceInfo({ status, workspaceName, workspaceId, focused, loading, envConfig, previews, onWakeWorkspace, onViewDiff, wakingWorkspaceId, viewMode, viewingDiffRepoName, onSelectChatMode, onSelectDiffMode, onCreatePr, isPlanMode }) {
2185
+ function WorkspaceInfo({ status, workspaceName, workspaceId, focused, loading, envConfig, agentAvailability, previews, onWakeWorkspace, onViewDiff, wakingWorkspaceId, viewMode, viewingDiffRepoName, onSelectChatMode, onSelectDiffMode, onCreatePr, isPlanMode }) {
2166
2186
  const borderColor = focused ? "#66bb6a" : "#333333";
2167
2187
  const [cursorIndex, setCursorIndex] = useState6(0);
2168
2188
  const interactiveItems = useMemo5(() => {
@@ -2311,7 +2331,12 @@ function WorkspaceInfo({ status, workspaceName, workspaceId, focused, loading, e
2311
2331
  );
2312
2332
  }
2313
2333
  const statusColor = status.status === "active" ? "#66bb6a" : status.status === "sleeping" ? "#ffaa00" : "#ff4444";
2314
- const env = status.environmentDetails;
2334
+ const rawEnv = status.environmentDetails;
2335
+ const env = rawEnv && agentAvailability ? {
2336
+ ...rawEnv,
2337
+ claudeAuthMethod: agentAvailability.claude.available ? rawEnv.claudeAuthMethod : "none",
2338
+ codexAuthMethod: agentAvailability.codex.available ? rawEnv.codexAuthMethod : "none"
2339
+ } : rawEnv;
2315
2340
  const expectedSkills = (envConfig.skills?.environment_skills ?? []).map((s) => s.source);
2316
2341
  const expectedGlobalVars = (envConfig.variables?.environment_variables ?? []).filter((v) => v.scope_type === "global").map((v) => v.key);
2317
2342
  const expectedGlobalFiles = (envConfig.files?.environment_files ?? []).filter((f) => f.scope_type === "global").map((f) => f.path);
@@ -2707,6 +2732,7 @@ function AppInner() {
2707
2732
  const { connected: sseConnected } = useWorkspaceEvents(
2708
2733
  isMockSelected ? null : selectedWorkspaceId
2709
2734
  );
2735
+ const { data: agentAvailability } = useAgentAvailability(isMockSelected ? null : selectedWorkspaceId);
2710
2736
  const createWorkspaceMutation = useCreateWorkspace();
2711
2737
  const deleteWorkspaceMutation = useDeleteWorkspace();
2712
2738
  const wakeWorkspaceMutation = useWakeWorkspace();
@@ -2726,6 +2752,9 @@ function AppInner() {
2726
2752
  const selectedWorkspace = allWorkspaces.find((ws) => ws.id === selectedWorkspaceId) ?? null;
2727
2753
  const selectedChat = chats.find((c) => c.id === resolvedChatId) ?? null;
2728
2754
  const isProcessing = mockThinking || (selectedChat?.processing ?? false);
2755
+ const selectedAgent = selectedChat?.provider ?? "claude";
2756
+ const agentAvailable = agentAvailability ? selectedAgent === "codex" ? agentAvailability.codex.available : agentAvailability.claude.available : true;
2757
+ const agentLabel = selectedAgent === "codex" ? "Codex" : "Claude Code";
2729
2758
  const displayMessages = useMemo6(() => {
2730
2759
  if (isMockSelected) return mockMessages;
2731
2760
  const rawEvents = historyData?.events ?? [];
@@ -2955,12 +2984,16 @@ function AppInner() {
2955
2984
  setMockThinking(true);
2956
2985
  return;
2957
2986
  }
2987
+ if (!agentAvailable) {
2988
+ toast.error(new Error(`${agentLabel} is not connected. Run \`replicas ${selectedAgent === "codex" ? "codex-auth" : "claude-auth"}\` to connect.`));
2989
+ return;
2990
+ }
2958
2991
  sendMessageMutation.mutate({
2959
2992
  message,
2960
2993
  permissionMode: taskMode === "plan" ? "read" : void 0
2961
2994
  });
2962
2995
  },
2963
- [selectedWorkspaceId, resolvedChatId, isMockSelected, sendMessageMutation, taskMode]
2996
+ [selectedWorkspaceId, resolvedChatId, isMockSelected, sendMessageMutation, taskMode, agentAvailable, agentLabel, selectedAgent, toast.error]
2964
2997
  );
2965
2998
  return /* @__PURE__ */ jsxs9("box", { flexDirection: "column", width: "100%", height: "100%", backgroundColor: "#000000", children: [
2966
2999
  /* @__PURE__ */ jsxs9("box", { flexDirection: "row", flexGrow: 1, backgroundColor: "#000000", children: [
@@ -3004,7 +3037,9 @@ function AppInner() {
3004
3037
  focusPanel,
3005
3038
  taskMode,
3006
3039
  isProcessing,
3007
- loading: loadingMessages
3040
+ loading: loadingMessages,
3041
+ agentAvailable,
3042
+ agentLabel
3008
3043
  }
3009
3044
  ) : selectedWorkspaceId && statusData?.status === "sleeping" ? /* @__PURE__ */ jsxs9(
3010
3045
  "box",
@@ -3057,6 +3092,7 @@ function AppInner() {
3057
3092
  files: envFiles ?? null
3058
3093
  },
3059
3094
  previews,
3095
+ agentAvailability: agentAvailability ?? null,
3060
3096
  onWakeWorkspace: handleWakeWorkspace,
3061
3097
  onViewDiff: handleViewDiff,
3062
3098
  onCreatePr: () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.2.55",
3
+ "version": "0.2.57",
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": {