Skip to content

armgit / cua

Public Imported from GitHub
0

Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.

feat(spaces): drop the line under Kind; MicroVM status in Settings, Advanced (CUA-2446) (#6048)

dduponta87d74c40177
diff --git a/.github/actions/sentry-upload/action.yml b/.github/actions/sentry-upload/action.yml
index 4289ae8fa5..ba3a07ff04 100644
--- a/.github/actions/sentry-upload/action.yml
+++ b/.github/actions/sentry-upload/action.yml
@@ -69,6 +69,9 @@ runs:
sourcemaps)
if [ "$INJECT" = true ]; then sentry sourcemaps inject "$target" || echo "::warning::sourcemaps inject failed"; fi
sentry sourcemaps upload --release "$release" --url-prefix "$URL_PREFIX" "$target" || echo "::warning::sourcemaps upload failed for $release"
- [ "$DELETE_MAPS" = true ] && find "$target" -name '*.map' -delete ;;
+ # An `if`, not `[ ] && find`: with delete-maps off that test is the
+ # step's last command and its status 1 failed the step.
+ if [ "$DELETE_MAPS" = true ]; then find "$target" -name '*.map' -delete; fi ;;
*) echo "::error::unknown kind $KIND"; exit 1 ;;
esac
+ exit 0
diff --git a/.github/scripts/require_staging_smoke.sh b/.github/scripts/require_staging_smoke.sh
index 7252d8b2c3..40b1211b99 100755
--- a/.github/scripts/require_staging_smoke.sh
+++ b/.github/scripts/require_staging_smoke.sh
@@ -13,7 +13,7 @@
#
# How it is satisfied: the tag run sends a cua-release-candidate dispatch to
# trycua/cloud (request_staging_smoke.sh), which runs the staging smoke and
-# posts the status; this gate waits for it (WAIT_MINUTES, 30 in the CD jobs).
+# posts the status; this gate waits for it (WAIT_MINUTES: 30 in most CD jobs, 120 in cd-cua-spaces).
# By hand, for a rerun or when the dispatch could not be sent:
# gh workflow run spaces-staging-smoke.yml -R trycua/cloud -f component=<c> -f sha=<tag sha>
# or, after the release PR merges and the tag exists:
diff --git a/.github/scripts/tests/test_sentry_upload_action.py b/.github/scripts/tests/test_sentry_upload_action.py
new file mode 100644
index 0000000000..8e79ed0501
--- /dev/null
+++ b/.github/scripts/tests/test_sentry_upload_action.py
@@ -0,0 +1,70 @@
+"""The Sentry upload action never fails a release build.
+
+Runs the composite action's script against a stub `npx` (no network), for
+each kind and each delete-maps setting, and checks it exits 0 even when the
+Sentry CLI fails. v0.17.0-beta.2's Electron Linux job failed on its last
+line (`[ "$DELETE_MAPS" = true ] && find ...` with delete-maps off).
+"""
+
+from __future__ import annotations
+
+import os
+import pathlib
+import subprocess
+
+import pytest
+import yaml
+
+REPO_ROOT = pathlib.Path(__file__).resolve().parents[3]
+ACTION = REPO_ROOT / ".github/actions/sentry-upload/action.yml"
+
+
+def script() -> str:
+ action = yaml.safe_load(ACTION.read_text())
+ return action["runs"]["steps"][0]["run"]
+
+
+def run(tmp_path: pathlib.Path, *, kind: str, delete_maps: str, inject: str, cli_ok: bool) -> subprocess.CompletedProcess:
+ bin_dir = tmp_path / "bin"
+ bin_dir.mkdir(exist_ok=True)
+ npx = bin_dir / "npx"
+ npx.write_text(f"#!/bin/sh\nexit {0 if cli_ok else 1}\n")
+ npx.chmod(0o755)
+ upload = tmp_path / "dist"
+ upload.mkdir(exist_ok=True)
+ (upload / "main.js").write_text("//")
+ (upload / "main.js.map").write_text("{}")
+ env = {
+ **os.environ,
+ "PATH": f"{bin_dir}:{os.environ['PATH']}",
+ "GITHUB_WORKSPACE": str(REPO_ROOT),
+ "SENTRY_AUTH_TOKEN": "test-token",
+ "VERSION": "0.17.0-beta.3",
+ "KIND": kind,
+ "UPLOAD_PATH": str(upload),
+ "URL_PREFIX": "app:///dist-electron",
+ "DELETE_MAPS": delete_maps,
+ "INJECT": inject,
+ "SENTRY_CLI": "@sentry/[email protected]",
+ }
+ return subprocess.run(["bash", "-c", script()], env=env, capture_output=True, text=True)
+
+
[email protected]("delete_maps", ["true", "false"])
[email protected]("inject", ["true", "false"])
[email protected]("cli_ok", [True, False])
+def test_sourcemaps_upload_never_fails_the_build(tmp_path, delete_maps, inject, cli_ok):
+ result = run(tmp_path, kind="sourcemaps", delete_maps=delete_maps, inject=inject, cli_ok=cli_ok)
+ assert result.returncode == 0, result.stdout + result.stderr
+ maps_left = (tmp_path / "dist/main.js.map").exists()
+ assert maps_left == (delete_maps != "true")
+
+
[email protected]("cli_ok", [True, False])
+def test_debug_files_upload_never_fails_the_build(tmp_path, cli_ok):
+ result = run(tmp_path, kind="debug-files", delete_maps="false", inject="false", cli_ok=cli_ok)
+ assert result.returncode == 0, result.stdout + result.stderr
+
+
+def test_an_unknown_kind_is_an_error(tmp_path):
+ assert run(tmp_path, kind="nope", delete_maps="false", inject="false", cli_ok=True).returncode == 1
diff --git a/.github/workflows/cd-cua-spaces.yml b/.github/workflows/cd-cua-spaces.yml
index 663a5e20b7..0d83e40dd4 100644
--- a/.github/workflows/cd-cua-spaces.yml
+++ b/.github/workflows/cd-cua-spaces.yml
@@ -2005,8 +2005,11 @@ jobs:
name: Staging smoke is green
if: startsWith(github.ref, 'refs/tags/cua-spaces-v')
runs-on: ubuntu-latest
- # Waits up to 30 minutes for the smoke that request-staging-smoke starts.
- timeout-minutes: 40
+ # Waits up to 2 hours for the smoke that request-staging-smoke starts:
+ # the smoke can sit in trycua/cloud's queue for half an hour before it
+ # runs (v0.17.0-beta.2's posted 35 minutes after the request, after a
+ # 30-minute wait had given up), and the release builds take longer still.
+ timeout-minutes: 130
defaults:
run:
working-directory: .
@@ -2020,7 +2023,7 @@ jobs:
GH_TOKEN: ${{ github.token }}
SKIP_STAGING_GATE: ${{ github.event_name == 'workflow_dispatch' && inputs.skip_staging_gate }}
SKIP_REASON: ${{ github.event_name == 'workflow_dispatch' && inputs.skip_staging_reason || '' }}
- WAIT_MINUTES: "30"
+ WAIT_MINUTES: "120"
run: .github/scripts/require_staging_smoke.sh cua-spaces "$GITHUB_SHA"
verify-release:
diff --git a/apps/cua-spaces-desktop/src/native/generated/cua_spaces_ffi.ts b/apps/cua-spaces-desktop/src/native/generated/cua_spaces_ffi.ts
index 1963be187b..656add5ed3 100644
--- a/apps/cua-spaces-desktop/src/native/generated/cua_spaces_ffi.ts
+++ b/apps/cua-spaces-desktop/src/native/generated/cua_spaces_ffi.ts
@@ -31366,6 +31366,69 @@ const FfiConverterTypeAppMenuPreview = (() => {
return new FFIConverter();
})();
+export type AppMicrovmInput = {
+ /**
+ * This machine's system (`macos`, `linux`, `windows`).
+ */
+ os?: AppSpaceOs,
+ /**
+ * Ready backends (none: not read yet).
+ */
+ localBackends?: Array<string>,
+ /**
+ * Why each other backend is not ready, by backend name.
+ */
+ localDetails?: Map<string, string>,
+ /**
+ * This machine's architecture (`arm64`, `amd64`).
+ */
+ hostArch?: string
+}
+
+/**
+ * Generated factory for {@link AppMicrovmInput} record objects.
+ */
+export const AppMicrovmInput = (() => {
+ const defaults = () => ({
+ });
+ const create = (() => {
+ return uniffiCreateRecord<AppMicrovmInput, ReturnType<typeof defaults>>(defaults);
+ })();
+ return Object.freeze({
+ create,
+ new: create,
+ defaults: () => Object.freeze(defaults()) as Partial<AppMicrovmInput>,
+ });
+})();
+
+const FfiConverterTypeAppMicrovmInput = (() => {
+ type TypeName = AppMicrovmInput;
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
+ read(from: RustBuffer): TypeName {
+ return {
+ os: FfiConverterOptionalTypeAppSpaceOs.read(from),
+ localBackends: FfiConverterOptionalSequenceString.read(from),
+ localDetails: FfiConverterOptionalMapStringString.read(from),
+ hostArch: FfiConverterOptionalString.read(from)
+ };
+ }
+ write(value: TypeName, into: RustBuffer): void {
+ FfiConverterOptionalTypeAppSpaceOs.write(value.os, into);
+ FfiConverterOptionalSequenceString.write(value.localBackends, into);
+ FfiConverterOptionalMapStringString.write(value.localDetails, into);
+ FfiConverterOptionalString.write(value.hostArch, into);
+ }
+ allocationSize(value: TypeName): number {
+ return FfiConverterOptionalTypeAppSpaceOs.allocationSize(value.os) +
+ FfiConverterOptionalSequenceString.allocationSize(value.localBackends) +
+ FfiConverterOptionalMapStringString.allocationSize(value.localDetails) +
+ FfiConverterOptionalString.allocationSize(value.hostArch);
+
+ }
+ };
+ return new FFIConverter();
+})();
+
export enum AppOnboardingMode {
/**
* Access other machines (nothing installed).
@@ -40989,6 +41052,11 @@ export type AppSettingsInput = {
* (`placement.overflow`); none: no row.
*/
overflow?: boolean,
+ /**
+ * What this machine's runtime doctor said, for Runtimes' MicroVM row
+ * (whether microVMs run here, and why not); none: no MicroVM row.
+ */
+ microvm?: AppMicrovmInput,
/**
* Settings, General's Show tips switch: tips are on
* (`!AppSettings.tips.off`). A shell that does not say reads as on.
@@ -41037,6 +41105,7 @@ const FfiConverterTypeAppSettingsInput = (() => {
lumeSource: FfiConverterOptionalString.read(from),
linuxSource: FfiConverterOptionalString.read(from),
overflow: FfiConverterOptionalBoolean.read(from),
+ microvm: FfiConverterOptionalTypeAppMicrovmInput.read(from),
showTips: FfiConverterBool.read(from)
};
}
@@ -41061,6 +41130,7 @@ const FfiConverterTypeAppSettingsInput = (() => {
FfiConverterOptionalString.write(value.lumeSource, into);
FfiConverterOptionalString.write(value.linuxSource, into);
FfiConverterOptionalBoolean.write(value.overflow, into);
+ FfiConverterOptionalTypeAppMicrovmInput.write(value.microvm, into);
FfiConverterBool.write(value.showTips, into);
}
allocationSize(value: TypeName): number {
@@ -41084,6 +41154,7 @@ const FfiConverterTypeAppSettingsInput = (() => {
FfiConverterOptionalString.allocationSize(value.lumeSource) +
FfiConverterOptionalString.allocationSize(value.linuxSource) +
FfiConverterOptionalBoolean.allocationSize(value.overflow) +
+ FfiConverterOptionalTypeAppMicrovmInput.allocationSize(value.microvm) +
FfiConverterBool.allocationSize(value.showTips);
}
@@ -45979,11 +46050,6 @@ export type AppWizardView = {
* Kind tiles: Container, Virtual machine, MicroVM.
*/
kindTiles: Array<AppTile>,
- /**
- * One plain line under Kind: what the chosen kind is (and why MicroVM
- * is greyed out, when it is).
- */
- kindHelp?: string,
/**
* Runtime menu.
*/
@@ -46184,7 +46250,6 @@ const FfiConverterTypeAppWizardView = (() => {
runtimeSwitch: FfiConverterOptionalTypeAppRuntimeSwitch.read(from),
advanced: FfiConverterBool.read(from),
kindTiles: FfiConverterSequenceTypeAppTile.read(from),
- kindHelp: FfiConverterOptionalString.read(from),
runtimes: FfiConverterSequenceTypeAppMenuOption.read(from),
runtime: FfiConverterTypeAppRuntime.read(from),
runtimeEnabled: FfiConverterBool.read(from),
@@ -46243,7 +46308,6 @@ const FfiConverterTypeAppWizardView = (() => {
FfiConverterOptionalTypeAppRuntimeSwitch.write(value.runtimeSwitch, into);
FfiConverterBool.write(value.advanced, into);
FfiConverterSequenceTypeAppTile.write(value.kindTiles, into);
- FfiConverterOptionalString.write(value.kindHelp, into);
FfiConverterSequenceTypeAppMenuOption.write(value.runtimes, into);
FfiConverterTypeAppRuntime.write(value.runtime, into);
FfiConverterBool.write(value.runtimeEnabled, into);
@@ -46301,7 +46365,6 @@ const FfiConverterTypeAppWizardView = (() => {
FfiConverterOptionalTypeAppRuntimeSwitch.allocationSize(value.runtimeSwitch) +
FfiConverterBool.allocationSize(value.advanced) +
FfiConverterSequenceTypeAppTile.allocationSize(value.kindTiles) +
- FfiConverterOptionalString.allocationSize(value.kindHelp) +
FfiConverterSequenceTypeAppMenuOption.allocationSize(value.runtimes) +
FfiConverterTypeAppRuntime.allocationSize(value.runtime) +
FfiConverterBool.allocationSize(value.runtimeEnabled) +
@@ -69432,6 +69495,12 @@ const FfiConverterOptionalTypeAppCloudsInput = new FfiConverterOptional(FfiConve
// FfiConverter for Array<AppMenuPreviewRow>
const FfiConverterSequenceTypeAppMenuPreviewRow = new FfiConverterArray(FfiConverterTypeAppMenuPreviewRow);
+// FfiConverter for AppSpaceOs | undefined
+const FfiConverterOptionalTypeAppSpaceOs = new FfiConverterOptional(FfiConverterTypeAppSpaceOs);
+
+// FfiConverter for Map<string, string> | undefined
+const FfiConverterOptionalMapStringString = new FfiConverterOptional(FfiConverterMapStringString);
+
// FfiConverter for Array<AppNotchButton>
const FfiConverterSequenceTypeAppNotchButton = new FfiConverterArray(FfiConverterTypeAppNotchButton);
@@ -69465,9 +69534,6 @@ const FfiConverterOptionalTypeAppCliInstallPlan = new FfiConverterOptional(FfiCo
// FfiConverter for AppOnboardingMode | undefined
const FfiConverterOptionalTypeAppOnboardingMode = new FfiConverterOptional(FfiConverterTypeAppOnboardingMode);
-// FfiConverter for AppSpaceOs | undefined
-const FfiConverterOptionalTypeAppSpaceOs = new FfiConverterOptional(FfiConverterTypeAppSpaceOs);
-
// FfiConverter for AppDriveStepRequest | undefined
const FfiConverterOptionalTypeAppDriveStepRequest = new FfiConverterOptional(FfiConverterTypeAppDriveStepRequest);
@@ -69612,6 +69678,9 @@ const FfiConverterOptionalTypeAppTeamsInput = new FfiConverterOptional(FfiConver
// FfiConverter for AppLoginItemInput | undefined
const FfiConverterOptionalTypeAppLoginItemInput = new FfiConverterOptional(FfiConverterTypeAppLoginItemInput);
+// FfiConverter for AppMicrovmInput | undefined
+const FfiConverterOptionalTypeAppMicrovmInput = new FfiConverterOptional(FfiConverterTypeAppMicrovmInput);
+
// FfiConverter for Array<AppSettingsSection>
const FfiConverterSequenceTypeAppSettingsSection = new FfiConverterArray(FfiConverterTypeAppSettingsSection);
@@ -69684,9 +69753,6 @@ const FfiConverterOptionalTypeAppStreamDisplay = new FfiConverterOptional(FfiCon
// FfiConverter for AppTipLink | undefined
const FfiConverterOptionalTypeAppTipLink = new FfiConverterOptional(FfiConverterTypeAppTipLink);
-// FfiConverter for Map<string, string> | undefined
-const FfiConverterOptionalMapStringString = new FfiConverterOptional(FfiConverterMapStringString);
-
// FfiConverter for AppLocalStorage | undefined
const FfiConverterOptionalTypeAppLocalStorage = new FfiConverterOptional(FfiConverterTypeAppLocalStorage);
@@ -71405,6 +71471,7 @@ export default Object.freeze({
FfiConverterTypeAppMenuOption,
FfiConverterTypeAppMenuPreview,
FfiConverterTypeAppMenuPreviewRow,
+ FfiConverterTypeAppMicrovmInput,
FfiConverterTypeAppModeChoice,
FfiConverterTypeAppMsg,
FfiConverterTypeAppNewSpaceOn,
diff --git a/apps/cua-spaces-desktop/test/bridge-native.test.ts b/apps/cua-spaces-desktop/test/bridge-native.test.ts
index ef1816cbe0..8a34c67f76 100644
--- a/apps/cua-spaces-desktop/test/bridge-native.test.ts
+++ b/apps/cua-spaces-desktop/test/bridge-native.test.ts
@@ -183,7 +183,10 @@ describe.skipIf(!built)("the bridge on the app core", () => {
["links.list", {}],
["links.create", { target: "3000" }],
["links.stop", { id: "all" }],
+ ["checklist.get", {}],
["cli.plan", {}],
+ ["checklist.send", { action: { type: "done", step: "teleport" } }],
+ ["crashReporting.config", {}],
["session.signOut", {}],
];
const problems: string[] = [];
@@ -603,6 +606,7 @@ describe.skipIf(!built)("the bridge on the app core", () => {
"nudges.answer": { id: "none", choice: "separate" },
"links.create": { target: "3000" },
"links.stop": { id: "all" },
+ "checklist.send": { action: { type: "done", step: "teleport" } },
"spaces.deleteMany": { ids: ["local:nowhere"] },
"spaces.leave": { ids: ["local:nowhere"] },
};
diff --git a/apps/cua-spaces-desktop/test/bridge-spaces.test.ts b/apps/cua-spaces-desktop/test/bridge-spaces.test.ts
index 322c329c1b..28825e91db 100644
--- a/apps/cua-spaces-desktop/test/bridge-spaces.test.ts
+++ b/apps/cua-spaces-desktop/test/bridge-spaces.test.ts
@@ -228,17 +228,17 @@ describe.skipIf(!built)("a Space's detail, files, sharing and clouds on the app
describe("bulk delete and leave", () => {
it("deletes several, one result per id in order, a failure restoring only its row", async () => {
- backend.bulkErrors.set("cloud:builder", "timed out");
- const answer = (await call("spaces.deleteMany", { ids: [aurora, "cloud:builder", "local:nowhere"] })) as { results: { id: string; ok: boolean; error?: string }[] };
+ backend.bulkErrors.set("direct:builder", "timed out");
+ const answer = (await call("spaces.deleteMany", { ids: [aurora, "direct:builder", "local:nowhere"] })) as { results: { id: string; ok: boolean; error?: string }[] };
expect(answer.results).toEqual([
{ id: aurora, ok: true },
- { id: "cloud:builder", ok: false, error: "timed out" },
+ { id: "direct:builder", ok: false, error: "timed out" },
{ id: "local:nowhere", ok: false, error: "No Space local:nowhere." },
]);
expect(backend.removed).toEqual([{ id: aurora, removeOnly: false }]);
expect(model.spaces.some((s) => s.id === aurora)).toBe(false);
- expect(model.isDeleting("cloud:builder")).toBe(false);
- expect(model.spaces.some((s) => s.id === "cloud:builder")).toBe(true);
+ expect(model.isDeleting("direct:builder")).toBe(false);
+ expect(model.spaces.some((s) => s.id === "direct:builder")).toBe(true);
expect(await code("spaces.deleteMany", { ids: "x" })).toBe("bad_args");
});
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppModel.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppModel.swift
index 8dc85c92db..c2ff22af70 100644
--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppModel.swift
+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppModel.swift
@@ -1808,7 +1808,11 @@ public final class AppModel {
keyvaultUnlockPrompt: keyvault.unlockPromptShows,
keyvaultSiteIcons: settings.keyvaultSiteIcons, keyvaultProtection: keyvault.page.protection,
autoConnect: settings.autoConnect, lumeSource: lumeSource, linuxSource: linuxSource,
- overflow: placementOverflow, showTips: !settings.tips.off))
+ overflow: placementOverflow,
+ // Runtimes' MicroVM row: the runtime doctor New Space's MicroVM tile follows.
+ microvm: AppMicrovmInput(os: .macos, localBackends: wizard.env.localBackends,
+ localDetails: wizard.env.localDetails, hostArch: wizard.env.hostArch),
+ showTips: !settings.tips.off))
}
/// Teams for Settings: the account's organizations with their people
diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ViewModelTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ViewModelTests.swift
index 7793b2f0ab..1f1d17c7ac 100644
--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ViewModelTests.swift
+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ViewModelTests.swift
@@ -667,7 +667,6 @@ struct ViewModelTests {
let v = model.wizard.view
#expect(v.kindTiles.map(\.id) == ["container", "vm", "microvm"])
#expect(v.runtimes.map(\.value) == ["auto", "vz", "containerization"])
- #expect(v.kindHelp == "The container image with its own kernel, on Virtualization.framework.")
model.wizard.send(.setRuntime(runtime: .containerization))
model.create(model.wizard.view.plan)
for _ in 0..<50 where backend.created.isEmpty { try? await Task.sleep(for: .milliseconds(20)) }
@@ -683,7 +682,12 @@ struct ViewModelTests {
await mac.openNewSpace()
mac.wizard.send(.chooseKind(kind: .microvm))
#expect(mac.wizard.view.kindTiles.first { $0.id == "microvm" }?.enabled == false)
- #expect(mac.wizard.view.kindTiles.first { $0.id == "microvm" }?.detail == "Needs macOS 26.")
+ // No words in New Space; Settings, Advanced, Runtimes says why.
+ #expect(mac.wizard.view.kindTiles.first { $0.id == "microvm" }?.detail == "")
+ let microvm = mac.settingsPage.sections.first { $0.id == "runtimes" }?.rows.filter { $0.id.hasPrefix("microvm-") }
+ #expect(microvm?.map(\.id) == ["microvm-runtime", "microvm-runtime-note"])
+ #expect(microvm?.first?.value == "Not available")
+ #expect(microvm?.last?.label == "MicroVM needs macOS 26.")
#expect(appWizardCreateArgs(plan: mac.wizard.view.plan).kind == .container)
}
diff --git a/apps/cua-spaces-web/e2e/new-space.ts b/apps/cua-spaces-web/e2e/new-space.ts
index 05b22a113c..0fe5e350f5 100644
--- a/apps/cua-spaces-web/e2e/new-space.ts
+++ b/apps/cua-spaces-web/e2e/new-space.ts
@@ -116,10 +116,8 @@ async function checkWizard(page: Page, state: WizardState, v: WizardView, menuCh
if (field("os")) await expectTiles(root, "os", v.osTiles);
if (field("kind")) {
await expectTiles(root, "kind", v.kindTiles);
- // What the chosen kind is (and why MicroVM is greyed out), in one line.
- const help = root.locator("[data-kind-help]");
- if (v.kindHelp) await expect(help).toHaveText(v.kindHelp);
- else await expect(help).toHaveCount(0);
+ // No line under Kind: why MicroVM is greyed out is Settings, Advanced's.
+ await expect(root.locator("[data-kind-help]")).toHaveCount(0);
}
if (field("image")) {
const input = root.locator("[data-image-input]");
diff --git a/apps/cua-spaces-web/src/__tests__/new-space-microvm-line.test.tsx b/apps/cua-spaces-web/src/__tests__/new-space-microvm-line.test.tsx
deleted file mode 100644
index 91786b5887..0000000000
--- a/apps/cua-spaces-web/src/__tests__/new-space-microvm-line.test.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-// SPDX-License-Identifier: FSL-1.1-MIT
-// Copyright (c) 2026 Cua AI, Inc.
-
-// New Space's Kind row: the core's one quiet line under Kind says what the
-// chosen kind is and why MicroVM is greyed out on this host, in view (not
-// only in a hover tooltip), so a microVM that would fail is never offered.
-
-import { cleanup, fireEvent, screen, waitFor } from "@testing-library/react";
-import { afterEach, beforeEach, describe, expect, it } from "vitest";
-import { wasmBuilt } from "@/bridge/__tests__/testCore";
-import { resetNewSpaceSession } from "@/bridge/new-space";
-import { mountApp, stubBrowserApis } from "./app-harness";
-
-beforeEach(resetNewSpaceSession);
-afterEach(cleanup);
-stubBrowserApis();
-
-describe.skipIf(!wasmBuilt)("New Space's Kind line", () => {
- it("shows why MicroVM is greyed out on this host", { timeout: 20_000 }, async () => {
- await mountApp("/spaces", { failsCreates: false, listsGhost: false });
- fireEvent.click(await screen.findByRole("button", { name: /New Space/ }));
- const dialog = await waitFor(
- () => {
- const d = document.querySelector<HTMLElement>("[data-new-space]");
- expect(d).not.toBeNull();
- return d!;
- },
- { timeout: 4000 },
- );
- fireEvent.click(await waitFor(() => dialog.querySelector<HTMLElement>("[data-advanced-toggle]")!));
- const tile = await waitFor(() => {
- const t = dialog.querySelector<HTMLButtonElement>("[data-tile='kind:microvm']");
- expect(t).not.toBeNull();
- return t!;
- });
- expect(tile.disabled).toBe(true);
- const line = dialog.querySelector("[data-kind-help]");
- expect(line?.textContent).toMatch(/MicroVM needs /);
- // The same words the tile's tooltip gives, in one line.
- expect(line!.textContent!.toLowerCase()).toContain(tile.title.replace(/\.$/, "").toLowerCase());
- });
-});
diff --git a/apps/cua-spaces-web/src/__tests__/new-space-microvm-settings.test.tsx b/apps/cua-spaces-web/src/__tests__/new-space-microvm-settings.test.tsx
new file mode 100644
index 0000000000..ffbad249a8
--- /dev/null
+++ b/apps/cua-spaces-web/src/__tests__/new-space-microvm-settings.test.tsx
@@ -0,0 +1,58 @@
+// SPDX-License-Identifier: FSL-1.1-MIT
+// Copyright (c) 2026 Cua AI, Inc.
+
+// New Space's Kind row has no line under it: a MicroVM this computer can't
+// run is greyed out with no words there. Why it can't is told in Settings,
+// Advanced, beside the runtimes (`settings::microvm_rows`), from the same
+// runtime doctor the tile follows.
+
+import { cleanup, fireEvent, screen, waitFor } from "@testing-library/react";
+import { afterEach, beforeEach, describe, expect, it } from "vitest";
+import { wasmBuilt } from "@/bridge/__tests__/testCore";
+import { resetNewSpaceSession } from "@/bridge/new-space";
+import { mountApp, stubBrowserApis } from "./app-harness";
+
+beforeEach(resetNewSpaceSession);
+afterEach(cleanup);
+stubBrowserApis();
+
+describe.skipIf(!wasmBuilt)("MicroVM: greyed out in New Space, explained in Settings", () => {
+ it("New Space greys MicroVM out with no line under Kind and no reason", { timeout: 20_000 }, async () => {
+ await mountApp("/spaces", { failsCreates: false, listsGhost: false });
+ fireEvent.click(await screen.findByRole("button", { name: /New Space/ }));
+ const dialog = await waitFor(
+ () => {
+ const d = document.querySelector<HTMLElement>("[data-new-space]");
+ expect(d).not.toBeNull();
+ return d!;
+ },
+ { timeout: 4000 },
+ );
+ fireEvent.click(await waitFor(() => dialog.querySelector<HTMLElement>("[data-advanced-toggle]")!));
+ const tile = await waitFor(() => {
+ const t = dialog.querySelector<HTMLButtonElement>("[data-tile='kind:microvm']");
+ expect(t).not.toBeNull();
+ return t!;
+ });
+ expect(tile.disabled).toBe(true);
+ expect(tile.title).toBe("");
+ expect(dialog.querySelector("[data-kind-help]")).toBeNull();
+ expect(dialog.textContent).not.toMatch(/MicroVM needs|Needs macOS 26/);
+ });
+
+ it("Settings, Advanced says why MicroVMs don't run here", { timeout: 20_000 }, async () => {
+ await mountApp("/settings/advanced", { failsCreates: false, listsGhost: false });
+ const row = await waitFor(
+ () => {
+ const r = document.querySelector<HTMLElement>("[data-microvm-runtime]");
+ expect(r).not.toBeNull();
+ return r!;
+ },
+ { timeout: 8000 },
+ );
+ expect(row.querySelector("[data-row-label]")?.textContent).toBe("MicroVMs");
+ expect(row.querySelector("[data-row-value]")?.textContent).toBe("Not available");
+ expect(row.querySelector("[data-row-description]")?.textContent).toBe("MicroVM needs macOS 26.");
+ expect(row.getAttribute("data-microvm-problem")).toBe("true");
+ });
+});
diff --git a/apps/cua-spaces-web/src/bridge/__tests__/new-space.test.tsx b/apps/cua-spaces-web/src/bridge/__tests__/new-space.test.tsx
index 4d303a0ac9..beab4d2690 100644
--- a/apps/cua-spaces-web/src/bridge/__tests__/new-space.test.tsx
+++ b/apps/cua-spaces-web/src/bridge/__tests__/new-space.test.tsx
@@ -83,15 +83,14 @@ describe.skipIf(!wasmBuilt)("New Space (wasm core)", () => {
["vm", true, false],
["microvm", true, true],
]);
- expect(v.kindHelp).toBe("The container image with its own kernel, on Apple Containerization.");
expect(v.runtimes.map((r) => r.value)).toEqual(["auto", "containerization"]);
expect(wizardCreateArgs(core, v.plan)).toMatchObject({ kind: "microvm", image: "ghcr.io/trycua/linux:24.04", on: "local" });
- // Without one, greyed out with why, and the line under Kind says it.
+ // Without one, greyed out, with no words in New Space (Settings, Advanced says why).
const none = wizardEnv(core, { options: DEMO_NEW_SPACE_OPTIONS, clouds: null, defaultLocation: "local", machines: [] });
const off = wizardView(core, wizardReduce(core, wizardInitial(core, none), { type: "choose-kind", kind: "microvm" }, none), none, "macos");
- expect(off.kindTiles.find((t) => t.id === "microvm")).toMatchObject({ enabled: false, pressed: false, detail: "Needs macOS 26." });
- expect(off.kindHelp).toBe("A sandboxed Linux container. Starts fastest. MicroVM needs macOS 26.");
+ expect(off.kindTiles.find((t) => t.id === "microvm")).toMatchObject({ enabled: false, pressed: false, detail: "" });
+ expect("kindHelp" in off).toBe(false);
expect(wizardCreateArgs(core, off.plan).kind).toBe("container");
});
diff --git a/apps/cua-spaces-web/src/bridge/contracts/bridge-shapes.json b/apps/cua-spaces-web/src/bridge/contracts/bridge-shapes.json
index f09740c5b4..bca9856fc6 100644
--- a/apps/cua-spaces-web/src/bridge/contracts/bridge-shapes.json
+++ b/apps/cua-spaces-web/src/bridge/contracts/bridge-shapes.json
@@ -5505,6 +5505,15 @@
"type": "string"
}
},
+ "localDetails": {
+ "type": [
+ "object",
+ "null"
+ ],
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
"maxCpus": {
"type": "number"
},
diff --git a/apps/cua-spaces-web/src/bridge/contracts/new-space.ts b/apps/cua-spaces-web/src/bridge/contracts/new-space.ts
index b6fa5d8809..956a533724 100644
--- a/apps/cua-spaces-web/src/bridge/contracts/new-space.ts
+++ b/apps/cua-spaces-web/src/bridge/contracts/new-space.ts
@@ -117,6 +117,8 @@ export interface WizardEnv {
localAvailable: boolean;
localReason?: string | null;
localBackends?: string[] | null;
+ /** Why each local backend that is not ready is not (the runtime doctor's detail). */
+ localDetails?: Record<string, string> | null;
maxCpus: number;
hostArch?: string | null;
storage?: LocalStorage | null;
@@ -295,8 +297,6 @@ export interface WizardView {
runtimeSwitch?: RuntimeSwitch | null;
advanced: boolean;
kindTiles: WizardTile[];
- /** One plain line under Kind: what the chosen kind is (and why MicroVM is greyed out). */
- kindHelp?: string | null;
runtimes: { value: Runtime; label: string }[];
runtime: Runtime;
runtimeEnabled: boolean;
diff --git a/apps/cua-spaces-web/src/bridge/contracts/shapes.ts b/apps/cua-spaces-web/src/bridge/contracts/shapes.ts
index daf6b7355b..8a91277a7f 100644
--- a/apps/cua-spaces-web/src/bridge/contracts/shapes.ts
+++ b/apps/cua-spaces-web/src/bridge/contracts/shapes.ts
@@ -586,6 +586,7 @@ const WizardEnvShape = ref(
localAvailable: bool,
localReason: optNull(str),
localBackends: optNull(strings),
+ localDetails: optNull(dict(str)),
maxCpus: num,
hostArch: optNull(str),
storage: optNull(LocalStorageShape),
diff --git a/apps/cua-spaces-web/src/bridge/index.ts b/apps/cua-spaces-web/src/bridge/index.ts
index 1b8219091f..9995f81bbe 100644
--- a/apps/cua-spaces-web/src/bridge/index.ts
+++ b/apps/cua-spaces-web/src/bridge/index.ts
@@ -104,6 +104,7 @@ export {
useCloudActions,
useConnectCloud,
useFirstSpaceOffers,
+ useMicrovmRows,
useNewSpaceRequests,
useNewSpaceWizard,
useRuntimeFix,
diff --git a/apps/cua-spaces-web/src/bridge/new-space-hooks.ts b/apps/cua-spaces-web/src/bridge/new-space-hooks.ts
index 1c68b8ab2e..de2875dc47 100644
--- a/apps/cua-spaces-web/src/bridge/new-space-hooks.ts
+++ b/apps/cua-spaces-web/src/bridge/new-space-hooks.ts
@@ -9,6 +9,8 @@ import { BridgeContext } from "./BridgeProvider";
import type { CoreClient } from "./core";
import type { CloudConnectWire, CloudSheetAction, CloudSheetView, CloudTarget, RuntimeFix, RuntimeSwitch, WizardAction, WizardEnv, WizardView } from "./contracts/new-space";
import type { Space, SpaceOs } from "./contracts/spaces";
+import type { SettingsPage, SettingsRow } from "./contracts/host";
+import { hostOs } from "./host-os";
import { useMachines, useSettings, useSpaces } from "./hooks";
import { newPendingId } from "./store";
import {
@@ -429,3 +431,24 @@ export function useRuntimeFix(): RuntimeFixHook {
},
};
}
+
+/**
+ * Settings, Advanced, Runtimes' MicroVM row (`settings::microvm_rows`):
+ * whether this computer runs microVMs and on what, or why not, from the
+ * same runtime doctor New Space's MicroVM tile follows. New Space only
+ * greys MicroVM out; the reason is told here. Empty until the host's
+ * options are in (asked for here when not yet).
+ */
+export function useMicrovmRows(): SettingsRow[] {
+ const ctx = useContext(BridgeContext)!;
+ const { core, env, s } = useNewSpaceEnv();
+ const needsOptions = optionsPending(s.options);
+ useEffect(() => {
+ if (needsOptions && core.status === "ready") void ctx.ready.then(loadHostData);
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [needsOptions, core.status, ctx.ready]);
+ if (!s.options || core.status !== "ready") return [];
+ const microvm = { os: hostOs(), localBackends: env.localBackends ?? null, localDetails: env.localDetails ?? null, hostArch: env.hostArch ?? null };
+ const page = core.tryCall<SettingsPage>("settings.page", { input: { microvm } });
+ return page?.sections.find((x) => x.id === "runtimes")?.rows.filter((r) => r.id.startsWith("microvm-")) ?? [];
+}
diff --git a/apps/cua-spaces-web/src/components/new-space/new-space-dialog.tsx b/apps/cua-spaces-web/src/components/new-space/new-space-dialog.tsx
index 016801fb2b..844d7f56f9 100644
--- a/apps/cua-spaces-web/src/components/new-space/new-space-dialog.tsx
+++ b/apps/cua-spaces-web/src/components/new-space/new-space-dialog.tsx
@@ -383,16 +383,7 @@ function SystemRow({ field: f, v }: { field: WizardField; v: WizardView }) {
<Row
id="kind"
label={f.label}
- below={
- <>
- {error}
- {v.kindHelp ? (
- <p data-kind-help="" className="mt-1 text-xs text-muted-foreground">
- {v.kindHelp}
- </p>
- ) : null}
- </>
- }
+ below={error}
>
<Tiles id="kind" label={f.label} tiles={v.kindTiles} onPick={(kind) => send({ type: "choose-kind", kind })} />
</Row>
diff --git a/apps/cua-spaces-web/src/components/settings/advanced-tab.tsx b/apps/cua-spaces-web/src/components/settings/advanced-tab.tsx
index abce11c80c..9836434226 100644
--- a/apps/cua-spaces-web/src/components/settings/advanced-tab.tsx
+++ b/apps/cua-spaces-web/src/components/settings/advanced-tab.tsx
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: FSL-1.1-MIT
// Copyright (c) 2026 Cua AI, Inc.
-import { setFlagOverride, useAbout, useBridge, useExperiments, useFlag, useMachines, useSession, useSettings, useThisMachine, type SettingsOption, type SettingsRow as CoreRow } from "@/bridge";
+import { setFlagOverride, useAbout, useBridge, useExperiments, useFlag, useMachines, useMicrovmRows, useSession, useSettings, useThisMachine, type SettingsOption, type SettingsRow as CoreRow } from "@/bridge";
import { aboutView } from "@/bridge/settings-derive";
import { SettingsGroup } from "@/components/settings-group";
import { SettingRow } from "@/components/ui/grouped";
@@ -41,15 +41,24 @@ export function AdvancedTab() {
const runtimes = page?.sections.find((s) => s.id === "runtimes");
const autoConnect = general?.rows.find((r) => r.id === "auto-connect");
const overflow = general?.rows.find((r) => r.id === "placement-overflow");
+ // Whether this computer runs microVMs, and why not (New Space only greys MicroVM out).
+ const microvm = useMicrovmRows();
+ const microvmStatus = microvm.find((r) => r.id === "microvm-runtime");
+ const microvmNote = microvm.find((r) => r.id === "microvm-runtime-note");
const choose = (row: CoreRow, option: string) => void chooseSetting(row.id, option).catch(toastError(`Couldn't change ${row.label}`));
return (
<div data-settings-tab="advanced">
<EarlyReleases />
<Labs />
- {runtimes || autoConnect || overflow ? (
+ {runtimes || autoConnect || overflow || microvmStatus ? (
<SettingsGroup title="Which software runs Spaces on this Mac">
{runtimes?.rows.filter((r) => r.kind === "choice").map((r) => <CoreSettingsRow key={r.id} row={runtimeRow(r)} asSelect onChoose={choose} />)}
+ {microvmStatus ? (
+ <div data-microvm-runtime="" data-microvm-problem={microvmNote?.kind === "error" || undefined}>
+ <CoreSettingsRow row={{ ...microvmStatus, label: "MicroVMs" }} description={microvmNote?.label} />
+ </div>
+ ) : null}
{autoConnect ? <CoreSettingsRow row={{ ...autoConnect, label: "Open a Space’s screen right away" }} onChoose={choose} /> : null}
{overflow ? (
<CoreSettingsRow
diff --git a/apps/cua-spaces-web/src/components/settings/core-section.tsx b/apps/cua-spaces-web/src/components/settings/core-section.tsx
index fd4ce184cd..100f5ed053 100644
--- a/apps/cua-spaces-web/src/components/settings/core-section.tsx
+++ b/apps/cua-spaces-web/src/components/settings/core-section.tsx
@@ -167,7 +167,7 @@ export function CoreSettingsRow({
default:
return (
<Line {...attrs} title={row.help ?? undefined} className={cn(!row.enabled && !row.button && "opacity-50")}>
- <Label label={row.label} />
+ <Label label={row.label} description={description} />
<div className="flex min-w-0 items-center gap-2">
{row.value ? (
<span data-row-value className="truncate text-[13px] text-muted-foreground">
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.json
index 47d76b0c23..a81b8beccc 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
@@ -16,7 +16,7 @@
"connect-by-address"
],
"kindsOff": [
- "microvm | MicroVM | Needs macOS 26. | off"
+ "microvm | MicroVM | | off"
],
"placement": "local",
"placementError": null,
@@ -68,7 +68,7 @@
"connect-by-address"
],
"kindsOff": [
- "microvm | MicroVM | Needs macOS 26. | off"
+ "microvm | MicroVM | | off"
],
"placement": "local",
"placementError": null,
@@ -120,7 +120,7 @@
"connect-by-address"
],
"kindsOff": [
- "microvm | MicroVM | Needs macOS 26. | off"
+ "microvm | MicroVM | | off"
],
"placement": "local",
"placementError": null,
@@ -172,7 +172,7 @@
"connect-by-address"
],
"kindsOff": [
- "microvm | MicroVM | Needs macOS 26 on Mac mini. | off"
+ "microvm | MicroVM | | off"
],
"placement": "host",
"placementError": null,
@@ -222,7 +222,7 @@
],
"kindsOff": [
"container | Container | | off",
- "microvm | MicroVM | Runs Linux images only. | off"
+ "microvm | MicroVM | | off"
],
"placement": "host",
"placementError": "Mac mini is at its limit: Apple's macOS license allows two macOS VMs per Mac.",
@@ -271,7 +271,7 @@
"connect-by-address"
],
"kindsOff": [
- "microvm | MicroVM | Needs macOS 26 on Mac mini. | off"
+ "microvm | MicroVM | | off"
],
"placement": "host",
"placementError": null,
@@ -320,7 +320,7 @@
"connect-by-address"
],
"kindsOff": [
- "microvm | MicroVM | Needs Linux with KVM on lab. | off"
+ "microvm | MicroVM | | off"
],
"placement": "host",
"placementError": null,
@@ -370,7 +370,7 @@
"connect-by-address"
],
"kindsOff": [
- "microvm | MicroVM | Needs Linux with KVM on lab. | off"
+ "microvm | MicroVM | | off"
],
"placement": "host",
"placementError": null,
@@ -423,7 +423,7 @@
],
"kindsOff": [
"vm | Virtual machine | AWS does not run this image. Ask your agent to deploy the Ubuntu 24.04 VM image on AWS and add it with cua spaces add. | off",
- "microvm | MicroVM | Is not offered on AWS. | off"
+ "microvm | MicroVM | | off"
],
"placement": "yours",
"placementError": null,
@@ -477,7 +477,7 @@
"connect-by-address"
],
"kindsOff": [
- "microvm | MicroVM | Needs macOS 26. | off"
+ "microvm | MicroVM | | off"
],
"placement": "local",
"placementError": null,
@@ -529,7 +529,7 @@
"connect-by-address"
],
"kindsOff": [
- "microvm | MicroVM | Needs macOS 26 on Mac mini. | off"
+ "microvm | MicroVM | | off"
],
"placement": "host",
"placementError": null,
@@ -574,7 +574,7 @@
"memory"
],
"kindsOff": [
- "microvm | MicroVM | Needs macOS 26 on Mac mini. | off"
+ "microvm | MicroVM | | off"
],
"placement": "host",
"placementError": null,
@@ -619,7 +619,7 @@
"open-when-ready"
],
"kindsOff": [
- "microvm | MicroVM | Needs macOS 26 on Mac mini. | off"
+ "microvm | MicroVM | | off"
],
"placement": "host",
"placementError": null,
@@ -661,7 +661,7 @@
"cloud": null,
"fields": [],
"kindsOff": [
- "microvm | MicroVM | Needs macOS 26 on Mac mini. | off"
+ "microvm | MicroVM | | off"
],
"placement": "host",
"placementError": null,
@@ -703,7 +703,7 @@
"cloud": null,
"fields": [],
"kindsOff": [
- "microvm | MicroVM | Needs macOS 26. | off"
+ "microvm | MicroVM | | off"
],
"placement": "local",
"placementError": null,
@@ -742,7 +742,7 @@
"cloud": null,
"fields": [],
"kindsOff": [
- "microvm | MicroVM | Needs macOS 26. | off"
+ "microvm | MicroVM | | off"
],
"placement": "local",
"placementError": null,
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.json
index 8b06774383..1e3d4bb22c 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
@@ -17,7 +17,7 @@
"connect-by-address"
],
"kindsOff": [
- "microvm | MicroVM | Needs macOS 26. | off"
+ "microvm | MicroVM | | off"
],
"placement": "local",
"placementError": null,
@@ -64,7 +64,7 @@
"connect-by-address"
],
"kindsOff": [
- "microvm | MicroVM | Needs macOS 26. | off"
+ "microvm | MicroVM | | off"
],
"placement": "local",
"placementError": null,
@@ -701,7 +701,7 @@
],
"kindsOff": [
"vm | Virtual machine | VM Spaces need a nested-virtualization machine; not offered yet. Ask your agent to deploy the Ubuntu 24.04 VM image on AWS and add it with cua spaces add. | off",
- "microvm | MicroVM | Is not offered on AWS. | off"
+ "microvm | MicroVM | | off"
],
"placement": "yours",
"placementError": null,
@@ -743,7 +743,7 @@
"fields": [],
"kindsOff": [
"vm | Virtual machine | VM Spaces need a nested-virtualization machine; not offered yet. Ask your agent to deploy the Ubuntu 24.04 VM image on AWS and add it with cua spaces add. | off",
- "microvm | MicroVM | Is not offered on AWS. | off"
+ "microvm | MicroVM | | off"
],
"placement": "yours",
"placementError": null,
@@ -788,7 +788,7 @@
],
"kindsOff": [
"vm | Virtual machine | VM Spaces need a nested-virtualization machine; not offered yet. Ask your agent to deploy the Ubuntu 24.04 VM image on AWS and add it with cua spaces add. | off",
- "microvm | MicroVM | Is not offered on AWS. | off"
+ "microvm | MicroVM | | off"
],
"placement": "yours",
"placementError": null,
@@ -830,7 +830,7 @@
"fields": [],
"kindsOff": [
"vm | Virtual machine | VM Spaces need a nested-virtualization machine; not offered yet. Ask your agent to deploy the Ubuntu 24.04 VM image on AWS and add it with cua spaces add. | off",
- "microvm | MicroVM | Is not offered on AWS. | off"
+ "microvm | MicroVM | | off"
],
"placement": "yours",
"placementError": null,
@@ -875,7 +875,7 @@
],
"kindsOff": [
"vm | Virtual machine | VM Spaces need a nested-virtualization machine; not offered yet. Ask your agent to deploy the Ubuntu 24.04 VM image on AWS and add it with cua spaces add. | off",
- "microvm | MicroVM | Is not offered on AWS. | off"
+ "microvm | MicroVM | | off"
],
"placement": "yours",
"placementError": null,
@@ -921,7 +921,7 @@
],
"kindsOff": [
"vm | Virtual machine | Modal does not run this image. Ask your agent to deploy the Ubuntu 24.04 VM image on Modal and add it with cua spaces add. | off",
- "microvm | MicroVM | Is not offered on Modal. | off"
+ "microvm | MicroVM | | off"
],
"placement": "yours",
"placementError": null,
@@ -966,7 +966,7 @@
"open-when-ready"
],
"kindsOff": [
- "microvm | MicroVM | Needs macOS 26. | off"
+ "microvm | MicroVM | | off"
],
"placement": "local",
"placementError": null,
diff --git a/libs/cua/crates/cua-spaces-app-core/src/settings.rs b/libs/cua/crates/cua-spaces-app-core/src/settings.rs
index a6dea7441e..4142843cba 100644
--- a/libs/cua/crates/cua-spaces-app-core/src/settings.rs
+++ b/libs/cua/crates/cua-spaces-app-core/src/settings.rs
@@ -370,6 +370,21 @@ pub struct TelemetryInput {
pub notice_shown: bool,
}
+/// This machine's runtime doctor, for Settings, Advanced, Runtimes'
+/// MicroVM row (the same facts New Space's MicroVM tile follows).
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase", default)]
+pub struct MicrovmInput {
+ /// This machine's system (`macos`, `linux`, `windows`).
+ pub os: Option<crate::model::SpaceOs>,
+ /// Ready backends (none: not read yet).
+ pub local_backends: Option<Vec<String>>,
+ /// Why each other backend is not ready, by backend name.
+ pub local_details: Option<std::collections::HashMap<String, String>>,
+ /// This machine's architecture (`arm64`, `amd64`).
+ pub host_arch: Option<String>,
+}
+
/// What the Settings page shows.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase", default)]
@@ -431,6 +446,10 @@ pub struct SettingsInput {
/// (`placement.overflow`); none: no row.
#[serde(default)]
pub overflow: Option<bool>,
+ /// What this machine's runtime doctor said, for Runtimes' MicroVM row
+ /// (whether microVMs run here, and why not); none: no MicroVM row.
+ #[serde(default)]
+ pub microvm: Option<MicrovmInput>,
/// Settings, General's Show tips switch: tips are on
/// (`!AppSettings.tips.off`). A shell that does not say reads as on.
#[serde(default = "default_true")]
@@ -460,6 +479,7 @@ impl Default for SettingsInput {
lume_source: None,
linux_source: None,
overflow: None,
+ microvm: None,
show_tips: true,
}
}
@@ -854,11 +874,13 @@ pub fn page(input: &SettingsInput) -> SettingsPage {
},
];
- if input.lume_source.is_some() || input.linux_source.is_some() {
- sections.push(runtimes_section(
- input.lume_source.as_deref(),
- input.linux_source.as_deref(),
- ));
+ if input.lume_source.is_some() || input.linux_source.is_some() || input.microvm.is_some() {
+ let mut runtimes =
+ runtimes_section(input.lume_source.as_deref(), input.linux_source.as_deref());
+ if let Some(m) = &input.microvm {
+ runtimes.rows.extend(microvm_rows(m));
+ }
+ sections.push(runtimes);
}
if let Some(t) = &input.telemetry {
@@ -988,6 +1010,61 @@ pub fn runtimes_section(lume_source: Option<&str>, linux_source: Option<&str>) -
}
}
+/// Runtimes' MicroVM row: whether this machine runs microVMs and on what,
+/// or why not (New Space only greys MicroVM out; the reason is told here).
+pub fn microvm_rows(m: &MicrovmInput) -> Vec<SettingsRow> {
+ use crate::wizard::{LocalProbe, MicrovmStatus, microvm_status_of};
+ use SettingsRowKind::*;
+ let probe = LocalProbe {
+ backends: m.local_backends.as_deref(),
+ details: m.local_details.as_ref(),
+ host_arch: m.host_arch.as_deref(),
+ };
+ let os = m.os.unwrap_or(crate::model::SpaceOs::Macos);
+ let mut status = row("microvm-runtime", Text, "MicroVM");
+ let note = match microvm_status_of(&probe, os) {
+ MicrovmStatus::Checking => {
+ status.value = Some("Checking\u{2026}".into());
+ None
+ }
+ MicrovmStatus::Ready(runtimes) => {
+ status.value = Some("Ready".into());
+ let names: Vec<String> = runtimes.iter().map(|r| r.label()).collect();
+ Some(row(
+ "microvm-runtime-note",
+ Note,
+ &format!("MicroVM Spaces run on {}.", join_or(&names)),
+ ))
+ }
+ MicrovmStatus::Blocked(why) => {
+ status.value = Some("Not available".into());
+ Some(row(
+ "microvm-runtime-note",
+ Error,
+ &format!("MicroVM {}", lower_first(&why)),
+ ))
+ }
+ };
+ std::iter::once(status).chain(note).collect()
+}
+
+/// "A", "A or B", "A, B or C".
+fn join_or(names: &[String]) -> String {
+ match names {
+ [] => String::new(),
+ [one] => one.clone(),
+ [rest @ .., last] => format!("{} or {last}", rest.join(", ")),
+ }
+}
+
+fn lower_first(s: &str) -> String {
+ let mut c = s.chars();
+ match c.next() {
+ Some(f) => format!("{}{}", f.to_lowercase(), c.as_str()),
+ None => String::new(),
+ }
+}
+
/// The Settings page with Settings, Storage (the Cua Volume's store,
/// Finder volume and cache, [`crate::drive_settings::storage_section`])
/// after General, while the Cua Volume experiment is on. Off, Storage is
@@ -1048,6 +1125,66 @@ mod tests {
assert_eq!(ids, ["Automatic", "Built-in", "System"]);
}
+ #[test]
+ fn runtimes_say_whether_microvms_run_here_and_why_not() {
+ use crate::model::SpaceOs;
+ let page_for = |m: MicrovmInput| {
+ let p = page(&SettingsInput {
+ microvm: Some(m),
+ ..Default::default()
+ });
+ let s = p.sections.into_iter().find(|s| s.id == "runtimes").unwrap();
+ s.rows
+ .into_iter()
+ .map(|r| (r.id, r.value.or(Some(r.label)).unwrap_or_default()))
+ .collect::<Vec<_>>()
+ };
+ let mac = |ready: &[&str]| MicrovmInput {
+ os: Some(SpaceOs::Macos),
+ local_backends: Some(ready.iter().map(|b| b.to_string()).collect()),
+ local_details: None,
+ host_arch: Some("arm64".into()),
+ };
+ assert_eq!(
+ page_for(mac(&["docker", "vz", "containerization"])),
+ [
+ ("microvm-runtime".to_string(), "Ready".to_string()),
+ (
+ "microvm-runtime-note".to_string(),
+ "MicroVM Spaces run on Virtualization.framework or Apple Containerization."
+ .to_string()
+ ),
+ ]
+ );
+ assert_eq!(
+ page_for(mac(&["docker"])),
+ [
+ ("microvm-runtime".to_string(), "Not available".to_string()),
+ (
+ "microvm-runtime-note".to_string(),
+ "MicroVM needs macOS 26.".to_string()
+ ),
+ ]
+ );
+ assert_eq!(
+ page_for(MicrovmInput {
+ local_backends: None,
+ ..mac(&[])
+ }),
+ [(
+ "microvm-runtime".to_string(),
+ "Checking\u{2026}".to_string()
+ )]
+ );
+ // Without the doctor's answer, no MicroVM row (and no section).
+ assert!(
+ page(&SettingsInput::default())
+ .sections
+ .iter()
+ .all(|s| s.id != "runtimes")
+ );
+ }
+
#[test]
fn the_runtimes_section_shows_the_linux_choice() {
let page = page(&SettingsInput {
diff --git a/libs/cua/crates/cua-spaces-app-core/src/wizard.rs b/libs/cua/crates/cua-spaces-app-core/src/wizard.rs
index a53bd7d67c..6d86a49069 100644
--- a/libs/cua/crates/cua-spaces-app-core/src/wizard.rs
+++ b/libs/cua/crates/cua-spaces-app-core/src/wizard.rs
@@ -1155,7 +1155,11 @@ pub fn microvm_capable(image: &SandboxImage) -> bool {
/// ready rows), in the order `auto` picks them: on a Mac cua's own monitor
/// before Apple's Containerization. `None` while not checked.
pub fn local_microvm_runtimes(env: &WizardEnv) -> Option<Vec<Runtime>> {
- let ready = env.local_backends.as_ref()?;
+ microvm_runtimes_of(env.local_backends.as_deref())
+}
+
+fn microvm_runtimes_of(ready: Option<&[String]>) -> Option<Vec<Runtime>> {
+ let ready = ready?;
Some(
[Runtime::Vz, Runtime::Containerization, Runtime::Firecracker]
.into_iter()
@@ -1213,18 +1217,39 @@ impl MicrovmBlock {
/// monitor), Linux needs KVM and passt (Firecracker installs on first
/// use), Windows has no microVMs.
fn local_microvm_block(env: &WizardEnv, os: SpaceOs) -> MicrovmBlock {
- if env.local_backends.is_none() {
+ let probe = LocalProbe {
+ backends: env.local_backends.as_deref(),
+ details: env.local_details.as_ref(),
+ host_arch: env.host_arch.as_deref(),
+ };
+ microvm_block_of(&probe, os)
+}
+
+/// What this machine's runtime doctor said: its ready backends, why the
+/// others are not, and its architecture.
+#[derive(Debug, Clone, Copy, Default)]
+pub struct LocalProbe<'a> {
+ /// Ready backends (none: not read yet).
+ pub backends: Option<&'a [String]>,
+ /// Why each other backend is not ready.
+ pub details: Option<&'a std::collections::HashMap<String, String>>,
+ /// `arm64`, `amd64`.
+ pub host_arch: Option<&'a str>,
+}
+
+fn microvm_block_of(probe: &LocalProbe<'_>, os: SpaceOs) -> MicrovmBlock {
+ if probe.backends.is_none() {
return MicrovmBlock::Checking;
}
let detail = |b: &str| {
- env.local_details
- .as_ref()
+ probe
+ .details
.and_then(|d| d.get(b))
.cloned()
.unwrap_or_default()
};
MicrovmBlock::Why(match os {
- SpaceOs::Macos if arch_word(env.host_arch.as_deref()) == Some("amd64") => {
+ SpaceOs::Macos if arch_word(probe.host_arch) == Some("amd64") => {
"needs a Mac with Apple silicon".into()
}
SpaceOs::Macos if detail("containerization").contains("another install") => {
@@ -1320,14 +1345,39 @@ fn microvm_on(state: &WizardState, env: &WizardEnv, os: SpaceOs) -> bool {
&& microvm_support(state, env, os).is_ok()
}
-/// The kind's one plain line under Kind.
-fn kind_help(kind: SpaceKind, microvm_runtime: Option<&Runtime>) -> String {
- match kind {
- SpaceKind::Container => "A sandboxed Linux container. Starts fastest.".into(),
- SpaceKind::Vm => "A full computer with its own kernel and disk.".into(),
- SpaceKind::Microvm => match microvm_runtime {
- Some(r) => format!("The container image with its own kernel, on {}.", r.label()),
- None => "The container image with its own kernel.".into(),
+/// Whether this machine runs microVMs, for Settings, Advanced, Runtimes:
+/// New Space only greys MicroVM out, and the reason (or the runtime it
+/// uses) is told here, where the runtimes are.
+#[derive(Debug, Clone, PartialEq, Eq)]
+pub enum MicrovmStatus {
+ /// This machine's runtimes are not read yet.
+ Checking,
+ /// Ready, on these runtimes (in the order `auto` picks them).
+ Ready(Vec<Runtime>),
+ /// Why not, as a sentence ("Needs macOS 26.").
+ Blocked(String),
+}
+
+/// [`MicrovmStatus`] of this machine (`os` is its system), from its
+/// runtime doctor.
+pub fn local_microvm_status(env: &WizardEnv, os: SpaceOs) -> MicrovmStatus {
+ microvm_status_of(
+ &LocalProbe {
+ backends: env.local_backends.as_deref(),
+ details: env.local_details.as_ref(),
+ host_arch: env.host_arch.as_deref(),
+ },
+ os,
+ )
+}
+
+/// [`local_microvm_status`] from the doctor's own answer.
+pub fn microvm_status_of(probe: &LocalProbe<'_>, os: SpaceOs) -> MicrovmStatus {
+ match microvm_runtimes_of(probe.backends) {
+ Some(r) if !r.is_empty() => MicrovmStatus::Ready(r),
+ _ => match microvm_block_of(probe, os) {
+ MicrovmBlock::Checking => MicrovmStatus::Checking,
+ b => MicrovmStatus::Blocked(b.detail()),
},
}
}
@@ -2831,10 +2881,6 @@ pub struct WizardView {
pub advanced: bool,
/// Kind tiles: Container, Virtual machine, MicroVM.
pub kind_tiles: Vec<Tile>,
- /// One plain line under Kind: what the chosen kind is (and why MicroVM
- /// is greyed out, when it is).
- #[serde(default, skip_serializing_if = "Option::is_none")]
- pub kind_help: Option<String>,
/// Runtime menu.
pub runtimes: Vec<MenuOption>,
/// Effective runtime.
@@ -3752,15 +3798,12 @@ pub fn view_on(state: &WizardState, env: &WizardEnv, os: SpaceOs) -> WizardView
}
})
.collect();
- // MicroVM where the machine can boot one, else greyed out with why.
+ // MicroVM where the machine can boot one, else greyed out. Why not is
+ // Settings' (Advanced, Runtimes: `local_microvm_status`), not New Space's.
kind_tiles.push(Tile {
id: SpaceKind::Microvm.as_str().into(),
title: SpaceKind::Microvm.label().into(),
- detail: micro
- .as_ref()
- .err()
- .map(MicrovmBlock::detail)
- .unwrap_or_default(),
+ detail: String::new(),
pressed: microvm,
enabled: micro.is_ok(),
});
@@ -3773,16 +3816,6 @@ pub fn view_on(state: &WizardState, env: &WizardEnv, os: SpaceOs) -> WizardView
Location::Host => host.and_then(host_microvm_runtime),
_ => None,
};
- let kind_help = {
- let line = kind_help(kind, microvm_runtime.as_ref());
- // Why MicroVM is greyed out, when the image could be one.
- match &micro {
- Err(MicrovmBlock::Why(why)) if microvm_capable(&container_of(state)) => {
- Some(format!("{line} MicroVM {why}."))
- }
- _ => Some(line),
- }
- };
let engine_text = match placement {
Location::Local => match &image.local {
_ if microvm => {
@@ -4034,7 +4067,6 @@ pub fn view_on(state: &WizardState, env: &WizardEnv, os: SpaceOs) -> WizardView
runtime_switch,
advanced: state.advanced,
kind_tiles,
- kind_help,
runtimes: engines
.iter()
.map(|r| MenuOption {
@@ -6040,10 +6072,6 @@ mod tests {
(t.title.as_str(), t.enabled, t.pressed),
("MicroVM", true, false)
);
- assert_eq!(
- v.kind_help.as_deref(),
- Some("A sandboxed Linux container. Starts fastest.")
- );
let s = reduce(
&s,
@@ -6060,10 +6088,6 @@ mod tests {
SpaceKind::Container,
"it boots the container image"
);
- assert_eq!(
- v.kind_help.as_deref(),
- Some("The container image with its own kernel, on Apple Containerization.")
- );
let args = create_args(&v.plan);
assert_eq!(args.kind, SpaceKind::Microvm);
assert_eq!(args.runtime, Runtime::Auto);
@@ -6127,9 +6151,10 @@ mod tests {
.collect::<Vec<_>>(),
["auto", "vz", "containerization"]
);
+ // Settings, Advanced, Runtimes says which runtimes run them.
assert_eq!(
- v.kind_help.as_deref(),
- Some("The container image with its own kernel, on Virtualization.framework.")
+ local_microvm_status(&e, SpaceOs::Macos),
+ MicrovmStatus::Ready(vec![Runtime::Vz, Runtime::Containerization])
);
let s = reduce(
&s,
@@ -6154,16 +6179,17 @@ mod tests {
);
let v = view_on(&s, &linux, SpaceOs::Linux);
assert_eq!(
- v.kind_help.as_deref(),
- Some("The container image with its own kernel, on Firecracker.")
+ local_microvm_status(&linux, SpaceOs::Linux),
+ MicrovmStatus::Ready(vec![Runtime::Firecracker])
);
assert_eq!(create_args(&v.plan).kind, SpaceKind::Microvm);
}
- /// Where no microVM runtime is ready, MicroVM is greyed out with why in
- /// one line, and choosing it does nothing.
+ /// Where no microVM runtime is ready, MicroVM is greyed out with no
+ /// words in New Space (Settings, Advanced, Runtimes says why), and
+ /// choosing it does nothing.
#[test]
- fn microvm_is_greyed_out_with_why() {
+ fn microvm_is_greyed_out_and_settings_says_why() {
let cases: [(WizardEnv, SpaceOs, &str); 7] = [
// A Mac before macOS 26 without cua's monitor.
(
@@ -6238,7 +6264,16 @@ mod tests {
let v = view_on(&s, &e, os);
let t = microvm_tile(&v);
assert!(!t.enabled, "{why}");
- assert_eq!(t.detail, why);
+ // New Space only greys it out; Settings, Advanced, Runtimes says why.
+ assert_eq!(t.detail, "", "{why}");
+ assert_eq!(
+ local_microvm_status(&e, os),
+ if why == OFFER_NOT_CHECKED {
+ MicrovmStatus::Checking
+ } else {
+ MicrovmStatus::Blocked(why.to_string())
+ },
+ );
let chosen = reduce(
&s,
&WizardAction::ChooseKind {
@@ -6252,12 +6287,6 @@ mod tests {
SpaceKind::Container
);
}
- // The line under Kind says why, once.
- let e = mac_env(&["docker", "lume"], &[]);
- assert_eq!(
- view(&initial(&e), &e).kind_help.as_deref(),
- Some("A sandboxed Linux container. Starts fastest. MicroVM needs macOS 26.")
- );
// A macOS image is never a microVM.
let e = mac_env(&["docker", "lume", "vz"], &[]);
let s = reduce(
@@ -6266,11 +6295,8 @@ mod tests {
&e,
);
let v = view(&s, &e);
- assert_eq!(microvm_tile(&v).detail, "Runs Linux images only.");
- assert_eq!(
- v.kind_help.as_deref(),
- Some("A full computer with its own kernel and disk.")
- );
+ assert!(!microvm_tile(&v).enabled);
+ assert_eq!(microvm_tile(&v).detail, "");
}
/// On one of your machines, MicroVM follows the kinds it reports.
@@ -6316,12 +6342,9 @@ mod tests {
(args.on.as_str(), args.kind),
("host:box", SpaceKind::Microvm)
);
- assert_eq!(
- v.kind_help.as_deref(),
- Some("The container image with its own kernel, on Firecracker.")
- );
let v = view(&on("mini"), &e);
- assert_eq!(microvm_tile(&v).detail, "Needs macOS 26 on Mac mini.");
+ assert!(!microvm_tile(&v).enabled);
+ assert_eq!(microvm_tile(&v).detail, "");
// Moving to a machine without microVMs makes it a container.
let moved = reduce(
&s,
diff --git a/libs/cua/crates/cua-spaces-ffi/src/app_core_types.rs b/libs/cua/crates/cua-spaces-ffi/src/app_core_types.rs
index 9d9cd0eca5..916badf334 100644
--- a/libs/cua/crates/cua-spaces-ffi/src/app_core_types.rs
+++ b/libs/cua/crates/cua-spaces-ffi/src/app_core_types.rs
@@ -4139,9 +4139,6 @@ pub struct AppWizardView {
pub advanced: bool,
/// Kind tiles: Container, Virtual machine, MicroVM.
pub kind_tiles: Vec<AppTile>,
- /// One plain line under Kind: what the chosen kind is (and why MicroVM
- /// is greyed out, when it is).
- pub kind_help: Option<String>,
/// Runtime menu.
pub runtimes: Vec<AppMenuOption>,
/// Effective runtime.
@@ -7020,6 +7017,21 @@ pub struct AppTelemetryInput {
pub notice_shown: bool,
}
+/// This machine's runtime doctor, for Settings, Advanced, Runtimes'
+/// MicroVM row (the same facts New Space's MicroVM tile follows).
+pub type AppMicrovmInput = core::settings::MicrovmInput;
+#[uniffi::remote(Record)]
+pub struct AppMicrovmInput {
+ /// This machine's system (`macos`, `linux`, `windows`).
+ pub os: Option<AppSpaceOs>,
+ /// Ready backends (none: not read yet).
+ pub local_backends: Option<Vec<String>>,
+ /// Why each other backend is not ready, by backend name.
+ pub local_details: Option<std::collections::HashMap<String, String>>,
+ /// This machine's architecture (`arm64`, `amd64`).
+ pub host_arch: Option<String>,
+}
+
/// What the Settings page shows.
pub type AppSettingsInput = core::settings::SettingsInput;
#[uniffi::remote(Record)]
@@ -7075,6 +7087,9 @@ pub struct AppSettingsInput {
/// Overflow into your clouds when this machine is full
/// (`placement.overflow`); none: no row.
pub overflow: Option<bool>,
+ /// What this machine's runtime doctor said, for Runtimes' MicroVM row
+ /// (whether microVMs run here, and why not); none: no MicroVM row.
+ pub microvm: Option<AppMicrovmInput>,
/// Settings, General's Show tips switch: tips are on
/// (`!AppSettings.tips.off`). A shell that does not say reads as on.
pub show_tips: bool,
diff --git a/libs/cua/scripts/generate-app-core-ffi.py b/libs/cua/scripts/generate-app-core-ffi.py
index 9d4a523f38..3bbfea3b83 100644
--- a/libs/cua/scripts/generate-app-core-ffi.py
+++ b/libs/cua/scripts/generate-app-core-ffi.py
@@ -54,7 +54,7 @@ TYPES = [
("login_item.rs", "login_item", ["LoginItemStatus", "LoginItemInput", "LoginItemPlan"]),
("local_network.rs", "local_network", ["LocalNetworkAccess", "LocalNetworkInput", "LocalNetworkStepKind", "LocalNetworkStep"]),
("experiments.rs", "experiments", ["Experiments"]),
- ("settings.rs", "settings", ["SwitcherTheme", "AppSettings", "KeyCombo", "SignInPhase", "TelemetryInput", "SettingsInput", "SettingsRowKind", "SettingsOption", "SettingsRow", "SettingsSection", "SettingsPage"]),
+ ("settings.rs", "settings", ["SwitcherTheme", "AppSettings", "KeyCombo", "SignInPhase", "TelemetryInput", "MicrovmInput", "SettingsInput", "SettingsRowKind", "SettingsOption", "SettingsRow", "SettingsSection", "SettingsPage"]),
("sign_in.rs", "sign_in", ["SignInFailure", "SignInFooterState", "SignInFooterInput", "SignInToast", "SignInFooter"]),
("window.rs", "window", ["ChromeInput", "MainChrome", "MenuItemId", "MenuItem", "MenuInput"]),
("host.rs", "host", ["HostSummaryInput", "HostSetupRequest", "HostClient", "HostAccess", "HostPermissionInput", "HostProvidedSpace", "HostSpacesAudit", "HostState", "HostAccount", "HostAccountStep", "HostActionId", "HostSettingChange", "HostToggle", "HostConfirm", "HostAction", "HostAccessRow", "PermissionRow", "HostSetupChoice", "HostPanelView", "HostFormState", "HostFormAction", "HostFormChoice", "HostFormField", "HostFormView"]),
diff --git a/libs/spaces-app-swift/Sources/CuaSpacesFFI/CuaSpacesFFI.swift b/libs/spaces-app-swift/Sources/CuaSpacesFFI/CuaSpacesFFI.swift
index 79a3456965..a55c9ad912 100644
--- a/libs/spaces-app-swift/Sources/CuaSpacesFFI/CuaSpacesFFI.swift
+++ b/libs/spaces-app-swift/Sources/CuaSpacesFFI/CuaSpacesFFI.swift
@@ -25488,6 +25488,92 @@ public func FfiConverterTypeAppMenuPreviewRow_lower(_ value: AppMenuPreviewRow)
}
+public struct AppMicrovmInput: Equatable, Hashable {
+ /**
+ * This machine's system (`macos`, `linux`, `windows`).
+ */
+ public var os: AppSpaceOs?
+ /**
+ * Ready backends (none: not read yet).
+ */
+ public var localBackends: [String]?
+ /**
+ * Why each other backend is not ready, by backend name.
+ */
+ public var localDetails: [String: String]?
+ /**
+ * This machine's architecture (`arm64`, `amd64`).
+ */
+ public var hostArch: String?
+
+ // Default memberwise initializers are never public by default, so we
+ // declare one manually.
+ public init(
+ /**
+ * This machine's system (`macos`, `linux`, `windows`).
+ */os: AppSpaceOs?,
+ /**
+ * Ready backends (none: not read yet).
+ */localBackends: [String]?,
+ /**
+ * Why each other backend is not ready, by backend name.
+ */localDetails: [String: String]?,
+ /**
+ * This machine's architecture (`arm64`, `amd64`).
+ */hostArch: String?) {
+ self.os = os
+ self.localBackends = localBackends
+ self.localDetails = localDetails
+ self.hostArch = hostArch
+ }
+
+
+
+
+}
+
+#if compiler(>=6)
+extension AppMicrovmInput: Sendable {}
+#endif
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public struct FfiConverterTypeAppMicrovmInput: FfiConverterRustBuffer {
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AppMicrovmInput {
+ return
+ try AppMicrovmInput(
+ os: FfiConverterOptionTypeAppSpaceOs.read(from: &buf),
+ localBackends: FfiConverterOptionSequenceString.read(from: &buf),
+ localDetails: FfiConverterOptionDictionaryStringString.read(from: &buf),
+ hostArch: FfiConverterOptionString.read(from: &buf)
+ )
+ }
+
+ public static func write(_ value: AppMicrovmInput, into buf: inout [UInt8]) {
+ FfiConverterOptionTypeAppSpaceOs.write(value.os, into: &buf)
+ FfiConverterOptionSequenceString.write(value.localBackends, into: &buf)
+ FfiConverterOptionDictionaryStringString.write(value.localDetails, into: &buf)
+ FfiConverterOptionString.write(value.hostArch, into: &buf)
+ }
+}
+
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeAppMicrovmInput_lift(_ buf: RustBuffer) throws -> AppMicrovmInput {
+ return try FfiConverterTypeAppMicrovmInput.lift(buf)
+}
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeAppMicrovmInput_lower(_ value: AppMicrovmInput) -> RustBuffer {
+ return FfiConverterTypeAppMicrovmInput.lower(value)
+}
+
+
public struct AppModeChoice: Equatable, Hashable {
/**
* What it means.
@@ -35174,6 +35260,11 @@ public struct AppSettingsInput: Equatable, Hashable {
* (`placement.overflow`); none: no row.
*/
public var overflow: Bool?
+ /**
+ * What this machine's runtime doctor said, for Runtimes' MicroVM row
+ * (whether microVMs run here, and why not); none: no MicroVM row.
+ */
+ public var microvm: AppMicrovmInput?
/**
* Settings, General's Show tips switch: tips are on
* (`!AppSettings.tips.off`). A shell that does not say reads as on.
@@ -35254,6 +35345,10 @@ public struct AppSettingsInput: Equatable, Hashable {
* Overflow into your clouds when this machine is full
* (`placement.overflow`); none: no row.
*/overflow: Bool?,
+ /**
+ * What this machine's runtime doctor said, for Runtimes' MicroVM row
+ * (whether microVMs run here, and why not); none: no MicroVM row.
+ */microvm: AppMicrovmInput?,
/**
* Settings, General's Show tips switch: tips are on
* (`!AppSettings.tips.off`). A shell that does not say reads as on.
@@ -35278,6 +35373,7 @@ public struct AppSettingsInput: Equatable, Hashable {
self.lumeSource = lumeSource
self.linuxSource = linuxSource
self.overflow = overflow
+ self.microvm = microvm
self.showTips = showTips
}
@@ -35317,6 +35413,7 @@ public struct FfiConverterTypeAppSettingsInput: FfiConverterRustBuffer {
lumeSource: FfiConverterOptionString.read(from: &buf),
linuxSource: FfiConverterOptionString.read(from: &buf),
overflow: FfiConverterOptionBool.read(from: &buf),
+ microvm: FfiConverterOptionTypeAppMicrovmInput.read(from: &buf),
showTips: FfiConverterBool.read(from: &buf)
)
}
@@ -35342,6 +35439,7 @@ public struct FfiConverterTypeAppSettingsInput: FfiConverterRustBuffer {
FfiConverterOptionString.write(value.lumeSource, into: &buf)
FfiConverterOptionString.write(value.linuxSource, into: &buf)
FfiConverterOptionBool.write(value.overflow, into: &buf)
+ FfiConverterOptionTypeAppMicrovmInput.write(value.microvm, into: &buf)
FfiConverterBool.write(value.showTips, into: &buf)
}
}
@@ -44227,11 +44325,6 @@ public struct AppWizardView: Equatable, Hashable {
* Kind tiles: Container, Virtual machine, MicroVM.
*/
public var kindTiles: [AppTile]
- /**
- * One plain line under Kind: what the chosen kind is (and why MicroVM
- * is greyed out, when it is).
- */
- public var kindHelp: String?
/**
* Runtime menu.
*/
@@ -44451,10 +44544,6 @@ public struct AppWizardView: Equatable, Hashable {
/**
* Kind tiles: Container, Virtual machine, MicroVM.
*/kindTiles: [AppTile],
- /**
- * One plain line under Kind: what the chosen kind is (and why MicroVM
- * is greyed out, when it is).
- */kindHelp: String?,
/**
* Runtime menu.
*/runtimes: [AppMenuOption],
@@ -44594,7 +44683,6 @@ public struct AppWizardView: Equatable, Hashable {
self.runtimeSwitch = runtimeSwitch
self.advanced = advanced
self.kindTiles = kindTiles
- self.kindHelp = kindHelp
self.runtimes = runtimes
self.runtime = runtime
self.runtimeEnabled = runtimeEnabled
@@ -44668,7 +44756,6 @@ public struct FfiConverterTypeAppWizardView: FfiConverterRustBuffer {
runtimeSwitch: FfiConverterOptionTypeAppRuntimeSwitch.read(from: &buf),
advanced: FfiConverterBool.read(from: &buf),
kindTiles: FfiConverterSequenceTypeAppTile.read(from: &buf),
- kindHelp: FfiConverterOptionString.read(from: &buf),
runtimes: FfiConverterSequenceTypeAppMenuOption.read(from: &buf),
runtime: FfiConverterTypeAppRuntime.read(from: &buf),
runtimeEnabled: FfiConverterBool.read(from: &buf),
@@ -44728,7 +44815,6 @@ public struct FfiConverterTypeAppWizardView: FfiConverterRustBuffer {
FfiConverterOptionTypeAppRuntimeSwitch.write(value.runtimeSwitch, into: &buf)
FfiConverterBool.write(value.advanced, into: &buf)
FfiConverterSequenceTypeAppTile.write(value.kindTiles, into: &buf)
- FfiConverterOptionString.write(value.kindHelp, into: &buf)
FfiConverterSequenceTypeAppMenuOption.write(value.runtimes, into: &buf)
FfiConverterTypeAppRuntime.write(value.runtime, into: &buf)
FfiConverterBool.write(value.runtimeEnabled, into: &buf)
@@ -69850,6 +69936,30 @@ fileprivate struct FfiConverterOptionTypeAppMenuPreview: FfiConverterRustBuffer
}
}
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+fileprivate struct FfiConverterOptionTypeAppMicrovmInput: FfiConverterRustBuffer {
+ typealias SwiftType = AppMicrovmInput?
+
+ public static func write(_ value: SwiftType, into buf: inout [UInt8]) {
+ guard let value = value else {
+ writeInt(&buf, Int8(0))
+ return
+ }
+ writeInt(&buf, Int8(1))
+ FfiConverterTypeAppMicrovmInput.write(value, into: &buf)
+ }
+
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType {
+ switch try readInt(&buf) as Int8 {
+ case 0: return nil
+ case 1: return try FfiConverterTypeAppMicrovmInput.read(from: &buf)
+ default: throw UniffiInternalError.unexpectedOptionalTag
+ }
+ }
+}
+
#if swift(>=5.8)
@_documentation(visibility: private)
#endif