Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.
Rust agentai-agentapplecomputer-usecomputer-use-agentcontainerizationcuadesktop-automationhacktoberfestlumemacosmanusoperatorswiftvirtualizationvirtualization-frameworkwindowswindows-sandbox
fix(spaces-web): hide config file paths behind Advanced in Connected apps (CUA-2314) (#6001)
cua-agents[bot]be3d166c78ed
diff --git a/apps/cua-spaces-web/src/__tests__/settings-agents.test.tsx b/apps/cua-spaces-web/src/__tests__/settings-agents.test.tsxindex cf488c60cd..adf53e7dfc 100644--- a/apps/cua-spaces-web/src/__tests__/settings-agents.test.tsx+++ b/apps/cua-spaces-web/src/__tests__/settings-agents.test.tsx@@ -41,7 +41,9 @@ describe("configured agents without binary evidence", () => {const mounted = render(<BridgeProvider adapter={adapter} core={noCore}><RouterProvider router={router} /></BridgeProvider>);if (dialog === "connect") {await waitFor(() => expect(document.querySelector("li")?.textContent).toContain("Set up"));- expect(document.querySelector("li")?.textContent).toContain("C:/Users/test/.claude.json");+ // The file path stays out of the row; it is only in the closed Advanced section.+ expect(document.querySelector("li")?.textContent).not.toContain(".claude.json");+ expect(document.querySelector<HTMLDetailsElement>("[data-connect-advanced]")?.open).toBe(false);expect(document.querySelector("li")?.textContent).not.toContain("Not installed");} else {await waitFor(() => expect(document.querySelector("[data-run-agent]")?.getAttribute("data-run-agent")).toBe("ready"));@@ -55,7 +57,7 @@ const app = (id: string) => document.querySelector<HTMLElement>(`[data-connectedconst switchOf = (id: string) => within(app(id)!).getByRole("switch");describe.skipIf(!wasmBuilt)("Settings, Connected apps", () => {- it("lists the coding apps on this computer with one switch each, and the rest behind Show all", { timeout: 20_000 }, async () => {+ it("lists the coding apps on this computer with one switch each, file paths only under Advanced", { timeout: 20_000 }, async () => {await mountApp("/settings/connected-apps", { failsCreates: false, listsGhost: false });await waitFor(() => expect(app("hermes")).not.toBeNull(), { timeout: 8000 });expect(within(app("claude-code")!).getByText("Claude Code")).toBeTruthy();@@ -66,8 +68,12 @@ describe.skipIf(!wasmBuilt)("Settings, Connected apps", () => {expect(document.querySelector('[data-connected-missing="gemini-cli"]')).toBeNull();fireEvent.click(document.querySelector("[data-connected-show-all]")!);await waitFor(() => expect(document.querySelector('[data-connected-missing="gemini-cli"]')).not.toBeNull());- expect(app("claude-code")!.textContent).toContain("~/.claude.json");- expect(document.querySelector("[data-connected-by-hand]")).not.toBeNull();+ // Rows stay icon, name and switch; paths and Add it by hand wait in a closed Advanced.+ expect(app("claude-code")!.textContent).not.toContain(".claude.json");+ const advanced = document.querySelector<HTMLDetailsElement>("[data-connected-advanced]")!;+ expect(advanced.open).toBe(false);+ expect(advanced.querySelector('[data-connected-file="claude-code"]')!.textContent).toContain("~/.claude.json");+ expect(advanced.querySelector("[data-connected-by-hand]")).not.toBeNull();});it("switches one app on and off, remembers an app turned off, and offers Undo", { timeout: 20_000 }, async () => {diff --git a/apps/cua-spaces-web/src/components/agents/connect-dialog.tsx b/apps/cua-spaces-web/src/components/agents/connect-dialog.tsxindex 62bcdb7540..fd71ae8a63 100644--- a/apps/cua-spaces-web/src/components/agents/connect-dialog.tsx+++ b/apps/cua-spaces-web/src/components/agents/connect-dialog.tsx@@ -1,7 +1,7 @@// SPDX-License-Identifier: FSL-1.1-MIT// Copyright (c) 2026 Cua AI, Inc.-import { CheckIcon, CopyIcon } from "lucide-react";+import { CheckIcon, ChevronRightIcon, CopyIcon } from "lucide-react";import { useEffect, useState } from "react";import { isUnsupported, useAgents, type AgentSetupRow } from "@/bridge";@@ -15,7 +15,8 @@ import { cn } from "@/lib/utils";* What the cua MCP server is and how an agent gets it: the agents on this* machine (`agents.setup`, the SDK's agent setup), one button that sets up* every installed one (`agents.configure`, the same as `cua agents setup`),- * and the config entry for doing it by hand.+ * and, under a closed "Advanced", the config entry for doing it by hand. Rows+ * show the agent and its state only; file paths stay in Advanced.*/type Manual = "claude-code" | "codex" | "hermes" | "openclaw";@@ -107,7 +108,7 @@ export function ConnectAgentDialog({ open, onOpenChange }: { open: boolean; onOp<p className="px-3 py-3 text-xs text-muted-foreground">Looking for agents…</p>) : rows.length === 0 ? (<p className="px-3 py-3 text-xs text-muted-foreground">- {detectError ?? "This app can't look for agents here. Run cua agents setup in a terminal, or add the server by hand below."}+ {detectError ?? "This app can't look for agents here. Run cua agents setup in a terminal, or add it by hand under Advanced below."}</p>) : (<ul className="divide-y">@@ -123,14 +124,17 @@ export function ConnectAgentDialog({ open, onOpenChange }: { open: boolean; onOp</p></section>- <section className="mt-6">- <h3 className="mb-2 text-xs font-semibold">Add it by hand</h3>+ <details className="group mt-6" data-connect-advanced="">+ <summary className="flex cursor-default list-none items-center gap-1 text-[13px] text-muted-foreground outline-none hover:text-foreground focus-visible:text-foreground [&::-webkit-details-marker]:hidden">+ <ChevronRightIcon className="size-3.5 transition-transform group-open:rotate-90" aria-hidden /> Advanced+ </summary>+ <h3 className="mt-3 mb-2 text-xs font-semibold">Add it by hand</h3><Segmented aria-label="Agent" value={manual} options={MANUAL_OPTIONS} onValueChange={setManual} /><Snippet file={MANUAL[manual].file} text={MANUAL[manual].snippet} /><p className="mt-2 text-xs text-muted-foreground">Use the full path to <code className="font-mono">cua</code> if the agent runs without your shell's PATH, as apps opened from the Dock do.</p>- </section>+ </details><div className="mt-6 flex justify-end"><Button variant="outline" onClick={() => onOpenChange(false)}>@@ -148,7 +152,6 @@ function SetupRow({ row }: { row: AgentSetupRow }) {<li className="flex items-center gap-3 px-3 py-2"><div className="min-w-0 flex-1"><div className={cn("text-[13px]", !row.installed && "text-muted-foreground")}>{row.name}</div>- {(row.installed || row.configured) && row.mcpConfig ? <div className="truncate font-mono text-2xs text-muted-foreground">{row.mcpConfig}</div> : null}</div><span className={cn("inline-flex shrink-0 items-center gap-1 text-xs", row.configured ? "text-foreground" : "text-muted-foreground")}>{row.configured ? <CheckIcon className="size-3.5 text-success" aria-hidden /> : null}diff --git a/apps/cua-spaces-web/src/components/settings/coding-apps-section.tsx b/apps/cua-spaces-web/src/components/settings/coding-apps-section.tsxindex 3bca42edaa..376eab2c4d 100644--- a/apps/cua-spaces-web/src/components/settings/coding-apps-section.tsx+++ b/apps/cua-spaces-web/src/components/settings/coding-apps-section.tsx@@ -1,7 +1,7 @@// SPDX-License-Identifier: FSL-1.1-MIT// Copyright (c) 2026 Cua AI, Inc.-import { ChevronDownIcon, ChevronUpIcon } from "lucide-react";+import { ChevronDownIcon, ChevronRightIcon, ChevronUpIcon } from "lucide-react";import { lazy, Suspense, useState } from "react";import type { AgentSetupRow } from "@/bridge";@@ -22,8 +22,9 @@ const DriverSettingsCard = lazy(() => import("@/components/volume/driver-card")./*** Settings, Connected apps, "Coding apps": the coding apps on this computer,* one switch each for Cua being set up in it (with Background computer use),- * and "Set up new apps automatically". "Show all" opens file paths, the apps- * that aren't installed, and adding Cua by hand.+ * and "Set up new apps automatically". Rows show only the app and its switch.+ * "Show all" opens the apps that aren't installed, Background computer use,+ * and a collapsed "Advanced" with each app's settings file and adding Cua by hand.*/export function CodingAppsSection({ apps }: { apps: ConnectedApps }) {const { openExternal } = useExternal();@@ -41,7 +42,7 @@ export function CodingAppsSection({ apps }: { apps: ConnectedApps }) {We didn't find a coding app yet. Install one and Cua will notice.</div>) : (- shown.map((row) => <AppRow key={row.agent} row={row} apps={apps} showPath={all} />)+ shown.map((row) => <AppRow key={row.agent} row={row} apps={apps} />))}<SettingsRowlabel="Set up new apps automatically"@@ -80,12 +81,12 @@ export function CodingAppsSection({ apps }: { apps: ConnectedApps }) {</button>{all ? (<>- <ByHand /><SettingsGroup title="Background computer use"><Suspense fallback={<div className="h-48" />}><DriverSettingsCard /></Suspense></SettingsGroup>+ <Advanced rows={shown} /></>) : null}</div>@@ -97,12 +98,12 @@ function useExternal() {return { openExternal: async (url: string) => void (await data?.call("session.openExternal", { url }).catch(() => {})) };}-function AppRow({ row, apps, showPath }: { row: AgentSetupRow; apps: ConnectedApps; showPath: boolean }) {+function AppRow({ row, apps }: { row: AgentSetupRow; apps: ConnectedApps }) {const busy = apps.pending.includes(row.agent);const failure = apps.failures[row.agent];const on = row.configured && !failure;const justOff = !row.configured && apps.state.off.includes(row.agent);- const note = failure ? null : justOff ? "Off." : showPath && row.mcpConfig ? row.mcpConfig : null;+ const note = failure ? null : justOff ? "Off." : null;return (<div data-connected-app={row.agent} data-on={String(on)} data-failed={failure ? "" : undefined} className={cn(failure && "bg-destructive/5")}><div className="flex min-h-12 items-center gap-3 px-4 py-2.5">@@ -111,7 +112,7 @@ function AppRow({ row, apps, showPath }: { row: AgentSetupRow; apps: ConnectedAp<label htmlFor={`app-${row.agent}`} className="block truncate text-[13px]">{row.name}</label>- {note ? <p className={cn("mt-0.5 truncate text-xs text-muted-foreground", showPath && !justOff && "font-mono")}>{note}</p> : null}+ {note ? <p className="mt-0.5 truncate text-xs text-muted-foreground">{note}</p> : null}</div><Switch id={`app-${row.agent}`} checked={on} disabled={busy} onCheckedChange={(next) => void apps.toggle(row, next)} /></div>@@ -126,7 +127,6 @@ function Failure({ row, text, busy, onRetry }: { row: AgentSetupRow; text: strinconst snippet = BY_HAND[row.agent];return (<div className="px-4 pb-4 pl-14" data-connected-failure={row.agent}>- {row.mcpConfig ? <p className="-mt-1 mb-1 font-mono text-xs text-muted-foreground">{row.mcpConfig}</p> : null}<p className="text-[13px] text-destructive">{text}</p><div className="mt-3 flex gap-2"><Button size="sm" variant="outline" disabled={busy} onClick={onRetry}>@@ -148,6 +148,36 @@ function Failure({ row, text, busy, onRetry }: { row: AgentSetupRow; text: strin);}+/**+ * "Advanced", closed by default: the file each app keeps its settings in, and+ * adding Cua by hand. Most people never need either.+ */+function Advanced({ rows }: { rows: AgentSetupRow[] }) {+ const files = rows.filter((r) => r.mcpConfig);+ return (+ <details className="group mb-8" data-connected-advanced="">+ <summary className="flex cursor-default list-none items-center gap-1 px-1 text-[13px] text-muted-foreground outline-none hover:text-foreground focus-visible:text-foreground [&::-webkit-details-marker]:hidden">+ <ChevronRightIcon className="size-3.5 transition-transform group-open:rotate-90" aria-hidden /> Advanced+ </summary>+ <div className="mt-4">+ {files.length > 0 ? (+ <SettingsGroup title="Settings files">+ {files.map((r) => (+ <div key={r.agent} data-connected-file={r.agent} className="flex min-h-11 items-center gap-3 px-4 py-2">+ <span className="w-40 shrink-0 truncate text-[13px]">{r.name}</span>+ <code className="min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground select-text" title={r.mcpConfig ?? undefined}>+ {r.mcpConfig}+ </code>+ </div>+ ))}+ </SettingsGroup>+ ) : null}+ <ByHand />+ </div>+ </details>+ );+}+/** "Add it by hand": for an app in an unusual place, another computer, or a work laptop where Cua may not edit settings. */function ByHand() {const ids = Object.keys(BY_HAND);@@ -155,7 +185,7 @@ function ByHand() {const entry = BY_HAND[id]!;const label: Record<string, string> = { "claude-code": "Claude Code", codex: "Codex", hermes: "Hermes", openclaw: "OpenClaw", cursor: "Cursor" };return (- <section className="mb-8" data-connected-by-hand="">+ <section data-connected-by-hand=""><h2 className="mb-2 px-1 text-xs font-semibold text-muted-foreground">Add it by hand</h2><div className="rounded-xl border bg-card p-4 shadow-xs"><Segmented aria-label="App" value={id} options={ids.map((value) => ({ value, label: label[value] ?? value }))} onValueChange={setId} />