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
cua-spaces(macos): show Windows Spaces as coming soon (#5403)
Francesco Bonaccia802eaf26ca9
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/NewSpaceWizardView.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/NewSpaceWizardView.swiftindex 3252ed04d0..6e762ba395 100644--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/NewSpaceWizardView.swift+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/NewSpaceWizardView.swift@@ -111,7 +111,7 @@ public struct NewSpaceWizardView: View {get: { v.image.os },set: { wizard.send(.chooseOs(os: $0)) })) {ForEach(v.osTiles, id: \.id) { tile in- Text(tile.title).tag(osOf(tile.id)).help(tile.detail)+ Text(tile.title).tag(osOf(tile.id)).selectionDisabled(!tile.enabled).help(tile.detail)}}.pickerStyle(.segmented)diff --git a/apps/cua-spaces/src/components/desktop/NewSpaceWizard.test.tsx b/apps/cua-spaces/src/components/desktop/NewSpaceWizard.test.tsxindex b06b4f5678..4743f3bd29 100644--- a/apps/cua-spaces/src/components/desktop/NewSpaceWizard.test.tsx+++ b/apps/cua-spaces/src/components/desktop/NewSpaceWizard.test.tsx@@ -2,7 +2,9 @@// Copyright (c) 2026 Cua AI, Inc.import { cleanup, fireEvent, render, screen, waitFor, within } from "@testing-library/react";-import { describe, expect, it, vi } from "vitest";+import { afterEach, describe, expect, it, vi } from "vitest";++afterEach(() => vi.restoreAllMocks());import list from "../../../../../libs/images/sandbox-images.json";import {@@ -258,7 +260,15 @@ describe("New Space wizard", () => {expect(screen.getByRole("button", { name: "Continue" })).toBeDisabled();});+ it("shows Windows as coming soon on a Mac and cannot pick it", () => {+ renderWizard();+ const tile = screen.getByRole("button", { name: /^Windows/ });+ expect(tile).toHaveTextContent("coming soon");+ expect(tile).toBeDisabled();+ });+it("the OS tiles pick that system's first image", () => {+ vi.spyOn(navigator, "platform", "get").mockReturnValue("Win32");renderWizard();fireEvent.click(screen.getByRole("button", { name: /^Windows/ }));expect(imageField()).toHaveValue("ghcr.io/trycua/windows:2022");@@ -472,6 +482,7 @@ describe("QEMU VMs", () => {});it("are offered once QEMU is ready", () => {+ vi.spyOn(navigator, "platform", "get").mockReturnValue("Linux x86_64");renderWizard({ localBackends: ["docker", "qemu"] });runOn("local");pick("ghcr.io/trycua/windows:2022");diff --git a/apps/cua-spaces/src/components/desktop/NewSpaceWizard.tsx b/apps/cua-spaces/src/components/desktop/NewSpaceWizard.tsxindex 976395ad7d..726d6c0f62 100644--- a/apps/cua-spaces/src/components/desktop/NewSpaceWizard.tsx+++ b/apps/cua-spaces/src/components/desktop/NewSpaceWizard.tsx@@ -10,6 +10,7 @@ import type { Runtime } from "../../model/types";import type { CloudPricing, GpuChoice } from "../../native/fleet";import type { LocalStorage } from "../../native/local";import { telemetryBridge, type TelemetryBridge } from "../../native/telemetry";+import { hostOs } from "../../model/host";import { ImageField, type ImageFieldView } from "./ImageField";import { Sym } from "./Sym";@@ -324,7 +325,7 @@ export function NewSpaceWizard({useEffect(() => {setState((s) => core<WizardState>("wizard.reduce", { state: s, action: { type: "sync-default", location: defaultLocation }, env }));}, [defaultLocation, env]);- const v = core<WizardView>("wizard.view", { state, env });+ const v = core<WizardView>("wizard.view", { state, env, hostOs: hostOs() });// Before paint, so a quick create never shows the sheet; once, because StrictMode runs mount effects twice.const started = useRef(false);useLayoutEffect(() => {diff --git a/libs/cua/crates/cua-spaces-app-core/parity/golden/create-resources.json b/libs/cua/crates/cua-spaces-app-core/parity/golden/create-resources.jsonindex ffa971becc..c72b4d4dbb 100644--- a/libs/cua/crates/cua-spaces-app-core/parity/golden/create-resources.json+++ b/libs/cua/crates/cua-spaces-app-core/parity/golden/create-resources.json@@ -1892,7 +1892,7 @@"submit": null,"submitLabel": "Add Space"},- "canContinue": true,+ "canContinue": false,"cpusText": "4 cores","disk": null,"fields": [@@ -1950,7 +1950,7 @@"submit": null,"submitLabel": "Add Space"},- "canContinue": true,+ "canContinue": false,"cpusText": "4 cores","disk": null,"fields": [@@ -2008,12 +2008,16 @@"submit": null,"submitLabel": "Add Space"},- "canContinue": true,+ "canContinue": false,"cpusText": "4 cores","disk": null,"fields": [- "cpus: CPU cores",- "memory: Memory"+ "os: System",+ "image: Image [ghcr.io/org/app:tag]",+ "placement: Run on",+ "kind: Kind (advanced)",+ "runtime: Runtime (advanced)",+ "connect-by-address: Connect by address…"],"gpu": null,"image": "ghcr.io/trycua/windows:2022",@@ -2050,7 +2054,7 @@"auto","qemu"],- "step": 1+ "step": 0},"wizard": "next"},@@ -2062,7 +2066,7 @@"submit": null,"submitLabel": "Add Space"},- "canContinue": true,+ "canContinue": false,"cpusText": "4 cores","disk": null,"fields": [diff --git a/libs/cua/crates/cua-spaces-app-core/parity/golden/placement-picker.json b/libs/cua/crates/cua-spaces-app-core/parity/golden/placement-picker.jsonindex f0bf139d0d..67fbb5be40 100644--- a/libs/cua/crates/cua-spaces-app-core/parity/golden/placement-picker.json+++ b/libs/cua/crates/cua-spaces-app-core/parity/golden/placement-picker.json@@ -44,7 +44,9 @@"Name: space-000000002a","When ready: Open the desktop"],- "systemsOff": []+ "systemsOff": [+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off"+ ]}},{@@ -90,7 +92,9 @@"Name: space-000000002a","When ready: Open the desktop"],- "systemsOff": []+ "systemsOff": [+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off"+ ]}},{@@ -136,7 +140,9 @@"Name: space-000000002a","When ready: Open the desktop"],- "systemsOff": []+ "systemsOff": [+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off"+ ]}},{@@ -179,7 +185,9 @@"Name: space-000000002a","When ready: Open the desktop"],- "systemsOff": []+ "systemsOff": [+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off"+ ]}},{@@ -224,7 +232,9 @@"Name: space-000000002a","When ready: Open the desktop"],- "systemsOff": []+ "systemsOff": [+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off"+ ]}},{@@ -267,7 +277,9 @@"Name: space-000000002a","When ready: Open the desktop"],- "systemsOff": []+ "systemsOff": [+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off"+ ]}},{@@ -310,7 +322,9 @@"Name: space-000000002a","When ready: Open the desktop"],- "systemsOff": []+ "systemsOff": [+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off"+ ]}},{@@ -356,7 +370,9 @@"Name: space-000000002a","When ready: Open the desktop"],- "systemsOff": []+ "systemsOff": [+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off"+ ]}},{@@ -407,7 +423,7 @@"When ready: Open the desktop"],"systemsOff": [- "windows | Windows | AWS does not run this image. Ask your agent to deploy the Windows Server 2022 image on AWS and add it with cua spaces add. | off",+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off","macos | macOS | macOS on AWS needs EC2 Mac (24 h minimum); not offered. Ask your agent to deploy the macOS Tahoe 26 image on AWS and add it with cua spaces add. | off"]}@@ -455,7 +471,9 @@"Name: space-000000002a","When ready: Open the desktop"],- "systemsOff": []+ "systemsOff": [+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off"+ ]}},{@@ -498,7 +516,9 @@"Name: space-000000002a","When ready: Open the desktop"],- "systemsOff": []+ "systemsOff": [+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off"+ ]}},{@@ -537,7 +557,9 @@"Name: space-000000002a","When ready: Open the desktop"],- "systemsOff": []+ "systemsOff": [+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off"+ ]}},{@@ -576,7 +598,9 @@"Name: space-000000002a","When ready: Open the desktop"],- "systemsOff": []+ "systemsOff": [+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off"+ ]}},{@@ -612,7 +636,9 @@"Name: space-000000002a","When ready: Open the desktop"],- "systemsOff": []+ "systemsOff": [+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off"+ ]}},{@@ -647,7 +673,9 @@"Name: space-000000002a","When ready: Open the desktop"],- "systemsOff": []+ "systemsOff": [+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off"+ ]}},{@@ -682,7 +710,9 @@"Name: space-000000002a","When ready: Open the desktop"],- "systemsOff": []+ "systemsOff": [+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off"+ ]}}]diff --git a/libs/cua/crates/cua-spaces-app-core/parity/golden/your-cloud.json b/libs/cua/crates/cua-spaces-app-core/parity/golden/your-cloud.jsonindex 846f0e575c..fa15b5b4ab 100644--- a/libs/cua/crates/cua-spaces-app-core/parity/golden/your-cloud.json+++ b/libs/cua/crates/cua-spaces-app-core/parity/golden/your-cloud.json@@ -41,7 +41,9 @@"Name: space-000000002a","When ready: Open the desktop"],- "systemsOff": []+ "systemsOff": [+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off"+ ]}},{@@ -84,7 +86,9 @@"Name: space-000000002a","When ready: Open the desktop"],- "systemsOff": []+ "systemsOff": [+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off"+ ]}},{@@ -541,7 +545,7 @@"When ready: Open the desktop"],"systemsOff": [- "windows | Windows | Windows on AWS is not offered yet. Ask your agent to deploy the Windows Server 2022 image on AWS and add it with cua spaces add. | off",+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off","macos | macOS | macOS on AWS needs EC2 Mac (24 h minimum); not offered. Ask your agent to deploy the macOS Tahoe 26 image on AWS and add it with cua spaces add. | off"]}@@ -582,7 +586,7 @@"When ready: Open the desktop"],"systemsOff": [- "windows | Windows | Windows on AWS is not offered yet. Ask your agent to deploy the Windows Server 2022 image on AWS and add it with cua spaces add. | off",+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off","macos | macOS | macOS on AWS needs EC2 Mac (24 h minimum); not offered. Ask your agent to deploy the macOS Tahoe 26 image on AWS and add it with cua spaces add. | off"]}@@ -626,7 +630,7 @@"When ready: Open the desktop"],"systemsOff": [- "windows | Windows | Windows on AWS is not offered yet. Ask your agent to deploy the Windows Server 2022 image on AWS and add it with cua spaces add. | off",+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off","macos | macOS | macOS on AWS needs EC2 Mac (24 h minimum); not offered. Ask your agent to deploy the macOS Tahoe 26 image on AWS and add it with cua spaces add. | off"]}@@ -667,7 +671,7 @@"When ready: Open the desktop"],"systemsOff": [- "windows | Windows | Windows on AWS is not offered yet. Ask your agent to deploy the Windows Server 2022 image on AWS and add it with cua spaces add. | off",+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off","macos | macOS | macOS on AWS needs EC2 Mac (24 h minimum); not offered. Ask your agent to deploy the macOS Tahoe 26 image on AWS and add it with cua spaces add. | off"]}@@ -712,7 +716,7 @@"When ready: Open the desktop"],"systemsOff": [- "windows | Windows | Windows on AWS is not offered yet. Ask your agent to deploy the Windows Server 2022 image on AWS and add it with cua spaces add. | off",+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off","macos | macOS | macOS on AWS needs EC2 Mac (24 h minimum); not offered. Ask your agent to deploy the macOS Tahoe 26 image on AWS and add it with cua spaces add. | off"]}@@ -757,7 +761,7 @@"When ready: Open the desktop"],"systemsOff": [- "windows | Windows | Modal does not run this image. Ask your agent to deploy the Windows Server 2022 image on Modal and add it with cua spaces add. | off",+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off","macos | macOS | Modal does not run this image. Ask your agent to deploy the macOS Tahoe 26 image on Modal and add it with cua spaces add. | off"]}@@ -800,7 +804,9 @@"Name: space-000000002a","When ready: Open the desktop"],- "systemsOff": []+ "systemsOff": [+ "windows | Windows (coming soon) | Windows Spaces are coming soon on Mac. | off"+ ]}}]diff --git a/libs/cua/crates/cua-spaces-app-core/src/wizard.rs b/libs/cua/crates/cua-spaces-app-core/src/wizard.rsindex 03afb1937a..eab93d4dcf 100644--- a/libs/cua/crates/cua-spaces-app-core/src/wizard.rs+++ b/libs/cua/crates/cua-spaces-app-core/src/wizard.rs@@ -2911,6 +2911,11 @@ pub fn placement_options_on(out}+/// The Windows tile's title on a Mac host.+const WINDOWS_SOON_TITLE: &str = "Windows (coming soon)";+/// Its tooltip.+const WINDOWS_SOON_DETAIL: &str = "Windows Spaces are coming soon on Mac.";+/// The wizard as drawn.pub fn view(state: &WizardState, env: &WizardEnv) -> WizardView {view_on(state, env, SpaceOs::Macos)@@ -2987,7 +2992,9 @@ pub fn view_on(state: &WizardState, env: &WizardEnv, os: SpaceOs) -> WizardViewlet custom = custom_ref(state).is_some();let image_error = validate_image_ref(&state.image_text);let disk = disk_view(state, &image, env, os);+ let windows_soon = os == SpaceOs::Macos && image.os == SpaceOs::Windows;let can_continue = image.os != SpaceOs::Unknown+ && !windows_soon&& match state.step {0 => placeable && placement_ready && image_error.is_none(),1 => disk.error.is_none() && resource_edit.as_ref().is_none_or(|e| e.error.is_none()),@@ -2996,6 +3003,7 @@ pub fn view_on(state: &WizardState, env: &WizardEnv, os: SpaceOs) -> WizardView};let images = &catalog().images;let pressed_os = selected_os(state);+ let host_os = os;let os_tiles = [(SpaceOs::Linux, "Linux", "Ubuntu desktop with cua-spacesd"),(SpaceOs::Windows, "Windows", "Windows Server VM"),@@ -3012,12 +3020,18 @@ pub fn view_on(state: &WizardState, env: &WizardEnv, os: SpaceOs) -> WizardViewreasons.into_iter().next()}).flatten();+ // Windows Spaces are not offered from a Mac yet: shown, not chosen.+ let soon = host_os == SpaceOs::Macos && os == SpaceOs::Windows;Tile {id: os.as_str().into(),- title: title.into(),- detail: why.clone().unwrap_or_else(|| detail.into()),+ title: if soon { WINDOWS_SOON_TITLE } else { title }.into(),+ detail: if soon {+ WINDOWS_SOON_DETAIL.to_string()+ } else {+ why.clone().unwrap_or_else(|| detail.into())+ },pressed: pressed_os == Some(os),- enabled: images.iter().any(|i| i.os == os) && why.is_none(),+ enabled: !soon && images.iter().any(|i| i.os == os) && why.is_none(),}}).collect();@@ -3615,6 +3629,25 @@ mod tests {}}+ #[test]+ fn windows_is_coming_soon_on_a_mac_and_cannot_continue() {+ let e = env();+ let s = reduce(+ &initial(&e),+ &WizardAction::ChooseOs {+ os: SpaceOs::Windows,+ },+ &e,+ );+ let mac = view_on(&s, &e, SpaceOs::Macos);+ let tile = mac.os_tiles.iter().find(|t| t.id == "windows").unwrap();+ assert!(!tile.enabled && tile.title.contains("coming soon"));+ assert!(!mac.can_continue);+ let win = view_on(&s, &e, SpaceOs::Windows);+ let tile = win.os_tiles.iter().find(|t| t.id == "windows").unwrap();+ assert_eq!(tile.title, "Windows");+ }+/// A Windows VM runs on QEMU, which the app never installs: on a PC/// without it (or before the doctor answered) the Windows image is not/// offered here, so nothing downloads gigabytes only to fail.@@ -4367,8 +4400,14 @@ mod tests {"each cloud is its own entry: no second menu");// Systems and kinds it cannot run are greyed out with why.- let win = v.os_tiles.iter().find(|t| t.id == "windows").unwrap();- assert!(!win.enabled);+ let soon = v.os_tiles.iter().find(|t| t.id == "windows").unwrap();+ assert!(!soon.enabled);+ assert_eq!(soon.title, "Windows (coming soon)");+ assert_eq!(soon.detail, "Windows Spaces are coming soon on Mac.");+ // Off a Mac, the cloud's own reason shows.+ let v_linux = view_on(&s, &e, SpaceOs::Linux);+ let win = v_linux.os_tiles.iter().find(|t| t.id == "windows").unwrap();+ assert!(!win.enabled && win.title == "Windows");assert!(win.detail.starts_with("Windows on AWS is not offered yet. Ask your agent to deploy the ")diff --git a/libs/cua/crates/cua-spaces/src/spaces.rs b/libs/cua/crates/cua-spaces/src/spaces.rsindex ab41f6dd6e..280adc14e4 100644--- a/libs/cua/crates/cua-spaces/src/spaces.rs+++ b/libs/cua/crates/cua-spaces/src/spaces.rs@@ -2044,6 +2044,7 @@ impl Spaces {/// dropping the returned future (a closed request) does the same.pub async fn create(&self, mut opts: SpaceCreate) -> Result<SpaceCreated> {use cua_sandbox_core::progress::{Phase, Progress, report};+ refuse_windows_on_mac(opts.image.as_deref(), cfg!(target_os = "macos"))?;let sink = opts.progress.take().map(|p| p.0);let (key, on) = self.create_key(&mut opts)?;// Every report names the Space it is about.@@ -3221,10 +3222,39 @@ fn thumbnail_failure(f: &crate::thumbnails::CaptureFailure) -> Error {}}+/// Windows Spaces are not offered from a Mac yet: every create failed at the+/// image pull. Refuses one up front, in words a person can act on. Windows+/// and Linux hosts are not affected.+pub(crate) const WINDOWS_COMING_SOON: &str = "Windows Spaces are coming soon on Mac.";++fn refuse_windows_on_mac(image: Option<&str>, host_is_mac: bool) -> Result<()> {+ let windows = image.is_some_and(|i| {+ cua_image::catalog::catalog_os(i).as_deref() == Some("windows")+ || i.rsplit('/')+ .next()+ .is_some_and(|n| n.to_ascii_lowercase().starts_with("windows"))+ });+ if host_is_mac && windows {+ return Err(Error::invalid(WINDOWS_COMING_SOON));+ }+ Ok(())+}+#[cfg(test)]mod tests {use super::*;+ #[test]+ fn a_windows_create_from_a_mac_is_refused_in_plain_words() {+ for image in ["windows", "windows:2022", "ghcr.io/trycua/windows:2022"] {+ let e = refuse_windows_on_mac(Some(image), true).unwrap_err();+ assert!(e.to_string().contains("coming soon on Mac"), "{image}: {e}");+ assert!(refuse_windows_on_mac(Some(image), false).is_ok());+ }+ assert!(refuse_windows_on_mac(Some("ghcr.io/trycua/linux:24.04"), true).is_ok());+ assert!(refuse_windows_on_mac(None, true).is_ok());+ }+#[test]fn the_default_connect_budget_does_not_depend_on_the_boot() {let now = std::time::Instant::now();