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
feat(spaces): one first run everywhere: connect your agent, then This Mac is your first Space (0.10.0) (#5462)
Francesco Bonaccic4b4b0922f7f
diff --git a/.github/scripts/tests/release_please_spaces_preview.cjs b/.github/scripts/tests/release_please_spaces_preview.cjsindex 127ce0a9e2..f5f2343078 100644--- a/.github/scripts/tests/release_please_spaces_preview.cjs+++ b/.github/scripts/tests/release_please_spaces_preview.cjs@@ -93,7 +93,7 @@ async function preview(message, files, expectedVersion) {async function main() {const [major, minor, patch] = manifest[packagePath].split('.').map(Number);- const swift = [`${packagePath}/Sources/CuaSpacesMacKit/Views/OnboardingView.swift`];+ const swift = [`${packagePath}/Sources/CuaSpacesMacKit/Views/MainWindow.swift`];await preview('fix(spaces-macos): keep the onboarding window in front', swift,`${major}.${minor}.${patch + 1}`);await preview('feat(spaces-macos): add a menu bar Space switcher', swift,diff --git a/apps/cua-spaces-desktop/README.md b/apps/cua-spaces-desktop/README.mdindex 96cb94e187..0db8557606 100644--- a/apps/cua-spaces-desktop/README.md+++ b/apps/cua-spaces-desktop/README.md@@ -379,8 +379,11 @@ chose, whether the keychain prompt is still on screen). Per system:Sparkle's relaunch prompt for a copy replaced on disk has no Electroncounterpart (electron-updater installs on quit or relaunch).- **The first run** is the page's (`routes/onboarding`, the app core's- flow); `onboarding.json` is the Swift app's file, and Settings' Welcome- "Show again" makes it due again.+ flow), the same page the SwiftUI app now opens for its own; `onboarding.json`+ is the Swift app's file, and Settings' Welcome "Show again" makes it due+ again. A Space it creates (`spaces.create` with `notifyWhenReady`) posts a+ "<Space> is ready" notification with the Cua key (`cua-key-128.png` from the+ web build); clicking it opens the Space's page.## Live videodiff --git a/apps/cua-spaces-desktop/src/bridge/methods.ts b/apps/cua-spaces-desktop/src/bridge/methods.tsindex d5d13ab954..5c01aa16a6 100644--- a/apps/cua-spaces-desktop/src/bridge/methods.ts+++ b/apps/cua-spaces-desktop/src/bridge/methods.ts@@ -10,6 +10,7 @@export const METHODS = ["app.info","session.get", "session.signIn", "session.signOut",+ "onboarding.get", "onboarding.complete","spaces.list", "spaces.open","spaces.createOptions", "spaces.create","spaces.setPower", "spaces.delete", "spaces.cancelCreate",@@ -46,10 +47,9 @@ export const METHODS = ["checklist.get", "checklist.send",] as const;-/** A live desktop's media ticket for the page's WebCodecs player, the- * first run's state (the SwiftUI app draws its first run natively),+/** A live desktop's media ticket for the page's WebCodecs player,* presence over the page's video (the SwiftUI app draws it natively), and* New Space's runtime fix on Windows ("Install Docker Desktop"). */-export const ELECTRON_METHODS = ["onboarding.get", "onboarding.complete", "spaces.openStream", "presence.join", "presence.publish", "presence.leave", "spaces.fixRuntime"] as const;+export const ELECTRON_METHODS = ["spaces.openStream", "presence.join", "presence.publish", "presence.leave", "spaces.fixRuntime"] as const;export type Method = (typeof METHODS)[number] | (typeof ELECTRON_METHODS)[number];diff --git a/apps/cua-spaces-desktop/src/bridge/onboarding.ts b/apps/cua-spaces-desktop/src/bridge/onboarding.tsindex 3237179f89..7383d8f5c4 100644--- a/apps/cua-spaces-desktop/src/bridge/onboarding.ts+++ b/apps/cua-spaces-desktop/src/bridge/onboarding.ts@@ -1,8 +1,8 @@// SPDX-License-Identifier: FSL-1.1-MIT// Copyright (c) 2026 Cua AI, Inc.-// The first run on this host (`onboarding.get`, `onboarding.complete`, only-// the Electron shell's: the SwiftUI app draws its own first run natively).+// The first run on this host (`onboarding.get`, `onboarding.complete`, as+// the SwiftUI host answers them: both shells show the web UI's onboarding).// The page runs the app core's flow (`routes/onboarding`) and asks here// whether it is due; finishing saves `onboarding.json` as the Swift app's// OnboardingModel.finish does, asks for Local Network access while someonediff --git a/apps/cua-spaces-desktop/src/bridge/space-ready.ts b/apps/cua-spaces-desktop/src/bridge/space-ready.tsnew file mode 100644index 0000000000..e5acd1f063--- /dev/null+++ b/apps/cua-spaces-desktop/src/bridge/space-ready.ts@@ -0,0 +1,25 @@+// SPDX-License-Identifier: FSL-1.1-MIT+// Copyright (c) 2026 Cua AI, Inc.++// The system notification for a Space the first run created+// ("<Space> is ready", `spaces.create` with `notifyWhenReady`): the SwiftUI+// host's `SpaceReadyNote`. It carries the Cua key and a click opens the+// Space's page.+import type { SystemNote } from "./system";++/** The Cua key in the web build's directory (`public/cua-key-128.png`). */+export const SPACE_READY_ICON = "cua-key-128.png";++const OS_WORDS: Record<string, string> = { macos: "macOS ", linux: "Linux ", windows: "Windows " };++/** What the notification says: no OS word for a Space whose OS is not known, "this Mac" only on a Mac. */+export function spaceReadyNote(space: { id: string; name: string; os: string }, platform: NodeJS.Platform): SystemNote {+ const where = platform === "darwin" ? "this Mac" : "this computer";+ return {+ id: `space-ready-${space.id}`,+ title: `${space.name} is ready`,+ body: `A fresh ${OS_WORDS[space.os] ?? ""}computer inside ${where}. Your agent can use it now.`,+ route: `/spaces/${encodeURIComponent(space.id)}`,+ icon: SPACE_READY_ICON,+ };+}diff --git a/apps/cua-spaces-desktop/src/bridge/spaces.ts b/apps/cua-spaces-desktop/src/bridge/spaces.tsindex 86056b2755..2d649bd472 100644--- a/apps/cua-spaces-desktop/src/bridge/spaces.ts+++ b/apps/cua-spaces-desktop/src/bridge/spaces.ts@@ -14,6 +14,7 @@ import { isCancelled } from "../model/errors";import { bool, string } from "./args";import type { BridgeContext } from "./context";import { Failure, type BridgeArgs, type Handlers } from "./host";+import { spaceReadyNote } from "./space-ready";import { encode } from "./value";export function spacesState(model: AppModel) {@@ -97,7 +98,7 @@ export function progress(p: SpaceCreateProgress, pendingId: string) {}export function spacesMethods(ctx: BridgeContext): Handlers {- const { model, events, ui } = ctx;+ const { model, events, ui, system, platform } = ctx;const native = model.native;const space = (args: BridgeArgs): AppSpace => {@@ -126,6 +127,8 @@ export function spacesMethods(ctx: BridgeContext): Handlers {model.fixRuntime(action);return null;},+ // `{config, pendingId, os?, notifyWhenReady?}`. The create belongs to the app, not to the window:+ // it runs on when the window is closed, and `notifyWhenReady` posts "<Space> is ready" when it succeeds."spaces.create": async (args) => {const pendingId = string(args, "pendingId");if (!native.appCreatesIsPending(pendingId)) throw Failure.badArgs("pendingId: pending:<id>");@@ -143,6 +146,11 @@ export function spacesMethods(ctx: BridgeContext): Handlers {throw error;}const made = model.spaces.find((s) => s.id === id);+ // A create the first run started: "<Space> is ready", window or not.+ if (args.notifyWhenReady === true) {+ const known = made && made.os !== native.AppSpaceOs.Unknown ? made.os : os;+ system?.notify(spaceReadyNote({ id, name: made?.name ?? a.name ?? id, os: String(known) }, platform));+ }if (made) return encode(made);return { id, name: a.name ?? id, os, status: "running", detail: "", lastUsedAt: Number(AppModel.nowMs()) };},diff --git a/apps/cua-spaces-desktop/src/bridge/system.ts b/apps/cua-spaces-desktop/src/bridge/system.tsindex 1e620d9f90..eab1882a78 100644--- a/apps/cua-spaces-desktop/src/bridge/system.ts+++ b/apps/cua-spaces-desktop/src/bridge/system.ts@@ -18,6 +18,8 @@ export interface SystemNote {title: string;body: string;route?: string;+ /** An image shown with it: a file name in the web build's directory (`cua-key-128.png`). */+ icon?: string;}export interface SystemServices {diff --git a/apps/cua-spaces-desktop/src/main.ts b/apps/cua-spaces-desktop/src/main.tsindex a96c852394..a6db2886e7 100644--- a/apps/cua-spaces-desktop/src/main.ts+++ b/apps/cua-spaces-desktop/src/main.ts@@ -26,7 +26,7 @@ import { connectNotch, type NotchCore } from "./notch";import { dropOnSpace, feedNotch, followDragReadiness, notchTeleport, notchThumbnail, openSpaceFromNotch, teleportFromNotch, type NotchFeedUi } from "./notch-feed";import { createPipWindows } from "./pip";import { electronKeyvaultPrompts } from "./prompts";-import { APP_ORIGIN, handleAppProtocol, registerSchemePrivileges } from "./protocol";+import { APP_ORIGIN, handleAppProtocol, registerSchemePrivileges, resolveWebRoot } from "./protocol";import { readSettings, writeSettings } from "./settings";import { DEEP_LINK_SCHEME, deepLinkInArgv, routeForDeepLink } from "./deep-link";import { makeSystem } from "./system";@@ -174,7 +174,7 @@ async function startNativeHost(showRoute: (route: string) => void, globalShortcubuild,platform: process.platform,env: process.env,- system: makeSystem({ native, showRoute, globalShortcut }),+ system: makeSystem({ native, showRoute, webRoot: resolveWebRoot(), globalShortcut }),ui: {openSpace: (spaceId, name, os) => void viewers.open(spaceId, name, os),setBackground: (win, color, appearance) => {diff --git a/apps/cua-spaces-desktop/src/note-icon.ts b/apps/cua-spaces-desktop/src/note-icon.tsnew file mode 100644index 0000000000..3e3f41d011--- /dev/null+++ b/apps/cua-spaces-desktop/src/note-icon.ts@@ -0,0 +1,15 @@+// SPDX-License-Identifier: FSL-1.1-MIT+// Copyright (c) 2026 Cua AI, Inc.++// A notification's image (`SystemNote.icon`): a plain file name inside the+// directory of the web build the app loads, such as the Cua key+// (`public/cua-key-128.png`). Anything that is not a plain name is refused,+// so a note can only name a file of the build.+import { existsSync } from "node:fs";+import * as path from "node:path";++export function noteIconPath(webRoot: string, name: string): string | null {+ if (name === "" || name !== path.basename(name) || name.startsWith(".")) return null;+ const file = path.join(webRoot, name);+ return existsSync(file) ? file : null;+}diff --git a/apps/cua-spaces-desktop/src/system.ts b/apps/cua-spaces-desktop/src/system.tsindex e155ded336..2b370cf5ad 100644--- a/apps/cua-spaces-desktop/src/system.ts+++ b/apps/cua-spaces-desktop/src/system.ts@@ -9,13 +9,14 @@// The owner check is the system's prompt through the app core// (`model/presence.ts`: Touch ID, Windows Hello, polkit), with a dialog of// the app's own that says so where Windows or Linux has none.-import { app, BrowserWindow, dialog, Notification, shell } from "electron";+import { app, BrowserWindow, dialog, nativeImage, Notification, shell } from "electron";import * as os from "node:os";import type { SystemNote, SystemServices } from "./bridge/system";import type { GlobalShortcut } from "./global-shortcut";import { confirmOwner } from "./model/presence";import { makeLoginItem } from "./login-item";import type { Native } from "./native/load";+import { noteIconPath } from "./note-icon";import { ElectronUpdater } from "./updater";const OPENABLE = /^(https?:|x-apple\.systempreferences:|ms-settings:)/;@@ -23,6 +24,8 @@ const OPENABLE = /^(https?:|x-apple\.systempreferences:|ms-settings:)/;export function makeSystem(o: {native: Native;showRoute: (route: string) => void;+ /** The web build's directory: where a note's `icon` is found. */+ webRoot?: string;globalShortcut?: GlobalShortcut | null;platform?: NodeJS.Platform;}): SystemServices {@@ -33,7 +36,9 @@ export function makeSystem(o: {const notify = (note: SystemNote) => {if (!Notification.isSupported()) return;shown.get(note.id)?.close();- const n = new Notification({ title: note.title, body: note.body });+ const file = note.icon && o.webRoot ? noteIconPath(o.webRoot, note.icon) : null;+ const icon = file ? nativeImage.createFromPath(file) : null;+ const n = new Notification({ title: note.title, body: note.body, ...(icon && !icon.isEmpty() ? { icon } : {}) });n.on("click", () => {app.focus({ steal: true });o.showRoute(note.route ?? "/spaces");diff --git a/apps/cua-spaces-desktop/test/host-bridge.test.ts b/apps/cua-spaces-desktop/test/host-bridge.test.tsindex 8f5f652329..b879ed1ff7 100644--- a/apps/cua-spaces-desktop/test/host-bridge.test.ts+++ b/apps/cua-spaces-desktop/test/host-bridge.test.ts@@ -210,10 +210,10 @@ describe.skipIf(!built)("This machine, Devices and Settings on the app core", ()const problems: string[] = [];for (const [method, args] of cases) problems.push(...shapeProblems(method, await call(method, args)));expect(problems).toEqual([]);- // Every method of this area has its case (the Electron-only ones are checked below).+ // Every method of this area has its case (the first run's are checked below).// (host.joinWithCode runs the bundled cua: join-with-code.test.ts.)- const electronOnly = new Set(["onboarding.get", "onboarding.complete", "host.joinWithCode"]);- expect(HOST_METHODS.filter((m) => !electronOnly.has(m) && !cases.some(([c]) => c === m))).toEqual([]);+ const checkedBelow = new Set(["onboarding.get", "onboarding.complete", "host.joinWithCode"]);+ expect(HOST_METHODS.filter((m) => !checkedBelow.has(m) && !cases.some(([c]) => c === m))).toEqual([]);expect(HOST_METHODS.filter((m) => NOT_YET.includes(m))).toEqual([]);});@@ -805,6 +805,27 @@ describe.skipIf(!built)("This machine, Devices and Settings on the app core", ()expect(await code("onboarding.complete", { mode: "server" })).toBe("bad_args");});+ it("posts \"<Space> is ready\" for a create the first run started, and for no other", async () => {+ const config = { image: "ghcr.io/trycua/linux:24.04", kind: "container", on: "local" };+ await call("spaces.create", { pendingId: "pending:n1", config: { ...config, name: "quiet" }, os: "linux" });+ await call("spaces.create", { pendingId: "pending:n2", config: { ...config, name: "no" }, os: "linux", notifyWhenReady: false });+ expect(system.notes).toEqual([]);+ await call("spaces.create", { pendingId: "pending:n3", config: { ...config, name: "dev" }, os: "linux", notifyWhenReady: true });+ expect(system.notes).toEqual([+ {+ id: "space-ready-local:dev",+ title: "dev is ready",+ body: "A fresh Linux computer inside this Mac. Your agent can use it now.",+ route: "/spaces/local%3Adev",+ icon: "cua-key-128.png",+ },+ ]);+ // Without a system side (a build that has none) the create still answers.+ await make({ system: null });+ const made = (await call("spaces.create", { pendingId: "pending:n4", config: { ...config, name: "bare" }, os: "linux", notifyWhenReady: true })) as { id: string };+ expect(made.id).toBe("local:bare");+ });+it("the page reads the first run from the session (Electron), and finishes it", async () => {const win = { cuaDesktop: { invoke: (_c: string, request: unknown) => bridge.registry.dispatch(request), platform: "darwin" }, open: () => null };const adapter = await pageAdapter(win);diff --git a/apps/cua-spaces-desktop/test/space-ready.test.ts b/apps/cua-spaces-desktop/test/space-ready.test.tsnew file mode 100644index 0000000000..f8a90abb2e--- /dev/null+++ b/apps/cua-spaces-desktop/test/space-ready.test.ts@@ -0,0 +1,58 @@+// SPDX-License-Identifier: FSL-1.1-MIT+// Copyright (c) 2026 Cua AI, Inc.++// "<Space> is ready": the note a create from the first run posts (the SwiftUI+// host's `SpaceReadyNote`) and the image it carries.+import { mkdtempSync, rmSync, writeFileSync } from "node:fs";+import { tmpdir } from "node:os";+import * as path from "node:path";+import { afterAll, describe, expect, it } from "vitest";+import { SPACE_READY_ICON, spaceReadyNote } from "../src/bridge/space-ready";+import { noteIconPath } from "../src/note-icon";++describe("the Space ready note", () => {+ it("says what is ready, names the OS, and opens the Space's page", () => {+ expect(spaceReadyNote({ id: "local:aurora", name: "aurora", os: "linux" }, "darwin")).toEqual({+ id: "space-ready-local:aurora",+ title: "aurora is ready",+ body: "A fresh Linux computer inside this Mac. Your agent can use it now.",+ route: "/spaces/local%3Aaurora",+ icon: "cua-key-128.png",+ });+ expect(spaceReadyNote({ id: "a", name: "a", os: "macos" }, "darwin").body).toMatch(/^A fresh macOS computer/);+ expect(spaceReadyNote({ id: "a", name: "a", os: "windows" }, "darwin").body).toMatch(/^A fresh Windows computer/);+ expect(spaceReadyNote({ id: "a", name: "a", os: "unknown" }, "darwin").body).toBe("A fresh computer inside this Mac. Your agent can use it now.");+ });++ it("says this computer where the app does not run on a Mac", () => {+ for (const platform of ["win32", "linux"] as const) {+ expect(spaceReadyNote({ id: "a", name: "a", os: "linux" }, platform).body).toBe("A fresh Linux computer inside this computer. Your agent can use it now.");+ }+ });++ it("carries the Cua key from the web build", () => {+ expect(SPACE_READY_ICON).toBe("cua-key-128.png");+ });+});++describe("a note's image", () => {+ const root = mkdtempSync(path.join(tmpdir(), "cua-note-icon-"));+ writeFileSync(path.join(root, "cua-key-128.png"), "png");+ writeFileSync(path.join(path.dirname(root), "outside.png"), "png");+ afterAll(() => {+ rmSync(root, { recursive: true, force: true });+ rmSync(path.join(path.dirname(root), "outside.png"), { force: true });+ });++ it("is a file of the web build, by its plain name", () => {+ expect(noteIconPath(root, "cua-key-128.png")).toBe(path.join(root, "cua-key-128.png"));+ });++ it("is none when the build lacks it or the name is a path", () => {+ expect(noteIconPath(root, "missing.png")).toBeNull();+ expect(noteIconPath(root, "../outside.png")).toBeNull();+ expect(noteIconPath(root, path.join(root, "cua-key-128.png"))).toBeNull();+ expect(noteIconPath(root, "")).toBeNull();+ expect(noteIconPath(root, ".hidden")).toBeNull();+ });+});diff --git a/apps/cua-spaces-macos/README.md b/apps/cua-spaces-macos/README.mdindex bfb07a5e3c..0ca20d853f 100644--- a/apps/cua-spaces-macos/README.md+++ b/apps/cua-spaces-macos/README.md@@ -11,10 +11,10 @@ render and do platform glue.| Main window | Sidebar with Spaces (one section per location; a dragged window drops on a row) and the Keyvault (All, Waiting, Access, Recent, one row per site) with the global Keyvault switch; Space detail with the live desktop, per-window streams, picture in picture, agent runs and the Teleport drop well || New Space | Step-by-step sheet: System, Resources, Options, Summary; Connect by address || Keyvault | Sidebar and list: categories, a site's accounts with their unattended switches, approval sheets |-| Onboarding | Paged setup with the stacked Cua mark and page dots; installs the bundled `cua` and sets up host access through the shared core |+| Onboarding | The shared web onboarding (`/onboarding` in `apps/cua-spaces-web`), in the New UI window, whether or not the New UI setting is on; the app draws none of its own. The page asks and finishes it through `onboarding.get` and `onboarding.complete` (the state is `onboarding.json`); a Space it creates posts a "<Space> is ready" notification (`notifyWhenReady`) that opens the Space. With the New UI off, the window gives way to the native one when the first run ends || Devices | Settings → Devices: this Mac's enrollment (enrolled until, grace ends, needs enrollment), the account's devices with Rename and Revoke, Recent Access; the Enroll sheet (sign in again, or a one-time code approved from an enrolled device), the approval sheet for a device asking to join (a notification too; Approve asks for Touch ID or the login password), and a banner in the main window when this Mac needs enrolling || Menu bar | The Cua mark (template); status line, Open, New Space, Settings, Quit |-| Launch at login | Settings → General: `SMAppService.mainApp`, showing what macOS reports (on, off, waiting for approval with a button to Login Items, not found); the first run's Done page ticks it. A login launch opens without the main window, and the app's daemon (host Spaces, persistent agents, Cua Volume) starts with it |+| Launch at login | Settings → General: `SMAppService.mainApp`, showing what macOS reports (on, off, waiting for approval with a button to Login Items, not found); the first run's Done page (the web onboarding's) ticks it. A login launch opens without the main window, and the app's daemon (host Spaces, persistent agents, Cua Volume) starts with it || Join with a code | `host.joinWithCode` runs the bundled `cua host setup --pair <code>` (3 minute limit); `cua://add/<CODE>` opens Machines at `?join=<CODE>` and the page asks before joining || Notch panel | The "N Spaces" tab, Space tiles with live thumbnails, and the Teleport prompt; hover opens it after 300 ms, a dragged window or file drops on a tile. Window drags need Accessibility; the panel says so with an Open Settings button |@@ -71,6 +71,7 @@ pressed look; `CUA_SPACES_UPDATER=live` runs Sparkle in a fixtures run (the feedInfo.plist; use a test bundle identifier and a local feed), `CUA_SPACES_UPDATE_CHECK=background`checks at launch, and `CUA_SPACES_REFRESH=1` runs the after-update refresh in a fixturesrun (with a throwaway `HOME`). State lives under `$HOME/Library/Application Support/com.trycua.spaces.macos`.+`CUA_SPACES_OFFSCREEN=1` runs with nothing on screen, for captures on a Mac in use (`OffscreenRun`): an accessory app (no Dock icon or menu bar), no menu bar item, notch or global shortcut, no activation, and transparent click-through windows that still paint, so `CUA_SPACES_WEBUI_CAPTURE` works (with fixtures and a throwaway `HOME`, a first run captures `/onboarding`).`CuaSpacesMac --check-launch-only` loads the app's libraries, prints its version and exits(`scripts/check-launch.sh`; release builds too).diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMac/main.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMac/main.swiftindex 33e34fe593..df8d802fef 100644--- a/apps/cua-spaces-macos/Sources/CuaSpacesMac/main.swift+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMac/main.swift@@ -23,4 +23,6 @@ TargetEnvironment.pin()// Teleport, the Cua Volume, persistent agents and the Keyvault for every// runtime the SDK builds in this process (the Cua Spaces extensions).cuaSpacesRegister()+// `CUA_SPACES_OFFSCREEN=1` (debug): an accessory app, for captures nobody sees.+OffscreenRun.prepare()CuaSpacesMacApp.main()diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppEnvironment.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppEnvironment.swiftindex 0fa3bb5dfe..024175a922 100644--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppEnvironment.swift+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppEnvironment.swift@@ -60,7 +60,6 @@ public enum AppEnvironment {refresh = UpdateRefresh(cua: cua, bundle: Bundle.main.bundlePath)}let updateRefresh = refresh- let executable = Bundle.main.executablePath ?? CommandLine.arguments[0]// This app's own daemon, started before the SDK connects (it// replaces another build's, or its own from before an update);// fixtures never touch the host.@@ -94,21 +93,8 @@ public enum AppEnvironment {let account: AccountRunning = fixtures ? FixtureAccount() : PendingAccount(gate: gate)let telemetry: TelemetryRunning = fixtures ? FixtureTelemetry() : LiveTelemetry()let agents: AgentSetupRunning = fixtures ? FixtureAgentSetup() : PendingAgentSetup(gate: gate)- // First run's writes go through the shared core (the Tauri app runs- // the same installer and host setup); fixtures run none of them.- let onboarding = OnboardingModel(- statePath: onboardingPath,- identity: account.identity(),- cli: fixtures ? nil : AppCliInstaller.forExecutable(executable: executable),- host: host, agentSetup: agents)- if !fixtures {- onboarding.onWelcomeLeft = { on in- do { try appTelemetryWelcomeLeft(on: on) } catch {- NSLog("Cua Spaces: the usage-data setting was not saved: %@", LiveSpacesBackend.words(error))- }- }- onboarding.driveTools = backend as? AgentsToolRunning- }+ // The first run's pages are the web UI's; this is its state file.+ let onboarding = OnboardingModel(statePath: onboardingPath)// This Mac on the relay: the session's device key (fixtures: an// in-memory account; presence answers yes there).let devices: DevicesRunning = fixtures ? fixtureDevices(env["CUA_SPACES_RELAY_USAGE"]) : PendingDevices(gate: gate)@@ -138,7 +124,6 @@ public enum AppEnvironment {return nil}}- onboarding.accountToken = tokenmodel.host.accountToken = tokenmodel.teamsReader = LiveTeams(token: token)// The keychain check first (the bundled `cua`, without a prompt),@@ -413,7 +398,7 @@ public enum AppEnvironment {}/// `CUA_SPACES_START_VIEW`: `new-space`, `new-space-picker`, `new-space-resources`, `keyvault`, `keyvault-waiting`,- /// `approval`, `onboarding`, `onboarding-mode`, `this-machine`, `host-setup`,+ /// `approval`, `onboarding` (the first run, in the New UI window), `this-machine`, `host-setup`,/// `host-configured`, `settings`, `settings-devices` (Settings on its/// Devices tab), `settings-about` (on its About tab), `settings-experiments`/// (on its Experiments tab), `device-approval` (the approval sheet for the first@@ -424,11 +409,7 @@ public enum AppEnvironment {/// (`notch`; 1.5 s after launch), `notch-hover`, `notch-permission`,/// `notch-drag-target` (`notch-prompt`) and `notch-drop`; `notch-menu` (the notch/// open and the menu bar menu) and `menu` (the menu alone; `menu-popup`- /// shows its items as a context menu over the main window); the onboarding- /// pages `onboarding-signin`, `-agents`, `-presentation`, `-drive`- /// (`-drive-bucket`: Your S3 bucket's prompt, `-drive-manual`: its- /// fields), `-mode`,- /// `-host-form`, `-done`;+ /// shows its items as a context menu over the main window);/// `CUA_SPACES_CREATE` (`<image>[,<name>]`) creates a Space on this Mac/// through the New Space wizard's plan and the real create path, as if/// Create were pressed (end-to-end runs and captures), and@@ -493,63 +474,13 @@ public enum AppEnvironment {model.selection = .keyvault(.category(category: .waiting))if let first = model.keyvault.overview.pending.first { model.keyvault.openApproval(first.id) }case "onboarding":+ // The first run is the web page's: its window opens on it+ // (`RootView`) once the launch is ready.model.onboarding.restart()- case "onboarding-mode":- model.onboarding.restart()- model.onboarding.send(.start)- model.onboarding.send(.signinDone)- model.onboarding.send(.agentsDone(configured: []))- model.onboarding.send(.presentationDone)- model.onboarding.send(.driveContinue)- case "onboarding-host-form":- model.onboarding.restart()- model.onboarding.send(.start)- model.onboarding.send(.signinDone)- model.onboarding.send(.agentsDone(configured: []))- model.onboarding.send(.presentationDone)- model.onboarding.send(.driveContinue)- model.onboarding.host.openForm()- case "onboarding-signin":- model.onboarding.restart()- model.onboarding.send(.start)- case "onboarding-agents":- model.onboarding.restart()- model.onboarding.send(.start)- model.onboarding.send(.signinDone)- case "onboarding-presentation":- model.onboarding.restart()- model.onboarding.send(.start)- model.onboarding.send(.signinDone)- model.onboarding.send(.agentsDone(configured: []))- case "onboarding-drive", "onboarding-drive-bucket", "onboarding-drive-manual":- // The Volume page shows with the Cua Volume experiment on- // (for this run only; the settings file is not written).- model.settings.experiments.cuaVolume = true- model.onboarding.restart()- model.onboarding.send(.start)- model.onboarding.send(.signinDone)- model.onboarding.send(.agentsDone(configured: []))- model.onboarding.send(.presentationDone)- if env["CUA_SPACES_START_VIEW"] != "onboarding-drive" {- // Your S3 bucket: the agent prompt, or its fields.- await model.onboarding.checkDrive()- model.onboarding.send(.storageChosen(choice: .s3))- if env["CUA_SPACES_START_VIEW"] == "onboarding-drive-manual" {- model.onboarding.send(.driveStorage(action: .showManual(on: true)))- }- }case "drive":// The Volume page shows with Cua Volume on (this run only).model.settings.experiments.cuaVolume = truemodel.selection = .drive- case "onboarding-done":- model.onboarding.restart()- model.onboarding.send(.start)- model.onboarding.send(.signinDone)- model.onboarding.send(.agentsDone(configured: []))- model.onboarding.send(.presentationDone)- model.onboarding.send(.driveContinue)- model.onboarding.send(.modeChosen(mode: .client))case "settings", "settings-devices", "settings-storage", "settings-about", "settings-experiments":if env["CUA_SPACES_START_VIEW"] == "settings-devices" { model.settingsTab = .devices }if env["CUA_SPACES_START_VIEW"] == "settings-about" { model.settingsTab = .about }diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppModel.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppModel.swiftindex 95f4ab7c16..5b0b1cba79 100644--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppModel.swift+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppModel.swift@@ -203,8 +203,8 @@ public final class AppModel {// filled from the SDK's shared cache.notch.thumbnails.fetch = { [backend] id, maxAgeMs in await backend.thumbnail(id: id, maxAgeMs: maxAgeMs) }// The app core's usage events for each step (the Tauri app sends- // the same ones): the first run, Settings, Storage, enrollment.- onboarding.telemetry = telemetry+ // the same ones): Settings, Storage, enrollment. The first run's+ // are the web page's (`telemetry.track`).self.checklist.telemetry = telemetryself.storage.telemetry = telemetryself.devices.telemetry = telemetry@@ -220,25 +220,8 @@ public final class AppModel {}self.host.onChange = { [weak self] in self?.recompose() }followChecklist()- // The first run's "Where should Cua Spaces show up?" is this setting.- onboarding.onPresentation = { [weak self] menuBar in- guard let self else { return }- self.settings.menuBar = menuBar- self.saveSettings()- }- onboarding.currentMenuBar = { [weak self] in self?.settings.menuBar ?? false }// Done's "Launch at login" checkbox is the user's choice.onboarding.onLaunchAtLogin = { [weak self] on in self?.setLaunchAtLogin(on) }- // Done reads the account again (the CLI's sign-in is the same- // session), and its "Turn on" turns the Cua Volume experiment on.- onboarding.readIdentity = { [weak self] in self?.account?.identity() }- onboarding.onTurnOnVolume = { [weak self] in- self?.chooseExperiment(row: "experiment:cua_volume", option: "on")- }- // Settings, Experiments decide the first run's pages (Cua Volume).- onboarding.currentExperiments = { [weak self] in- self?.settings.experiments ?? AppExperiments(cuaVolume: false, yourCloud: false, sharing: true, webUi: false)- }// Which experiments are on: the day's `cua_app_active` carries them.telemetry?.record(appTelemetryExperimentsOn(experiments: settings.experiments))// The notifications marker lives in the settings file, so a restart@@ -275,10 +258,6 @@ public final class AppModel {let name = profile?.name.flatMap { $0.trimmingCharacters(in: .whitespaces).isEmpty ? nil : $0 }return AppHostAccount(id: profile?.subject, email: profile?.email, display: name ?? who)}- // Onboarding's This machine step has its own HostModel: give it the- // same inline sign-in, or a skipped sign-in fails setup with "Not- // signed in" instead of opening the browser and carrying on.- self.onboarding.host.signIn = self.host.signIn// A row takes a window drop by the core's rule (the notch tiles' too).dropTargets.isDropTarget = { [weak self] id inself?.spaces.first { $0.id == id }.map { appSpaceAcceptsDrop(space: $0) } ?? false@@ -299,9 +278,7 @@ public final class AppModel {func attachLive(_ live: LiveSpacesBackend?) {identity = account?.identity()host.identity = identity- onboarding.host.identity = identitydevices.signedIn = identity != nil- onboarding.adoptIdentity(identity)if let live {self.live = livelet queued = whenLive@@ -737,6 +714,10 @@ public final class AppModel {/// Closes the New UI window and puts the native one in its place (the/// `web_ui` experiment was turned off).public var closeWebUI: (() -> Void)?+ /// The first run is due again (Settings, Welcome, Show again): opens its+ /// window (the web onboarding), which nothing else would while only+ /// Settings is up.+ public var openOnboarding: (() -> Void)?/// New Space with "Run on" set to `on` (`host:<machine>`): a machine's/// "New Space on <name>…".@@ -1191,18 +1172,16 @@ public final class AppModel {}let who = try await attempt.wait()guard signInAttempt == current, case .waiting = signIn else { return }+ let previous = identityidentity = who ?? account.identity()host.identity = identity- onboarding.host.identity = identitydevices.signedIn = identity != nil- // Activation funnel: the first run records `signed_in` on its- // sign-in page; a sign-in from the main window (first run done or- // not showing, so its state is on Welcome) records it here.- if onboarding.state.step == .welcome, let who = identity, !who.isEmpty,- who != onboarding.state.identity {+ // Activation funnel: the first run's page records `signed_in` on+ // its own (the core's flow); a sign-in once it is done (from+ // Settings, the machines page) records it here, for a new account.+ if onboarding.completed, let who = identity, !who.isEmpty, who != previous {telemetry?.record([.step(step: "signed_in", ok: true)])}- onboarding.send(.signedIn(identity: identity ?? ""))signIn = .idlesignInURL = nil// Relay sharing paused while signed out comes back for its@@ -1239,7 +1218,6 @@ public final class AppModel {try? await account?.signOut()identity = nilhost.identity = nil- onboarding.host.identity = nildevices.signedIn = falseteamsState = .signedOut// Signed out: relay sharing stops (the setup stays to resume).@@ -1323,11 +1301,10 @@ public final class AppModel {if settings.experiments != before { applyExperiments(before: before, after: settings.experiments) }}- /// What follows a change of the switches: the first run, an open New+ /// What follows a change of the switches: an open New/// Space, and the New UI's window in place of the native one (or back).private func applyExperiments(before: AppExperiments, after: AppExperiments) {guard before != after else { return }- onboarding.send(.experimentsLoaded(experiments: after))// New UI on: its window takes the native one's place; off: the reverse.if !before.webUi, after.webUi { openWebUI?() }if before.webUi, !after.webUi { closeWebUI?() }@@ -1486,6 +1463,9 @@ public final class AppModel {case "telemetry":do {telemetryInput = try telemetry?.setEnabled(option == "on")+ // The switch sits beside the usage note (the first run's+ // Welcome, Settings): the notice was seen.+ telemetry?.acknowledgeNotice()} catch {show(error: LiveSpacesBackend.words(error))}@@ -1499,7 +1479,9 @@ public final class AppModel {case "account": await signOut()case "sign-in": await beginSignIn()case "sign-in-code": cancelSignIn()- case "welcome": onboarding.restart()+ case "welcome":+ onboarding.restart()+ openOnboarding?()case "launch-at-login-approve":loginItem?.openSystemSettings()case "billing", "teams-manage", "teams-billing":diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppServices.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppServices.swiftindex c84e1fc29d..160c95fc76 100644--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppServices.swift+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppServices.swift@@ -128,6 +128,10 @@ public protocol TelemetryRunning: AnyObject, Sendable {/// Records signals the app core derived (`appTelemetry*`): the same ones/// the Tauri app sends for the same step.func record(_ signals: [AppTelemetrySignal])+ /// The first run's usage notice was on screen and the person moved on+ /// (left Welcome, finished the first run, or used the switch beside the+ /// note): from here usage events may be sent. Keeps the switch as it is.+ func acknowledgeNotice()}/// The SDK's telemetry setting (`$CUA_HOME/config.toml`, the same switch as@@ -148,6 +152,15 @@ public final class LiveTelemetry: TelemetryRunning, @unchecked Sendable {guard !signals.isEmpty else { return }_ = appTelemetryRecord(signals: signals)}+ /// Writes the notice marker (and records the `app_launched` that waited+ /// for it) once; the switch stays as it is.+ public func acknowledgeNotice() {+ let s = telemetryStatus()+ guard !s.noticeShown else { return }+ do { try appTelemetryWelcomeLeft(on: s.enabled) } catch {+ NSLog("Cua Spaces: the usage notice was not recorded: %@", LiveSpacesBackend.words(error))+ }+ }}/// An in-memory switch (fixtures, tests).@@ -164,6 +177,12 @@ public final class FixtureTelemetry: TelemetryRunning, @unchecked Sendable {public func record(_ signals: [AppTelemetrySignal]) {if current.enabled { recorded += signals }}+ /// How many times the notice was acknowledged.+ public private(set) var acknowledgements = 0+ public func acknowledgeNotice() {+ acknowledgements += 1+ current.noticeShown = true+ }}/// A started sign-in: the code to confirm (device flow), then the identity.diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/OffscreenRun.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/OffscreenRun.swiftnew file mode 100644index 0000000000..db4e69d4cd--- /dev/null+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/OffscreenRun.swift@@ -0,0 +1,30 @@+// SPDX-License-Identifier: FSL-1.1-MIT+// Copyright (c) 2026 Cua AI, Inc.++import AppKit++/// `CUA_SPACES_OFFSCREEN=1` (debug builds only, through `DevHooks`): a run+/// nobody sees, for captures on a Mac someone is working at. The app is an+/// accessory (no Dock icon, no menu bar), the menu bar item and the notch are+/// never put up, the global shortcut is never taken, and nothing activates+/// the app. Its windows are made, ordered in and painted, so+/// `WKWebView.takeSnapshot` works, but are fully transparent, click-through+/// and shadowless, and never become key.+public enum OffscreenRun {+ public static var isOn: Bool { DevHooks.value("CUA_SPACES_OFFSCREEN") == "1" }++ /// Before anything shows (`main.swift`, ahead of the app's scenes).+ public static func prepare() {+ guard isOn else { return }+ MainActor.assumeIsolated { _ = NSApplication.shared.setActivationPolicy(.accessory) }+ }++ /// Makes `window` invisible and untouchable; it still paints.+ @MainActor static func hide(_ window: NSWindow) {+ guard isOn else { return }+ window.alphaValue = 0+ window.ignoresMouseEvents = true+ window.hasShadow = false+ window.collectionBehavior.formUnion([.transient, .ignoresCycle, .stationary])+ }+}diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/OnboardingModel.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/OnboardingModel.swiftindex faf1777d32..00ab917155 100644--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/OnboardingModel.swift+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/OnboardingModel.swift@@ -1,437 +1,59 @@// SPDX-License-Identifier: FSL-1.1-MIT// Copyright (c) 2026 Cua AI, Inc.-import AppKit-import CuaSDKimport CuaSpacesFFIimport Foundationimport Observation-/// The Command line page's installer of the bundled `cua`: the app core's,-/// through the cua SDK (`AppCliInstaller`), the same one the Tauri app runs.-public protocol CliInstallRunning: AnyObject, Sendable {- func plan() async -> AppCliInstallPlan- func install(request: AppCliInstallRequest) async throws -> AppCliInstallPlan-}--extension AppCliInstaller: CliInstallRunning {}--/// First run: the core's step order and answers, plus the writes the flow-/// runs through the shared core: installing the bundled `cua` command after-/// its page, and host setup.+/// Whether the first run is done, and the file that says so+/// (`onboarding.json`). The pages are the shared web UI's (`/onboarding` in+/// apps/cua-spaces-web), in the New UI window: `RootView` opens it while+/// this is not `completed`, and the page asks and answers through the+/// bridge (`onboarding.get`, `onboarding.complete`), as the Electron shell's+/// does. The file is the same one both shells write.@MainActor@Observablepublic final class OnboardingModel {- public private(set) var state: AppOnboardingStatepublic private(set) var completed: Bool+ /// What the first run chose: this Mac as a host, or a client.+ public private(set) var mode: AppOnboardingModelet statePath: String?- let cli: CliInstallRunning?- let agentSetup: AgentSetupRunning?- /// This machine's host setup (the same form and host as the main window).- public let host: HostModel- /// The signed-in account's token, for relay host setup.- public var accountToken: ((_ forceRefresh: Bool) async throws -> String?)? {- get { host.accountToken }- set { host.accountToken = newValue }- }- /// Welcome was left with its usage-data switch at this value (live:- /// writes the machine's setting when it changed, then records that the- /// notice was shown; nothing is sent before).- public var onWelcomeLeft: ((Bool) -> Void)?- /// Where the first run's usage events go (the app core derives them;- /// the Tauri app sends the same ones for the same steps), and the- /// machine's telemetry setting Welcome's switch starts from.- public var telemetry: TelemetryRunning?- /// The setting was read for this run.- private var shownOnce = false- /// The fixed words.- public let copy = appOnboardingCopy()-- /// Where Cua Spaces shows up was picked (menu bar only or not): the app- /// saves it as the "Spaces tab in the notch" setting.- public var onPresentation: ((Bool) -> Void)?- /// The setting now (the presentation page starts on it).- public var currentMenuBar: (() -> Bool)?/// Done's "Launch at login" checkbox, applied when the first run/// finishes (the app registers it, or not).public var onLaunchAtLogin: ((Bool) -> Void)?- /// Settings, Experiments now: the pages follow them (the Cua Volume page- /// only with Cua Volume on).- public var currentExperiments: (() -> AppExperiments)?- // AI agents- public private(set) var agentStatuses: [AppAgentSetupStatus]?- public var agentSelection: Set<String> = []- public var agentSkills = true- public var agentMcp = true- /// The background computer-use card: also set up cua-driver (on by- /// default, like the skills and MCP switches).- public var agentDriver = true- public private(set) var agentsBusy = false- public private(set) var agentsError: String?- public private(set) var agentOutcomes: [AppAgentSetupOutcomeInput]?-- public init(statePath: String?, installerMode: AppOnboardingMode? = nil, identity: String? = nil,- cli: CliInstallRunning? = nil, host: HostRunning? = nil, agentSetup: AgentSetupRunning? = nil) {+ public init(statePath: String?) {self.statePath = statePath- self.cli = cli- self.agentSetup = agentSetup- self.host = HostModel(host: host)- self.host.identity = identity- self.state = appOnboardingInitial(installerMode: installerMode, identity: identity)- self.completed = statePath.flatMap { Self.readCompleted($0) } ?? false- }-- public var view: AppOnboardingView { appOnboardingView(state: state) }-- public func send(_ action: AppOnboardingAction) {- let before = state- state = appOnboardingReduce(state: before, action: action)- // Leaving Welcome: its usage-data switch decides before anything- // is sent (the core derives nothing while Welcome shows).- if before.step == .welcome, state.step != .welcome {- onWelcomeLeft?(appOnboardingView(state: before).usage?.on ?? true)- }- telemetry?.record(appTelemetryOnboarding(state: before, action: action))- }-- /// The first page showed: Welcome's usage-data switch starts from the- /// machine's setting (Settings, Privacy; `cua telemetry off`).- /// Each time Welcome shows (Back included), `welcome-shown`: on a- /// machine that already showed the usage notice, the core counts the- /// run now (once per run), not only when Welcome is left.- public func shown() {- if !shownOnce {- shownOnce = true- if let x = currentExperiments?() { send(.experimentsLoaded(experiments: x)) }- if let t = telemetry?.status() { send(.telemetryLoaded(telemetry: t)) }- }- if state.step == .welcome { send(.welcomeShown) }- }-- /// Welcome's "Share anonymous usage data" switch.- public func setShareUsage(_ on: Bool) { send(.usageDataToggled(on: on)) }-- // MARK: - The cua command-- /// Reads what installing the bundled `cua` would do (writes nothing).- public func planCli() async {- guard let cli, state.cliPlan == nil else { return }- send(.cliPlanned(plan: await cli.plan()))- }-- /// Continue (`install`) or Skip from Command line.- public func finishCli(install: Bool) async {- guard !state.cliInstalling else { return }- send(.cliDone(install: install))- guard state.cliInstalling, let cli, let plan = state.cliPlan else { return }- do {- send(.cliPlanned(plan: try await cli.install(request: AppCliInstallRequest(modifyPath: !plan.onPath))))- } catch {- send(.cliInstallFailed(error: LiveSpacesBackend.words(error)))- }- }-- /// Another `cua` that comes first on PATH (an old Python cua-cli, say),- /// so typing `cua` runs it rather than the installed path Done shows:- /// Done notes it under "cua command".- public var cliShadowedBy: String? {- guard state.cliTarget != nil, let other = state.cliPlan?.shadowedBy, !other.isEmpty else { return nil }- return other- }-- // MARK: - Where it shows up-- /// A presentation card was picked: the flow shows it and the app saves- /// the setting now.- public func pickPresentation(menuBar: Bool) {- send(.presentationPicked(menuBar: menuBar))- onPresentation?(menuBar)- }-- // MARK: - AI agents-- /// Installed agents, detected.- public var installedAgents: [AppAgentSetupStatus] { (agentStatuses ?? []).filter(\.installed) }-- /// Detects the coding agents (reads only).- public func loadAgents() async {- guard let agentSetup else {- agentStatuses = []- return- }- let all = await agentSetup.statuses()- agentStatuses = all- agentSelection = Set(all.filter(\.installed).map(\.id))- }-- public var canSetUpAgents: Bool {- !agentSelection.isEmpty && (agentSkills || agentMcp || agentDriver) && !agentsBusy- }-- /// "Set up": the chosen parts for the ticked agents, then cua-driver- /// when the background computer-use card is ticked.- public func setUpAgents() async {- guard let agentSetup, canSetUpAgents else { return }- agentsBusy = true- agentsError = nil- defer { agentsBusy = false }- let ids = installedAgents.map(\.id).filter { agentSelection.contains($0) }- do {- var outcomes: [AppAgentSetupOutcomeInput] = []- if agentSkills || agentMcp {- outcomes += try await agentSetup.setUp(agents: ids, skills: agentSkills, mcp: agentMcp)- }- if agentDriver { outcomes += try await agentSetup.setUpCuaDriver(agents: ids) }- agentOutcomes = outcomes- } catch {- agentsError = LiveSpacesBackend.words(error)- }- }-- /// One line per ticked agent after setup.- public var agentSummaries: [AppAgentSetupSummary] {- guard let outcomes = agentOutcomes else { return [] }- return installedAgents.filter { agentSelection.contains($0.id) }- .map { appAgentSetupSummary(outcomes: outcomes, agent: $0.id, name: $0.name) }- }-- /// Continue after setup (the agents that set up cleanly) or Skip.- public func finishAgents(skipped: Bool = false) {- let configured = skipped ? [] : installedAgents.filter { agentSelection.contains($0.id) }- .filter { a in- appAgentSetupSummary(outcomes: agentOutcomes ?? [], agent: a.id, name: a.name).failed.isEmpty- }- .map(\.name)- send(.agentsDone(configured: configured))- }-- // MARK: - Cua Volume-- /// The daemon's Spaces tools (`volume_mount_status`, `volume_mount`,- /// `volume_unmount`); nil: no daemon, the page says the drive is not- /// available.- public var driveTools: AgentsToolRunning?- /// Opens a URL (System Settings' file system extensions).- public var openURL: (URL) -> Void = { NSWorkspace.shared.open($0) }-- private func mountStatus(_ tool: String) async throws -> AppDriveMountInput {- guard let driveTools else { throw AgentsToolError(message: "No cua daemon") }- let r = try await driveTools.agentsTool(tool, [:])- let data = try JSONSerialization.data(withJSONObject: r)- return try appDriveMountFromJson(json: String(decoding: data, as: UTF8.self))- }-- /// Reads what the mount can do here (the checkbox) and where the files- /// live now (the storage choice).- public func checkDrive() async {- let status = try? await mountStatus("volume_mount_status")- send(.driveChecked(os: .macos, status: status))- await loadDriveStorage()- }-- /// Reads `volume_storage` (the page polls it while the agent prompt- /// shows, so a bucket the agent connects is noticed).- public func loadDriveStorage() async {- if let driveTools, let raw = try? await driveTools.agentsTool("volume_storage", [:]),- let storage = try? appStorageActionFromJson(json: StorageModel.json(["type": "loaded", "storage": raw])),- case let .loaded(input) = storage {- let wasBusy = state.storage.busy- send(.driveStorageLoaded(storage: input, home: userHome()))- // A bucket the agent connected: the core asks to adopt it.- if !wasBusy, case .adopt? = state.storage.request { await runStorageRequest() }- }- }-- /// The agent prompt shows: poll for the bucket it sets up.- public var watchingStorage: Bool {- view.drive?.storageRows.contains { $0.id == "s3-prompt" } ?? false- }-- /// Shows a path in Finder.- public var reveal: (String) -> Void = { path in- NSWorkspace.shared.activateFileViewerSelecting([URL(fileURLWithPath: homeExpanded(path))])- }-- /// A bucket form edit, Test connection or a choice: runs the test the- /// core asks for.- public func driveStorage(_ action: AppStorageAction) async {- send(.driveStorage(action: action))- await runStorageRequest()- }-- /// Runs `volume_storage_set` when the page's storage state asks for it- /// (a test, or Continue's save), and answers the core.- private func runStorageRequest() async {- guard let request = state.storage.request else { return }- let update: AppDriveStorageUpdate- switch request {- case let .test(u), let .save(u), let .adopt(u): update = u- default: return- }- var isTest = false- if case .test = request { isTest = true }- var isAdopt = false- if case .adopt = request { isAdopt = true }- do {- guard let driveTools else { throw AgentsToolError(message: "No cua daemon") }- let args = (try? JSONSerialization.jsonObject(with: Data(appStorageUpdateJson(update: update).utf8)))- as? [String: Any] ?? [:]- let raw = try await driveTools.agentsTool("volume_storage_set", args)- let type = isTest ? "checked" : "saved"- guard case let .checked(check)? = try? appStorageActionFromJson(- json: StorageModel.json(["type": "checked", "check": raw])) else {- throw AgentsToolError(message: "Unexpected answer from volume_storage_set")- }- if isAdopt {- send(.driveStorage(action: .adopted(check: check)))- } else if type == "checked" {- send(.driveStorage(action: .checked(check: check)))- } else {- send(.driveStorageSaved(check: check))- await runMountRequest()- }- } catch {- if isAdopt {- send(.driveStorage(action: .adopted(check: AppDriveCheckInput(- ok: false, reachable: false, authorized: false, versioning: false,- detail: LiveSpacesBackend.words(error), applied: false))))- } else if isTest {- send(.driveStorage(action: .failed(error: LiveSpacesBackend.words(error))))- } else {- send(.driveStorageSaved(check: AppDriveCheckInput(- ok: false, reachable: false, authorized: false, versioning: false,- detail: LiveSpacesBackend.words(error), applied: false)))- }- }- }-- private func runMountRequest() async {- guard let request = state.driveRequest else { return }- do {- let status = try await mountStatus(request == .mount ? "volume_mount" : "volume_unmount")- send(.driveMounted(status: status))- } catch {- send(.driveFailed(error: LiveSpacesBackend.words(error)))- }- }-- /// Continue on the Cua Volume page: saves the storage choice, then- /// mounts (or unmounts) when the checkbox and the daemon disagree.- public func continueDrive() async {- send(.driveContinue)- await runStorageRequest()- await runMountRequest()+ let saved = statePath.flatMap { Self.read($0) }+ self.completed = saved?.completed ?? false+ self.mode = saved?.mode ?? .client}- // MARK: - This machine-- public var showingHostForm: Bool { host.form != nil }-- /// "Set up for access": host setup through the SDK (relay mode signs in- /// with the app's account), then Done.- public func setUpHost() async {- await host.submit()- if host.form == nil, host.state?.configured == true {- send(.modeChosen(mode: .host))- }- }-- /// The panes host setup still needs granted (macOS privacy settings).- public var hostPermissions: [AppPermissionRow] {- appHostPermissionRows(permissions: host.state?.permissions ?? [])- }-- // MARK: - Done-- // MARK: - Done-- /// The account now, read from the shared session (the CLI's sign-in- /// included). Set by the app.- public var readIdentity: (() -> String?)?- /// Turns the Cua Volume experiment on (Settings, Experiments) for- /// Done's "Turn on".- public var onTurnOnVolume: (() -> Void)?-- /// Done shows: read the machine again rather than trusting what this- /// run saw. A `cua` from install.sh, a sign-in from `cua auth login`- /// while the window was open, and agents set up earlier all count.- public func refreshDone() async {- if let cli { quietly(.cliPlanned(plan: await cli.plan())) }- if let who = readIdentity?(), !who.isEmpty, who != state.identity {- quietly(.signedIn(identity: who))- }- if let agentSetup {- let configured = await agentSetup.statuses().filter { $0.installed && $0.cuaConfigured }.map(\.name)- if !configured.isEmpty { quietly(.agentsDetected(configured: configured)) }- }- }-- /// What the machine says, not something the user did on a page: no- /// usage event.- private func quietly(_ action: AppOnboardingAction) {- state = appOnboardingReduce(state: state, action: action)- }-- /// A fix on Done's to-do list: its page opens, and leaving it comes- /// back to Done. Cua Volume turns its experiment on first.- public func fixTodo(_ id: AppOnboardingTodoId) async {- if id == .volume, !state.experiments.cuaVolume {- onTurnOnVolume?()- var x = currentExperiments?() ?? state.experiments- x.cuaVolume = true- send(.experimentsLoaded(experiments: x))- if !state.driveChecked { await checkDrive() }- }- if id == .cli, state.cliPlan == nil { await planCli() }- send(.todoChosen(id: id))- }-- /// "Start using Cua Spaces".- public func finish() {- telemetry?.record(appTelemetryOnboardingFinished(state: state))+ /// "Start using Cua Spaces": saved to the state file.+ public func finish(mode: AppOnboardingMode = .client, launchAtLogin: Bool? = nil) {completed = true- onLaunchAtLogin?(state.launchAtLogin)+ self.mode = mode+ if let launchAtLogin { onLaunchAtLogin?(launchAtLogin) }guard let statePath else { return }- let mode = state.mode == .host ? "host" : "client"let url = URL(fileURLWithPath: statePath)try? FileManager.default.createDirectory(at: url.deletingLastPathComponent(),withIntermediateDirectories: true)- try? Data("{\"completed\":true,\"mode\":\"\(mode)\"}".utf8).write(to: url, options: .atomic)- }-- /// The account became known after the first run started (the launch- /// reads it once the keychain allows): a first run still on Welcome- /// starts from it, as if it had been known from the start.- public func adoptIdentity(_ identity: String?) {- host.identity = identity- guard !completed, state.identity != identity else { return }- // Signed in (from the app or the CLI, one shared session): on any- // page, so Done never says "not signed in" for a signed-in Mac. A- // sign-out only clears it on Welcome, before the flow asked.- if let identity, !identity.isEmpty {- quietly(.signedIn(identity: identity))- } else if state.step == .welcome {- state.identity = identity- }+ let word = mode == .host ? "host" : "client"+ try? Data("{\"completed\":true,\"mode\":\"\(word)\"}".utf8).write(to: url, options: .atomic)}- /// Shows the flow again (Settings).+ /// Shows the flow again (Settings, Welcome): due until it finishes. The+ /// file stays as it was.public func restart() {completed = false- shownOnce = false- host.closeForm()- agentOutcomes = nil- let plan = state.cliPlan- state = appOnboardingInitial(installerMode: state.installerMode, identity: state.identity)- if let x = currentExperiments?() { send(.experimentsLoaded(experiments: x)) }- if let plan { send(.cliPlanned(plan: plan)) }- Task { await checkDrive() }}- static func readCompleted(_ path: String) -> Bool? {+ static func readCompleted(_ path: String) -> Bool? { read(path)?.completed }++ private static func read(_ path: String) -> (completed: Bool, mode: AppOnboardingMode)? {guard let data = FileManager.default.contents(atPath: path),- let obj = try? JSONSerialization.jsonObject(with: data) as? [String: Any] else { return nil }- return obj["completed"] as? Bool+ let obj = try? JSONSerialization.jsonObject(with: data) as? [String: Any],+ let completed = obj["completed"] as? Bool else { return nil }+ return (completed, (obj["mode"] as? String) == "host" ? .host : .client)}}diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/SpaceReadyNotifier.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/SpaceReadyNotifier.swiftnew file mode 100644index 0000000000..b3619e345c--- /dev/null+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/SpaceReadyNotifier.swift@@ -0,0 +1,88 @@+// SPDX-License-Identifier: FSL-1.1-MIT+// Copyright (c) 2026 Cua AI, Inc.++import AppKit+import CuaSpacesFFI+import Foundation+import UserNotifications++/// A Space the onboarding created has come up: what the notification says.+struct SpaceReadyNote: Equatable {+ let spaceId: String+ let name: String+ let os: AppSpaceOs++ /// "<Space name> is ready".+ var title: String { "\(name) is ready" }++ /// "A fresh macOS computer inside this Mac. Your agent can use it now."+ /// (no OS word when the Space's is not known).+ var body: String {+ let word: String+ switch os {+ case .macos: word = "macOS "+ case .linux: word = "Linux "+ case .windows: word = "Windows "+ case .unknown: word = ""+ }+ return "A fresh \(word)computer inside this Mac. Your agent can use it now."+ }++ /// The notification's identifier; clicking it carries the Space's id back.+ var identifier: String { Self.identifierPrefix + spaceId }++ static let identifierPrefix = "space-ready-"++ /// The Space a clicked notification (its identifier) is about.+ static func spaceId(fromIdentifier id: String) -> String? {+ guard id.hasPrefix(identifierPrefix), id.count > identifierPrefix.count else { return nil }+ return String(id.dropFirst(identifierPrefix.count))+ }+}++/// The system notification for a Space created from the first run+/// ("<Space> is ready"): posted whether or not a window is open, carrying+/// the Cua key as its mark. Only a bundled app posts it (a test process has+/// no notification identity); its click is `DeviceNotifier`'s `onOpen`.+@MainActor+final class SpaceReadyNotifier {+ static let shared = SpaceReadyNotifier()+ private var authorized: Bool?++ func post(_ note: SpaceReadyNote) {+ guard DeviceNotifier.available else { return }+ let center = UNUserNotificationCenter.current()+ center.delegate = DeviceNotifier.shared+ let content = UNMutableNotificationContent()+ content.title = note.title+ content.body = note.body+ content.sound = .default+ // Adding an attachment moves its file: give it a copy.+ if let copy = Self.attachmentCopy(of: CuaKey.url),+ let attachment = try? UNNotificationAttachment(identifier: "cua-key", url: copy,+ options: [UNNotificationAttachmentOptionsTypeHintKey: "public.png"]) {+ content.attachments = [attachment]+ }+ let request = UNNotificationRequest(identifier: note.identifier, content: content, trigger: nil)+ Task {+ if authorized == nil {+ authorized = (try? await center.requestAuthorization(options: [.alert, .sound])) ?? false+ }+ guard authorized == true else { return }+ try? await center.add(request)+ }+ }++ /// The image as a file of its own in the temporary directory (nil when+ /// there is none or it can't be copied).+ static func attachmentCopy(of source: URL?, in directory: URL = FileManager.default.temporaryDirectory) -> URL? {+ guard let source else { return nil }+ let copy = directory.appendingPathComponent("cua-notification-\(UUID().uuidString).png")+ do {+ try FileManager.default.copyItem(at: source, to: copy)+ return copy+ } catch {+ return nil+ }+ }+}diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/CuaSpacesMacApp.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/CuaSpacesMacApp.swiftindex 5cfc6903f9..9c8d36a0e6 100644--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/CuaSpacesMacApp.swift+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/CuaSpacesMacApp.swift@@ -36,7 +36,8 @@ public struct CuaSpacesMacApp: App {}.defaultSize(width: 980, height: 660)// Open at every launch (see `ignoreSavedWindowState`), except while- // New UI is on: then its window opens instead (`AppDelegate.start`).+ // New UI is on or the first run is due: then the New UI window opens+ // instead (`AppDelegate.start`)..defaultLaunchBehavior(Self.opensWebUIAtLaunch(model) ? .suppressed : .presented).commands {CommandGroup(replacing: .newItem) {@@ -69,21 +70,21 @@ public struct CuaSpacesMacApp: App {SettingsScene(model: model)}- MenuBarExtra {+ // Not inserted in an offscreen run (`OffscreenRun`).+ MenuBarExtra(isInserted: .constant(!OffscreenRun.isOn)) {MenuBarContent(model: model)} label: {MenuBarLabel(model: model)}}- /// New UI is on and the first run is done: a launch opens the New UI- /// window rather than the native main window (the first run itself- /// stays in the main window).+ /// New UI is on, or the first run is due (it is the web UI's onboarding):+ /// a launch opens the New UI window rather than the native main window.static func opensWebUIAtLaunch(_ model: AppModel) -> Bool {opensWebUIAtLaunch(webUi: model.settings.experiments.webUi, onboarded: model.onboarding.completed)}- static func opensWebUIAtLaunch(webUi: Bool, onboarded: Bool) -> Bool { webUi && onboarded }+ static func opensWebUIAtLaunch(webUi: Bool, onboarded: Bool) -> Bool { webUi || !onboarded }}/// The menu bar icon. It is there from launch, so it also hands the New UI@@ -108,7 +109,8 @@ struct MenuBarLabel: View {}}-/// First run, else the main window.+/// The main window. The first run is not drawn here: it is the shared web+/// onboarding, in the New UI window (see `MainWindowSwitch`).struct RootView: View {@Bindable var model: AppModel@Environment(\.dismissWindow) private var dismissWindow@@ -135,12 +137,13 @@ struct RootView: View {MainWindowSwitch.nativeAppeared(nil, model: model)}} else {- OnboardingView(onboarding: model.onboarding, onSignIn: model.account == nil ? nil : {- await model.beginSignIn()- return model.identity- }, signInPhase: model.signIn, onCancelSignIn: { model.cancelSignIn() }, signInURL: model.signInURL)- .toolbar(removing: .title)- .toolbarBackgroundVisibility(.hidden, for: .windowToolbar)+ // First run: the web onboarding opens in this window's place.+ Color.clear+ .background(WindowReader { MainWindowSwitch.firstRunAppeared($0, model: model) })+ .onAppear {+ WebUIWindowController.actions = .make(openWindow: openWindow)+ MainWindowSwitch.firstRunAppeared(nil, model: model)+ }}}}@@ -300,6 +303,8 @@ final class AppDelegate: NSObject, NSApplicationDelegate {// New UI on and off: one window, its frame kept, never two.model.openWebUI = { MainWindowSwitch.switchToWebUI(model: model) }model.closeWebUI = { WebUIWindowController.closeShared() }+ // "Show again" for the first run: the web onboarding's window.+ model.openOnboarding = { WebUIWindowController.show(model: model, at: .onboarding) }let controller = NotchController(model: model.notch)controller.sidebar = model.dropTargetscontroller.pageTiles = model.pageDropTargets@@ -353,8 +358,9 @@ final class AppDelegate: NSObject, NSApplicationDelegate {}}}- // "Spaces tab in the notch": applied now and on every change.- Self.followNotchSetting(model, controller)+ // "Spaces tab in the notch": applied now and on every change (an+ // offscreen run never puts the notch up).+ if !OffscreenRun.isOn { Self.followNotchSetting(model, controller) }// The tiles read the shared thumbnail store (the SDK's cache);// open, every tile asks for one no older than the open interval.let thumbnails = model.thumbnails@@ -375,13 +381,17 @@ final class AppDelegate: NSObject, NSApplicationDelegate {}notch = controller// ⌘⇧Space from any app: the window of the UI in use, in front.- GlobalShortcut.install(model)+ if !OffscreenRun.isOn { GlobalShortcut.install(model) }AppEnvironment.applyStartView(model, notch: controller)- // New UI on: its window is the one a launch opens (the main window- // is suppressed); not when opened at login.- if CuaSpacesMacApp.opensWebUIAtLaunch(model), !Self.launchedAtLogin,- DevHooks.value("CUA_SPACES_START_VIEW") == nil {- WebUIWindowController.show(model: model)+ // New UI on, or the first run due: the New UI window is the one a+ // launch opens (the main window is suppressed), the first run at+ // `/onboarding`; not when opened at login.+ if CuaSpacesMacApp.opensWebUIAtLaunch(model), !Self.launchedAtLogin {+ if !model.onboarding.completed {+ WebUIWindowController.show(model: model, at: .onboarding)+ } else if DevHooks.value("CUA_SPACES_START_VIEW") == nil {+ WebUIWindowController.show(model: model)+ }}// The notch shows the Spaces (and takes drops on them) with the main// window closed: keep the roster, and so each tile's reachability,@@ -400,8 +410,14 @@ final class AppDelegate: NSObject, NSApplicationDelegate {// approval sheet) even with the window closed; this Mac's own// enrollment shows as the main window's banner. Nothing else asks.model.devices.notify = { DeviceNotifier.shared.post($0) }- // A click on one of the app's notifications: the main UI in use.+ // A click on one of the app's notifications: the main UI in use+ // (a Space that came up: its page).DeviceNotifier.shared.onOpen = { id in+ if let spaceId = SpaceReadyNote.spaceId(fromIdentifier: id) {+ model.select(spaceId)+ router.open(.space(spaceId)) { WebUIWindowController.actions?.openMain() }+ return+ }router.open(id.hasPrefix("agent-") ? .agents : .home) { WebUIWindowController.actions?.openMain() }}// Persistent agents' answers and requests, from the daemon's feed,@@ -421,7 +437,8 @@ final class AppDelegate: NSObject, NSApplicationDelegate {// there while it waits). Opened at login: in the background, never// taking focus. Fixtures (UI tests, captures) come forward only// when asked.- if Self.activatesAtLaunch(loginLaunch: Self.launchedAtLogin,+ if !OffscreenRun.isOn,+ Self.activatesAtLaunch(loginLaunch: Self.launchedAtLogin,fixtures: DevHooks.value("CUA_SPACES_FIXTURES") == "1",asked: DevHooks.value("CUA_SPACES_ACTIVATE") == "1") {NSApp.activate()diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/DriveMountPreview.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/DriveMountPreview.swiftdeleted file mode 100644index 60a3962a67..0000000000--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/DriveMountPreview.swift+++ /dev/null@@ -1,374 +0,0 @@-// SPDX-License-Identifier: FSL-1.1-MIT-// Copyright (c) 2026 Cua AI, Inc.--import AppKit-import CuaSDK-import CuaSpacesFFI-import SwiftUI--/// The first run's Cua Volume page: its animated miniature over one checkbox-/// line, like the AI agents page's background computer-use card-/// (`DriverCardView`). The miniature is a Space whose files fly over, one-/// after another, into the "Cua Volume" volume that appears in a Finder-/// window's sidebar. The scene and every frame are the core's-/// (`appDriveMountPreview`, `appDriveMountPreviewFrame`), so the Tauri app-/// plays the same beats; the card's words and state are the core's-/// `AppDriveCard`.-struct DriveCardView: View {- let card: AppDriveCard- let toggle: (Bool) -> Void- var openSettings: ((URL) -> Void)?- /// Where the files live: `local`, `s3`, `later`.- var chooseStorage: ((String) -> Void)?- /// A bucket row's field edit, choice or button (the row's id).- var editStorage: ((String, String) -> Void)?- var chooseStorageRow: ((String, String) -> Void)?- var pressStorageRow: ((String) -> Void)?- /// Show a path in Finder (the mounted volume).- var reveal: ((String) -> Void)?- var fixedMs: UInt32?- /// Overrides the system's Reduce Motion (tests).- var still: Bool?-- var body: some View {- VStack(alignment: .leading, spacing: 8) {- // The bucket's prompt or fields take the picture's place.- if card.storageRows.isEmpty {- DriveMountPreview(fixedMs: fixedMs, stillOverride: still)- .clipShape(.rect(cornerRadius: 6))- .accessibilityElement(children: .ignore)- .accessibilityLabel(card.imageLabel)- }- if let title = card.storageTitle, !card.storageOptions.isEmpty {- Text(title).font(.callout).foregroundStyle(.secondary)- Picker(title, selection: Binding(- get: { card.storageOptions.first(where: \.active)?.id ?? "local" },- set: { chooseStorage?($0) })) {- ForEach(card.storageOptions, id: \.id) { Text($0.label).tag($0.id) }- }- .pickerStyle(.segmented)- .labelsHidden()- .disabled(card.busy)- .accessibilityIdentifier("onboarding-storage")- if !card.storageRows.isEmpty {- StorageRowsView(rows: card.storageRows, edit: { editStorage?($0, $1) },- choose: { chooseStorageRow?($0, $1) }, press: { pressStorageRow?($0) })- }- if let note = card.storageNote {- Text(note).font(.callout).foregroundStyle(.secondary).fixedSize(horizontal: false, vertical: true)- }- if let stored = card.storedIn {- PathLine(text: stored, path: card.storedPath)- }- if let mounted = card.mountedAt {- HStack(spacing: 6) {- PathLine(text: mounted, path: card.mountedPath)- if let path = card.mountedPath, let reveal {- Button("Show in Finder") { reveal(path) }.buttonStyle(.link).font(.callout)- }- }- }- Divider()- }- HStack(spacing: 8) {- Toggle(card.label, isOn: Binding(get: { card.checked }, set: { toggle($0) }))- .toggleStyle(.checkbox)- .lineLimit(1)- .disabled(!card.enabled)- .accessibilityIdentifier("onboarding-drive")- if card.busy { ProgressView().controlSize(.small) }- }- if let error = card.error {- Text(error).foregroundStyle(.red).fixedSize(horizontal: false, vertical: true)- } else if let note = card.note {- HStack(alignment: .firstTextBaseline, spacing: 8) {- Text(note).font(.callout).foregroundStyle(.secondary).fixedSize(horizontal: false, vertical: true)- if let label = card.settingsLabel, let url = card.settingsUrl.flatMap(URL.init(string:)) {- Button(label) { openSettings?(url) }.controlSize(.small)- }- }- }- }- .frame(maxWidth: .infinity, alignment: .leading)- }-}--/// The bucket's fields on the first run's page, two columns (label, then-/// field), each row one line: the core's rows (`AppSettingsRow`).-struct StorageRowsView: View {- let rows: [AppSettingsRow]- let edit: (String, String) -> Void- let choose: (String, String) -> Void- let press: (String) -> Void-- var body: some View {- Grid(alignment: .leading, horizontalSpacing: 10, verticalSpacing: 6) {- ForEach(rows, id: \.id) { r in- switch r.kind {- case .field, .secret:- GridRow {- Text(r.label).foregroundStyle(.secondary).lineLimit(1)- Group {- if r.kind == .secret {- SecureField("", text: Binding(get: { r.value ?? "" }, set: { edit(r.id, $0) }),- prompt: r.placeholder.map { Text($0) })- } else {- TextField("", text: Binding(get: { r.value ?? "" }, set: { edit(r.id, $0) }),- prompt: r.placeholder.map { Text($0) })- }- }- .textFieldStyle(.roundedBorder)- .controlSize(.small)- .disabled(!r.enabled)- .accessibilityIdentifier("onboarding-\(r.id)")- }- case .choice:- GridRow {- Text(r.label).foregroundStyle(.secondary).lineLimit(1)- Picker(r.label, selection: Binding(- get: { r.options.first(where: \.active)?.id ?? "" },- set: { choose(r.id, $0) })) {- ForEach(r.options, id: \.id) { Text($0.label).tag($0.id) }- }- .labelsHidden().pickerStyle(.segmented).controlSize(.small).fixedSize()- .disabled(!r.enabled)- }- case .text:- GridRow {- Text(r.value ?? r.label).foregroundStyle(.secondary)- .fixedSize(horizontal: false, vertical: true)- HStack {- Spacer()- if let b = r.button { Button(b) { press(r.id) }.controlSize(.small).disabled(!r.enabled) }- }- }- case .error, .note:- GridRow {- Text(r.label).foregroundStyle(r.kind == .error ? Color.red : Color.secondary)- .fixedSize(horizontal: false, vertical: true).gridCellColumns(2)- }- case .prompt:- GridRow {- PromptBox(label: r.label, text: r.value ?? "", copyLabel: r.button ?? "Copy")- .gridCellColumns(2)- }- case .toggle:- GridRow {- Text(r.label).foregroundStyle(.secondary).lineLimit(1)- Toggle(r.label, isOn: Binding(- get: { r.options.first(where: { $0.id == "on" })?.active ?? false },- set: { choose(r.id, $0 ? "on" : "off") }))- .labelsHidden().controlSize(.small)- .disabled(!r.enabled)- }- case .link:- GridRow {- Button(r.label) { press(r.id) }.buttonStyle(.link).disabled(!r.enabled)- .gridCellColumns(2)- .accessibilityIdentifier("onboarding-\(r.id)")- }- }- }- }- .font(.callout)- }-}--/// A path line: middle-truncated, the full path in the tooltip.-struct PathLine: View {- let text: String- let path: String?-- var body: some View {- Text(text).font(.callout).foregroundStyle(.secondary)- .lineLimit(1).truncationMode(.middle).help(path ?? text)- }-}--/// A prompt to hand to a coding agent: a label, the text in a quiet-/// read-only box (selectable, wrapping) and Copy.-struct PromptBox: View {- let label: String- let text: String- let copyLabel: String- @State private var copied = false-- var body: some View {- VStack(alignment: .leading, spacing: 6) {- HStack {- Text(label).foregroundStyle(.secondary)- Spacer()- Button(copyLabel) {- NSPasteboard.general.clearContents()- NSPasteboard.general.setString(text, forType: .string)- copied = true- }- .controlSize(.small)- .accessibilityIdentifier("storage-prompt-copy")- }- Text(text)- .font(.callout)- .textSelection(.enabled)- .fixedSize(horizontal: false, vertical: true)- .frame(maxWidth: .infinity, alignment: .leading)- .padding(8)- .background(Color(nsColor: .textBackgroundColor), in: .rect(cornerRadius: 6))- .overlay(RoundedRectangle(cornerRadius: 6).strokeBorder(Color(nsColor: .separatorColor)))- .accessibilityIdentifier("storage-prompt")- }- }-}--/// The page's miniature. It loops while it is on screen in the key window-/// and stops otherwise; with Reduce Motion it is the core's still.-struct DriveMountPreview: View {- /// A fixed moment in the loop (snapshots); nil plays it.- var fixedMs: UInt32?- /// Overrides the system's Reduce Motion (tests).- var stillOverride: Bool?- @Environment(\.accessibilityReduceMotion) private var reduceMotion- @Environment(\.onboardingMotionStill) private var motionStill- @Environment(\.appearsActive) private var appearsActive- @State private var onScreen = false- @State private var origin = Date()-- var body: some View {- let scene = Self.scene- Group {- if let fixedMs {- DriveMountCanvas(scene: scene, frame: appDriveMountPreviewFrame(tMs: fixedMs))- } else if stillOverride ?? (reduceMotion || motionStill) {- DriveMountCanvas(scene: scene, frame: appDriveMountPreviewStill())- } else {- TimelineView(.animation(minimumInterval: 1.0 / 30, paused: !onScreen || !appearsActive)) { context in- let elapsed = max(0, context.date.timeIntervalSince(origin)) * 1000- let ms = UInt32(elapsed.truncatingRemainder(dividingBy: Double(scene.loopMs)))- DriveMountCanvas(scene: scene, frame: appDriveMountPreviewFrame(tMs: ms))- }- }- }- .frame(width: scene.width, height: scene.height)- // The desktop spans the card; the stage sits centred in it.- .frame(maxWidth: .infinity)- .background {- LinearGradient(colors: [PreviewColors.wallpaperTop, PreviewColors.wallpaperBottom],- startPoint: .top, endPoint: .bottom)- }- .onAppear {- origin = Date()- onScreen = true- }- .onDisappear { onScreen = false }- }-- @MainActor static let scene = appDriveMountPreview()-}--/// One frame of the miniature on its stage (points, origin top left): the-/// Space, the Finder window with its sidebar and the volume, then the file-/// in flight above both.-struct DriveMountCanvas: View {- let scene: AppDriveMountPreview- let frame: AppDriveMountFrame-- var body: some View {- ZStack(alignment: .topLeading) {- Color.clear.frame(width: scene.width, height: scene.height)- MiniWindow(window: scene.space) {- ForEach(Array(scene.sourceIcons.enumerated()), id: \.offset) { _, icon in- FileGlyph().frame(width: icon.width, height: icon.height)- .offset(x: icon.x - scene.space.frame.x, y: icon.y - scene.space.frame.y)- }- ForEach(Array(scene.sourceLabels.enumerated()), id: \.offset) { _, bar in- MiniBar(rect: bar, origin: scene.space.frame)- }- }- MiniWindow(window: scene.finder) {- let f = scene.finder.frame- Rectangle()- .fill(Color.secondary.opacity(0.1))- .frame(width: scene.sidebar.width, height: scene.sidebar.height)- .offset(x: scene.sidebar.x - f.x, y: scene.sidebar.y - f.y)- ForEach(Array(scene.places.enumerated()), id: \.offset) { _, bar in- MiniBar(rect: bar, origin: f)- }- VolumeRow(scene: scene, shown: frame.volume)- .offset(x: scene.volume.x - f.x, y: scene.volume.y - f.y)- ForEach(Array(scene.destIcons.enumerated()), id: \.offset) { i, icon in- let shown = i < frame.arrived.count ? frame.arrived[i] : 0- Group {- FileGlyph().frame(width: icon.width, height: icon.height)- .offset(x: icon.x - f.x, y: icon.y - f.y)- MiniBar(rect: scene.destLabels[i], origin: f)- }- .opacity(shown)- }- }- if let at = frame.flight, let icon = scene.sourceIcons.first {- FileGlyph()- .frame(width: icon.width, height: icon.height)- .shadow(color: .black.opacity(0.2), radius: 1.5, y: 1)- .offset(x: at.x, y: at.y)- }- }- .frame(width: scene.width, height: scene.height, alignment: .topLeading)- .clipped()- .accessibilityHidden(true)- }-}--/// The volume's sidebar row: the selection highlight, a drive glyph and the-/// name, all fading in with `shown`.-private struct VolumeRow: View {- let scene: AppDriveMountPreview- let shown: Double-- var body: some View {- let v = scene.volume- let icon = scene.volumeIcon- ZStack(alignment: .topLeading) {- RoundedRectangle(cornerRadius: 2.5)- .fill(Color.accentColor.opacity(0.18))- .frame(width: v.width, height: v.height)- RoundedRectangle(cornerRadius: 1.2)- .strokeBorder(Color.secondary.opacity(0.8), lineWidth: 0.7)- .frame(width: icon.width, height: icon.height)- .offset(x: icon.x - v.x, y: icon.y - v.y)- Text(scene.volumeLabel)- .font(.system(size: scene.fontSize, weight: .medium))- .foregroundStyle(.primary)- .fixedSize()- .frame(height: v.height)- .offset(x: scene.volumeLabelX - v.x)- }- .frame(width: v.width, height: v.height, alignment: .topLeading)- .opacity(shown)- }-}--/// A document: a page with a folded corner.-private struct FileGlyph: View {- var body: some View {- GeometryReader { g in- let w = g.size.width, h = g.size.height, fold = w * 0.35- let page = Path { p in- p.move(to: .zero)- p.addLine(to: CGPoint(x: w - fold, y: 0))- p.addLine(to: CGPoint(x: w, y: fold))- p.addLine(to: CGPoint(x: w, y: h))- p.addLine(to: CGPoint(x: 0, y: h))- p.closeSubpath()- }- ZStack {- page.fill(Color(nsColor: .windowBackgroundColor))- page.stroke(Color.secondary.opacity(0.6), lineWidth: 0.6)- Path { p in- p.move(to: CGPoint(x: w - fold, y: 0))- p.addLine(to: CGPoint(x: w - fold, y: fold))- p.addLine(to: CGPoint(x: w, y: fold))- }- .stroke(Color.secondary.opacity(0.6), lineWidth: 0.6)- }- }- }-}diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/DriverPreview.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/DriverPreview.swiftdeleted file mode 100644index d1bb6e7cfc..0000000000--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/DriverPreview.swift+++ /dev/null@@ -1,236 +0,0 @@-// SPDX-License-Identifier: FSL-1.1-MIT-// Copyright (c) 2026 Cua AI, Inc.--import AppKit-import CuaSDK-import CuaSpacesFFI-import SwiftUI--/// The AI agents page's background computer-use card: its animated-/// miniature over one checkbox line, inside the page's own card (no second-/// frame around it). The miniature is a back window where-/// the cua-driver agent cursor ticks boxes while the user's own pointer-/// selects text in a front window, both at once. The scene and every frame-/// are the core's (`appDriverPreview`, `appDriverPreviewFrame`), so the-/// Tauri app plays the same beats; this view only draws them, like the-/// presentation cards' `PresentationPreview`.-struct DriverCardView: View {- let title: String- let imageLabel: String- @Binding var isOn: Bool- var fixedMs: UInt32?- /// Overrides the system's Reduce Motion (tests).- var still: Bool?-- var body: some View {- VStack(alignment: .leading, spacing: 8) {- DriverPreview(fixedMs: fixedMs, stillOverride: still)- .clipShape(.rect(cornerRadius: 6))- .accessibilityElement(children: .ignore)- .accessibilityLabel(imageLabel)- Toggle(title, isOn: $isOn)- .toggleStyle(.checkbox)- .lineLimit(1)- .accessibilityIdentifier("agents-driver")- }- .frame(maxWidth: .infinity, alignment: .leading)- }-}--/// The card's miniature. It loops while it is on screen in the key window-/// and stops otherwise; with Reduce Motion it is the core's still.-struct DriverPreview: View {- /// A fixed moment in the loop (snapshots); nil plays it.- var fixedMs: UInt32?- /// Overrides the system's Reduce Motion (tests).- var stillOverride: Bool?- @Environment(\.accessibilityReduceMotion) private var reduceMotion- @Environment(\.onboardingMotionStill) private var motionStill- @Environment(\.appearsActive) private var appearsActive- @State private var onScreen = false- @State private var origin = Date()-- var body: some View {- let scene = Self.scene- Group {- if let fixedMs {- DriverPreviewCanvas(scene: scene, frame: appDriverPreviewFrame(tMs: fixedMs))- } else if stillOverride ?? (reduceMotion || motionStill) {- DriverPreviewCanvas(scene: scene, frame: appDriverPreviewStill())- } else {- TimelineView(.animation(minimumInterval: 1.0 / 30, paused: !onScreen || !appearsActive)) { context in- let elapsed = max(0, context.date.timeIntervalSince(origin)) * 1000- let ms = UInt32(elapsed.truncatingRemainder(dividingBy: Double(scene.loopMs)))- DriverPreviewCanvas(scene: scene, frame: appDriverPreviewFrame(tMs: ms))- }- }- }- .frame(width: scene.width, height: scene.height)- // The desktop spans the card; the stage sits centred in it.- .frame(maxWidth: .infinity)- .background {- LinearGradient(colors: [PreviewColors.wallpaperTop, PreviewColors.wallpaperBottom],- startPoint: .top, endPoint: .bottom)- }- .onAppear {- origin = Date()- onScreen = true- }- .onDisappear { onScreen = false }- }-- @MainActor static let scene = appDriverPreview()-}--/// One frame of the miniature, on its stage (points, origin top left):-/// the back window, the agent cursor working in it, the front window over-/// both, then the user's pointer.-struct DriverPreviewCanvas: View {- let scene: AppDriverPreview- let frame: AppDriverFrame-- var body: some View {- ZStack(alignment: .topLeading) {- Color.clear.frame(width: scene.width, height: scene.height)- MiniWindow(window: scene.back) {- ForEach(Array(scene.checkboxes.enumerated()), id: \.offset) { i, box in- MiniCheckbox(tick: i < frame.checked.count ? frame.checked[i] : 0)- .frame(width: box.width, height: box.height)- .offset(x: box.x - scene.back.frame.x, y: box.y - scene.back.frame.y)- }- ForEach(Array(scene.labels.enumerated()), id: \.offset) { _, bar in- MiniBar(rect: bar, origin: scene.back.frame)- }- }- AgentCursor(scene: scene, frame: frame)- MiniWindow(window: scene.front) {- if Int(scene.selectedLine) < scene.lines.count, frame.selection > 0 {- let line = scene.lines[Int(scene.selectedLine)]- RoundedRectangle(cornerRadius: 1.5)- .fill(Color.accentColor.opacity(0.3))- .frame(width: line.width * frame.selection, height: 8)- .offset(x: line.x - scene.front.frame.x, y: line.y + line.height / 2 - 4 - scene.front.frame.y)- }- ForEach(Array(scene.lines.enumerated()), id: \.offset) { _, bar in- MiniBar(rect: bar, origin: scene.front.frame)- }- }- PreviewPointer(points: scene.pointer)- .scaleEffect(frame.pressed ? 0.85 : 1, anchor: .topLeading)- .offset(x: frame.pointer.x, y: frame.pointer.y)- }- .frame(width: scene.width, height: scene.height, alignment: .topLeading)- .clipped()- .accessibilityHidden(true)- }-}--/// A plain window: rounded, hairline edge, soft shadow, a title bar with the-/// three window buttons; `content` is laid out in the window's own points.-struct MiniWindow<Content: View>: View {- let window: AppPreviewWindow- @ViewBuilder let content: () -> Content-- var body: some View {- let f = window.frame- ZStack(alignment: .topLeading) {- RoundedRectangle(cornerRadius: window.radius, style: .continuous)- .fill(Color(nsColor: .windowBackgroundColor))- .shadow(color: .black.opacity(0.18), radius: 4, y: 2)- Rectangle()- .fill(Color(nsColor: .separatorColor).opacity(0.5))- .frame(height: 0.5)- .offset(y: window.titleBar)- HStack(spacing: 2.5) {- ForEach(0..<3, id: \.self) { _ in- Circle().fill(Color.secondary.opacity(0.35)).frame(width: 3.6, height: 3.6)- }- }- .offset(x: 5, y: (window.titleBar - 3.6) / 2)- content()- RoundedRectangle(cornerRadius: window.radius, style: .continuous)- .strokeBorder(Color(nsColor: .separatorColor), lineWidth: 0.5)- }- .frame(width: f.width, height: f.height, alignment: .topLeading)- .clipShape(.rect(cornerRadius: window.radius, style: .continuous))- .offset(x: f.x, y: f.y)- }-}--/// A placeholder text bar.-struct MiniBar: View {- let rect: AppLogicalRect- let origin: AppLogicalRect-- var body: some View {- Capsule()- .fill(Color.secondary.opacity(0.28))- .frame(width: rect.width, height: rect.height)- .offset(x: rect.x - origin.x, y: rect.y - origin.y)- }-}--/// A checkbox whose tick fades and fills in with `tick` (0 to 1).-private struct MiniCheckbox: View {- let tick: Double-- var body: some View {- ZStack {- RoundedRectangle(cornerRadius: 2)- .strokeBorder(Color.secondary.opacity(0.6), lineWidth: 0.75)- RoundedRectangle(cornerRadius: 2)- .fill(Color.accentColor)- .opacity(tick)- Path { p in- p.move(to: CGPoint(x: 2, y: 4.2))- p.addLine(to: CGPoint(x: 3.5, y: 5.7))- p.addLine(to: CGPoint(x: 6.2, y: 2.4))- }- .trim(from: 0, to: tick)- .stroke(.white, style: StrokeStyle(lineWidth: 1.1, lineCap: .round, lineJoin: .round))- }- }-}--/// The cua-driver agent cursor: the driver theme's arrow in its fill with a-/// white edge and a soft glow of the fill, and its click rays.-private struct AgentCursor: View {- let scene: AppDriverPreview- let frame: AppDriverFrame-- var body: some View {- let fill = Self.color(scene.agentFill)- let shape = PolygonShape(points: scene.agentPointer)- // The outline's tip is at the origin; it spreads right and down.- let box = CGSize(width: 16, height: 16)- ZStack(alignment: .topLeading) {- if frame.ripple > 0 {- Path { p in- for r in scene.agentRays {- p.move(to: CGPoint(x: r.from.x, y: r.from.y))- p.addLine(to: CGPoint(x: r.to.x, y: r.to.y))- }- }- .stroke(fill, style: StrokeStyle(lineWidth: 1.2, lineCap: .round))- .scaleEffect(1 + 0.4 * frame.ripple, anchor: .topLeading)- .opacity(1 - frame.ripple)- }- ZStack(alignment: .topLeading) {- shape.stroke(.white, style: StrokeStyle(lineWidth: 1.4, lineJoin: .round))- shape.fill(fill)- }- .frame(width: box.width, height: box.height, alignment: .topLeading)- .shadow(color: fill.opacity(0.7), radius: 2.5)- .scaleEffect(frame.agentPressed ? 0.85 : 1, anchor: .topLeading)- }- .frame(width: box.width, height: box.height, alignment: .topLeading)- .offset(x: frame.agent.x, y: frame.agent.y)- }-- /// `#RRGGBB`.- static func color(_ hex: String) -> Color {- let v = UInt32(hex.trimmingCharacters(in: CharacterSet(charactersIn: "#")), radix: 16) ?? 0x5EC0E8- return Color(.sRGB, red: Double((v >> 16) & 0xFF) / 255, green: Double((v >> 8) & 0xFF) / 255,- blue: Double(v & 0xFF) / 255)- }-}diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/Marks.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/Marks.swiftnew file mode 100644index 0000000000..08e804cd86--- /dev/null+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/Marks.swift@@ -0,0 +1,26 @@+// SPDX-License-Identifier: FSL-1.1-MIT+// Copyright (c) 2026 Cua AI, Inc.++import AppKit+import Foundation++/// The Cua key: the app icon's keycap with the Cua mark, on its own+/// (apps/cua-spaces-macos/scripts/dmg-art/key.html). The icon of Cua's own+/// notifications, in place of a colored tile; unread stays with the text.+public enum CuaKey {+ public static let image: NSImage? = {+ guard let url = url else { return nil }+ return NSImage(contentsOf: url)+ }()++ /// The key's PNG in the module's resources.+ public static var url: URL? { ModuleResources.url(forResource: "cua-key", withExtension: "png") }+}++/// The stacked Cua mark (generated by apps/cua-spaces/scripts/icons).+public enum StackMark {+ public static let image: NSImage? = {+ guard let url = ModuleResources.url(forResource: "stack-mark", withExtension: "svg") else { return nil }+ return NSImage(contentsOf: url)+ }()+}diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/OnboardingView.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/OnboardingView.swiftdeleted file mode 100644index add2c3b459..0000000000--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/OnboardingView.swift+++ /dev/null@@ -1,714 +0,0 @@-// SPDX-License-Identifier: FSL-1.1-MIT-// Copyright (c) 2026 Cua AI, Inc.--import AppKit-import CuaSDK-import CuaSpacesFFI-import SwiftUI--/// First run, laid out like the Tauri app's: Welcome centred (the stacked-/// Cua mark, title, one line, Get started), every other page in two columns-/// (title and one line on the left; the details card on the right). The-/// buttons sit in the window's bottom corners like macOS Setup Assistant:-/// Back bottom-left, Skip then the primary action bottom-right (the primary-/// in the corner), page dots centred between them. Done adds the example-/// prompts under both columns, scrolling slowly. Pages, copy, cards,-/// which buttons show and the answers are the core's (`appOnboardingView`);-/// only the placement is this view's, the same as the Tauri app's. The-/// bundled `cua` installs only from its Command line page.-public struct OnboardingView: View {- @Bindable var onboarding: OnboardingModel- var onSignIn: (() async -> String?)?- /// Where the account's sign-in stands (the code while it waits, why it- /// failed).- var signInPhase: AppSignInPhase- /// Stops waiting for the browser.- var onCancelSignIn: (() -> Void)?- /// The page a waiting sign-in finishes on, to open it again.- var signInURL: URL?- /// The This machine page's selection (nil: the core's preselected one).- /// Choosing only selects; Continue moves on.- @State private var selectedMode: AppOnboardingMode?-- public init(onboarding: OnboardingModel, onSignIn: (() async -> String?)? = nil,- signInPhase: AppSignInPhase = .idle, onCancelSignIn: (() -> Void)? = nil, signInURL: URL? = nil) {- self.onboarding = onboarding- self.onSignIn = onSignIn- self.signInPhase = signInPhase- self.onCancelSignIn = onCancelSignIn- self.signInURL = signInURL- }-- private var signingIn: Bool {- switch signInPhase {- case .starting, .waiting: return true- default: return false- }- }-- public var body: some View {- let v = onboarding.view- VStack(spacing: 0) {- Spacer(minLength: 24)- if v.step == .welcome {- welcome(v)- } else {- HStack(alignment: .center, spacing: 56) {- VStack(alignment: .leading, spacing: 8) {- Text(v.title)- .font(.system(size: 22, weight: .semibold))- .fixedSize(horizontal: false, vertical: true)- Text(v.lede).foregroundStyle(.secondary)- if v.step == .signin {- teamsLine- }- }- // Done's to-do list takes the room it needs.- .frame(maxWidth: v.step == .done ? 250 : .infinity, alignment: .leading)- card(v)- .frame(maxWidth: .infinity)- }- .frame(maxWidth: 820)- .padding(.horizontal, 40)- if !v.prompts.isEmpty {- PromptTicker(prompts: v.prompts)- .frame(maxWidth: 820, alignment: .leading)- .padding(.horizontal, 40)- .padding(.top, 28)- }- }- Spacer(minLength: 24)- // The buttons always show: the pages give way first.- footer(v).layoutPriority(1)- }- .frame(minWidth: 720, minHeight: 520)- .task { await onboarding.planCli() }- // Done reads the machine again: a CLI from install.sh, a sign-in- // from the CLI and agents set up earlier all count.- .task(id: v.step) { if v.step == .done { await onboarding.refreshDone() } }- .task { if !onboarding.state.driveChecked { await onboarding.checkDrive() } }- }-- /// The Sign in page's Teams line: a link to the account app (app.cua.ai),- /// which administers teams.- @ViewBuilder private var teamsLine: some View {- let copy = onboarding.copy- HStack(spacing: 4) {- Text(copy.teams).foregroundStyle(.tertiary)- if let url = URL(string: copy.teamsUrl) {- Text("\u{00b7}").foregroundStyle(.tertiary)- Link(copy.teamsLink, destination: url)- .accessibilityIdentifier("onboarding-teams")- }- }- .font(.caption)- .padding(.top, 4)- }-- private func welcome(_ v: AppOnboardingView) -> some View {- VStack(spacing: 12) {- if v.showMark, let mark = StackMark.image {- Image(nsImage: mark)- .resizable()- .interpolation(.high)- .frame(width: 120, height: 120)- .accessibilityHidden(true)- .padding(.bottom, 8)- }- Text(v.title).font(.system(size: 22, weight: .semibold))- Text(v.lede).foregroundStyle(.secondary)- Button(v.primaryLabel) { onboarding.send(.start) }- .buttonStyle(.borderedProminent)- .controlSize(.large)- .keyboardShortcut(.defaultAction)- .padding(.top, 12)- if let usage = v.usage {- // The usage-data switch and its notice, first thing: nothing- // is sent before Welcome is left, nothing at all while off.- VStack(spacing: 6) {- Toggle(usage.label, isOn: Binding(get: { usage.on }, set: { onboarding.setShareUsage($0) }))- .toggleStyle(.switch)- .controlSize(.small)- .disabled(!usage.enabled)- .help(usage.help ?? "")- .accessibilityIdentifier("onboarding-share-usage")- if let notice = v.notice {- // It wraps, with its link inline.- noticeText(notice, v)- .font(.caption)- .foregroundStyle(.secondary)- .multilineTextAlignment(.center)- .fixedSize(horizontal: false, vertical: true)- .environment(\.openURL, OpenURLAction { url in- NSWorkspace.shared.open(url)- return .handled- })- .accessibilityIdentifier("onboarding-telemetry-notice")- }- }- .frame(maxWidth: 520)- .padding(.top, 20)- }- }- .onAppear { onboarding.shown() }- }-- /// The right column: the page's details in a bordered card (none when- /// the page has nothing to show, like the Tauri app).- @ViewBuilder private func card(_ v: AppOnboardingView) -> some View {- let body = cardContent(v)- if hasCard(v) {- body- .padding(.horizontal, 20)- .padding(.vertical, 18)- .frame(maxWidth: .infinity, alignment: .leading)- .background(Color(nsColor: .controlBackgroundColor), in: .rect(cornerRadius: 12))- .overlay(RoundedRectangle(cornerRadius: 12).strokeBorder(Color(nsColor: .separatorColor)))- } else {- Color.clear.frame(height: 1)- }- }-- private func hasCard(_ v: AppOnboardingView) -> Bool {- switch v.step {- case .signin: return onboarding.state.identity != nil || signInPhase != .idle- case .cli: return onboarding.state.cliError != nil- default: return true- }- }-- @ViewBuilder private func cardContent(_ v: AppOnboardingView) -> some View {- let copy = onboarding.copy- switch v.step {- case .signin:- if let identity = onboarding.state.identity {- Text(appOnboardingSignedInText(identity: identity)).foregroundStyle(.secondary)- } else {- signInStatus- }- case .agents:- agentsContent- case .drive:- if let card = v.drive {- DriveCardView(card: card, toggle: { onboarding.send(.driveToggled(on: $0)) },- openSettings: { onboarding.openURL($0) },- chooseStorage: { id in- onboarding.send(.storageChosen(choice: id == "s3" ? .s3 : id == "later" ? .later : .local))- },- editStorage: { id, value in- if let a = appStorageEdit(id: id, value: value) { onboarding.send(.driveStorage(action: a)) }- },- chooseStorageRow: { id, option in- if let a = appStorageChoose(id: id, option: option) {- Task { await onboarding.driveStorage(a) }- }- },- pressStorageRow: { id in- switch id {- case "s3-test": Task { await onboarding.driveStorage(.test) }- case "s3-manual": onboarding.send(.driveStorage(action: .showManual(on: true)))- case "s3-use-prompt": onboarding.send(.driveStorage(action: .showManual(on: false)))- default: break- }- },- reveal: { onboarding.reveal($0) })- // The agent prompt shows: watch for the bucket it sets up.- .task(id: onboarding.watchingStorage) {- while onboarding.watchingStorage, !Task.isCancelled {- try? await Task.sleep(for: .seconds(2))- await onboarding.loadDriveStorage()- }- }- // While macOS waits for the extension's approval, the- // daemon finishes the mount on its own: follow it.- .task(id: card.settingsUrl) {- while card.settingsUrl != nil, !Task.isCancelled {- try? await Task.sleep(for: .seconds(2))- await onboarding.checkDrive()- }- }- }- case .cli:- if let error = onboarding.state.cliError {- Text(error).foregroundStyle(.red).fixedSize(horizontal: false, vertical: true)- }- case .presentation:- VStack(spacing: 10) {- ForEach(v.presentations, id: \.id) { c in- PresentationCardView(card: c) { onboarding.pickPresentation(menuBar: c.menuBar) }- }- }- .onAppear {- if let now = onboarding.currentMenuBar?(), now != onboarding.state.menuBar {- onboarding.send(.presentationPicked(menuBar: now))- }- }- case .mode:- if onboarding.showingHostForm {- // A failed setup shows under the form, not inside its scroll.- VStack(alignment: .leading, spacing: 8) {- HostFormView(host: onboarding.host, buttons: false, showsFailure: false)- .frame(minHeight: 230, maxHeight: .infinity)- if let failure = onboarding.host.setupFailure {- HostSetupFailureView(failure: failure, retrying: onboarding.host.settingUp) {- Task { await onboarding.setUpHost() }- }- .padding(.horizontal, 20)- }- if let progress = onboarding.host.progress {- HostSetupProgressView(text: progress)- .padding(.horizontal, 20)- }- }- } else {- VStack(alignment: .leading, spacing: 10) {- ForEach(v.choices, id: \.label) { choice in- Button {- selectedMode = choice.mode- } label: {- Text(choice.label)- .fontWeight(.semibold)- .frame(maxWidth: .infinity, alignment: .leading)- .padding(.horizontal, 16)- .padding(.vertical, 14)- .contentShape(.rect)- }- .buttonStyle(.plain)- .background(Color(nsColor: .windowBackgroundColor), in: .rect(cornerRadius: 10))- .overlay(RoundedRectangle(cornerRadius: 10)- .strokeBorder(choice.mode == currentMode(v) ? Color.primary : Color(nsColor: .separatorColor),- lineWidth: choice.mode == currentMode(v) ? 2 : 1))- .accessibilityAddTraits(choice.mode == currentMode(v) ? .isSelected : [])- .accessibilityIdentifier(choice.mode == .host ? "onboarding-host" : "onboarding-client")- }- }- }- case .done:- VStack(alignment: .leading, spacing: 8) {- // What is set up, and a one-click fix for what is not (the- // core's to-do list, in the Home checklist's style).- VStack(alignment: .leading, spacing: 0) {- ForEach(Array(v.todos.enumerated()), id: \.element.title) { i, todo in- if i > 0 { Divider() }- OnboardingTodoRow(todo: todo) { Task { await onboarding.fixTodo(todo.id) } }- .padding(.vertical, 6)- }- }- Grid(alignment: .leading, horizontalSpacing: 16, verticalSpacing: 6) {- ForEach(v.summary, id: \.label) { f in- GridRow {- Text(f.label).foregroundStyle(.secondary)- Text(f.value).fixedSize(horizontal: false, vertical: true)- }- }- }- .padding(.top, 4)- if let other = onboarding.cliShadowedBy {- Text("Another \(Text("cua").monospaced()) at \(other) comes first on PATH.")- .font(.caption).foregroundStyle(.secondary)- .fixedSize(horizontal: false, vertical: true)- .accessibilityIdentifier("onboarding-cli-shadowed")- }- if !onboarding.hostPermissions.isEmpty {- Text(copy.permissionsTitle).font(.headline).padding(.top, 8)- PermissionRows(rows: onboarding.hostPermissions, openLabel: copy.openSettings)- }- if let login = v.launchAtLogin {- VStack(alignment: .leading, spacing: 4) {- Toggle(login.label, isOn: Binding(- get: { login.checked },- set: { onboarding.send(.launchAtLoginToggled(on: $0)) }))- .toggleStyle(.checkbox)- .accessibilityIdentifier("onboarding-launch-at-login")- Text(login.note).font(.caption).foregroundStyle(.secondary)- .fixedSize(horizontal: false, vertical: true)- }- .padding(.top, 12)- }- }- default:- EmptyView()- }- }-- /// A sign-in under way: the code to confirm, the browser page again and- /// Cancel; or why it failed (the primary button then says Try again).- @ViewBuilder private var signInStatus: some View {- switch signInPhase {- case .starting:- Text(onboarding.copy.signInWaiting).foregroundStyle(.secondary)- case let .waiting(userCode):- VStack(alignment: .leading, spacing: 10) {- Text(appOnboardingSignInCodeText(userCode: userCode))- .foregroundStyle(.secondary)- .textSelection(.enabled)- .accessibilityIdentifier("onboarding-signin-code")- HStack(spacing: 14) {- if let url = signInURL {- Button("Open the browser again") { NSWorkspace.shared.open(url) }- .buttonStyle(.link)- .accessibilityIdentifier("onboarding-signin-reopen")- }- if let onCancelSignIn {- Button("Cancel", action: onCancelSignIn)- .buttonStyle(.link)- .accessibilityIdentifier("onboarding-signin-cancel")- }- }- .font(.caption)- }- case let .failed(message):- Text(message)- .foregroundStyle(.red)- .fixedSize(horizontal: false, vertical: true)- .accessibilityIdentifier("onboarding-signin-error")- case .idle:- EmptyView()- }- }-- /// Detected coding agents: which to set up and what goes in.- @ViewBuilder private var agentsContent: some View {- let copy = onboarding.copy- VStack(alignment: .leading, spacing: 8) {- if onboarding.agentOutcomes != nil {- Text(copy.agentsDoneTitle).font(.headline)- ForEach(onboarding.agentSummaries, id: \.line) { s in- Text(s.line).lineLimit(1).help(([s.text] + s.failed).joined(separator: "\n"))- .foregroundStyle(s.failed.isEmpty ? Color.primary : Color.red)- }- } else if onboarding.agentStatuses == nil {- Text(copy.agentsLooking).foregroundStyle(.secondary)- } else if onboarding.installedAgents.isEmpty {- Text(copy.agentsNone).foregroundStyle(.secondary)- } else {- // Two columns, at most `agentsListHeight` tall (scrolling- // past it), so a long list never pushes Back and Continue- // off the window.- ViewThatFits(in: .vertical) {- agentGrid- ScrollView { agentGrid }- .scrollIndicators(.automatic)- }- .frame(maxHeight: Self.agentsListHeight, alignment: .top)- .accessibilityIdentifier("agents-list")- Divider()- HStack(spacing: 16) {- Toggle(copy.agentsSkills, isOn: $onboarding.agentSkills).toggleStyle(.checkbox)- Toggle(copy.agentsMcp, isOn: $onboarding.agentMcp).toggleStyle(.checkbox)- }- DriverCardView(title: copy.agentsDriver, imageLabel: copy.agentsDriverImage,- isOn: $onboarding.agentDriver)- .padding(.top, 4)- }- if let error = onboarding.agentsError {- Text(error).foregroundStyle(.red).fixedSize(horizontal: false, vertical: true)- }- }- .frame(maxWidth: .infinity, alignment: .leading)- .task { if onboarding.agentStatuses == nil { await onboarding.loadAgents() } }- }-- /// The agent list's tallest (six rows of two); longer lists scroll.- static let agentsListHeight: CGFloat = 132-- /// The detected agents' checkboxes, in two columns.- private var agentGrid: some View {- LazyVGrid(columns: [GridItem(.flexible(), alignment: .leading), GridItem(.flexible(), alignment: .leading)],- alignment: .leading, spacing: 6) {- ForEach(onboarding.installedAgents, id: \.id) { a in- Toggle(a.name, isOn: Binding(- get: { onboarding.agentSelection.contains(a.id) },- set: { on in- if on { onboarding.agentSelection.insert(a.id) } else { onboarding.agentSelection.remove(a.id) }- }))- .toggleStyle(.checkbox)- .fixedSize(horizontal: false, vertical: true)- .help([a.mcpConfig ?? a.skillsDir ?? "", a.error ?? ""].filter { !$0.isEmpty }.joined(separator: " \u{b7} "))- }- }- }-- /// The telemetry notice with its link inline at the end (it wraps).- private func noticeText(_ notice: String, _ v: AppOnboardingView) -> Text {- var s = AttributedString(notice)- s.foregroundColor = .secondary- if let label = v.noticeLinkLabel, let url = v.noticeLinkUrl.flatMap(URL.init(string:)) {- var link = AttributedString(label)- link.link = url- s += AttributedString(" ") + link- }- return Text(s)- }-- /// The bottom bar (Setup Assistant placement): Back in the bottom-left- /// corner; Skip, then the primary action in the bottom-right corner;- /// the page dots centred. Welcome keeps its centred Get started, so its- /// bar has only the dots.- private func footer(_ v: AppOnboardingView) -> some View {- ZStack {- dots(v)- if v.step != .welcome {- HStack(spacing: 12) {- back(v)- Spacer(minLength: 24)- trailing(v)- }- .controlSize(.large)- }- }- .frame(height: 32)- .padding(.horizontal, 24)- .padding(.bottom, 20)- }-- /// Bottom-left: Back (the host form's Back while it is open).- @ViewBuilder private func back(_ v: AppOnboardingView) -> some View {- if v.step == .mode, let form = onboarding.host.formView {- Button(form.backLabel) { onboarding.host.closeForm() }- .accessibilityIdentifier("onboarding-back")- } else if v.canBack {- Button(onboarding.copy.back) { onboarding.send(.back) }- .accessibilityIdentifier("onboarding-back")- }- }-- /// Bottom-right: Skip, then the primary action in the corner.- @ViewBuilder private func trailing(_ v: AppOnboardingView) -> some View {- HStack(spacing: 12) {- if v.step == .mode, let form = onboarding.host.formView {- Button(form.submitLabel) { Task { await onboarding.setUpHost() } }- .buttonStyle(.borderedProminent)- .keyboardShortcut(.defaultAction)- .disabled(!form.canSubmit)- .accessibilityIdentifier("host-setup")- } else {- if skipShows(v) {- Button(onboarding.copy.skip) { skip(v.step) }- .buttonStyle(.borderless)- .accessibilityIdentifier("onboarding-skip")- }- primary(v)- }- }- }-- @ViewBuilder private func primary(_ v: AppOnboardingView) -> some View {- let copy = onboarding.copy- switch v.step {- case .signin where onboarding.state.identity == nil:- if let onSignIn {- Button(signingIn ? copy.signInWaiting : signInPhase == .idle ? copy.signIn : copy.tryAgain) {- Task {- if let id = await onSignIn() { onboarding.send(.signedIn(identity: id)) }- }- }- .buttonStyle(.borderedProminent).controlSize(.large).keyboardShortcut(.defaultAction)- .disabled(signingIn)- }- case .agents:- if onboarding.agentOutcomes != nil {- Button(copy.continueLabel) { onboarding.finishAgents() }- .buttonStyle(.borderedProminent).controlSize(.large).keyboardShortcut(.defaultAction)- } else if !onboarding.installedAgents.isEmpty {- Button(onboarding.agentsBusy ? copy.agentsSettingUp : copy.agentsSetUp) {- Task { await onboarding.setUpAgents() }- }- .buttonStyle(.borderedProminent).controlSize(.large).keyboardShortcut(.defaultAction)- .disabled(!onboarding.canSetUpAgents)- .accessibilityIdentifier("agents-setup")- }- case .mode:- Button(v.primaryLabel) { continueMode(v) }- .buttonStyle(.borderedProminent)- .controlSize(.large)- .keyboardShortcut(.defaultAction)- .accessibilityIdentifier("onboarding-continue")- case .drive:- Button(v.primaryLabel) { Task { await onboarding.continueDrive() } }- .buttonStyle(.borderedProminent)- .controlSize(.large)- .keyboardShortcut(.defaultAction)- .disabled(v.drive.map { !$0.canContinue } ?? false)- .accessibilityIdentifier("drive-continue")- default:- Button(v.primaryLabel) { advance(v.step) }- .buttonStyle(.borderedProminent)- .controlSize(.large)- .keyboardShortcut(.defaultAction)- .disabled(onboarding.state.cliInstalling)- }- }-- private func currentMode(_ v: AppOnboardingView) -> AppOnboardingMode {- selectedMode ?? v.preselectedMode- }-- /// Continue on This machine: the selected mode (host opens its form).- private func continueMode(_ v: AppOnboardingView) {- if currentMode(v) == .host { onboarding.host.openForm() } else { onboarding.send(.modeChosen(mode: .client)) }- }-- private func skipShows(_ v: AppOnboardingView) -> Bool {- switch v.step {- case .agents: return onboarding.agentOutcomes == nil- default: return v.canSkip- }- }-- private func skip(_ step: AppOnboardingStep) {- switch step {- case .cli: Task { await onboarding.finishCli(install: false) }- case .signin: onboarding.send(.signinDone)- case .agents: onboarding.finishAgents(skipped: true)- default: advance(step)- }- }-- private func advance(_ step: AppOnboardingStep) {- switch step {- case .welcome: onboarding.send(.start)- case .cli: Task { await onboarding.finishCli(install: true) }- case .signin: onboarding.send(.signinDone)- case .agents: onboarding.finishAgents(skipped: true)- case .presentation: onboarding.send(.presentationDone)- case .drive: Task { await onboarding.continueDrive() }- case .mode: continueMode(onboarding.view)- case .done: onboarding.finish()- }- }-- private func dots(_ v: AppOnboardingView) -> some View {- HStack(spacing: 8) {- ForEach(v.dots, id: \.label) { dot in- Circle()- .fill(dot.current ? Color.primary : Color.secondary.opacity(0.35))- .frame(width: 6, height: 6)- .help(dot.label)- }- }- .accessibilityElement(children: .ignore)- .accessibilityLabel("Step \((v.dots.firstIndex { $0.current } ?? 0) + 1) of \(v.dots.count)")- }-}--/// One line of Done's to-do list: a tick when set up, its name (with-/// "(optional)") and plain line, and its fix until done.-struct OnboardingTodoRow: View {- let todo: AppOnboardingTodo- let fix: () -> Void-- var body: some View {- HStack(spacing: 12) {- Image(systemName: todo.done ? "checkmark.circle.fill" : "circle")- .font(.title3)- .foregroundStyle(todo.done ? Color.accentColor : Color.secondary)- .accessibilityHidden(true)- VStack(alignment: .leading, spacing: 2) {- (Text(todo.title).fontWeight(.medium)- + Text(todo.optional && !todo.done ? " (optional)" : "").foregroundStyle(.secondary))- .foregroundStyle(todo.done ? .secondary : .primary)- Text(todo.note)- .font(.callout)- .foregroundStyle(.secondary)- .fixedSize(horizontal: false, vertical: true)- }- Spacer(minLength: 8)- if let action = todo.action {- Button(action, action: fix)- .fixedSize()- .accessibilityIdentifier("onboarding-fix-\(todo.title)")- }- }- .accessibilityElement(children: .contain)- .accessibilityValue(todo.done ? "Done" : "")- }-}--/// One "Where should Cua Spaces show up?" card, full width (the two are-/// stacked): the mode's animated miniature (`PresentationPreview`, the-/// core's scene and frames), wide and short, over its one-line title.-struct PresentationCardView: View {- let card: AppPresentationCard- var fixedMs: UInt32?- /// Overrides the system's Reduce Motion (tests).- var still: Bool?- let pick: () -> Void-- var body: some View {- Button(action: pick) {- VStack(spacing: 8) {- PresentationPreview(menuBar: card.menuBar, fixedMs: fixedMs, stillOverride: still)- .clipShape(.rect(cornerRadius: 6))- .accessibilityElement(children: .ignore)- .accessibilityLabel(card.imageLabel)- Text(card.title).font(.system(size: 12.5, weight: .medium))- }- .padding(8)- .frame(maxWidth: .infinity)- .contentShape(.rect)- }- .buttonStyle(.plain)- .background(Color(nsColor: .windowBackgroundColor), in: .rect(cornerRadius: 10))- .overlay(RoundedRectangle(cornerRadius: 10)- .strokeBorder(card.selected ? Color.accentColor : Color(nsColor: .separatorColor),- lineWidth: card.selected ? 2 : 1))- .accessibilityAddTraits(card.selected ? [.isButton, .isSelected] : .isButton)- .accessibilityIdentifier(card.id)- }-}--/// Done's example prompts (the core's): "Try asking your agent:" and a few-/// static lines. Each copies to the clipboard on click and says "Copied".-struct PromptTicker: View {- let prompts: [String]- @State private var copied: String?-- var body: some View {- VStack(alignment: .leading, spacing: 4) {- Text("Try asking your agent:")- .foregroundStyle(.secondary)- .padding(.bottom, 2)- ForEach(prompts, id: \.self) { text in- Button {- NSPasteboard.general.clearContents()- NSPasteboard.general.setString(text, forType: .string)- copied = text- Task {- try? await Task.sleep(for: .seconds(1.5))- if copied == text { copied = nil }- }- } label: {- HStack(spacing: 10) {- Text("\u{201C}\(text)\u{201D}")- .foregroundStyle(.secondary)- .lineLimit(1)- if copied == text { Text("Copied") }- }- .frame(maxWidth: .infinity, alignment: .leading)- .contentShape(.rect)- }- .buttonStyle(.plain)- .accessibilityHint("Copies this prompt")- }- }- }-}--/// The Cua key: the app icon's keycap with the stacked Cua mark, on its own-/// (apps/cua-spaces-macos/scripts/dmg-art/key.html). The icon of Cua's own-/// notifications, in place of a colored tile; unread stays with the text.-public enum CuaKey {- public static let image: NSImage? = {- guard let url = ModuleResources.url(forResource: "cua-key", withExtension: "png") else { return nil }- return NSImage(contentsOf: url)- }()-}--/// The stacked Cua mark (generated by apps/cua-spaces/scripts/icons).-public enum StackMark {- public static let image: NSImage? = {- guard let url = ModuleResources.url(forResource: "stack-mark", withExtension: "svg") else { return nil }- return NSImage(contentsOf: url)- }()-}diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/PresentationPreview.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/PresentationPreview.swiftdeleted file mode 100644index 3acad4c294..0000000000--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/PresentationPreview.swift+++ /dev/null@@ -1,368 +0,0 @@-// SPDX-License-Identifier: FSL-1.1-MIT-// Copyright (c) 2026 Cua AI, Inc.--import AppKit-import CuaSDK-import CuaSpacesFFI-import CuaSpacesNotchUI-import SwiftUI--/// A "Where should Cua Spaces show up?" card's animated miniature: the-/// notch opening into the Space tiles, or the menu bar icon's menu dropping-/// down. The scene and every frame are the core's-/// (`appPresentationPreview`, `appPresentationPreviewFrame`), so the Tauri-/// app plays the same beats; this view only draws them, with the notch's-/// own shapes, tab label and tiles.-///-/// It loops while it is on screen in the key window, and stops otherwise.-/// With Reduce Motion it is the core's still: the expanded state.-struct PresentationPreview: View {- let menuBar: Bool- /// A fixed moment in the loop (snapshots); nil plays it.- var fixedMs: UInt32?- /// Overrides the system's Reduce Motion (tests).- var stillOverride: Bool?- @Environment(\.accessibilityReduceMotion) private var reduceMotion- @Environment(\.onboardingMotionStill) private var motionStill- @Environment(\.appearsActive) private var appearsActive- @State private var onScreen = false- @State private var origin = Date()-- var body: some View {- let scene = Self.scene(menuBar)- Group {- if let fixedMs {- PresentationPreviewCanvas(scene: scene, frame: appPresentationPreviewFrame(menuBar: menuBar, tMs: fixedMs))- } else if stillOverride ?? (reduceMotion || motionStill) {- PresentationPreviewCanvas(scene: scene, frame: appPresentationPreviewStill(menuBar: menuBar))- } else {- TimelineView(.animation(minimumInterval: 1.0 / 30, paused: !onScreen || !appearsActive)) { context in- let elapsed = max(0, context.date.timeIntervalSince(origin)) * 1000- let ms = UInt32(elapsed.truncatingRemainder(dividingBy: Double(scene.loopMs)))- PresentationPreviewCanvas(scene: scene, frame: appPresentationPreviewFrame(menuBar: menuBar, tMs: ms))- }- }- }- .frame(width: scene.width, height: scene.height)- // The desktop and the menu bar span the card; the stage sits in- // them, centred under the notch or at the menu bar's trailing end.- .frame(maxWidth: .infinity, alignment: menuBar ? .trailing : .center)- .background(alignment: .top) {- ZStack(alignment: .top) {- LinearGradient(colors: [PreviewColors.wallpaperTop, PreviewColors.wallpaperBottom],- startPoint: .top, endPoint: .bottom)- Rectangle().fill(PreviewColors.menuBar).frame(height: scene.menuBarHeight)- }- }- // The loop starts when the card appears, not when the view is built:- // the preview opens on its first frame however long the page took to- // lay out.- .onAppear {- origin = Date()- onScreen = true- }- .onDisappear { onScreen = false }- }-- @MainActor private static var scenes: [Bool: AppPresentationPreview] = [:]-- @MainActor static func scene(_ menuBar: Bool) -> AppPresentationPreview {- if let hit = scenes[menuBar] { return hit }- let s = appPresentationPreview(menuBar: menuBar)- scenes[menuBar] = s- return s- }-}--/// One frame of a miniature, on its stage (points, origin top left).-struct PresentationPreviewCanvas: View {- let scene: AppPresentationPreview- let frame: AppPreviewFrame-- var body: some View {- ZStack(alignment: .topLeading) {- Color.clear.frame(width: scene.width, height: scene.height)- if let n = scene.notch { NotchMiniature(scene: scene, notch: n, frame: frame) }- if let m = scene.menu { MenuMiniature(scene: scene, menu: m, frame: frame) }- PreviewPointer(points: scene.pointer)- .scaleEffect(frame.pressed ? 0.85 : 1, anchor: .topLeading)- .offset(x: frame.pointer.x, y: frame.pointer.y)- }- .frame(width: scene.width, height: scene.height, alignment: .topLeading)- .clipped()- .accessibilityHidden(true)- }-}--extension EnvironmentValues {- /// Holds onboarding's looping miniatures (and Done's prompt ticker) on- /// their Reduce Motion still whatever the system setting. Snapshots set- /// it: a playing loop's frame depends on the wall clock and on whether- /// the offscreen window counts as active, so a page snapshot otherwise- /// catches a different beat from run to run.- var onboardingMotionStill: Bool {- get { self[OnboardingMotionStillKey.self] }- set { self[OnboardingMotionStillKey.self] = newValue }- }-}--/// `onboardingMotionStill`'s key, written out rather than with `@Entry`:-/// that macro's plugin ships with Xcode only, and the package also builds-/// with just the Command Line Tools (`scripts/test.sh`).-private struct OnboardingMotionStillKey: EnvironmentKey {- static let defaultValue = false-}--/// The miniature's desktop colours (the Tauri app's `--ob-preview-*`).-enum PreviewColors {- static let wallpaperTop = dynamic(light: 0xDFE6EF, dark: 0x2A3240)- static let wallpaperBottom = dynamic(light: 0xC6D0DD, dark: 0x1B212B)- static let menuBar = Color(nsColor: NSColor(name: nil) { a in- a.bestMatch(from: [.darkAqua]) == .darkAqua ? NSColor(white: 0, alpha: 0.28) : NSColor(white: 1, alpha: 0.55)- })-- static func dynamic(light: UInt32, dark: UInt32) -> Color {- func rgb(_ v: UInt32) -> NSColor {- NSColor(srgbRed: CGFloat((v >> 16) & 0xFF) / 255, green: CGFloat((v >> 8) & 0xFF) / 255,- blue: CGFloat(v & 0xFF) / 255, alpha: 1)- }- return Color(nsColor: NSColor(name: nil) { a in a.bestMatch(from: [.darkAqua]) == .darkAqua ? rgb(dark) : rgb(light) })- }-}--/// The standard arrow pointer from the core's outline: black, white edge.-struct PreviewPointer: View {- let points: [AppPreviewPoint]-- var body: some View {- let shape = PolygonShape(points: points)- ZStack(alignment: .topLeading) {- shape.stroke(.white, style: StrokeStyle(lineWidth: 1.6, lineJoin: .round))- shape.fill(.black)- }- .frame(width: 12, height: 16, alignment: .topLeading)- .shadow(color: .black.opacity(0.25), radius: 1, y: 0.5)- }-}--struct PolygonShape: Shape {- let points: [AppPreviewPoint]-- func path(in rect: CGRect) -> Path {- var p = Path()- guard let first = points.first else { return p }- p.move(to: CGPoint(x: rect.minX + first.x, y: rect.minY + first.y))- for pt in points.dropFirst() { p.addLine(to: CGPoint(x: rect.minX + pt.x, y: rect.minY + pt.y)) }- p.closeSubpath()- return p- }-}--/// The notch card: the closed notch and its "N Spaces" tab morphing into-/// the open panel (the header row and the tiles, at real size, scaled).-struct NotchMiniature: View {- let scene: AppPresentationPreview- let notch: AppNotchPreview- let frame: AppPreviewFrame-- var body: some View {- let n = notch- let o = CGFloat(frame.open)- let lerp = { (a: Double, b: Double) in CGFloat(a + (b - a) * frame.open) }- let w = lerp(n.closed.width, n.open.width)- let h = lerp(n.closed.height, n.open.height)- let top = lerp(n.closedRadii.top, n.openRadii.top)- let bottom = lerp(n.closedRadii.bottom, n.openRadii.bottom)- let x = (CGFloat(scene.width) - w) / 2- let motion = NotchModel.motion- let grow = 1 + (motion.hoverScale - 1) * frame.hover- let c = CGFloat(frame.content)- let contentScale = CGFloat(motion.contentScale) + (1 - CGFloat(motion.contentScale)) * c- ZStack(alignment: .topLeading) {- ZStack(alignment: .topLeading) {- tab(n)- NotchShape(top: top, bottom: bottom)- .fill(.black)- .shadow(color: .black.opacity(0.45 * min(max(o, 0), 1)), radius: 14 * n.scale, y: 6 * n.scale)- .frame(width: w, height: h)- .offset(x: x)- }- .frame(width: scene.width, height: scene.height, alignment: .topLeading)- .scaleEffect(x: grow, y: 1, anchor: .top)- ZStack(alignment: .top) {- NotchMiniContent(notch: n)- .scaleEffect(n.scale, anchor: .topLeading)- .frame(width: n.open.width, height: n.open.height, alignment: .topLeading)- .scaleEffect(contentScale, anchor: .top)- .opacity(c)- }- .frame(width: w, height: h, alignment: .top)- .clipShape(NotchShape(top: top, bottom: bottom))- .offset(x: x)- }- .environment(\.colorScheme, .dark)- }-- /// The tab right of the notch; it tucks under the notch as it opens.- private func tab(_ n: AppNotchPreview) -> some View {- let tuck = 20 * n.scale- let shown = CGFloat(frame.tab)- let ear = n.closedRadii.top- return NotchTabShape(ear: ear, corner: 10 * n.scale).fill(.black)- .frame(width: n.tab.width + tuck, height: n.tab.height)- .overlay {- NotchTabLabel(tab: n.view.tab.data)- .scaleEffect(n.scale)- .offset(x: (tuck - ear - 6 * n.scale) / 2)- }- .offset(x: n.tab.x - tuck - (1 - shown) * n.tab.width)- .opacity(shown)- }-}--/// The open panel's content at real size: the search left of the camera-/// housing, the buttons right of it, then the tiles.-struct NotchMiniContent: View {- let notch: AppNotchPreview-- var body: some View {- let n = notch- let gap: CGFloat = 12- let zone = max(0, (n.contentWidth - n.notch.width / n.scale) / 2 - n.side - gap)- VStack(alignment: .leading, spacing: 0) {- if let h = n.view.header {- HStack(spacing: 0) {- HStack(spacing: 6) {- Image(systemName: "magnifyingglass")- .font(.system(size: 12, weight: .medium))- .foregroundStyle(.white.opacity(0.5))- Text(h.placeholder)- .font(.system(size: 13))- .foregroundStyle(.white.opacity(0.35))- }- .frame(width: zone, alignment: .leading)- Spacer(minLength: 0)- HStack(spacing: 2) {- Spacer(minLength: 0)- ForEach(h.buttons, id: \.symbol) { b in- NotchIconLabel(symbol: b.symbol, state: NotchInteractionState())- }- }- .frame(width: zone)- }- .frame(height: n.notchHeight)- }- Spacer().frame(height: 15)- HStack(alignment: .top, spacing: 12) {- ForEach(n.view.tiles, id: \.id) { tile in- // No live thumbnails here: the OS mark stands in.- TileView(tile: tile.data).overlay(alignment: .top) {- OsIconImage(id: tile.symbol, size: 26)- .foregroundStyle(.white.opacity(0.22))- .frame(height: 80)- }- }- }- Spacer(minLength: 0)- }- .padding(.horizontal, n.side)- .frame(width: n.contentWidth, height: n.contentHeight, alignment: .topLeading)- .environment(\.notchOsIcon, NotchModel.osIcon)- }-}--/// The menu bar card: the Cua Spaces icon and the clock at the menu bar's-/// right end, and the icon's menu (the core's items) when it drops down.-struct MenuMiniature: View {- let scene: AppPresentationPreview- let menu: AppMenuPreview- let frame: AppPreviewFrame-- var body: some View {- let m = menu- ZStack(alignment: .topLeading) {- if frame.active {- RoundedRectangle(cornerRadius: 3, style: .continuous)- .fill(Color.primary.opacity(0.14))- .frame(width: m.highlight.width, height: m.highlight.height)- .offset(x: m.highlight.x, y: m.highlight.y)- }- Group {- if let icon = Self.icon {- Image(nsImage: icon).resizable().renderingMode(.template)- } else {- Color.clear- }- }- .foregroundStyle(.primary)- .frame(width: m.icon.width, height: m.icon.height)- .offset(x: m.icon.x, y: m.icon.y)- Text(m.clock)- .font(.system(size: 6.5, weight: .medium))- .monospacedDigit()- .fixedSize()- .frame(width: 40, height: scene.menuBarHeight, alignment: .trailing)- .offset(x: m.clockRight - 40)- if frame.open > 0 {- menuBody(m)- .offset(x: m.menu.x, y: m.menu.y)- .opacity(frame.open)- }- }- }-- private func menuBody(_ m: AppMenuPreview) -> some View {- ZStack(alignment: .topLeading) {- RoundedRectangle(cornerRadius: m.radius, style: .continuous)- .fill(Color(nsColor: .windowBackgroundColor))- .overlay(RoundedRectangle(cornerRadius: m.radius, style: .continuous)- .strokeBorder(Color(nsColor: .separatorColor), lineWidth: 0.5))- .shadow(color: .black.opacity(0.18), radius: 6, y: 3)- .frame(width: m.menu.width, height: m.menu.height)- ForEach(Array(m.rows.enumerated()), id: \.offset) { i, row in- self.row(row, highlighted: frame.highlighted == UInt32(i), m: m)- .frame(width: row.frame.width, height: row.frame.height)- .offset(x: row.frame.x - m.menu.x, y: row.frame.y - m.menu.y)- }- }- .frame(width: m.menu.width, height: m.menu.height, alignment: .topLeading)- }-- @ViewBuilder private func row(_ row: AppMenuPreviewRow, highlighted: Bool, m: AppMenuPreview) -> some View {- if row.item.id == .separator {- Rectangle()- .fill(Color(nsColor: .separatorColor))- .frame(height: 0.5)- .padding(.horizontal, m.inset)- } else {- HStack(spacing: 4) {- Text(row.item.label)- Spacer(minLength: 0)- if let k = row.item.shortcut {- Text(k).foregroundStyle(highlighted ? AnyShapeStyle(.white) : AnyShapeStyle(.secondary))- }- }- .font(.system(size: m.fontSize))- .foregroundStyle(highlighted ? AnyShapeStyle(.white) : row.item.enabled ? AnyShapeStyle(.primary) : AnyShapeStyle(.secondary))- .lineLimit(1)- .padding(.horizontal, m.inset)- .frame(maxWidth: .infinity, maxHeight: .infinity)- .background {- if highlighted {- RoundedRectangle(cornerRadius: 3, style: .continuous)- .fill(Color.accentColor)- .padding(.horizontal, m.inset / 2)- }- }- }- }-- /// The menu bar icon (the tray template both apps ship).- static let icon: NSImage? = {- guard let url = ModuleResources.url(forResource: "tray-template@2x", withExtension: "png"),- let image = NSImage(contentsOf: url) else { return nil }- image.isTemplate = true- image.size = NSSize(width: 18, height: 18)- return image- }()-}diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/SettingsView.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/SettingsView.swiftindex 7abb4ddbe3..f7fc3a414a 100644--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/SettingsView.swift+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/SettingsView.swift@@ -162,3 +162,37 @@ struct SettingsView: View {}}}++/// A prompt to hand to a coding agent: a label, the text in a quiet+/// read-only box (selectable, wrapping) and Copy.+struct PromptBox: View {+ let label: String+ let text: String+ let copyLabel: String+ @State private var copied = false++ var body: some View {+ VStack(alignment: .leading, spacing: 6) {+ HStack {+ Text(label).foregroundStyle(.secondary)+ Spacer()+ Button(copyLabel) {+ NSPasteboard.general.clearContents()+ NSPasteboard.general.setString(text, forType: .string)+ copied = true+ }+ .controlSize(.small)+ .accessibilityIdentifier("storage-prompt-copy")+ }+ Text(text)+ .font(.callout)+ .textSelection(.enabled)+ .fixedSize(horizontal: false, vertical: true)+ .frame(maxWidth: .infinity, alignment: .leading)+ .padding(8)+ .background(Color(nsColor: .textBackgroundColor), in: .rect(cornerRadius: 6))+ .overlay(RoundedRectangle(cornerRadius: 6).strokeBorder(Color(nsColor: .separatorColor)))+ .accessibilityIdentifier("storage-prompt")+ }+ }+}diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/ThisMachineView.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/ThisMachineView.swiftindex f9e713e5dc..f6d58c0c1d 100644--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/ThisMachineView.swift+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/ThisMachineView.swift@@ -20,7 +20,7 @@ struct ThisMachineView: View {let panel = host.panelGroup {if host.form != nil {- HostFormView(host: host, buttons: true)+ HostFormView(host: host)} else {Form {if let intro = panel.intro {@@ -346,11 +346,6 @@ struct PermissionRows: View {/// Advanced): the core's fields in order.struct HostFormView: View {@Bindable var host: HostModel- /// Draws Back and the submit button (onboarding draws its own).- var buttons: Bool- /// Shows a failed setup (and Retry) inside the form; onboarding draws- /// it under the form instead.- var showsFailure = truevar body: some View {if let v = host.formView {@@ -368,26 +363,24 @@ struct HostFormView: View {.foregroundStyle(.secondary).accessibilityIdentifier("host-advanced")ForEach(v.fields.filter(\.advanced), id: \.id) { field($0) }- if showsFailure, let failure = host.setupFailure {+ if let failure = host.setupFailure {HostSetupFailureView(failure: failure, retrying: v.busy) {Task { await host.submit() }}}- if showsFailure, let progress = host.progress {+ if let progress = host.progress {HostSetupProgressView(text: progress)}}- if buttons {- Section {- HStack {- Spacer()- Button(v.backLabel) { host.closeForm() }- Button(v.submitLabel) { Task { await host.submit() } }- .buttonStyle(.borderedProminent)- .keyboardShortcut(.defaultAction)- .disabled(!v.canSubmit)- .accessibilityIdentifier("host-setup")- }+ Section {+ HStack {+ Spacer()+ Button(v.backLabel) { host.closeForm() }+ Button(v.submitLabel) { Task { await host.submit() } }+ .buttonStyle(.borderedProminent)+ .keyboardShortcut(.defaultAction)+ .disabled(!v.canSubmit)+ .accessibilityIdentifier("host-setup")}}}diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/MainUIRoute.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/MainUIRoute.swiftindex 1cf8a08fef..1b21cfdd0c 100644--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/MainUIRoute.swift+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/MainUIRoute.swift@@ -25,6 +25,9 @@ public enum MainUIRoute: Equatable, Sendable {/// A page path as given (`/machines?join=<CODE>` from a `cua://add` link).case path(String)+ /// The first run: the shared web onboarding.+ static let onboarding = MainUIRoute.path("/onboarding")+/// The page's path, query included.var webPath: String {switch self {@@ -94,6 +97,11 @@ struct MainUIRouter {/// closes that; turning it off does the reverse. Whatever opens the native/// main window while it is on (the Dock, the Window menu, a path not routed/// through `MainUIRouter`) gets the New UI window in its place.+///+/// The first run is the web UI's onboarding, with New UI on or off: until it+/// is done the native window never shows anything of its own, and whatever+/// opens it gets the New UI window at `/onboarding` in its place. Once done,+/// New UI off puts the native window back (`WebUIWindowController.closeShared`).@MainActorenum MainWindowSwitch {/// The native main window (`Window(id: "main")`), while it exists.@@ -112,6 +120,24 @@ enum MainWindowSwitch {onboarded: model.onboarding.completed)}+ /// The first run is due and the launch is ready: the web onboarding+ /// replaces the native window, whether or not New UI is on.+ static func opensFirstRun(ready: Bool, onboarded: Bool) -> Bool {+ ready && !onboarded+ }++ static func opensFirstRun(_ model: AppModel) -> Bool {+ opensFirstRun(ready: model.startup.isReady, onboarded: model.onboarding.completed)+ }++ /// The native window is up while the first run is due (and the launch is+ /// ready): the web onboarding opens in its frame and it closes.+ static func firstRunAppeared(_ window: NSWindow?, model: AppModel, web: ((NSRect?) -> Void)? = nil) {+ if let window { nativeWindow = window }+ guard opensFirstRun(model), let window = window ?? nativeWindow else { return }+ replace(window, model: model, web: web)+ }+/// The native window is showing the main UI (`MainWindow` appeared in/// it): with New UI on, New UI opens in its frame and it closes.static func nativeAppeared(_ window: NSWindow?, model: AppModel,@@ -156,7 +182,12 @@ enum MainWindowSwitch {}private static func show(_ model: AppModel, frame: NSRect?) {- WebUIWindowController.show(model: model, frame: frame)+ // The first run opens on its page; the rest is the app as it was.+ if !model.onboarding.completed {+ WebUIWindowController.show(model: model, at: .onboarding, frame: frame)+ } else {+ WebUIWindowController.show(model: model, frame: frame)+ }}/// New UI was turned off: the native window opens in its frame.diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIBridge+Pages.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIBridge+Pages.swiftindex 32143066a6..8a8c6194ab 100644--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIBridge+Pages.swift+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIBridge+Pages.swift@@ -169,6 +169,9 @@ extension WebUIBridge {// signal here, before the SDK's own check.guard let telemetry = model.telemetrySink, telemetry.status().enabled else { return NSNull() }let signals = raw.compactMap(Self.telemetrySignal)+ // The page's first run moved past Welcome: its usage notice was+ // on screen, so events may be sent from here (this one included).+ if raw.contains(where: Self.leftWelcome) { telemetry.acknowledgeNotice() }if !signals.isEmpty { telemetry.record(signals) }return NSNull()@@ -395,6 +398,18 @@ extension WebUIBridge {return NSNull()}+ /// The page's first run moved past Welcome (its usage notice was on+ /// screen): any page left or shown other than Welcome being shown, or+ /// "Set up later".+ static func leftWelcome(_ raw: Any) -> Bool {+ guard let s = raw as? [String: Any] else { return false }+ switch s["type"] as? String {+ case "onboarding-page": return !(s["page"] as? String == "welcome" && s["action"] as? String == "shown")+ case "step": return s["step"] as? String == "onboarding_skipped"+ default: return false+ }+ }+/// A usage event as the core's signal: known kinds with every field a/// fixed word, flag or duration (anything else is dropped whole, so a/// name or a path never reaches the telemetry).diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIBridge.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIBridge.swiftindex ca941dc6f0..a4d6e20a6a 100644--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIBridge.swift+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIBridge.swift@@ -66,6 +66,9 @@ final class WebUIBridge: NSObject, WKScriptMessageHandlerWithReply {static let methods = ["app.info","session.get", "session.signIn", "session.signOut",+ // The first run: the shared web onboarding asks whether it is due and+ // finishes it here, as the Electron shell's handlers do.+ "onboarding.get", "onboarding.complete","spaces.list", "spaces.open","spaces.createOptions", "spaces.create","spaces.setPower", "spaces.delete", "spaces.cancelCreate",@@ -147,6 +150,9 @@ final class WebUIBridge: NSObject, WKScriptMessageHandlerWithReply {var offeredPaths: Set<String> = []/// "Send file…"'s picker (a test sets its own).var pickFiles: @MainActor () -> [URL]? = WebUIBridge.openPanel+ /// The "<Space> is ready" notification of a create the onboarding+ /// started (a test sets its own).+ var notifySpaceReady: @MainActor (SpaceReadyNote) -> Void = { SpaceReadyNotifier.shared.post($0) }/// The pasteboard of the last drag onto the window (a test sets its own).var dragPasteboard: @MainActor () -> NSPasteboard = { NSPasteboard(name: .drag) }/// Origins allowed to call (the bundled UI, and the dev server in a@@ -246,6 +252,9 @@ final class WebUIBridge: NSObject, WKScriptMessageHandlerWithReply {await model.signOut()return session()+ case "onboarding.get": return onboarding()+ case "onboarding.complete": return try completeOnboarding(args)+case "spaces.list": return spaces()case "spaces.open":let id = try string(args, "id")@@ -406,9 +415,29 @@ final class WebUIBridge: NSObject, WKScriptMessageHandlerWithReply {// The page a waiting sign-in finishes on, to show and copy."signInUrl": model.signInURL?.absoluteString ?? NSNull(),"chrome": BridgeValue.encode(model.chrome),+ "onboarding": onboarding(),]}+ /// The first run's state (`onboarding.get`): due until it finishes.+ func onboarding() -> [String: Any] {+ ["completed": model.onboarding.completed, "mode": model.onboarding.mode == .host ? "host" : "client"]+ }++ /// `onboarding.complete {mode, launchAtLogin?}`: "Start using Cua Spaces".+ /// Saved to `onboarding.json`, Done's "Launch at login" applied, the usage+ /// notice counted as shown. With New UI off the page was only the first+ /// run's stand-in: its window gives way to the native main window.+ func completeOnboarding(_ args: [String: Any]) throws -> [String: Any] {+ guard let word = args["mode"] as? String, word == "client" || word == "host" else {+ throw Failure.badArgs("mode: client | host")+ }+ model.onboarding.finish(mode: word == "host" ? .host : .client, launchAtLogin: args["launchAtLogin"] as? Bool)+ model.telemetrySink?.acknowledgeNotice()+ if !model.settings.experiments.webUi { model.closeWebUI?() }+ return onboarding()+ }+func spaces() -> [String: Any] {["loaded": model.loaded,@@ -546,12 +575,16 @@ final class WebUIBridge: NSObject, WKScriptMessageHandlerWithReply {return out}- /// `spaces.create {config, pendingId, os?}`: the core's create- /// arguments (`wizard.createArgs`), run as the native sheet's Create- /// runs them (`AppModel.runCreate`: the pending row in the list and the- /// notch, the SDK's progress, Cancel through `spaces.cancelCreate`).- /// Progress goes to the page as `spaces.createProgress`; the answer is- /// the new Space, or `cancelled`.+ /// `spaces.create {config, pendingId, os?, notifyWhenReady?}`: the core's+ /// create arguments (`wizard.createArgs`), run as the native sheet's+ /// Create runs them (`AppModel.runCreate`: the pending row in the list+ /// and the notch, the SDK's progress, Cancel through+ /// `spaces.cancelCreate`). Progress goes to the page as+ /// `spaces.createProgress`; the answer is the new Space, or `cancelled`.+ /// The create belongs to the app, not to the window: it runs on when the+ /// window is closed, and `notifyWhenReady` (a create the onboarding+ /// started) posts "<Space> is ready" as a system notification when it+ /// succeeds, window or not.func create(_ args: [String: Any]) async throws -> Any {let pendingId = try string(args, "pendingId")guard appCreatesIsPending(id: pendingId) else { throw Failure.badArgs("pendingId: pending:<id>") }@@ -567,7 +600,12 @@ final class WebUIBridge: NSObject, WKScriptMessageHandlerWithReply {} catch where isCancelled(error) {throw Failure(code: "cancelled", message: "cancelled")}- if let space = model.spaces.first(where: { $0.id == id }) { return BridgeValue.encode(space) }+ let made = model.spaces.first(where: { $0.id == id })+ if args["notifyWhenReady"] as? Bool == true {+ let known = made.map(\.os).flatMap { $0 == .unknown ? nil : $0 } ?? os+ notifySpaceReady(SpaceReadyNote(spaceId: id, name: made?.name ?? createArgs.name ?? id, os: known))+ }+ if let space = made { return BridgeValue.encode(space) }return ["id": id, "name": createArgs.name ?? id, "os": BridgeValue.encode(os), "status": "running","detail": "", "lastUsedAt": Double(AppModel.nowMs())] as [String: Any]}@@ -952,7 +990,9 @@ final class WebUIBridge: NSObject, WKScriptMessageHandlerWithReply {self?.pruneStreams()}follow("keyvault.changed") { [model] in _ = (model.keyvault.overview, model.keyvault.busy, model.keyvault.dismissed) }- follow("session.changed") { [model] in _ = (model.identity, model.signIn, model.cloudConfigured) }+ follow("session.changed") { [model] in+ _ = (model.identity, model.signIn, model.cloudConfigured, model.onboarding.completed)+ }follow("settings.changed") { [model] in _ = model.settings }// These views are rewritten on every read, so the event goes out// only when what the page shows differs.diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUICapture.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUICapture.swiftindex abef00e359..78cd128b06 100644--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUICapture.swift+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUICapture.swift@@ -9,11 +9,16 @@ import WebKit/// (`<html data-bridge>`), saves the web view's own snapshot of each to/// `<dir>/<route>-<theme>.png` with a `report.json`, then quits. Window/// captures from outside the app miss WKWebView's content (it draws in-/// another process), so the screenshots in docs/webui come from here.+/// another process), so the screenshots in docs/webui come from here. With+/// `CUA_SPACES_OFFSCREEN=1` too, nothing shows on screen (`OffscreenRun`).extension WebUIWindowController {- static let captureRoutes = ["spaces", "machines", "agents", "keyvault", "notifications", "settings",+ static let captureRoutes = ["onboarding", "spaces", "machines", "agents", "keyvault", "notifications", "settings","settings/about", "settings/devices"]+ /// The base page routes resolve under: the window may have opened at+ /// another route (the first run, at `/onboarding`).+ var captureBase: URL { Self.devURL ?? WebUISchemeHandler.startURL }+static var captureDirectory: URL? {guard DevHooks.enabled, let dir = DevHooks.environment["CUA_SPACES_WEBUI_CAPTURE"], !dir.isEmpty else { return nil }return URL(fileURLWithPath: dir, isDirectory: true)@@ -29,7 +34,7 @@ extension WebUIWindowController {var page: [String: Any] = [:]// The first navigation can interrupt the initial load: try again.for _ in 0..<3 where !(page["bridge"] is String) {- webView.load(URLRequest(url: startURL.appendingPathComponent(route)))+ webView.load(URLRequest(url: Self.url(route, in: captureBase)))page = await settledPage()}let file = dir.appendingPathComponent("\(route.replacingOccurrences(of: "/", with: "-"))-\(theme).png")@@ -84,6 +89,8 @@ extension WebUIWindowController {if page["bridge"] is String, (page["text"] as? Int ?? 0) > 0 { break }}try? await Task.sleep(for: .milliseconds(700))+ // Where it landed: with the first run due, every page goes to /onboarding.+ if let path = try? await webView.evaluateJavaScript("location.pathname") as? String { last["path"] = path }return last}}diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIWindow.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIWindow.swiftindex fc35834705..e01303731b 100644--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIWindow.swift+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIWindow.swift@@ -32,6 +32,7 @@ public final class WebUIWindowController: NSWindowController, NSWindowDelegate,/// The traffic lights' width plus a gap, for `--titlebar-left-inset`.static let fallbackLeftInset: CGFloat = 78static let titlebarHeight: CGFloat = 48+ static let windowIdentifier = NSUserInterfaceItemIdentifier("cua-new-ui")/// Where the window's frame is saved (the defaults' `NSWindow Frame <name>`).static let frameName = "CuaSpacesWebUI"static let devServer = URL(string: "http://localhost:5174/")!@@ -67,15 +68,15 @@ public final class WebUIWindowController: NSWindowController, NSWindowDelegate,/// Opens the window (or brings it forward) at `route`. A drop on a/// notch tile is kept for the page, which asks for it by name/// (`spaces.droppedFiles`).- public static func show(model: AppModel, at route: MainUIRoute) {+ public static func show(model: AppModel, at route: MainUIRoute, frame: NSRect? = nil) {notchDrop = route.droppedguard shared != nil else {// A new window loads the page there: a route asked for while it// starts could reach it before its router listens, and be lost.- show(model: model, frame: nil, startRoute: route.webPath)+ show(model: model, frame: frame, startRoute: route.webPath)return}- show(model: model)+ show(model: model, frame: frame)shared?.bridge.requestRoute(route.webPath)}@@ -158,6 +159,8 @@ public final class WebUIWindowController: NSWindowController, NSWindowDelegate,styleMask: [.titled, .closable, .miniaturizable, .resizable, .fullSizeContentView],backing: .buffered, defer: true)window.title = "Cua Spaces"+ // What the UI tests find this window by (the native one has none).+ window.identifier = Self.windowIdentifierwindow.titleVisibility = .hiddenwindow.titlebarAppearsTransparent = truewindow.isReleasedWhenClosed = false@@ -168,6 +171,8 @@ public final class WebUIWindowController: NSWindowController, NSWindowDelegate,// Where it was last (size and place), else centred.if !window.setFrameUsingName(Self.frameName) { window.center() }window.setFrameAutosaveName(Self.frameName)+ // An offscreen run (`OffscreenRun`): invisible, though it paints.+ OffscreenRun.hide(window)super.init(window: window)window.delegate = selfwebView.navigationDelegate = self@@ -201,6 +206,8 @@ public final class WebUIWindowController: NSWindowController, NSWindowDelegate,shown = trueapplyInset()}+ // Offscreen: in (so the page paints for `takeSnapshot`), never key, never active.+ if OffscreenRun.isOn { return window.orderFrontRegardless() }NSApp.activate()window.makeKeyAndOrderFront(nil)}@@ -263,7 +270,7 @@ public final class WebUIWindowController: NSWindowController, NSWindowDelegate,decisionHandler: @escaping @MainActor @Sendable (WKNavigationActionPolicy) -> Void) {guard let url = action.request.url else { return decisionHandler(.cancel) }if isAppURL(url) || url.scheme == "about" { return decisionHandler(.allow) }- if action.navigationType == .linkActivated, ["http", "https", "mailto"].contains(url.scheme ?? "") {+ if action.navigationType == .linkActivated, Self.opensOutside(url) {NSWorkspace.shared.open(url)}decisionHandler(.cancel)@@ -271,12 +278,19 @@ public final class WebUIWindowController: NSWindowController, NSWindowDelegate,public func webView(_ webView: WKWebView, createWebViewWith configuration: WKWebViewConfiguration,for action: WKNavigationAction, windowFeatures: WKWindowFeatures) -> WKWebView? {- if let url = action.request.url, ["http", "https", "mailto"].contains(url.scheme ?? "") {+ if let url = action.request.url, Self.opensOutside(url) {NSWorkspace.shared.open(url)}return nil}+ /// What the page may hand to the system (`window.open`, a link): web+ /// pages and mail, and System Settings' panes (`x-apple.systempreferences:`,+ /// as Electron's `openExternal` allows).+ static func opensOutside(_ url: URL) -> Bool {+ ["http", "https", "mailto", "x-apple.systempreferences"].contains(url.scheme ?? "")+ }+func isAppURL(_ url: URL) -> Bool {if url.scheme == WebUISchemeHandler.scheme { return url.host == WebUISchemeHandler.host }guard let dev = Self.devURL else { return false }diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/BridgeContractTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/BridgeContractTests.swiftindex 01718aa8e9..bb9289872a 100644--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/BridgeContractTests.swift+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/BridgeContractTests.swift@@ -257,6 +257,8 @@ struct BridgeContractTests {/// must be in `cases`).static let skipped: [String: String] = ["session.signIn": "starts a device sign-in that waits for the browser",+ "onboarding.get": "FirstRunTests covers it (answers depend on the state file)",+ "onboarding.complete": "FirstRunTests covers it (writes the state file, hands the window over)","spaces.create": "runs a create to the end; CreateOptionsTests and ViewModelTests cover it","spaces.delete": "removes the fixture Space the later cases use","spaces.add": "needs a running cua-spacesd at the address",diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/DriveTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/DriveTests.swiftindex 37e3dc1c3b..13ff6778dc 100644--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/DriveTests.swift+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/DriveTests.swift@@ -116,101 +116,10 @@ final class FakeDriveTools: AgentsToolRunning, @unchecked Sendable {struct DriveTests {init() { _ = NSApplication.shared }- func atDrive(_ tools: AgentsToolRunning?) -> OnboardingModel {- let o = OnboardingModel(statePath: nil)- o.driveTools = tools- // The Volume page shows with the Cua Volume experiment on.- o.send(.experimentsLoaded(experiments: AppExperiments(cuaVolume: true, yourCloud: false, sharing: false, webUi: false)))- o.send(.start)- o.send(.signinDone)- o.send(.agentsDone(configured: []))- o.send(.presentationDone)- return o- }-- @Test func theFirstRunCheckboxIsOffAndMountsOnContinue() async throws {- let tools = FakeDriveTools()- let o = atDrive(tools)- await o.checkDrive()- var card = try #require(o.view.drive)- #expect(card.label == "Add Cua Volume to Finder")- #expect(!card.checked && card.enabled, "off by default")- // Unticked: Continue mounts nothing.- await o.continueDrive()- #expect(o.view.step == .mode)- #expect(!tools.names().contains("volume_mount"))-- let p = atDrive(tools)- await p.checkDrive()- p.send(.driveToggled(on: true))- await p.continueDrive()- #expect(tools.names().contains("volume_mount"))- // macOS asks for the extension first: the page stays and says so.- #expect(p.view.step == .drive)- card = try #require(p.view.drive)- #expect(card.settingsLabel == "Open System Settings")- var opened: [URL] = []- p.openURL = { opened.append($0) }- p.openURL(URL(string: card.settingsUrl!)!)- #expect(opened.count == 1)- // Approved: the daemon finishes on its own; Continue moves on.- tools.mount = "mounted"- await p.checkDrive()- await p.continueDrive()- #expect(p.view.step == .mode)- p.send(.modeChosen(mode: .client))- #expect(p.view.todos.first { $0.id == .volume }?.done == true, "Done shows Cua Volume on")- }-- @Test func theFirstRunSavesYourBucketThenMounts() async throws {- let tools = FakeDriveTools()- let o = atDrive(tools)- await o.checkDrive()- var card = try #require(o.view.drive)- #expect(card.storageOptions.map(\.label) == ["This Mac", "Your S3 bucket", "Set up later"])- #expect(card.storageOptions.first(where: \.active)?.id == "local", "this Mac by default")- o.send(.storageChosen(choice: .s3))- o.send(.driveStorage(action: .showManual(on: true)))- for (id, value) in [("s3-endpoint", "http://127.0.0.1:9000"), ("s3-bucket", "cua-volume"),- ("s3-access-key", "maya-drive"), ("s3-secret", "fixture-secret")] {- o.send(.driveStorage(action: try #require(appStorageEdit(id: id, value: value))))- }- await o.driveStorage(.test)- let test = try #require(tools.calls.last { $0.0 == "volume_storage_set" })- #expect(test.1["dry_run"] as? Bool == true)- card = try #require(o.view.drive)- #expect(card.storageRows.first { $0.id == "s3-test" }?.value == "Connected, versioning on")- o.send(.driveToggled(on: true))- await o.continueDrive()- let save = try #require(tools.calls.last { $0.0 == "volume_storage_set" })- #expect(save.1["dry_run"] as? Bool == false && save.1["secret_access_key"] as? String == "fixture-secret")- #expect(tools.names().last == "volume_mount", "saved, then mounted")- #expect(o.view.step == .drive, "the fake asks for approval")- #expect(o.state.storage.form.secretAccessKey.isEmpty)- }-- @Test func theAgentPromptNoticesTheBucketAndConnects() async throws {+ /// Settings notices a bucket the agent connects (`cua volume config set`+ /// and `set-keys`) and shows it connected.+ @Test func settingsNoticesTheBucketAnAgentConnects() async throws {let tools = FakeDriveTools()- let o = atDrive(tools)- await o.checkDrive()- #expect(o.view.drive?.storedIn?.hasPrefix("Stored in ") == true)- o.send(.storageChosen(choice: .s3))- #expect(o.watchingStorage, "the prompt shows")- #expect(o.view.drive?.canContinue == false)- await o.loadDriveStorage()- #expect(!tools.names().contains("volume_storage_set"), "nothing yet")- // The agent ran `cua volume config set` and `set-keys`.- tools.backend = "s3"- tools.hasKeys = true- await o.loadDriveStorage()- let adopt = try #require(tools.calls.last { $0.0 == "volume_storage_set" })- #expect(adopt.1["dry_run"] as? Bool == false && adopt.1["access_key_id"] as? String == nil)- let card = try #require(o.view.drive)- #expect(card.storageRows.contains { $0.value == "Connected, versioning on" })- #expect(card.canContinue)- // Settings notices the same way.- tools.backend = "fs"- tools.hasKeys = falselet st = StorageModel(tools: tools)await st.load()await st.choose("backend", "s3")@@ -221,30 +130,6 @@ struct DriveTests {#expect(st.section.rows.contains { $0.value == "Connected, versioning on" })}- @Test func setUpLaterSkipsStorage() async throws {- let tools = FakeDriveTools()- let o = atDrive(tools)- await o.checkDrive()- o.send(.storageChosen(choice: .later))- #expect(o.view.drive?.storageNote != nil)- await o.continueDrive()- #expect(o.view.step == .mode)- #expect(!tools.names().contains("volume_storage_set"))- }-- @Test func withoutTheDrivesToolsThePageIsHonest() async throws {- let tools = FakeDriveTools()- tools.missing = true- let o = atDrive(tools)- await o.checkDrive()- let card = try #require(o.view.drive)- #expect(!card.enabled && !card.checked)- #expect(card.note == "Not available on this Mac yet")- await o.continueDrive()- #expect(o.view.step == .mode)- #expect(!tools.names().contains("volume_mount"))- }-@Test func storageSendsKeysOnlyToTheToolAndShowsTheVolume() async throws {let tools = FakeDriveTools()let s = StorageModel(tools: tools)@@ -341,33 +226,6 @@ struct DriveTests {@Test func snapshots() async throws {let snap = SnapshotTests()let tools = FakeDriveTools()- // The first run's card at beats of its loop, and the Reduce Motion- // still, ticked.- let o = atDrive(tools)- await o.checkDrive()- let card = try #require(o.view.drive)- let size = CGSize(width: 380, height: 180)- for (ms, name) in [(UInt32(400), "mounting"), (1200, "flying"), (3000, "arrived")] {- try snap.assertSnapshot(DriveCardView(card: card, toggle: { _ in }, fixedMs: ms).padding(12),- "onboarding-drive-\(name)", size: size)- }- o.send(.driveToggled(on: true))- try snap.assertSnapshot(DriveCardView(card: o.view.drive!, toggle: { _ in }, still: true).padding(12),- "onboarding-drive-still-on", size: size)- // Your S3 bucket: the agent prompt first.- o.send(.storageChosen(choice: .s3))- try snap.assertSnapshot(DriveCardView(card: o.view.drive!, toggle: { _ in }, still: true).padding(12),- "onboarding-drive-prompt", size: CGSize(width: 380, height: 420))- o.send(.driveStorage(action: .showManual(on: true)))- // Your S3 bucket, entered manually and tested.- o.send(.driveStorage(action: .showManual(on: true)))- for (id, value) in [("s3-endpoint", "http://127.0.0.1:9000"), ("s3-bucket", "cua-volume"),- ("s3-access-key", "maya-drive"), ("s3-secret", "fixture-secret")] {- o.send(.driveStorage(action: try #require(appStorageEdit(id: id, value: value))))- }- await o.driveStorage(.test)- try snap.assertSnapshot(DriveCardView(card: o.view.drive!, toggle: { _ in }, still: true).padding(12),- "onboarding-drive-bucket", size: CGSize(width: 380, height: 420))// Settings with the Storage section (S3, the volume mounted).tools.mount = "mounted"tools.enabled = truediff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/FirstRunTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/FirstRunTests.swiftnew file mode 100644index 0000000000..f0dc403a16--- /dev/null+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/FirstRunTests.swift@@ -0,0 +1,281 @@+// SPDX-License-Identifier: FSL-1.1-MIT+// Copyright (c) 2026 Cua AI, Inc.++import AppKit+import CuaSpacesFFI+@testable import CuaSpacesMacKit+import Foundation+import Testing++/// The first run on the Mac is the shared web onboarding: what the bridge+/// answers it (`onboarding.get`, `onboarding.complete`), the Space it+/// creates ("<Space> is ready", `notifyWhenReady`) and the usage notice it+/// shows.+@MainActor+@Suite("First run (web onboarding)", .serialized)+struct FirstRunTests {+ init() { _ = NSApplication.shared }++ func bridge(webUi: Bool = false, backend: SpacesBackend = FixtureSpacesBackend(),+ loginItem: LoginItemControlling? = nil) -> (WebUIBridge, AppModel, FixtureTelemetry, URL) {+ let dir = FileManager.default.temporaryDirectory.appendingPathComponent("cua-firstrun-\(UUID().uuidString)")+ let state = dir.appendingPathComponent("onboarding.json")+ let telemetry = FixtureTelemetry()+ let model = AppModel(backend: backend, keyvault: KeyvaultModel(client: nil),+ onboarding: OnboardingModel(statePath: state.path),+ settingsPath: dir.appendingPathComponent("settings.json").path, telemetry: telemetry,+ loginItem: loginItem)+ model.settings.experiments = AppExperiments(cuaVolume: false, yourCloud: false, sharing: true, webUi: webUi)+ let bridge = WebUIBridge(model: model, allowedOrigins: [])+ bridge.notifySpaceReady = { _ in }+ return (bridge, model, telemetry, state)+ }++ func yield() async {+ await withCheckedContinuation { k in DispatchQueue.main.async { k.resume() } }+ }++ // MARK: - The first run's window++ /// The first run is the web onboarding, with New UI on or off: once the+ /// launch is ready and until it is done, the native window gives way.+ @Test func theFirstRunIsTheWebOnboardingWhateverTheNewUISetting() {+ #expect(MainWindowSwitch.opensFirstRun(ready: true, onboarded: false))+ #expect(!MainWindowSwitch.opensFirstRun(ready: false, onboarded: false), "the launch screen waits")+ #expect(!MainWindowSwitch.opensFirstRun(ready: true, onboarded: true))+ #expect(MainUIRoute.onboarding.webPath == "/onboarding")+ }++ /// A window that is never shown (the replacement only reads its frame+ /// and closes it).+ func hiddenWindow() -> NSWindow {+ let w = NSWindow(contentRect: NSRect(x: 40, y: 40, width: 760, height: 480),+ styleMask: [.titled, .closable, .resizable], backing: .buffered, defer: true)+ w.isReleasedWhenClosed = false+ return w+ }++ /// First run, New UI on or off: the native window that appeared is+ /// replaced in its frame by the web window, never drawn.+ @Test func theNativeWindowOnAFirstRunIsReplacedInPlace() async {+ for webUi in [false, true] {+ let (_, model, _, _) = bridge(webUi: webUi)+ let w = hiddenWindow()+ let frame = w.frame+ var opened: [NSRect?] = []+ MainWindowSwitch.firstRunAppeared(w, model: model, web: { opened.append($0) })+ // Reported twice (its reader, its onAppear): replaced once.+ MainWindowSwitch.firstRunAppeared(nil, model: model, web: { opened.append($0) })+ #expect(opened == [frame], "New UI \(webUi ? "on" : "off")")+ await yield()+ await yield()+ #expect(w.alphaValue == 1, "hidden before it draws, then back to normal")+ }+ }++ /// Once the first run is done the native window is left alone.+ @Test func theNativeWindowStaysOnceTheFirstRunIsDone() async {+ let (_, model, _, _) = bridge()+ model.onboarding.finish()+ let w = hiddenWindow()+ var opened = 0+ MainWindowSwitch.firstRunAppeared(w, model: model, web: { _ in opened += 1 })+ await yield()+ #expect(opened == 0 && w.alphaValue == 1)+ }++ // MARK: - onboarding.get, onboarding.complete++ @Test func theFirstRunIsDueUntilItFinishesAndPersists() async throws {+ let (bridge, model, _, state) = bridge()+ let due = try #require(try await bridge.handle("onboarding.get", [:]) as? [String: Any])+ #expect(due["completed"] as? Bool == false && due["mode"] as? String == "client")+ let session = try #require(try await bridge.handle("session.get", [:]) as? [String: Any])+ #expect((session["onboarding"] as? [String: Any])?["completed"] as? Bool == false)++ let done = try #require(try await bridge.handle("onboarding.complete", ["mode": "host"]) as? [String: Any])+ #expect(done["completed"] as? Bool == true && done["mode"] as? String == "host")+ #expect(model.onboarding.completed)+ #expect(try String(contentsOf: state, encoding: .utf8) == #"{"completed":true,"mode":"host"}"#)+ let again = try #require(try await bridge.handle("onboarding.get", [:]) as? [String: Any])+ #expect(again["completed"] as? Bool == true && again["mode"] as? String == "host")+ #expect(((try await bridge.handle("session.get", [:]) as? [String: Any])?["onboarding"] as? [String: Any])?["completed"] as? Bool == true)+ // Settings, Welcome, shows it again.+ model.onboarding.restart()+ #expect((try await bridge.handle("onboarding.get", [:]) as? [String: Any])?["completed"] as? Bool == false)+ }++ @Test func completingNeedsAModeAndAppliesTheLoginCheckbox() async throws {+ let item = FixtureLoginItem()+ let (bridge, model, _, _) = bridge(loginItem: item)+ for bad: [String: Any] in [[:], ["mode": "team"], ["mode": 1]] {+ do {+ _ = try await bridge.handle("onboarding.complete", bad)+ Issue.record("expected bad_args for \(bad)")+ } catch let f as WebUIBridge.Failure {+ #expect(f.code == "bad_args")+ }+ }+ #expect(!model.onboarding.completed)+ _ = try await bridge.handle("onboarding.complete", ["mode": "client", "launchAtLogin": true])+ #expect(item.calls == ["register"])+ #expect(model.settings.launchAtLogin == true)+ }++ /// With New UI off the web page stood in for the first run: its window+ /// gives way to the native one. With it on, the page carries on in the+ /// same window.+ @Test func completingHandsOverToTheNativeWindowOnlyWithNewUIOff() async throws {+ for webUi in [false, true] {+ let (bridge, model, _, _) = bridge(webUi: webUi)+ var closed = 0+ model.closeWebUI = { closed += 1 }+ _ = try await bridge.handle("onboarding.complete", ["mode": "client"])+ #expect(closed == (webUi ? 0 : 1), "New UI \(webUi ? "on" : "off")")+ }+ }++ // MARK: - The usage notice++ @Test func theUsageNoticeIsSeenWhenWelcomeIsLeftNotBefore() async throws {+ let (bridge, _, telemetry, _) = bridge()+ func track(_ page: String, _ action: String) async throws {+ _ = try await bridge.handle("telemetry.track", ["signals": [+ ["type": "onboarding-page", "page": page, "action": action, "choice": "none"]]])+ }+ try await track("welcome", "shown")+ #expect(telemetry.acknowledgements == 0, "Welcome showing is not Welcome left")+ try await track("signin", "shown")+ #expect(telemetry.acknowledgements == 1)++ // Skipping the first run also moves past it.+ let (skip, _, skipped, _) = self.bridge()+ _ = try await skip.handle("telemetry.track", ["signals": [["type": "step", "step": "onboarding_skipped", "ok": true]]])+ #expect(skipped.acknowledgements == 1)++ // The switch beside the note, and finishing, count as seen too.+ let (settings, _, viaSwitch, _) = self.bridge()+ _ = try await settings.handle("settings.choose", ["row": "telemetry", "option": "off"])+ #expect(viaSwitch.acknowledgements == 1 && viaSwitch.current.enabled == false)+ let (finish, _, finished, _) = self.bridge()+ _ = try await finish.handle("onboarding.complete", ["mode": "client"])+ #expect(finished.acknowledgements == 1)+ }++ // MARK: - "<Space> is ready"++ @Test func theNotificationSaysWhatIsReadyAndWhereAClickGoes() {+ let linux = SpaceReadyNote(spaceId: "local:aurora", name: "aurora", os: .linux)+ #expect(linux.title == "aurora is ready")+ #expect(linux.body == "A fresh Linux computer inside this Mac. Your agent can use it now.")+ #expect(SpaceReadyNote(spaceId: "x", name: "x", os: .macos).body.hasPrefix("A fresh macOS computer"))+ #expect(SpaceReadyNote(spaceId: "x", name: "x", os: .windows).body.hasPrefix("A fresh Windows computer"))+ #expect(SpaceReadyNote(spaceId: "x", name: "x", os: .unknown).body+ == "A fresh computer inside this Mac. Your agent can use it now.")+ #expect(linux.identifier == "space-ready-local:aurora")+ #expect(SpaceReadyNote.spaceId(fromIdentifier: linux.identifier) == "local:aurora")+ #expect(SpaceReadyNote.spaceId(fromIdentifier: "agent-1") == nil)+ #expect(SpaceReadyNote.spaceId(fromIdentifier: "space-ready-") == nil)+ }++ @Test func theCuaKeyIsAttachedAsACopy() throws {+ let key = try #require(CuaKey.url, "the key is in the module's resources")+ #expect(CuaKey.image != nil)+ let dir = FileManager.default.temporaryDirectory.appendingPathComponent("cua-key-\(UUID().uuidString)")+ try FileManager.default.createDirectory(at: dir, withIntermediateDirectories: true)+ defer { try? FileManager.default.removeItem(at: dir) }+ let copy = try #require(SpaceReadyNotifier.attachmentCopy(of: key, in: dir))+ #expect(copy != key && copy.pathExtension == "png")+ #expect(try Data(contentsOf: copy) == Data(contentsOf: key))+ // The system moves the attachment's file: the original stays.+ try FileManager.default.removeItem(at: copy)+ #expect(FileManager.default.fileExists(atPath: key.path))+ #expect(SpaceReadyNotifier.attachmentCopy(of: nil, in: dir) == nil)+ }++ func config(_ name: String) -> [String: Any] {+ ["image": "ghcr.io/trycua/linux:24.04", "on": "local", "kind": "container", "runtime": "auto", "name": name]+ }++ @Test func aCreateFromTheOnboardingNotifiesWhenItSucceeds() async throws {+ let (bridge, _, _, _) = bridge()+ var posted: [SpaceReadyNote] = []+ bridge.notifySpaceReady = { posted.append($0) }+ _ = try await bridge.handle("spaces.create", ["config": config("aurora"), "pendingId": "pending:a1",+ "os": "linux", "notifyWhenReady": true])+ #expect(posted == [SpaceReadyNote(spaceId: "local:aurora", name: "aurora", os: .linux)])+ // Any other create, and a flag that is not true, stay quiet.+ _ = try await bridge.handle("spaces.create", ["config": config("quiet"), "pendingId": "pending:a2", "os": "linux"])+ _ = try await bridge.handle("spaces.create", ["config": config("no"), "pendingId": "pending:a3",+ "os": "linux", "notifyWhenReady": false])+ _ = try await bridge.handle("spaces.create", ["config": config("odd"), "pendingId": "pending:a4",+ "os": "linux", "notifyWhenReady": "yes", "something": 1])+ #expect(posted.count == 1)+ }++ @Test func aFailedOrCancelledCreateNeverNotifies() async throws {+ let backend = FixtureSpacesBackend()+ backend.cancelledCreates = ["pending:b1"]+ let (bridge, _, _, _) = bridge(backend: backend)+ var posted: [SpaceReadyNote] = []+ bridge.notifySpaceReady = { posted.append($0) }+ for id in ["pending:b1"] {+ do {+ _ = try await bridge.handle("spaces.create", ["config": config("gone"), "pendingId": id,+ "os": "linux", "notifyWhenReady": true])+ Issue.record("expected cancelled")+ } catch let f as WebUIBridge.Failure {+ #expect(f.code == "cancelled")+ }+ }+ backend.createError = "no room"+ do {+ _ = try await bridge.handle("spaces.create", ["config": config("full"), "pendingId": "pending:b2",+ "os": "linux", "notifyWhenReady": true])+ Issue.record("expected a failure")+ } catch {}+ #expect(posted.isEmpty)+ }++ /// The create belongs to the app: closing the onboarding window mid-create+ /// neither cancels it nor loses the notification.+ @Test func closingTheWindowMidCreateDoesNotCancelIt() async throws {+ let backend = FixtureSpacesBackend()+ backend.holdCreates = true+ let (_, model, _, _) = bridge(backend: backend)+ let controller = WebUIWindowController(model: model, route: "/onboarding")+ var posted: [SpaceReadyNote] = []+ controller.bridge.notifySpaceReady = { posted.append($0) }+ let create = Task { @MainActor in+ try await controller.bridge.handle("spaces.create", ["config": config("aurora"), "pendingId": "pending:c1",+ "os": "linux", "notifyWhenReady": true])+ }+ for _ in 0..<200 where model.creates.pending.isEmpty { await yield() }+ #expect(model.creates.pending.map(\.id) == ["pending:c1"])+ // The window goes (as the red button does); its page and bridge with it.+ controller.window?.close()+ await yield()+ #expect(model.creates.pending.map(\.id) == ["pending:c1"], "still creating")+ backend.releaseCreate()+ let space = try #require(try await create.value as? [String: Any])+ #expect(space["id"] as? String == "local:aurora")+ #expect(model.creates.pending.isEmpty)+ #expect(backend.created.count == 1)+ #expect(posted == [SpaceReadyNote(spaceId: "local:aurora", name: "aurora", os: .linux)])+ }+}++extension FirstRunTests {+ /// `session.openExternal` is `window.open` on this host: web pages, mail+ /// and System Settings' panes (a permission row's link) reach the system;+ /// nothing else does.+ @Test func theWindowHandsOnlyPagesMailAndSystemSettingsToTheSystem() {+ for ok in ["https://cua.ai/docs", "http://localhost:3000", "mailto:[email protected]",+ "x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility"] {+ #expect(WebUIWindowController.opensOutside(URL(string: ok)!), "\(ok)")+ }+ for no in ["file:///etc/hosts", "cua-spaces://app/settings", "javascript:alert(1)", "tel:123", "x-apple.systempreferences"] {+ #expect(!WebUIWindowController.opensOutside(URL(string: no)!), "\(no)")+ }+ }+}diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/HostSetupFailureTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/HostSetupFailureTests.swiftindex 59c0d4b2ad..42628ff7fe 100644--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/HostSetupFailureTests.swift+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/HostSetupFailureTests.swift@@ -95,23 +95,18 @@ struct HostSetupFailureTests {// MARK: - The model- @MainActor func onboarding(_ host: HostRunning) -> OnboardingModel {- let dir = FileManager.default.temporaryDirectory.appendingPathComponent("cua-mac-tests-\(UUID().uuidString)")- return OnboardingModel(statePath: dir.appendingPathComponent("onboarding.json").path, host: host)- }-@MainActor @Test func aFailedSetupKeepsTheRawErrorAsDetails() async {let host = FixtureHost()host.failSetup = Self.missingRelease + "\ncaused by: 404"- let model = onboarding(host)- model.host.openForm()- await model.setUpHost()- let failure = model.host.setupFailure+ let model = HostModel(host: host)+ model.openForm()+ await model.submit()+ let failure = model.setupFailure#expect(failure?.kind == .download)#expect(failure?.details == Self.missingRelease + "\ncaused by: 404", "the whole error, every line")- #expect(model.host.formView?.canSubmit == true, "Retry can run")- #expect(!model.host.settingUp)- #expect(model.showingHostForm)+ #expect(model.formView?.canSubmit == true, "Retry can run")+ #expect(!model.settingUp)+ #expect(model.form != nil)}/// A page button that fails (the first post-launch user turned a@@ -137,54 +132,54 @@ struct HostSetupFailureTests {@MainActor @Test func retryRunsTheSameChoiceAndClearsOnSuccess() async {let host = FixtureHost()host.failSetup = Self.missingRelease- let model = onboarding(host)- model.host.openForm()- model.host.send(.setProfile(profile: "spare"))- await model.setUpHost()- #expect(model.host.setupFailure != nil)- #expect(model.host.formView?.request?.profile == "spare", "the choice survives the failure")+ let model = HostModel(host: host)+ model.openForm()+ model.send(.setProfile(profile: "spare"))+ await model.submit()+ #expect(model.setupFailure != nil)+ #expect(model.formView?.request?.profile == "spare", "the choice survives the failure")host.failSetup = nil- await model.setUpHost()+ await model.submit()#expect(host.calls.count == 2)#expect(host.calls[0] == host.calls[1], "the retry sends the same request")- #expect(model.host.setupFailure == nil)- #expect(!model.showingHostForm)- #expect(model.host.state?.configured == true)+ #expect(model.setupFailure == nil)+ #expect(model.form == nil)+ #expect(model.state?.configured == true)}@MainActor @Test func whileRetryingTheFailureStaysAndSetupIsBusy() async {let gate = GatedHost()- let model = onboarding(gate)- model.host.openForm()+ let model = HostModel(host: gate)+ model.openForm()gate.fail = "no GUI session"- await model.setUpHost()- #expect(model.host.setupFailure?.kind == .guiSession)+ await model.submit()+ #expect(model.setupFailure?.kind == .guiSession)gate.fail = nilgate.hold = true- let retry = Task { await model.setUpHost() }+ let retry = Task { await model.submit() }await gate.waitUntilCalled(times: 2)- #expect(model.host.settingUp, "Retry shows progress and is disabled")- #expect(model.host.formView?.canSubmit == false, "no second setup while one runs")- #expect(model.host.setupFailure?.kind == .guiSession, "the failure stays while retrying")+ #expect(model.settingUp, "Retry shows progress and is disabled")+ #expect(model.formView?.canSubmit == false, "no second setup while one runs")+ #expect(model.setupFailure?.kind == .guiSession, "the failure stays while retrying")gate.release()await retry.value- #expect(!model.host.settingUp)- #expect(model.host.setupFailure == nil)+ #expect(!model.settingUp)+ #expect(model.setupFailure == nil)}@MainActor @Test func closingTheFormClearsTheFailure() async {let host = FixtureHost()host.failSetup = "boom"- let model = onboarding(host)- model.host.openForm()- await model.setUpHost()- #expect(model.host.setupFailure != nil)- model.host.closeForm()- #expect(model.host.setupFailure == nil)- model.host.openForm()- #expect(model.host.setupFailure == nil)+ let model = HostModel(host: host)+ model.openForm()+ await model.submit()+ #expect(model.setupFailure != nil)+ model.closeForm()+ #expect(model.setupFailure == nil)+ model.openForm()+ #expect(model.setupFailure == nil)}}diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/LiveDriveTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/LiveDriveTests.swiftindex 11175dae85..38401da63e 100644--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/LiveDriveTests.swift+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/LiveDriveTests.swift@@ -35,28 +35,15 @@ struct LiveDriveTests {return false}- @Test func firstRunMountsSettingsShowsItAndTheDrivePageOpensIt() async throws {+ @Test func settingsMountsShowsItAndTheDrivePageOpensIt() async throws {let backend = try LiveSpacesBackend.make()- // First run: off by default, ticked, Continue mounts.- let o = OnboardingModel(statePath: nil)- o.driveTools = backend- // The Volume page shows with the Cua Volume experiment on.- o.send(.experimentsLoaded(experiments: AppExperiments(cuaVolume: true, yourCloud: false, sharing: false, webUi: false)))- o.send(.start)- o.send(.signinDone)- o.send(.agentsDone(configured: []))- o.send(.presentationDone)- await o.checkDrive()- let card = try #require(o.view.drive)- #expect(card.enabled, "the daemon can mount here: \(card.note ?? "")")- #expect(!card.checked, "off by default")- o.send(.driveToggled(on: true))- await o.continueDrive()- #expect(o.state.driveError == nil, "\(o.state.driveError ?? "")")- #expect(o.view.step == .mode, "mounted, on to the next page")-- // Settings, Storage: the volume and its path; Show in Finder.+ // Settings, Storage: turning the mount on.let s = StorageModel(tools: backend)+ await s.load()+ await s.choose("mount", "on")+ #expect(s.state.error == nil, "\(s.state.error ?? "")")++ // The volume and its path; Show in Finder.var revealed: [String] = []s.reveal = { revealed.append($0) }#expect(await until(20) {diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/LoginItemTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/LoginItemTests.swiftindex 54000962b7..fd919614f4 100644--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/LoginItemTests.swift+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/LoginItemTests.swift@@ -90,35 +90,31 @@ struct LoginItemTests {#expect(general(m).first?.enabled == false)}+ /// The page's Done checkbox arrives with `onboarding.complete`.@Test func doneAppliesTheCheckbox() async {let ticked = FixtureLoginItem()let a = ViewModelTests().makeModel(loginItem: ticked)- for action: AppOnboardingAction in [.start, .signinDone, .agentsDone(configured: []), .presentationDone,- .driveContinue, .modeChosen(mode: .host)] {- a.onboarding.send(action)- }- #expect(a.onboarding.view.launchAtLogin?.checked == true)- a.onboarding.finish()+ a.onboarding.finish(mode: .host, launchAtLogin: true)#expect(ticked.calls == ["register"])#expect(a.settings.launchAtLogin == true)let unticked = FixtureLoginItem()let b = ViewModelTests().makeModel(loginItem: unticked)- for a: AppOnboardingAction in [.start, .signinDone, .agentsDone(configured: []), .presentationDone,- .driveContinue, .modeChosen(mode: .client)] {- b.onboarding.send(a)- }- #expect(b.onboarding.view.launchAtLogin?.checked == true)- b.onboarding.send(.launchAtLoginToggled(on: false))- #expect(b.onboarding.view.launchAtLogin?.checked == false)- b.onboarding.finish()+ b.onboarding.finish(mode: .client, launchAtLogin: false)#expect(unticked.calls == ["unregister"])#expect(b.settings.launchAtLogin == false)++ // No answer: nothing changes (the launch rule decides later).+ let silent = FixtureLoginItem()+ let c = ViewModelTests().makeModel(loginItem: silent)+ c.onboarding.finish()+ #expect(silent.calls.isEmpty)+ #expect(c.settings.launchAtLogin == nil)}/// macOS shows "Login Item Added" the moment an app registers. Nothing- /// registers on a fresh install until the user presses Start: not the- /// first launch, not walking the pages, not ticking or unticking the box.+ /// registers on a fresh install until the first run finishes: not the+ /// first launch, not the page's walk through its steps.@Test func nothingRegistersBeforeStart() async {let item = FixtureLoginItem()let m = ViewModelTests().makeModel(loginItem: item)@@ -126,16 +122,10 @@ struct LoginItemTests {await m.applyLaunchAtLogin()m.readLoginItem()#expect(item.calls.isEmpty, "the first launch registers nothing")- for action: AppOnboardingAction in [.start, .signinDone, .agentsDone(configured: []), .presentationDone,- .driveContinue, .modeChosen(mode: .host)] {- m.onboarding.send(action)- #expect(item.calls.isEmpty, "\(action) registers nothing")- }- m.onboarding.send(.launchAtLoginToggled(on: false))- m.onboarding.send(.launchAtLoginToggled(on: true))+ m.onboarding.restart()await m.applyLaunchAtLogin()- #expect(item.calls.isEmpty, "the Done checkbox only records the choice")- m.onboarding.finish()+ #expect(item.calls.isEmpty, "showing the first run again registers nothing")+ m.onboarding.finish(mode: .host, launchAtLogin: true)#expect(item.calls == ["register"], "Start registers it, once")}diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/MainUIRouteTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/MainUIRouteTests.swiftindex 013063959b..eb6c890d29 100644--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/MainUIRouteTests.swift+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/MainUIRouteTests.swift@@ -135,8 +135,8 @@ struct MainUIRouteTests {#expect(MainUIRouter.route(forNav: "nav.nope") == nil)}- /// Only the main UI gives way: the launch and the first run stay in- /// the native window.+ /// Only the main UI gives way to New UI: the launch stays in the native+ /// window, and the first run has its own rule (`opensFirstRun`).@Test func onlyTheMainUIGivesWayToNewUI() {#expect(MainWindowSwitch.replacesNative(webUi: true, ready: true, onboarded: true))#expect(!MainWindowSwitch.replacesNative(webUi: false, ready: true, onboarded: true))diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/NotchTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/NotchTests.swiftindex 00b209f645..efd298b8e7 100644--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/NotchTests.swift+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/NotchTests.swift@@ -562,12 +562,12 @@ struct LaunchTests {#expect(defaults.bool(forKey: "ApplePersistenceIgnoreState"))}- /// With New UI on (and the first run done), a launch opens the New UI- /// window, not the native main window; the first run stays native.- @Test func newUIOnOpensItsWindowAtLaunchInsteadOfTheMainWindow() {+ /// With New UI on, or the first run due (it is the web UI's onboarding),+ /// a launch opens the New UI window, not the native main window.+ @Test func newUIOrAFirstRunOpensItsWindowAtLaunchInsteadOfTheMainWindow() {#expect(CuaSpacesMacApp.opensWebUIAtLaunch(webUi: true, onboarded: true))- #expect(!CuaSpacesMacApp.opensWebUIAtLaunch(webUi: true, onboarded: false))+ #expect(CuaSpacesMacApp.opensWebUIAtLaunch(webUi: true, onboarded: false))#expect(!CuaSpacesMacApp.opensWebUIAtLaunch(webUi: false, onboarded: true))- #expect(!CuaSpacesMacApp.opensWebUIAtLaunch(webUi: false, onboarded: false))+ #expect(CuaSpacesMacApp.opensWebUIAtLaunch(webUi: false, onboarded: false))}}diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/OnboardingTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/OnboardingTests.swiftdeleted file mode 100644index 637f387dde..0000000000--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/OnboardingTests.swift+++ /dev/null@@ -1,446 +0,0 @@-// SPDX-License-Identifier: FSL-1.1-MIT-// Copyright (c) 2026 Cua AI, Inc.--import CuaSDK-import CuaSpacesFFI-@testable import CuaSpacesMacKit-import Foundation-import Testing--/// Records the host setup request; answers with a configured status.-final class FakeHost: HostRunning, @unchecked Sendable {- var requests: [(AppHostSetupRequest, String?)] = []- var fail: String?-- func setupRequest(request: AppHostSetupRequest, accountToken: String?) async throws -> HostStatus {- requests.append((request, accountToken))- if let fail { throw CuaError.Runtime(message: fail) }- return HostStatus(- configured: true, mode: request.mode, relayUrl: request.relayUrl, directUrl: nil,- envTokenPath: nil, machineId: "m-1", name: request.name, sharing: true,- serviceInstalled: true, serviceRunning: true, serviceKind: "launchd", online: true,- clients: [], allow: request.allow ?? [],- permissions: [HostPermission(id: "accessibility", title: "Accessibility",- settingsUrl: "x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility",- instructions: "Turn on Cua Spacesd.")],- error: nil)- }-- func status() async throws -> HostStatus { FixtureHost.unconfigured }- func stopSharing() async throws -> HostStatus { FixtureHost.unconfigured }- func startSharing() async throws -> HostStatus { FixtureHost.unconfigured }- func pauseSignedOut() async throws -> HostStatus { FixtureHost.unconfigured }- func resumeSignedIn(account: String) async throws -> HostStatus { FixtureHost.unconfigured }- func remove() async throws {}- func configure(change: HostSettingsChange) async throws -> HostStatus { FixtureHost.unconfigured }-}--final class FailingCli: CliInstallRunning, @unchecked Sendable {- let planned: AppCliInstallPlan- var installs = 0-- init(plan: AppCliInstallPlan) { planned = plan }-- func plan() async -> AppCliInstallPlan { planned }-- func install(request: AppCliInstallRequest) async throws -> AppCliInstallPlan {- installs += 1- throw CuaError.Runtime(message: "Permission denied")- }-}--/// A temp directory with a fake bundled `cua` next to a fake app executable.-/// Nothing outside it is read or written.-struct TempInstall {- let root: URL- let home: URL- let cua: URL-- init() throws {- root = FileManager.default.temporaryDirectory.appendingPathComponent("cua-mac-cli-\(UUID().uuidString)")- home = root.appendingPathComponent("home")- let macos = root.appendingPathComponent("Cua Spaces.app/Contents/MacOS")- try FileManager.default.createDirectory(at: macos, withIntermediateDirectories: true)- cua = macos.appendingPathComponent("cua")- try Data("#!/bin/sh\necho \"cua 1.2.3\"\n".utf8).write(to: cua)- try FileManager.default.setAttributes([.posixPermissions: 0o755], ofItemAtPath: cua.path)- }-- /// The SDK's installer (the app core's) over these paths only.- func installer(bundled: Bool = true, pathEnv: String = "/usr/bin:/bin") -> AppCliInstaller {- AppCliInstaller.withPaths(bundled: bundled ? cua.path : nil,- binDir: home.appendingPathComponent(".local/bin").path,- pathEnv: pathEnv,- profile: home.appendingPathComponent(".zshrc").path)- }-- func remove() { try? FileManager.default.removeItem(at: root) }-}--@MainActor-@Suite("Onboarding writes")-struct OnboardingTests {- func model(cli: CliInstallRunning? = nil, host: HostRunning? = nil,- agents: AgentSetupRunning? = nil) -> OnboardingModel {- let o = OnboardingModel(statePath: nil, cli: cli, host: host, agentSetup: agents)- o.send(.start)- return o- }-- /// A fresh first run in a temp HOME: launching writes nothing; the- /// Command line page follows Welcome, and Continue installs the bundled- /// cua and the shell profile puts it on PATH (a new shell resolves it).- @Test func theCommandLinePageInstallsTheCliOntoPath() async throws {- let tmp = try TempInstall()- defer { tmp.remove() }- let o = OnboardingModel(statePath: nil, cli: tmp.installer())- await o.planCli()- #expect(!FileManager.default.fileExists(atPath: tmp.home.path), "nothing written before the page")- #expect(o.view.step == .welcome)- o.send(.start)- #expect(o.view.step == .cli)- #expect(o.view.title == "Install the Cua CLI and add it to your PATH")- #expect(!FileManager.default.fileExists(atPath: tmp.home.path), "nothing written on the page")- await o.finishCli(install: true)- #expect(o.view.step == .signin)- let target = tmp.home.appendingPathComponent(".local/bin/cua").path- #expect(FileManager.default.isExecutableFile(atPath: target))- #expect(o.state.cliTarget == target)- // A new login shell with this HOME and the profile finds `cua`.- let profile = tmp.home.appendingPathComponent(".zshrc").path- let sh = Process()- sh.executableURL = URL(fileURLWithPath: "/bin/sh")- sh.arguments = ["-c", ". \"$1\" && command -v cua", "sh", profile]- sh.environment = ["HOME": tmp.home.path, "PATH": "/usr/bin:/bin"]- let out = Pipe()- sh.standardOutput = out- try sh.run()- sh.waitUntilExit()- let found = String(decoding: out.fileHandleForReading.readDataToEndOfFile(), as: UTF8.self)- .trimmingCharacters(in: .whitespacesAndNewlines)- #expect(sh.terminationStatus == 0)- #expect(found == target)- o.send(.signinDone)- o.send(.agentsDone(configured: []))- #expect(o.view.step == .presentation)- o.send(.presentationDone)- o.send(.driveContinue)- o.send(.modeChosen(mode: .client))- #expect(o.view.todos.first { $0.id == .cli }?.done == true, "Done counts the installed Cua CLI")- #expect(o.cliShadowedBy == nil, "nothing else on PATH")- // A second launch finds it current and writes nothing new.- let again = OnboardingModel(statePath: nil, cli: tmp.installer())- await again.planCli()- #expect(again.state.cliPlan?.upToDate == true && again.state.cliTarget == target)- again.send(.start)- #expect(again.view.step == .signin, "no Command line page once current")- }-- @Test func skippingTheCommandLinePageWritesNothing() async throws {- let tmp = try TempInstall()- defer { tmp.remove() }- let o = OnboardingModel(statePath: nil, cli: tmp.installer())- await o.planCli()- o.send(.start)- await o.finishCli(install: false)- #expect(o.view.step == .signin)- o.send(.back)- await o.finishCli(install: false)- #expect(o.view.step == .signin)- #expect(o.state.cliTarget == nil)- #expect(!FileManager.default.fileExists(atPath: tmp.home.path))- }-- @Test func aFailedInstallStaysOnTheCommandLinePageAndSaysWhy() async throws {- let tmp = try TempInstall()- defer { tmp.remove() }- let cli = FailingCli(plan: await tmp.installer().plan())- let o = OnboardingModel(statePath: nil, cli: cli)- await o.planCli()- o.send(.start)- await o.finishCli(install: true)- #expect(o.view.step == .cli)- #expect(o.state.cliError?.contains("Permission denied") == true)- #expect(o.state.cliTarget == nil)- #expect(!o.state.cliInstalling && o.view.canSkip)- await o.finishCli(install: false)- #expect(o.view.step == .signin)- #expect(cli.installs == 1)- }-- /// Another `cua` earlier on PATH (a stale Python cua-cli, say): Done- /// still shows the installed path and notes the one that runs first.- @Test func anotherCuaEarlierOnPathIsNotedOnDone() async throws {- let tmp = try TempInstall()- defer { tmp.remove() }- let stale = tmp.root.appendingPathComponent("stale/bin")- try FileManager.default.createDirectory(at: stale, withIntermediateDirectories: true)- let other = stale.appendingPathComponent("cua")- try Data("#!/bin/sh\necho \"cua-cli 0.1.0 (python)\"\n".utf8).write(to: other)- try FileManager.default.setAttributes([.posixPermissions: 0o755], ofItemAtPath: other.path)- let binDir = tmp.home.appendingPathComponent(".local/bin").path- let o = OnboardingModel(statePath: nil,- cli: tmp.installer(pathEnv: "\(stale.path):\(binDir):/usr/bin:/bin"))- #expect(o.cliShadowedBy == nil, "nothing installed yet")- await o.planCli()- o.send(.start)- await o.finishCli(install: true)- let target = tmp.home.appendingPathComponent(".local/bin/cua").path- #expect(o.state.cliTarget == target)- #expect(o.cliShadowedBy == other.path)- toMode(o)- o.send(.modeChosen(mode: .client))- #expect(o.view.step == .done)- #expect(o.view.todos.first { $0.id == .cli }?.done == true, "Done counts the installed Cua CLI")- }-- @Test func withoutABundledCliNothingIsInstalled() async throws {- let tmp = try TempInstall()- defer { tmp.remove() }- let o = OnboardingModel(statePath: nil, cli: tmp.installer(bundled: false))- await o.planCli()- o.send(.start)- #expect(o.view.step == .signin, "no Command line page without a bundled cua")- #expect(o.state.cliTarget == nil)- #expect(!FileManager.default.fileExists(atPath: tmp.home.path))- }-- @Test func thePresentationCardSetsTheNotchSetting() {- let o = model()- var saved: [Bool] = []- o.onPresentation = { saved.append($0) }- o.send(.signinDone)- o.send(.agentsDone(configured: []))- #expect(o.view.presentations.map(\.title) == ["Notch and menu bar", "Menu bar only"])- #expect(o.view.presentations.map(\.selected) == [true, false], "the notch by default")- #expect(o.view.presentations.map(\.id) == ["onboarding-notch", "onboarding-menu-bar"])- #expect(MenuMiniature.icon != nil, "the menu bar icon ships in the bundle")- o.pickPresentation(menuBar: true)- #expect(saved == [true])- #expect(o.view.presentations.map(\.selected) == [false, true])- o.send(.presentationDone)- o.send(.driveContinue)- #expect(o.view.step == .mode)- }-- func toMode(_ o: OnboardingModel) {- o.send(.signinDone)- o.send(.agentsDone(configured: []))- o.send(.presentationDone)- o.send(.driveContinue)- }-- /// Done is honest about the machine (CUA-1862): a sign-in from the CLI- /// while the window was past Welcome, and an agent set up earlier,- /// count; what is missing has a fix that opens its page and comes back.- @Test func doneReadsTheMachineAndEachFixComesBack() async {- let o = model(agents: FixtureAgentSetup())- toMode(o)- o.send(.modeChosen(mode: .client))- #expect(o.view.step == .done)- #expect(o.view.title == "Almost done")- #expect(o.view.todos.compactMap(\.action).contains("Sign in"))- // Signed in with `cua auth login` (the same session) after Welcome.- o.adoptIdentity("[email protected]")- #expect(o.state.identity == "[email protected]")- o.readIdentity = { "[email protected]" }- await o.refreshDone()- #expect(o.state.agents == ["Codex"], "the fixture's Codex already uses cua")- #expect(o.view.todos.first { $0.id == .signin }?.done == true)- // The Cua CLI fix opens its page; Back returns to Done.- await o.fixTodo(.cli)- #expect(o.view.step == .cli)- o.send(.back)- #expect(o.view.step == .done)- }-- /// Welcome counts the run as it shows once this machine showed the usage- /// notice (else only when it is left), and only once per run.- @Test func welcomeCountsTheRunWhenShownOnce() {- func steps(_ t: FixtureTelemetry) -> [String] {- t.recorded.compactMap { if case let .step(step, _) = $0 { return step } else { return nil } }- }- let seen = FixtureTelemetry()- seen.current.noticeShown = true- let o = OnboardingModel(statePath: nil)- o.telemetry = seen- o.shown()- #expect(steps(seen) == ["onboarding_shown"])- o.send(.start)- o.send(.back)- o.shown()- o.send(.start)- #expect(steps(seen) == ["onboarding_shown"])-- let fresh = FixtureTelemetry()- let f = OnboardingModel(statePath: nil)- f.telemetry = fresh- f.shown()- #expect(fresh.recorded.isEmpty)- f.send(.start)- #expect(steps(fresh) == ["onboarding_shown"])- }-- /// Welcome's usage-data switch: from the machine's setting, locked when- /// the environment decides, and settled before anything is recorded.- @Test func welcomesUsageSwitchSettlesBeforeAnythingIsRecorded() {- let telemetry = FixtureTelemetry()- let o = OnboardingModel(statePath: nil)- o.telemetry = telemetry- var left: [Bool] = []- o.onWelcomeLeft = { left.append($0) }- o.shown()- #expect(o.view.usage?.on == true)- #expect(o.view.usage?.label == "Share anonymous usage data")- #expect(o.view.notice?.contains("Change it here or in Settings, Privacy.") == true)- o.setShareUsage(false)- #expect(o.view.usage?.on == false)- #expect(telemetry.recorded.isEmpty)- o.send(.start)- #expect(left == [false])- o.send(.signinDone)- o.finish()- #expect(telemetry.recorded.isEmpty)-- let locked = FixtureTelemetry()- locked.current = AppTelemetryInput(enabled: false, lockedBy: "env DO_NOT_TRACK", noticeShown: true)- let l = OnboardingModel(statePath: nil)- l.telemetry = locked- l.shown()- #expect(l.view.usage?.on == false)- #expect(l.view.usage?.enabled == false)- #expect(l.view.usage?.help == "Set by env DO_NOT_TRACK")- l.setShareUsage(true)- #expect(l.view.usage?.on == false)- }-- /// Sign-in skipped, then "Set up for access": the This machine step's- /// own HostModel signs in inline through the app's sign-in (wired by- /// AppModel), then finishes setup with the new session's token.- @Test func skippedSignInSignsInInlineFromThisMachineThenFinishes() async {- let host = FakeHost()- let dir = FileManager.default.temporaryDirectory.appendingPathComponent("cua-mac-tests-\(UUID().uuidString)")- defer { try? FileManager.default.removeItem(at: dir) }- let o = OnboardingModel(statePath: nil, host: host)- let account = FixtureAccount()- let app = AppModel(backend: FixtureSpacesBackend(),- keyvault: KeyvaultModel(client: nil, clock: { fixtureNow }),- onboarding: o, settingsPath: dir.appendingPathComponent("settings.json").path,- account: account, telemetry: FixtureTelemetry())- o.accountToken = { _ in account.identity() == nil ? nil : "tok-signed-in" }- o.send(.start)- toMode(o)- #expect(o.host.identity == nil)- o.host.openForm()- await o.setUpHost()- #expect(app.identity == "[email protected]", "the app's sign-in ran")- #expect(o.host.identity == "[email protected]")- #expect(host.requests.count == 1)- #expect(host.requests.first?.1 == "tok-signed-in")- #expect(o.host.formView?.error == nil)- #expect(o.view.step == .done)- #expect(o.state.mode == .host)- }-- @Test func hostSetupRunsWithTheAccountTokenThenFinishes() async {- let host = FakeHost()- let o = model(host: host)- o.accountToken = { _ in "tok-1" }- toMode(o)- #expect(o.view.step == .mode)- #expect(o.view.choices.map(\.mode) == [.client, .host])- // The telemetry notice and its switch are Welcome's.- #expect(o.view.notice == nil)- #expect(o.view.usage == nil)- o.host.openForm()- o.host.send(.setName(name: " studio "))- o.host.send(.setAllow(allow: "[email protected], [email protected]"))- await o.setUpHost()- #expect(host.requests.count == 1)- let (request, token) = host.requests[0]- #expect(request.mode == "relay")- #expect(request.relayUrl == "https://relay.cua.ai")- #expect(request.name == "studio")- #expect(request.allow == ["[email protected]", "[email protected]"])- #expect(token == "tok-1")- #expect(o.view.step == .done)- #expect(o.state.mode == .host)- #expect(o.hostPermissions.map(\.id) == ["accessibility"])- #expect(!o.showingHostForm)- #expect(o.view.summary.last?.value == "Your other devices can reach it")- }-- @Test func directSetupNeedsAnAddressAndSendsNoToken() async {- let host = FakeHost()- let o = model(host: host)- o.accountToken = { _ in "tok-1" }- toMode(o)- o.host.openForm()- o.host.send(.toggleAdvanced)- o.host.send(.setDirect(on: true))- o.host.send(.setListen(listen: "somewhere"))- #expect(o.host.formView?.canSubmit == false)- await o.setUpHost()- #expect(host.requests.isEmpty)- o.host.send(.setListen(listen: "10.0.0.5:3211"))- await o.setUpHost()- #expect(host.requests.first?.0.direct == "10.0.0.5:3211")- #expect(host.requests.first?.1 == nil)- }-- @Test func aFailedSetupStaysOnThePageWithTheReason() async {- let host = FakeHost()- host.fail = "sign in to Cua first"- let o = model(host: host)- toMode(o)- o.host.openForm()- await o.setUpHost()- #expect(o.view.step == .mode)- #expect(o.host.formView?.error?.contains("sign in to Cua first") == true)- #expect(o.showingHostForm)- }-- @Test func theAgentsStepSetsUpTheTickedAgentsOnly() async {- let agents = FixtureAgentSetup()- let o = model(agents: agents)- o.send(.signinDone)- #expect(o.view.step == .agents)- await o.loadAgents()- #expect(o.installedAgents.map(\.id) == ["claude-code", "codex"])- o.agentSelection.remove("codex")- await o.setUpAgents()- #expect(agents.calls == ["setup:claude-code", "driver:claude-code"], "the driver card is on by default")- #expect(o.agentSummaries.map(\.line) == ["Claude Code: done"])- o.finishAgents()- #expect(o.view.step == .presentation)- #expect(o.state.agents == ["Claude Code"])- }-- /// The background computer-use card: on by default, like the skills- /// and MCP switches; ticked, "Set up" also runs the cua-driver step for- /// the same agents (alone when the skills and MCP switches are off), and- /// the summary names it.- @Test func theDriverCardAddsTheCuaDriverStepForTheTickedAgents() async {- let agents = FixtureAgentSetup()- let o = model(agents: agents)- o.send(.signinDone)- await o.loadAgents()- #expect(o.agentSkills && o.agentMcp && o.agentDriver, "all three on by default")- #expect(o.copy.agentsDriver == "cua-driver skill for background computer-use")- o.agentSkills = false- o.agentMcp = false- o.agentDriver = false- #expect(!o.canSetUpAgents, "nothing chosen")- o.agentDriver = true- #expect(o.canSetUpAgents)- o.agentSelection.remove("codex")- await o.setUpAgents()- #expect(agents.calls == ["driver:claude-code"])- let s = appAgentSetupSummary(outcomes: o.agentOutcomes ?? [], agent: "claude-code", name: "Claude Code")- #expect(s.text == "cua-driver configured, 1 skill installed")- o.agentSkills = true- o.agentMcp = true- await o.setUpAgents()- #expect(agents.calls == ["driver:claude-code", "setup:claude-code", "driver:claude-code"])- }-}diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ParityTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ParityTests.swiftindex 620a0a3444..03492fcc62 100644--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ParityTests.swift+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ParityTests.swift@@ -55,28 +55,6 @@ struct ParityTests {@Test("checklist") func checklist() throws { try check("checklist", runChecklist) }@Test("create-stages") func createStages() throws { try check("create-stages", runProvisioning) }- /// The app's own first run records exactly the golden's events: the- /// `OnboardingModel` the window drives, on a recording telemetry.- @MainActor @Test("telemetry-funnel through the first-run model")- func telemetryFunnelThroughTheModel() throws {- let flow = try json(Self.dir.appendingPathComponent("telemetry-funnel.json"))- let golden = try json(Self.dir.appendingPathComponent("golden/telemetry-funnel.json"))- for run in ["onboarding", "skipping", "no-usage-data"] {- let telemetry = FixtureTelemetry()- let o = OnboardingModel(statePath: nil)- o.telemetry = telemetry- for a in flow[run] as! [[String: Any]] {- o.send(try appOnboardingActionFromJson(json: text(a)))- }- o.finish()- let want = (golden["frames"] as! [[String: Any]])- .filter { ($0["at"] as? String) == run }- .flatMap { $0["signals"] as! [Any] }- let got = telemetry.recorded.map(Self.signalFrame)- #expect(canonical(got) == canonical(want), "\(run):\n want \(canonical(want))\n got \(canonical(got))")- }- }-// MARK: - Harnessfunc check(_ name: String, _ run: ([String: Any]) throws -> [Any]) throws {diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/SnapshotTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/SnapshotTests.swiftindex 4dd0a41c94..91a28f8f2f 100644--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/SnapshotTests.swift+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/SnapshotTests.swift@@ -34,111 +34,13 @@ struct SnapshotTests {kv: kv ? FakeKeyvault(try overview ?? fixtureOverview()) : nil,host: FixtureHost(), account: FixtureAccount(),agents: FixtureAgentSetup(), loginItem: loginItem)- m.onboarding.finish()+ // Done's "Launch at login" ticked, as the first run's default had it.+ m.onboarding.finish(launchAtLogin: true)await m.refresh()await m.keyvault.refresh()return m}- @Test func onboardingWelcome() throws {- let o = OnboardingModel(statePath: nil)- try assertSnapshot(OnboardingView(onboarding: o), "onboarding", size: CGSize(width: 820, height: 560))- }-- /// Every first-run page (the Tauri app's pages, from the same core).- @Test func onboardingPages() async throws {- let o = OnboardingModel(statePath: nil, agentSetup: FixtureAgentSetup())- let size = CGSize(width: 820, height: 560)- // Every page, the Volume page included (its experiment on).- o.send(.experimentsLoaded(experiments: AppExperiments(cuaVolume: true, yourCloud: false, sharing: false, webUi: false)))- o.send(.start)- try assertSnapshot(OnboardingView(onboarding: o), "onboarding-signin", size: size)- o.send(.signinDone)- await o.loadAgents()- try assertSnapshot(OnboardingView(onboarding: o), "onboarding-agents", size: size)- o.finishAgents(skipped: true)- try assertSnapshot(OnboardingView(onboarding: o), "onboarding-presentation", size: size)- o.send(.presentationDone)- o.send(.driveChecked(os: .macos, status: try appDriveMountFromJson(- json: #"{"enabled":false,"state":"off","method":"fskit","volume_name":"Cua Volume"}"#)))- try assertSnapshot(OnboardingView(onboarding: o), "onboarding-drive", size: size)- o.send(.driveContinue)- try assertSnapshot(OnboardingView(onboarding: o), "onboarding-mode", size: size)- o.send(.modeChosen(mode: .client))- try assertSnapshot(OnboardingView(onboarding: o), "onboarding-done", size: size)- // Everything set up: "You're all set" only now.- o.send(.cliInstalled(target: "/Users/me/.local/bin/cua"))- o.send(.signedIn(identity: "[email protected]"))- o.send(.agentsDetected(configured: ["Claude Code"]))- try assertSnapshot(OnboardingView(onboarding: o), "onboarding-done-all-set", size: size)- }-- /// The AI agents page with twelve agents at the window's minimum size:- /// the list scrolls in two columns, so Back and Set up stay in view.- @Test func onboardingAgentsLongListAtMinimumSize() async throws {- let names = ["Claude Code", "Codex", "Cursor", "Gemini CLI", "GitHub Copilot", "Windsurf", "Cline",- "Roo Code", "OpenCode", "Goose", "Amp", "Hermes"]- let statuses = names.map { n in- AppAgentSetupStatus(id: n.lowercased().replacingOccurrences(of: " ", with: "-"), name: n, installed: true,- skillsDir: "~/.agents/skills", mcpConfig: nil, cuaConfigured: false,- skillsInstalled: [], skillsOutdated: [], error: nil)- }- let o = OnboardingModel(statePath: nil, agentSetup: FixtureAgentSetup(statuses: statuses))- o.send(.start)- o.send(.signinDone)- await o.loadAgents()- #expect(o.installedAgents.count == 12)- #expect(o.view.canBack)- try assertSnapshot(OnboardingView(onboarding: o), "onboarding-agents-long", size: CGSize(width: 720, height: 520))- }-- /// The AI agents page's background computer-use card at beats of its- /// loop (the agent gliding while the user drags a selection, the agent- /// clicking a box, both idle at the loop's end), ticked, and the Reduce- /// Motion still.- @Test func driverCard() throws {- let copy = appOnboardingCopy()- func card(_ ms: UInt32?, on: Bool = false, still: Bool? = nil) -> some View {- DriverCardView(title: copy.agentsDriver, imageLabel: copy.agentsDriverImage, isOn: .constant(on),- fixedMs: ms, still: still)- .padding(12)- }- let size = CGSize(width: 380, height: 180)- for (ms, name) in [(UInt32(1500), "working"), (1750, "click"), (4799, "idle")] {- try assertSnapshot(card(ms), "onboarding-driver-\(name)", size: size)- }- try assertSnapshot(card(nil, on: true, still: true), "onboarding-driver-still-on", size: size)- let still = appDriverPreviewStill()- #expect(still.ripple > 0 && still.checked[0] == 1 && !still.agentPressed)- }-- /// The presentation cards' miniatures (both cards) at beats of the loop:- /// the pointer gliding up, the notch's hover cue, the notch springing- /// open while the menu drops down, both expanded; then the Reduce Motion- /// still (the expanded state, no loop).- @Test func presentationPreviews() async throws {- let o = OnboardingModel(statePath: nil, agentSetup: FixtureAgentSetup())- o.send(.start)- o.send(.signinDone)- o.finishAgents(skipped: true)- let cards = o.view.presentations- #expect(cards.count == 2)- func pair(_ ms: UInt32?, still: Bool? = nil) -> some View {- VStack(spacing: 10) {- ForEach(cards, id: \.id) { PresentationCardView(card: $0, fixedMs: ms, still: still) {} }- }- .padding(12)- }- let size = CGSize(width: 320, height: 300)- for (ms, name) in [(UInt32(900), "glide"), (1550, "dwell"), (1760, "opening"), (2400, "open")] {- try assertSnapshot(pair(ms), "onboarding-preview-\(name)", size: size)- }- try assertSnapshot(pair(nil, still: true), "onboarding-preview-still", size: size)- let still = [false, true].map { appPresentationPreviewStill(menuBar: $0) }- #expect(still[0].open == 1 && still[0].content == 1, "the notch open")- #expect(still[1].open == 1 && still[1].highlighted != nil, "the menu down")- }-@Test func newSpaceWizard() async throws {let m = try await model()await m.openNewSpace()@@ -743,30 +645,11 @@ struct SnapshotTests {try await assertNotch("notch-tab-pressed") { $0.highlight = NotchHighlight(.tab, pressed: true) }}- /// The host form inside onboarding: its Back and Set up take the- /// bottom corners like every other page.- @Test func onboardingHostForm() async throws {- let o = OnboardingModel(statePath: nil, host: FixtureHost(), agentSetup: FixtureAgentSetup())- // The page dots as recorded (the Cua Volume experiment on).- o.send(.experimentsLoaded(experiments: AppExperiments(cuaVolume: true, yourCloud: false, sharing: false, webUi: false)))- o.send(.start)- o.send(.signinDone)- o.finishAgents(skipped: true)- o.send(.presentationDone)- o.send(.driveContinue)- o.host.computerName = { "Ada’s MacBook Pro" }- o.host.openForm()- try assertSnapshot(OnboardingView(onboarding: o), "onboarding-host-form", size: CGSize(width: 820, height: 560))- }-// MARK: - Harnessfunc render<V: View>(_ view: V, size: CGSize) -> NSBitmapImageRep {- // Looping miniatures on their still: a playing loop's frame would- // depend on the clock (tests that want a beat pass `fixedMs`).let host = NSHostingView(rootView: view.frame(width: size.width, height: size.height)- .environment(\.colorScheme, .light)- .environment(\.onboardingMotionStill, true))+ .environment(\.colorScheme, .light))host.frame = CGRect(origin: .zero, size: size)let window = NSWindow(contentRect: host.frame, styleMask: [.borderless], backing: .buffered, defer: false)window.contentView = hostdiff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-agents-long.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-agents-long.pngdeleted file mode 100644index d17a9175e6..0000000000Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-agents-long.png and /dev/null differdiff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-agents.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-agents.pngdeleted file mode 100644index ea27228134..0000000000Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-agents.png and /dev/null differdiff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-done-all-set.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-done-all-set.pngdeleted file mode 100644index a83e95d97b..0000000000Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-done-all-set.png and /dev/null differdiff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-done.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-done.pngdeleted file mode 100644index d6fcac2743..0000000000Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-done.png and /dev/null differdiff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-drive-arrived.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-drive-arrived.pngdeleted file mode 100644index 3607c6647f..0000000000Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-drive-arrived.png and /dev/null differdiff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-drive-bucket.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-drive-bucket.pngdeleted file mode 100644index 28d0587d05..0000000000Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-drive-bucket.png and /dev/null differdiff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-drive-flying.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-drive-flying.pngdeleted file mode 100644index e582a3be45..0000000000Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-drive-flying.png and /dev/null differdiff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-drive-mounting.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-drive-mounting.pngdeleted file mode 100644index a11d2638fb..0000000000Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-drive-mounting.png and /dev/null differdiff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-drive-prompt.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-drive-prompt.pngdeleted file mode 100644index a074246642..0000000000Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-drive-prompt.png and /dev/null differdiff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-drive-still-on.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-drive-still-on.pngdeleted file mode 100644index 98a0fdf28f..0000000000Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-drive-still-on.png and /dev/null differdiff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-drive.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-drive.pngdeleted file mode 100644index eb92407ff0..0000000000Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-drive.png and /dev/null differdiff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-driver-click.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-driver-click.pngdeleted file mode 100644index 0a1268bb1b..0000000000Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-driver-click.png and /dev/null differdiff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-driver-idle.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-driver-idle.pngdeleted file mode 100644index 2f12bac8a0..0000000000Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-driver-idle.png and /dev/null differdiff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-driver-still-on.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-driver-still-on.pngdeleted file mode 100644index c36f107144..0000000000Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-driver-still-on.png and /dev/null differdiff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-driver-working.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-driver-working.pngdeleted file mode 100644index 36aca6b3a8..0000000000Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-driver-working.png and /dev/null differdiff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-host-form.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-host-form.pngdeleted file mode 100644index 3271f2e596..0000000000Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-host-form.png and /dev/null differdiff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-mode.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-mode.pngdeleted file mode 100644index 4fce9690e6..0000000000Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-mode.png and /dev/null differdiff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-presentation.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-presentation.pngdeleted file mode 100644index 45df61cd6f..0000000000Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-presentation.png and /dev/null differdiff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-preview-dwell.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-preview-dwell.pngdeleted file mode 100644index d4dc9a94d0..0000000000Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-preview-dwell.png and /dev/null differdiff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-preview-glide.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-preview-glide.pngdeleted file mode 100644index 6438d2c47e..0000000000Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-preview-glide.png and /dev/null differdiff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-preview-open.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-preview-open.pngdeleted file mode 100644index 0e07aa89c7..0000000000Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-preview-open.png and /dev/null differdiff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-preview-opening.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-preview-opening.pngdeleted file mode 100644index cff7e8503c..0000000000Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-preview-opening.png and /dev/null differdiff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-preview-still.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-preview-still.pngdeleted file mode 100644index 94a2cb98ce..0000000000Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-preview-still.png and /dev/null differdiff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-signin.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-signin.pngdeleted file mode 100644index ce46c34767..0000000000Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-signin.png and /dev/null differdiff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding.pngdeleted file mode 100644index 17e7526219..0000000000Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding.png and /dev/null differdiff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/StartupTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/StartupTests.swiftindex d5594b8f07..8d66d38c6a 100644--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/StartupTests.swift+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/StartupTests.swift@@ -284,7 +284,6 @@ import Testinggate.resolve(LiveServices(backend: FixtureSpacesBackend(), account: FixtureAccount(identity: "[email protected]")))model.attachLive(nil)#expect(model.identity == "[email protected]")- #expect(model.onboarding.state.identity == "[email protected]")// No SDK backend (fixtures): what waits for one never runs.#expect(seen.isEmpty)}diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/TelemetryCaptureTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/TelemetryCaptureTests.swiftindex 065780e6ed..7f237a251c 100644--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/TelemetryCaptureTests.swift+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/TelemetryCaptureTests.swift@@ -7,9 +7,12 @@ import CuaSpacesFFIimport Foundationimport Testing-/// One first run to a first ready Space through the app's own models and-/// the live telemetry path (`LiveTelemetry`, the FFI, the SDK's client and-/// its HTTP sender), sent to a loopback capture endpoint.+/// One first run to a first ready Space through the app's own models, the+/// bridge calls the web onboarding makes (`telemetry.track`,+/// `settings.choose`, `onboarding.complete`) and the live telemetry path+/// (`LiveTelemetry`, the FFI, the SDK's client and its HTTP sender), sent to+/// a loopback capture endpoint. The page's events are the core's, derived+/// here from the parity flow the way the page derives them.////// `CUA_TELEMETRY_CAPTURE_SHARE=off` turns Welcome's usage-data switch off/// first: then nothing at all may reach the endpoint.@@ -39,34 +42,48 @@ struct TelemetryCaptureTests {let telemetry = LiveTelemetry()let share = env["CUA_TELEMETRY_CAPTURE_SHARE"] != "off"let onboarding = OnboardingModel(statePath: nil)- onboarding.onWelcomeLeft = { on in try? appTelemetryWelcomeLeft(on: on) }let settings = URL(fileURLWithPath: home).appendingPathComponent("settings.json").pathlet backend = FixtureSpacesBackend()let model = AppModel(backend: backend, keyvault: KeyvaultModel(client: nil), onboarding: onboarding,settingsPath: settings, telemetry: telemetry)+ let bridge = WebUIBridge(model: model, allowedOrigins: [])++ /// The page's `telemetry.track`.+ func track(_ signals: [AppTelemetrySignal]) async throws {+ guard !signals.isEmpty else { return }+ _ = try await bridge.handle("telemetry.track", ["signals": signals.map(ParityTests.signalFrame)])+ }// The first run, page by page (the parity flow's run).let flow = try JSONSerialization.jsonObject(with: Data(contentsOf: ParityTests.dir.appendingPathComponent("telemetry-funnel.json"))) as! [String: Any]- onboarding.shown()+ let status = telemetry.status()if let forced = env["CUA_TELEMETRY"] {// The environment decides: the switch is locked and says why.- #expect(onboarding.view.usage?.enabled == false)- #expect(onboarding.view.usage?.help == "Set by env CUA_TELEMETRY", "CUA_TELEMETRY=\(forced)")+ #expect(status.enabled == false)+ #expect(status.lockedBy?.contains("CUA_TELEMETRY") == true, "CUA_TELEMETRY=\(forced)")try #require(share, "the off case must run without CUA_TELEMETRY (it overrides the setting)")} else {- #expect(onboarding.view.usage?.enabled == true)+ #expect(status.enabled == true, "on by default")+ }+ var state = appOnboardingInitial(installerMode: nil, identity: nil)+ func step(_ action: AppOnboardingAction) async throws {+ try await track(appTelemetryOnboarding(state: state, action: action))+ state = appOnboardingReduce(state: state, action: action)}- #expect(onboarding.view.usage?.on == true, "on by default")- if !share { onboarding.setShareUsage(false) }+ try await step(.welcomeShown)+ // Welcome's usage-data switch (the page's `settings.choose`).+ if !share { _ = try await bridge.handle("settings.choose", ["row": "telemetry", "option": "off"]) }// Nothing is queued while Welcome shows.#expect((try? JSONSerialization.jsonObject(with: Data(telemetryShowLast(limit: 100).utf8)) as? [Any])?.isEmpty ?? true)// The run's pages (the setting was read above, from this machine).for a in flow["onboarding"] as! [[String: Any]] where a["type"] as? String != "telemetry-loaded" {let data = try JSONSerialization.data(withJSONObject: a)- onboarding.send(try appOnboardingActionFromJson(json: String(decoding: data, as: UTF8.self)))+ try await step(try appOnboardingActionFromJson(json: String(decoding: data, as: UTF8.self)))}- onboarding.finish()+ try await track(appTelemetryOnboardingFinished(state: state))+ _ = try await bridge.handle("onboarding.complete", ["mode": "client"])+ #expect(onboarding.completed)// New Space: open the panel, create the default Linux Space, wait// until it is ready.diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ViewModelTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ViewModelTests.swiftindex 1385ff9bb7..b1a71090f4 100644--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ViewModelTests.swift+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ViewModelTests.swift@@ -418,7 +418,6 @@ struct ViewModelTests {model.chooseExperiment(row: "experiment:cua_volume", option: "on")#expect(model.settingsPageWithStorage.sections.map(\.id).prefix(4) == ["account", "teams", "general", "storage"])#expect(appSettingsLoad(path: model.settingsPath).experiments.cuaVolume, "saved")- #expect(model.onboarding.state.experiments.cuaVolume)let toggled = telemetry.recorded.compactMap { s -> String? inif case let .experiment(action, experiment) = s { return "\(action) \(experiment)" }return nil@@ -426,19 +425,28 @@ struct ViewModelTests {#expect(toggled == ["experiment_on cua_volume"])}- /// A sign-in from the main window (the first run done or not showing)- /// still counts in the activation funnel, once.- @Test func mainWindowSignInRecordsSignedIn() async {+ /// A sign-in after the first run (from Settings, say) still counts in+ /// the activation funnel, once; during the first run the page's own+ /// flow counts it.+ @Test func signInAfterTheFirstRunRecordsSignedIn() async {+ func steps(_ telemetry: FixtureTelemetry) -> [String] {+ telemetry.recorded.compactMap { s -> String? in+ if case let .step(step, ok) = s, ok { return step }+ return nil+ }+ }+ let first = FixtureTelemetry()+ let during = makeModel(account: FixtureAccount(), telemetry: first)+ await during.beginSignIn()+ #expect(during.identity == "[email protected]")+ #expect(steps(first).isEmpty, "the first run's page records it")+let telemetry = FixtureTelemetry()let model = makeModel(account: FixtureAccount(), telemetry: telemetry)- #expect(model.onboarding.state.step == .welcome)+ model.onboarding.finish()await model.beginSignIn()#expect(model.identity == "[email protected]")- let steps = telemetry.recorded.compactMap { s -> String? in- if case let .step(step, ok) = s, ok { return step }- return nil- }- #expect(steps == ["signed_in"])+ #expect(steps(telemetry) == ["signed_in"])}/// A sign-in that never finishes: Cancel stops it, a timeout fails it,@@ -1271,24 +1279,34 @@ struct ViewModelTests {#expect(model.keyvault.list.pending.count == 2)}- @Test func onboardingFollowsTheCoreAndPersists() throws {+ /// The first run's pages are the web UI's; the model only keeps whether+ /// it is done (and as what) in the state file both shells write.+ @Test func onboardingIsDueUntilItFinishesAndPersists() throws {let path = FileManager.default.temporaryDirectory.appendingPathComponent("cua-mac-onb-\(UUID().uuidString).json").path+ defer { try? FileManager.default.removeItem(atPath: path) }let o = OnboardingModel(statePath: path)- #expect(!o.completed)- #expect(o.view.showMark)- o.send(.start)- o.send(.signinDone)- o.send(.agentsDone(configured: []))- o.send(.presentationDone)- o.send(.driveContinue)- o.send(.modeChosen(mode: .client))- #expect(o.view.step == .done)- #expect(o.view.prompts.count == 3, "Done suggests what to ask a coding agent")- #expect(o.view.prompts.first == "Open a Linux Space and run my test suite in it")- o.finish()- #expect(OnboardingModel(statePath: path).completed)- try? FileManager.default.removeItem(atPath: path)+ #expect(!o.completed && o.mode == .client)+ var launchAtLogin: [Bool] = []+ o.onLaunchAtLogin = { launchAtLogin.append($0) }+ o.finish(mode: .host, launchAtLogin: false)+ #expect(o.completed && o.mode == .host)+ #expect(launchAtLogin == [false])+ #expect(try String(contentsOfFile: path, encoding: .utf8) == #"{"completed":true,"mode":"host"}"#)+ let again = OnboardingModel(statePath: path)+ #expect(again.completed && again.mode == .host, "the next launch reads it")+ #expect(OnboardingModel.readCompleted(path) == true)+ // Settings, Welcome: due again until it finishes; the file stays.+ again.restart()+ #expect(!again.completed)+ #expect(OnboardingModel.readCompleted(path) == true)+ again.finish()+ #expect(again.completed && again.mode == .client)+ // No answer for the checkbox: the app's own rule applies at launch.+ #expect(launchAtLogin == [false])+ // A missing or damaged file: the first run is due.+ #expect(OnboardingModel.readCompleted(path + ".nope") == nil)+ #expect(!OnboardingModel(statePath: path + ".nope").completed)}@Test func notchOpensAfterTheCoresDwell() async {diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/WebUIHostTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/WebUIHostTests.swiftindex 715b81fe05..4a8b6469b1 100644--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/WebUIHostTests.swift+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/WebUIHostTests.swift@@ -592,10 +592,13 @@ struct WebUIHostTests {@Test func showWelcomeAgainRestartsTheFirstRun() async throws {let (bridge, model) = bridge()+ var opened = 0+ model.openOnboarding = { opened += 1 }model.onboarding.finish()#expect(model.onboarding.completed)_ = try await bridge.handle("settings.choose", ["row": "welcome", "option": "show"])#expect(!model.onboarding.completed)+ #expect(opened == 1, "its window opens, even with only Settings up")}@Test func turningNewUIOffClosesItsWindow() {diff --git a/apps/cua-spaces-macos/UITests/CuaSpacesMacUITests.swift b/apps/cua-spaces-macos/UITests/CuaSpacesMacUITests.swiftindex 5324ef3e54..55411054b2 100644--- a/apps/cua-spaces-macos/UITests/CuaSpacesMacUITests.swift+++ b/apps/cua-spaces-macos/UITests/CuaSpacesMacUITests.swift@@ -43,12 +43,13 @@ final class CuaSpacesMacUITests: XCTestCase {XCTAssertTrue(app.otherElements["wizard-summary"].exists || app.staticTexts["Runs on"].exists)}- func testOnboardingStartsWithWelcome() {+ /// The first run is the shared web onboarding in the New UI window, not+ /// a view of the native app: no native Welcome, no native main window.+ func testFirstRunOpensTheNewUIWindow() {let app = launch(onboarded: false)- XCTAssertTrue(app.staticTexts["Welcome to Cua Spaces"].waitForExistence(timeout: 10))- app.buttons["Get started"].click()- // First run no longer has a Command line page: Sign in follows Welcome.- XCTAssertTrue(app.staticTexts["Sign in to reach your computers and Spaces from any of your devices. You can skip this and sign in later."].waitForExistence(timeout: 5))+ XCTAssertTrue(app.windows["cua-new-ui"].waitForExistence(timeout: 15))+ XCTAssertFalse(app.staticTexts["Welcome to Cua Spaces"].exists, "no native onboarding")+ XCTAssertFalse(app.staticTexts["aurora"].exists, "the native main window stays closed")}func testSpaceDetailShowsFactsAndTheDropWell() {diff --git a/apps/cua-spaces-web/e2e/flows.ts b/apps/cua-spaces-web/e2e/flows.tsindex 16aa88c6a4..a0be216676 100644--- a/apps/cua-spaces-web/e2e/flows.ts+++ b/apps/cua-spaces-web/e2e/flows.ts@@ -67,7 +67,10 @@ export const FLOW_PLAN: Record<string, FlowPlan> = {"agents-page": { status: "run", screen: "agents" },"drive-page": { status: "run", screen: "volume" },"menu-count": native("The menu bar item and the notch count Spaces natively; the web UI has neither"),- "drive-onboarding": { status: "run", screen: "onboarding" },+ "drive-onboarding": {+ status: "skip",+ reason: "The 0.10.0 first run has no Cua Volume page (connect the agent, then this computer); Cua Volume is set up from its own page (drive-page, drive-storage)",+ },"drive-storage": { status: "run", screen: "settings" },notifications: { status: "run", screen: "notifications" },about: { status: "run", screen: "settings/about" },@@ -78,6 +81,10 @@ export const FLOW_PLAN: Record<string, FlowPlan> = {experiments: { status: "run", screen: "settings/experiments" },"placement-picker": { status: "run", screen: "new-space" },machines: { status: "run", screen: "machines" },+ "first-run": {+ status: "skip",+ reason: "The page draws firstRun.view as is; src/__tests__/first-run-parity.test.ts replays this flow on the wasm core and src/__tests__/first-run.test.tsx drives the screen",+ },checklist: {status: "skip",reason: "The host app keeps the checklist and reads what it shows (checklist.observeFrom); the page only draws checklist.view of the host's copy (bridge/__tests__/checklist.test.ts)",diff --git a/apps/cua-spaces-web/public/onboarding/agent-claude.webp b/apps/cua-spaces-web/public/onboarding/agent-claude.webpnew file mode 100644index 0000000000..5c7e8f842aBinary files /dev/null and b/apps/cua-spaces-web/public/onboarding/agent-claude.webp differdiff --git a/apps/cua-spaces-web/public/onboarding/agent-codex.webp b/apps/cua-spaces-web/public/onboarding/agent-codex.webpnew file mode 100644index 0000000000..536a86b5deBinary files /dev/null and b/apps/cua-spaces-web/public/onboarding/agent-codex.webp differdiff --git a/apps/cua-spaces-web/public/onboarding/agent-hermes.webp b/apps/cua-spaces-web/public/onboarding/agent-hermes.webpnew file mode 100644index 0000000000..899ec3a674Binary files /dev/null and b/apps/cua-spaces-web/public/onboarding/agent-hermes.webp differdiff --git a/apps/cua-spaces-web/public/onboarding/agent-openclaw.webp b/apps/cua-spaces-web/public/onboarding/agent-openclaw.webpnew file mode 100644index 0000000000..2fa81a0fb4Binary files /dev/null and b/apps/cua-spaces-web/public/onboarding/agent-openclaw.webp differdiff --git a/apps/cua-spaces-web/public/onboarding/agent-other.webp b/apps/cua-spaces-web/public/onboarding/agent-other.webpnew file mode 100644index 0000000000..3bf0d9540eBinary files /dev/null and b/apps/cua-spaces-web/public/onboarding/agent-other.webp differdiff --git a/apps/cua-spaces-web/public/onboarding/cua.webp b/apps/cua-spaces-web/public/onboarding/cua.webpnew file mode 100644index 0000000000..e8772004b6Binary files /dev/null and b/apps/cua-spaces-web/public/onboarding/cua.webp differdiff --git a/apps/cua-spaces-web/public/onboarding/depth.webp b/apps/cua-spaces-web/public/onboarding/depth.webpnew file mode 100644index 0000000000..22abfcaaa7Binary files /dev/null and b/apps/cua-spaces-web/public/onboarding/depth.webp differdiff --git a/apps/cua-spaces-web/public/onboarding/extra.webp b/apps/cua-spaces-web/public/onboarding/extra.webpnew file mode 100644index 0000000000..c2f3818ce5Binary files /dev/null and b/apps/cua-spaces-web/public/onboarding/extra.webp differdiff --git a/apps/cua-spaces-web/public/onboarding/fonts/instrument-serif-latin-400-italic.woff2 b/apps/cua-spaces-web/public/onboarding/fonts/instrument-serif-latin-400-italic.woff2new file mode 100644index 0000000000..197abca255Binary files /dev/null and b/apps/cua-spaces-web/public/onboarding/fonts/instrument-serif-latin-400-italic.woff2 differdiff --git a/apps/cua-spaces-web/public/onboarding/fonts/outfit-latin-500-normal.woff2 b/apps/cua-spaces-web/public/onboarding/fonts/outfit-latin-500-normal.woff2new file mode 100644index 0000000000..264ce74280Binary files /dev/null and b/apps/cua-spaces-web/public/onboarding/fonts/outfit-latin-500-normal.woff2 differdiff --git a/apps/cua-spaces-web/public/onboarding/fonts/outfit-latin-600-normal.woff2 b/apps/cua-spaces-web/public/onboarding/fonts/outfit-latin-600-normal.woff2new file mode 100644index 0000000000..aa32da2408Binary files /dev/null and b/apps/cua-spaces-web/public/onboarding/fonts/outfit-latin-600-normal.woff2 differdiff --git a/apps/cua-spaces-web/public/onboarding/marks/mark-claude.svg b/apps/cua-spaces-web/public/onboarding/marks/mark-claude.svgnew file mode 100644index 0000000000..485b9342ba--- /dev/null+++ b/apps/cua-spaces-web/public/onboarding/marks/mark-claude.svg@@ -0,0 +1 @@+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" fill="#D97757"><path d="m19.6 66.5 19.7-11 .3-1-.3-.5h-1l-3.3-.2-11.2-.3L14 53l-9.5-.5-2.4-.5L0 49l.2-1.5 2-1.3 2.9.2 6.3.5 9.5.6 6.9.4L38 49.1h1.6l.2-.7-.5-.4-.4-.4L29 41l-10.6-7-5.6-4.1-3-2-1.5-2-.6-4.2 2.7-3 3.7.3.9.2 3.7 2.9 8 6.1L37 36l1.5 1.2.6-.4.1-.3-.7-1.1L33 25l-6-10.4-2.7-4.3-.7-2.6c-.3-1-.4-2-.4-3l3-4.2L28 0l4.2.6L33.8 2l2.6 6 4.1 9.3L47 29.9l2 3.8 1 3.4.3 1h.7v-.5l.5-7.2 1-8.7 1-11.2.3-3.2 1.6-3.8 3-2L61 2.6l2 2.9-.3 1.8-1.1 7.7L59 27.1l-1.5 8.2h.9l1-1.1 4.1-5.4 6.9-8.6 3-3.5L77 13l2.3-1.8h4.3l3.1 4.7-1.4 4.9-4.4 5.6-3.7 4.7-5.3 7.1-3.2 5.7.3.4h.7l12-2.6 6.4-1.1 7.6-1.3 3.5 1.6.4 1.6-1.4 3.4-8.2 2-9.6 2-14.3 3.3-.2.1.2.3 6.4.6 2.8.2h6.8l12.6 1 3.3 2 1.9 2.7-.3 2-5.1 2.6-6.8-1.6-16-3.8-5.4-1.3h-.8v.4l4.6 4.5 8.3 7.5L89 80.1l.5 2.4-1.3 2-1.4-.2-9.2-7-3.6-3-8-6.8h-.5v.7l1.8 2.7 9.8 14.7.5 4.5-.7 1.4-2.6 1-2.7-.6-5.8-8-6-9-4.7-8.2-.5.4-2.9 30.2-1.3 1.5-3 1.2-2.5-2-1.4-3 1.4-6.2 1.6-8 1.3-6.4 1.2-7.9.7-2.6v-.2H49L43 72l-9 12.3-7.2 7.6-1.7.7-3-1.5.3-2.8L24 86l10-12.8 6-7.9 4-4.6-.1-.5h-.3L17.2 77.4l-4.7.6-2-2 .2-3 1-1 8-5.5Z"></path></svg>\ No newline at end of filediff --git a/apps/cua-spaces-web/public/onboarding/marks/mark-hermes.svg b/apps/cua-spaces-web/public/onboarding/marks/mark-hermes.svgnew file mode 100644index 0000000000..74032799e9--- /dev/null+++ b/apps/cua-spaces-web/public/onboarding/marks/mark-hermes.svg@@ -0,0 +1,104 @@+<?xml version="1.0" encoding="UTF-8" standalone="no"?>+<svg+ id="Layer_1"+ version="1.1"+ viewBox="0 0 5487.0615 5487.0615"+ sodipodi:docname="Nous Girl Without Frame.svg"+ width="5487.0615"+ height="5487.0615"+ inkscape:version="1.4.4 (dcaf3e7, 2026-05-05)"+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"+ xmlns="http://www.w3.org/2000/svg"+ xmlns:svg="http://www.w3.org/2000/svg">+ <defs+ id="defs10">+ <clipPath+ clipPathUnits="userSpaceOnUse"+ id="clipPath10">+ <rect+ style="fill:#000000"+ id="rect11"+ width="5600"+ height="5600"+ x="0"+ y="0" />+ </clipPath>+ <clipPath+ clipPathUnits="userSpaceOnUse"+ id="clipPath12">+ <rect+ style="opacity:0.42;fill:#00ff00;stroke-width:0.993322"+ id="rect13"+ width="5525.4526"+ height="5600"+ x="0"+ y="0" />+ </clipPath>+ </defs>+ <sodipodi:namedview+ id="namedview10"+ pagecolor="#ffffff"+ bordercolor="#000000"+ borderopacity="0.25"+ inkscape:showpageshadow="2"+ inkscape:pageopacity="0.0"+ inkscape:pagecheckerboard="true"+ inkscape:deskcolor="#d1d1d1"+ inkscape:antialias-rendering="true"+ inkscape:clip-to-page="false"+ labelstyle="default"+ showgrid="false"+ showguides="true"+ inkscape:zoom="0.0625"+ inkscape:cx="5240"+ inkscape:cy="4864"+ inkscape:window-width="1635"+ inkscape:window-height="1020"+ inkscape:window-x="-6"+ inkscape:window-y="-6"+ inkscape:window-maximized="1"+ inkscape:current-layer="Layer_1">+ <inkscape:grid+ id="grid10"+ units="px"+ originx="-56.469222"+ originy="-56.469315"+ spacingx="1"+ spacingy="1"+ empcolor="#0099e5"+ empopacity="0.30196078"+ color="#0099e5"+ opacity="0.14901961"+ empspacing="5"+ enabled="true"+ visible="false" />+ <sodipodi:guide+ position="189.61933,4064.4693"+ orientation="1,0"+ id="guide17"+ inkscape:locked="false" />+ <sodipodi:guide+ position="5132.0393,3472.4693"+ orientation="1,0"+ id="guide18"+ inkscape:locked="false" />+ <sodipodi:guide+ position="2726.527,5461.2663"+ orientation="0,-1"+ id="guide19"+ inkscape:locked="false" />+ <sodipodi:guide+ position="4711.3214,112.93857"+ orientation="0,-1"+ id="guide20"+ inkscape:locked="false" />+ </sodipodi:namedview>+ <!-- Generator: Adobe Illustrator 30.0.0, SVG Export Plug-In . SVG Version: 2.1.1 Build 123) -->+ <path+ id="path14"+ style="opacity:1;fill:#000000"+ inkscape:label="nous girl"+ d="M 2780.0999 2572.1925 C 2731.3999 2572.7925 2683.4019 2574.5933 2673.3019 2576.2933 C 2641.3019 2580.3933 2609.7995 2583.9939 2590.1995 2585.7939 C 2558.6995 2588.6939 2461.4006 2604.1934 2436.0006 2609.4934 C 2430.6006 2610.6934 2417.6007 2613.5942 2407.5007 2615.3942 C 2396.9007 2617.7942 2381.4 2620.6937 2373.1 2622.4937 C 2364.3 2624.2937 2350.0005 2627.1938 2341.1005 2628.9938 C 2297.8005 2637.7938 2215.4009 2657.4932 2195.8009 2662.7932 C 2189.3009 2664.5932 2181.499 2666.2947 2179.199 2666.2947 C 2176.899 2666.2947 2169.8014 2668.0943 2163.8014 2669.7943 C 2158.5014 2671.5943 2146.5999 2674.4938 2138.1999 2676.8938 C 2110.2999 2683.9938 2106.2018 2685.2929 2084.8018 2691.1929 C 2072.9018 2694.6929 2059.8019 2698.2929 2056.3019 2699.4929 C 2034.9019 2705.3929 2015.3015 2711.9934 1989.8015 2720.8934 C 1973.8015 2726.1934 1957.1997 2731.5932 1952.9997 2732.7932 C 1948.2997 2734.5932 1942.3011 2736.2934 1939.9011 2737.4934 C 1937.0011 2738.6934 1925.1005 2742.8921 1913.8005 2746.9921 C 1901.9005 2751.0921 1888.8006 2755.7914 1885.3006 2757.6914 C 1881.1006 2759.4914 1869.9003 2763.5918 1860.3003 2767.0918 C 1850.3003 2770.5918 1839.0002 2774.8924 1835.4002 2776.5924 C 1827.7002 2780.0924 1796.302 2793.7927 1777.302 2801.5927 C 1661.602 2848.9927 1452.2004 2956.3923 1391.6004 2998.4923 C 1387.4004 3001.3923 1370.9005 3011.4918 1354.8005 3022.1918 C 1312.0005 3048.8918 1272.9013 3074.3922 1253.9013 3088.6922 C 1249.2013 3092.1922 1237.2994 3100.5915 1227.1994 3107.6915 C 1207.5994 3121.3915 1120.4013 3186.4936 1103.8013 3200.7936 C 1042.1013 3251.1936 1002.2989 3287.3931 950.69897 3339.5931 C 911.59897 3379.3931 864.10036 3432.7915 851.00036 3451.1915 C 849.20036 3453.5915 841.50097 3464.2936 833.80097 3474.2936 C 813.60097 3501.5936 773.80044 3562.0926 752.50044 3599.9926 C 713.90044 3666.9926 647.50056 3803.4919 635.60056 3839.0919 C 632.70056 3847.8919 629.00156 3855.6932 627.80156 3856.2932 C 626.60156 3857.4932 625.99975 3859.7927 625.99975 3861.5927 C 625.99975 3863.3927 621.90105 3876.992 616.50105 3890.692 C 609.40105 3910.892 594.60095 3954.7915 583.30095 3992.6915 C 580.90095 3998.5915 572.69995 4030.0928 568.99995 4044.8928 C 561.79995 4073.3928 552.3999 4117.2925 552.3999 4122.0925 C 552.3999 4126.8925 551.20065 4130.4923 550.00065 4133.9923 C 548.80065 4136.8923 546.50045 4147.6925 545.30045 4157.0925 C 544.10045 4166.4925 540.59977 4190.2931 537.59977 4209.8931 C 532.89977 4242.4931 532.30212 4253.6937 532.30212 4342.7937 C 532.30212 4431.8937 532.89873 4451.2934 541.69873 4502.8934 C 549.49873 4546.1934 559.50006 4582.3942 575.50006 4623.8942 C 578.40006 4630.9942 580.80149 4638.1924 580.80149 4638.6924 C 580.80149 4639.8924 589.70013 4658.2925 600.40013 4680.1925 C 617.00013 4713.9925 625.99914 4728.8923 643.19914 4755.5923 C 655.09914 4773.9923 687.60031 4810.7922 715.60031 4837.4922 C 733.40031 4855.2922 750.00089 4870.6928 751.80089 4871.8928 C 753.60089 4873.0928 762.50077 4880.2942 772.00077 4887.2942 C 815.80077 4922.2942 897.69957 4966.7939 938.09957 4977.3939 C 941.59957 4978.5939 952.89964 4982.0941 962.99964 4985.7941 C 1000.3996 4998.2941 1026.501 5005.3935 1031.801 5002.9935 C 1034.201 5002.3935 1033.6004 5001.1932 1030.6004 5000.0932 C 1017.5004 4994.6932 987.80012 4972.1933 970.60012 4954.9933 C 960.60012 4943.6933 945.70125 4925.8918 938.00125 4914.6918 C 923.20125 4892.7918 892.90185 4838.7923 885.80185 4820.9923 C 883.40185 4815.0923 879.3008 4805.5921 877.0008 4799.6921 C 874.6008 4793.7921 871.70069 4786.5945 870.50069 4784.2945 C 867.60069 4778.3945 857.9995 4751.0939 851.4995 4731.4939 C 846.1995 4716.6939 845.59958 4707.0929 849.69958 4707.0929 C 851.49958 4706.4929 857.39972 4717.0931 864.49972 4730.1931 C 892.39972 4784.7931 936.9016 4841.7937 987.9016 4887.9937 C 1020.5016 4917.6937 1072.1013 4958.5931 1078.0013 4958.5931 C 1083.9013 4958.5931 1082.0991 4960.9939 1085.1991 4964.4939 L 1091.6992 4969.7934 L 1089.9011 4999.4939 C 1088.7011 5028.5939 1085.1995 5067.6918 1076.1995 5153.1918 C 1073.7995 5178.7918 1070.3 5212.5939 1069.1 5227.8939 C 1067.9 5243.2939 1066.2009 5266.9933 1064.9009 5280.0933 C 1063.7009 5293.0933 1060.8001 5323.3922 1059.0001 5347.6922 C 1056.6001 5371.9922 1053.7013 5403.9928 1051.3013 5418.8928 C 1049.5013 5433.6928 1048.401 5450.8931 1048.401 5456.7931 C 1048.401 5462.6931 1046.6021 5481.7921 1044.3021 5499.5921 C 1038.4021 5553.5921 1034.1997 5592.0928 1031.1997 5620.5928 C 1027.6997 5658.4928 1022.3018 5708.9931 1019.3018 5728.4931 C 1016.9018 5748.6931 1010.5013 5801.9917 1008.0013 5828.1917 C 1004.5013 5861.9917 998.50199 5911.893 997.30199 5915.393 C 996.10199 5917.193 994.90048 5927.8919 993.80048 5939.6919 C 989.70048 5974.6919 986.70083 5997.1924 982.00083 6031.0924 C 979.10083 6048.8924 976.10138 6070.7934 974.90138 6080.3934 C 973.70138 6090.4934 972.00176 6099.993 971.40176 6102.293 C 970.80176 6104.093 969.00025 6113.5928 967.90025 6122.4928 C 965.50025 6138.4928 963.20171 6150.994 954.80171 6194.894 C 952.40171 6206.194 949.5016 6220.9922 948.3016 6228.0922 C 947.1016 6235.1922 944.20026 6249.9942 941.20026 6261.2942 C 938.80026 6272.5942 935.90015 6285.6928 934.70015 6290.9928 C 921.00015 6352.0928 887.2005 6433.994 861.2005 6468.394 C 830.9005 6508.094 795.30105 6533.693 757.40105 6542.493 C 733.00105 6548.393 660.10059 6546.5927 639.30059 6539.5927 C 599.50059 6526.4927 577.60041 6512.2942 546.20041 6481.3942 C 504.60041 6439.2942 482.70073 6391.2936 469.00073 6313.4936 C 464.30073 6286.1936 464.89941 6192.4916 470.19941 6165.1916 C 479.69941 6118.2916 486.19971 6098.1946 508.09971 6054.2946 C 517.59971 6034.6946 524.70107 6018.6921 523.50107 6018.0921 C 521.10107 6016.2921 472.50039 6071.4924 454.10039 6096.4924 C 445.70039 6108.3924 436.8992 6120.193 435.0992 6122.593 C 428.4992 6131.393 412.50007 6156.9936 412.50007 6158.7936 C 412.50007 6160.5936 409.5993 6164.0921 406.5993 6168.1921 C 395.9993 6182.9921 376.40126 6238.1935 369.80126 6271.9935 C 359.80126 6323.5935 359.2003 6331.2916 359.2003 6403.6916 C 359.2003 6476.0916 360.40069 6490.8929 368.60069 6525.8929 C 379.30069 6569.1929 384.0007 6581.593 403.6007 6620.793 C 427.9007 6670.593 460.50034 6712.6936 499.20034 6745.3936 C 527.00034 6768.4936 537.70159 6775.6929 569.80159 6791.0929 C 604.20159 6808.2929 614.19931 6811.2927 661.69931 6821.3927 C 705.59931 6830.8927 753.00167 6828.4926 814.80167 6814.8926 C 837.90167 6808.9926 900.20086 6782.2934 928.60086 6765.5934 C 950.50086 6752.4934 954.69964 6749.593 962.99964 6744.193 C 1040.1996 6690.793 1103.6008 6620.7947 1150.5008 6537.7947 C 1164.2008 6514.6947 1174.2004 6493.893 1180.7004 6478.993 C 1183.6004 6472.493 1187.3006 6467.6925 1189.1006 6467.6925 C 1193.8006 6467.6925 1193.8 6466.4939 1189.7 6491.3939 C 1183.1 6529.3939 1169.0003 6588.0931 1164.1003 6592.2931 C 1162.9003 6593.4931 1162.3004 6596.3932 1162.3004 6598.7932 C 1162.3004 6601.1932 1160.4996 6607.1936 1158.1996 6611.8936 C 1155.7996 6616.5936 1152.8995 6623.6943 1151.6995 6627.8943 C 1143.8995 6646.2943 1113.8012 6703.792 1101.9012 6721.592 C 1078.8012 6757.192 1066.9012 6771.9934 1031.9012 6806.9934 C 969.0012 6869.2934 918.10062 6899.5938 845.60062 6916.7938 C 822.50062 6922.6938 745.89873 6922.6931 722.19873 6917.3931 C 696.09873 6911.4931 639.70064 6894.2934 633.80064 6890.7934 C 630.90064 6889.5934 627.30041 6887.8931 625.40041 6887.8931 C 621.90041 6887.8931 570.20028 6862.9938 548.90028 6850.4938 C 518.00028 6833.2938 500.80003 6819.5935 470.50003 6790.4935 C 429.60003 6750.7935 406.40062 6719.893 383.30062 6674.193 C 373.80062 6655.193 370.80091 6647.4929 359.50091 6614.2929 C 349.50091 6582.7929 342.89878 6555.4938 338.19878 6519.8938 C 336.99878 6510.3938 335.30047 6498.4932 333.50047 6493.7932 C 332.30047 6489.0932 331.69933 6481.2926 331.09933 6475.9926 C 331.09933 6470.6926 330.5013 6464.6916 329.3013 6461.6916 C 328.1013 6458.9583 326.93501 6459.3607 325.80168 6462.894 C 323.40168 6472.394 324.00036 6595.1928 327.00036 6612.3928 C 328.20036 6620.7928 329.89999 6633.0921 330.49999 6639.6921 C 333.39999 6668.1921 345.89989 6722.1934 358.99989 6761.8934 C 368.39989 6790.3934 402.80137 6861.5939 415.90137 6879.9939 C 430.20137 6900.1939 459.20023 6934.5932 475.20023 6950.5932 C 516.80023 6993.3932 585.50045 7041.2921 646.60045 7071.5921 C 658.50045 7077.4921 668.49938 7082.193 669.09938 7082.193 C 669.69938 7082.193 676.80008 7085.0944 685.10008 7089.2944 C 693.50008 7092.7944 715.40175 7101.1931 733.80175 7107.0931 C 751.60175 7113.5931 767.60176 7119.5929 768.80176 7120.7929 C 770.00176 7121.9929 774.2001 7122.5928 777.2001 7122.5928 C 780.2001 7122.5928 786.70053 7123.7939 790.30053 7124.9939 C 794.40053 7126.1939 803.99954 7129.0928 810.99954 7130.8928 C 831.19954 7136.1928 831.19904 7136.7927 834.69904 7167.6927 C 837.09904 7193.2927 842.4004 7218.0924 850.1004 7241.1924 C 873.2004 7306.4924 924.30176 7363.9919 988.90176 7396.5919 C 1007.9017 7406.0919 1013.3013 7408.4936 1020.9013 7410.2936 C 1023.3013 7411.4936 1029.6995 7413.1914 1035.6995 7415.6914 C 1040.9995 7417.4914 1055.9015 7422.1932 1068.9015 7425.7932 C 1090.8015 7431.6932 1093.7994 7432.2934 1152.5994 7432.2934 C 1211.3994 7432.2934 1215.4999 7431.6938 1235.6999 7426.9938 C 1267.1999 7419.2938 1280.7999 7414.4919 1305.6999 7402.0919 C 1381.6999 7364.1919 1453.4998 7291.0933 1492.5998 7213.9933 C 1507.9998 7183.0933 1516.3998 7177.7922 1510.9998 7201.4922 C 1506.2998 7226.4922 1497.3018 7264.9931 1490.8018 7292.1931 C 1483.7018 7321.8931 1462.9021 7387.192 1452.3021 7413.192 C 1404.2021 7532.992 1359.6993 7604.7933 1291.5993 7675.3933 C 1270.2993 7696.7933 1247.0999 7719.2947 1239.3999 7725.7947 L 1233.1172 7730.9921 L 1826.8431 7730.9921 C 1847.415 7723.3614 1923.4639 7684.1631 1948.4999 7667.5924 C 1961.5999 7659.1924 1971.1009 7656.893 1979.4009 7660.493 C 1981.8009 7661.093 1983.4999 7662.8919 1983.4999 7664.5919 C 1983.4999 7666.2919 1974.0009 7677.0939 1962.8009 7689.4939 C 1951.5009 7701.9939 1937.8004 7717.9939 1933.1004 7724.4939 L 1928.1469 7730.9921 L 1950.7441 7730.9921 L 1953.2001 7726.4923 C 1959.7001 7715.7923 1974.5001 7693.2929 1988.2001 7674.2929 C 1995.3001 7664.2929 1995.8995 7664.2933 2013.6995 7662.4933 C 2023.1995 7661.8933 2034.4002 7660.693 2038.0002 7659.593 C 2045.1002 7658.293 2046.8004 7661.7921 2042.7004 7670.1921 C 2038.0004 7680.1921 2033.201 7692.6921 2025.501 7713.4921 L 2019.1597 7730.9921 L 2103.5421 7730.9921 L 2108.6998 7721.0926 C 2113.3998 7712.1926 2120.5005 7700.2933 2124.7005 7693.7933 C 2129.4005 7687.8933 2136.5006 7677.1919 2141.3006 7670.0919 C 2176.3006 7620.2919 2247.5004 7534.1934 2276.6004 7506.8934 C 2306.9004 7478.3934 2325.3021 7468.9933 2325.3021 7481.9933 C 2325.3021 7494.9933 2319.401 7498.5931 2312.801 7512.2931 C 2295.601 7546.0931 2253.4001 7597.094 2165.0001 7691.394 L 2128.064 7730.9921 L 2270.3669 7730.9921 L 2279.6009 7719.7937 C 2293.9009 7702.5937 2328.8996 7663.4926 2369.1996 7618.8926 C 2380.4996 7605.8926 2400.1005 7584.4941 2412.0005 7570.7941 C 2457.1005 7518.5941 2474.3011 7500.7938 2499.8011 7479.4938 C 2525.3011 7458.1938 2544.8005 7445.0932 2552.0005 7445.0932 C 2559.2005 7445.0932 2555.5001 7447.9937 2555.5001 7456.3937 C 2555.5001 7464.7937 2553.1004 7471.1942 2545.5004 7484.2942 C 2540.2004 7493.6942 2533.5994 7503.2926 2531.1994 7505.5926 C 2525.2994 7512.6926 2516.9002 7528.6935 2518.7002 7529.9935 C 2519.3002 7531.1935 2520.999 7530.5925 2522.699 7529.4925 C 2641.199 7452.1925 2763.4005 7380.8937 2886.3005 7310.8937 C 2947.7005 7275.8937 3009.4012 7241.1924 3070.8012 7206.1924 C 3109.3012 7184.1924 3187.8005 7120.494 3235.3005 7133.294 C 3228.8005 7143.894 3218.9996 7151.8931 3209.0996 7160.4931 C 3174.0996 7190.7931 3030.0021 7334.2931 3006.8021 7362.1931 C 2984.9021 7388.8931 2961.6997 7418.4944 2952.1997 7432.7944 C 2910.9997 7493.1944 2863.6003 7548.1942 2811.6003 7599.3942 C 2763.7003 7646.8942 2714.3996 7697.292 2702.5996 7711.592 L 2685.8426 7730.9921 L 2814.3777 7730.9921 L 2815.4005 7728.6931 C 2833.0005 7687.9931 2851.6012 7647.5923 2871.0012 7607.6923 C 2910.2012 7526.9923 2953.5013 7447.493 3011.0013 7378.693 C 3085.4013 7289.693 3182.0001 7220.8938 3286.7001 7170.9938 C 3391.2922 7121.2451 3503.9683 7089.8585 3617.8484 7068.9584 C 3505.3638 7089.6457 3391.9103 7162.3651 3304.8013 7231.9924 L 3194.3014 7332.192 C 3141.3014 7393.092 3096.1012 7439.2917 3057.0012 7510.6917 C 3020.5012 7577.5917 2986.8995 7643.7927 2968.6995 7718.3927 C 2967.6995 7722.4927 2966.5017 7726.893 2963.3017 7729.593 C 2962.591 7730.1655 2961.8237 7730.6241 2961.0177 7730.9921 L 3081.37 7730.9921 C 3100.3201 7620.3128 3175.0642 7518.7099 3250.6999 7438.9939 C 3337.9999 7346.8939 3442.6014 7263.592 3555.3014 7205.092 C 3723.7014 7117.692 3918.1003 7131.5934 4106.4003 7185.4934 C 4315.5003 7245.2934 4500.9016 7447.9937 4540.8016 7666.3937 L 4553.5069 7730.9921 L 4613.0137 7730.9921 C 4610.2698 7715.6766 4604.4129 7682.8509 4602.0006 7670.6931 C 4544.7006 7379.2931 4329.8999 7161.0925 4043.5999 7093.8925 C 4002.9999 7084.3925 3951.8004 7077.4939 3910.3004 7073.3939 C 3901.9004 7072.7939 3893.0999 7070.9943 3890.6999 7069.8943 C 3882.2999 7065.1943 3888.9003 7062.7935 3903.8003 7063.9935 C 3911.5003 7064.5935 3942.8991 7066.3931 3973.1991 7067.4931 C 4024.1991 7069.8931 4041.9994 7070.9928 4081.0994 7077.4928 C 4089.4994 7078.6928 4103.6008 7080.3918 4113.1008 7081.5918 C 4207.4008 7093.2918 4296.0013 7135.2934 4370.3013 7193.7934 C 4407.1013 7222.7934 4444.5004 7255.0936 4473.9004 7291.4936 C 4518.8004 7346.9936 4560.0017 7403.993 4587.8017 7469.893 C 4623.39 7554.0921 4639.4111 7641.3538 4652.6648 7730.9921 L 4701.4232 7730.9921 C 4696.1283 7680.414 4693.0081 7627.9224 4720.5 7585.7946 C 4756.4 7530.8946 4816.7006 7499.8924 4865.4006 7457.5924 C 4917.4006 7412.3924 4966.6988 7359.9935 4996.1988 7296.9935 C 5030.8988 7239.3935 5076.5999 7098.1929 5092.4999 6992.7929 C 5101.4999 6933.1929 5104.3013 6872.9939 5107.0013 6812.7939 C 5110.6013 6734.3939 5108.6008 6674.6916 5099.4008 6584.1916 C 5088.0008 6471.6916 5071.1999 6360.5922 5047.3999 6250.1922 C 5024.9999 6145.7922 5003.501 6037.1942 4971.501 5935.2942 C 4969.701 5929.3942 4968.6007 5922.7922 4968.6007 5920.4922 C 4968.6007 5918.1922 4966.7992 5911.692 4965.0992 5905.692 C 4963.2992 5899.192 4959.8004 5887.2939 4957.4004 5878.9939 C 4955.0004 5870.5939 4952.101 5858.2927 4950.301 5851.6927 C 4948.501 5845.1927 4945.6002 5836.2928 4944.4002 5831.4928 C 4943.2002 5826.7928 4939.6992 5812.4933 4935.5992 5799.4933 C 4932.0992 5786.4933 4927.1999 5768.6925 4924.8999 5760.3925 C 4922.4999 5751.9925 4919.601 5742.5926 4919.001 5740.1926 C 4917.801 5737.2926 4914.9007 5727.6942 4912.4007 5718.8942 C 4910.6007 5709.3942 4905.9003 5693.2924 4903.0003 5682.0924 C 4899.5003 5670.7924 4895.7994 5658.3925 4895.1994 5653.5925 C 4893.9994 5648.8925 4892.3004 5642.8934 4891.1004 5639.2934 C 4889.3004 5636.3934 4886.4003 5626.2932 4884.6003 5617.9932 C 4882.2003 5609.5932 4878.7013 5597.7925 4876.8013 5591.8925 C 4875.6013 5585.9925 4872.7006 5576.4923 4870.9006 5570.5923 C 4869.7006 5564.6923 4866.7991 5555.1939 4865.5991 5549.2939 C 4863.7991 5543.3939 4860.8997 5531.4931 4858.4997 5523.0931 C 4856.0997 5514.7931 4852.6009 5502.3939 4850.8009 5495.8939 C 4847.3009 5482.8939 4834.2004 5434.1918 4831.2004 5421.1918 C 4830.0004 5416.4918 4827.1003 5405.794 4824.7003 5397.394 C 4817.0003 5366.494 4814.6997 5357.6934 4805.0997 5317.8934 C 4799.7997 5295.9934 4795.5991 5275.793 4795.5991 5273.493 C 4795.5991 5271.193 4793.7995 5265.192 4792.0995 5259.192 C 4790.2995 5253.792 4787.4 5240.7928 4785 5230.0928 C 4782.6 5219.3928 4779.6999 5208.1921 4778.4999 5203.9921 C 4777.2999 5199.8921 4775.0016 5192.0915 4773.8016 5186.1915 C 4773.2016 5180.2915 4770.3009 5168.3927 4767.9009 5160.0927 C 4760.2009 5129.1927 4757.3004 5116.1926 4754.8004 5101.9926 C 4753.6004 5094.1926 4751.8996 5086.592 4750.6996 5084.192 C 4749.4996 5082.392 4747.2007 5072.8936 4744.8007 5062.8936 C 4740.1007 5040.3936 4734.1009 5014.1929 4731.1009 5003.5929 C 4726.4009 4982.8929 4719.2018 4951.3923 4716.8018 4940.6923 C 4715.6018 4934.1923 4712.7004 4922.8941 4711.5004 4915.7941 C 4709.7004 4908.6941 4706.101 4895.0931 4704.401 4884.8931 C 4702.001 4875.3931 4698.9994 4860.4935 4697.1994 4852.8935 C 4694.7994 4845.1935 4691.9 4830.9925 4690.1 4821.9925 C 4687.7 4813.1925 4685.3992 4801.7924 4684.1992 4797.0924 C 4682.9992 4792.3924 4680.1003 4780.4931 4678.3003 4769.7931 C 4675.9003 4759.0931 4671.1991 4737.1929 4667.5991 4719.9929 C 4663.4991 4702.7929 4659.8989 4686.1926 4659.1989 4682.0926 C 4658.5989 4677.9926 4656.8006 4667.2926 4654.5006 4657.1926 C 4646.2006 4616.1926 4643.1995 4598.4928 4641.9995 4591.8928 C 4640.7995 4584.7928 4637.299 4562.7928 4630.699 4530.1928 C 4628.899 4521.3928 4625.4012 4504.0944 4623.5012 4492.2944 C 4621.1012 4480.3944 4618.2011 4467.292 4617.0011 4462.592 C 4615.8011 4457.892 4615.1993 4451.2929 4615.1993 4448.2929 C 4615.1993 4445.2929 4612.801 4433.4922 4610.501 4422.1922 C 4601.601 4385.2922 4601.0004 4381.8929 4601.0004 4376.4929 C 4601.0004 4371.0929 4599.2013 4363.3928 4596.8013 4353.3928 C 4595.0013 4343.8928 4591.4999 4327.7913 4589.6999 4317.6913 C 4587.8999 4308.2913 4584.3005 4292.7933 4582.6005 4284.5933 C 4580.8005 4276.1933 4577.9003 4260.7927 4576.1003 4250.1927 C 4570.7003 4225.8927 4565.4006 4202.0931 4562.4006 4193.2931 C 4561.2006 4189.1931 4560.6007 4183.7932 4560.6007 4181.3932 C 4560.6007 4178.9932 4558.7992 4171.9932 4557.0992 4164.7932 C 4555.2992 4158.2932 4551.7997 4145.7938 4549.9997 4137.4938 C 4547.5997 4129.0938 4544.6996 4118.4922 4543.4996 4113.6922 C 4541.6996 4108.9922 4540.0013 4101.1935 4538.8013 4095.8935 C 4536.4013 4081.0935 4510.9006 3994.3934 4504.4006 3976.0934 C 4503.2006 3974.2934 4501.5004 3968.3931 4499.7004 3963.0931 C 4498.5004 3957.6931 4492.0007 3939.9936 4486.0007 3922.7936 C 4479.5007 3905.5936 4473.5004 3889.5937 4473.0004 3885.9937 C 4470.6004 3880.0937 4461.1013 3854.4923 4450.4013 3825.4923 C 4440.9013 3800.5923 4431.9992 3777.9937 4429.0992 3770.8937 C 4427.2992 3766.7937 4421.4006 3752.4942 4416.0006 3738.8942 C 4404.2006 3706.2942 4392.901 3678.8927 4385.801 3663.5927 C 4382.901 3657.0927 4380.4013 3650.493 4380.4013 3649.893 C 4380.4013 3648.693 4377.9992 3643.9924 4375.6992 3638.5924 C 4373.2992 3632.6924 4367.399 3618.9929 4362.699 3606.5929 C 4350.799 3577.4929 4346.101 3565.5925 4315.801 3505.0925 C 4285.501 3442.7925 4274.8014 3423.193 4242.3014 3368.093 C 4228.6014 3344.993 4216.1008 3322.9932 4214.4008 3319.3932 C 4210.3008 3312.2932 4191.2988 3284.994 4181.1988 3271.894 C 4177.6988 3267.194 4172.7995 3260.0933 4170.4995 3255.8933 C 4161.6995 3242.1933 4115.3013 3182.992 4094.0013 3158.592 C 4082.1013 3144.892 4064.2999 3124.1934 4053.6999 3112.2934 C 4025.7999 3079.6934 3945.2015 3003.7935 3892.4015 2960.3935 C 3855.6015 2929.4935 3801.6996 2888.5936 3785.5996 2878.4936 C 3781.4996 2876.0936 3767.8005 2866.6937 3754.7005 2858.2937 C 3684.7005 2811.3937 3611.2005 2771.093 3534.6005 2737.293 C 3501.4005 2722.993 3488.9 2717.693 3469.9 2710.593 C 3448.6 2702.293 3439.0007 2698.7929 3432.5007 2695.7929 C 3428.3007 2693.9929 3415.3015 2689.2932 3403.4015 2685.7932 C 3391.5015 2681.6932 3379.1005 2677.4928 3376.2005 2676.3928 C 3370.8005 2673.9928 3342.4005 2665.0922 3287.8005 2648.4922 C 3228.5005 2631.2922 3220.7996 2628.893 3178.6996 2619.393 C 3129.3996 2607.593 3114.6017 2604.5947 3068.3017 2596.2947 C 3057.0017 2594.4947 3039.2989 2590.9915 3029.1989 2589.1915 C 3019.1989 2587.3915 3006.6992 2585.6918 3002.5992 2585.6918 C 2998.4992 2585.6918 2985.4005 2584.4922 2974.7005 2582.1922 C 2924.9005 2573.7922 2870.8999 2570.8925 2780.0999 2572.1925 z M 2352.5995 2672.1917 C 2434.4995 2672.1917 2444.5017 2672.1917 2513.9017 2682.8929 C 2535.8017 2686.3929 2560.8013 2691.6931 2574.5013 2695.8931 C 2580.4013 2697.6931 2587.0004 2699.3927 2588.8004 2699.3927 C 2592.9004 2699.3927 2638.1003 2713.0928 2644.0003 2715.9928 C 2645.8003 2717.1928 2649.2998 2718.3939 2651.0998 2718.3939 C 2652.8998 2718.3939 2658.3003 2720.1935 2662.4003 2721.8935 C 2667.1003 2723.6935 2678.9996 2728.3928 2689.6996 2732.5928 C 2699.6996 2736.6928 2713.5001 2741.9925 2719.4001 2744.3925 C 2724.8001 2746.7925 2737.8006 2752.7929 2747.3006 2757.4929 C 2756.8006 2762.1929 2765.0994 2765.7929 2765.0994 2765.7929 C 2767.4994 2765.7929 2825 2797.7913 2834.5 2803.6913 C 2839.2 2807.1913 2854.7014 2817.3942 2868.3014 2826.2942 C 2882.0014 2835.6942 2896.7996 2845.8932 2901.4996 2848.7932 C 2906.7996 2852.2932 2926.4002 2867.7919 2946.0002 2883.1919 C 2983.4002 2912.8919 3082.9988 3010.0945 3115.6988 3049.2945 C 3144.7988 3083.6945 3166.1015 3110.3928 3183.3015 3134.0928 C 3220.1015 3183.3928 3226.1007 3191.5933 3230.8007 3198.7933 C 3233.2007 3202.8933 3240.2014 3214.1929 3246.8014 3224.3929 C 3282.4014 3277.1929 3313.3013 3331.1931 3345.3013 3395.7931 C 3377.3013 3461.0931 3400.5012 3509.6936 3400.5012 3513.8936 C 3400.5012 3518.0936 3401.7015 3519.2938 3403.4015 3522.2938 C 3408.1015 3530.6938 3420.6005 3561.9938 3424.1005 3573.8938 C 3425.7005 3579.0938 3428.1017 3584.3926 3429.3017 3586.1926 C 3429.9017 3587.3926 3433.5007 3596.8925 3437.1007 3606.3925 C 3440.0007 3615.7925 3446.5017 3634.1933 3451.4017 3647.2933 C 3456.1017 3660.3933 3461.4016 3676.3926 3463.3016 3682.8926 C 3465.7016 3689.3926 3468.601 3698.2925 3470.401 3703.0925 C 3472.201 3707.7925 3475.1011 3717.3928 3476.9011 3724.3928 C 3479.3011 3731.4928 3482.2006 3742.1923 3484.0006 3748.0923 C 3485.8006 3753.9923 3489.3 3764.6936 3491.1 3771.7936 C 3493.5 3778.8936 3496.5009 3790.1927 3498.9009 3796.1927 C 3500.7009 3802.6927 3502.4005 3809.8915 3502.4005 3812.1915 C 3502.4005 3814.4915 3503.0004 3819.2931 3504.2004 3822.1931 C 3506.6004 3828.0931 3514.9013 3866.0935 3524.9013 3915.3935 C 3526.7013 3926.0935 3530.2008 3941.4935 3532.0008 3950.3935 C 3536.7008 3972.2935 3536.1021 3989.4921 3530.8021 3998.4921 C 3526.7021 4004.9921 3513.6001 4013.8934 3507.7001 4013.8934 C 3501.8001 4013.8934 3501.2021 4016.2917 3495.8021 4018.5917 C 3484.0021 4024.4917 3472.1008 4036.9935 3470.3008 4047.0935 C 3467.9008 4057.1935 3474.4012 4075.5935 3483.4012 4083.8935 C 3489.3012 4089.7935 3523.2012 4106.4926 3528.5012 4106.4926 C 3537.3012 4106.4926 3614.5012 4149.1932 3641.8012 4169.3932 C 3663.1012 4184.7932 3689.9017 4211.4936 3689.9017 4217.4936 C 3689.9017 4223.4936 3682.7998 4220.9934 3671.4998 4212.7934 C 3664.9998 4208.0934 3645.3998 4197.3925 3628.1998 4188.3925 C 3610.3998 4178.8925 3595.5997 4171.1925 3594.9997 4169.9925 C 3594.9997 4168.7925 3593.2001 4168.1926 3591.5001 4168.1926 C 3589.8001 4168.1926 3580.1998 4163.992 3570.1998 4158.692 C 3559.4998 4153.392 3534.6008 4142.0924 3514.5008 4133.0924 C 3471.8008 4115.2924 3461.7003 4106.9933 3453.5003 4083.7933 C 3437.5003 4039.3933 3436.3006 4019.693 3448.1006 4009.093 C 3452.2006 4005.593 3461.2015 3999.5926 3468.8015 3995.9926 C 3475.9015 3992.4926 3486.6004 3987.1934 3491.3004 3983.4934 L 3500.801 3976.8931 L 3499.6005 3948.3932 C 3498.4005 3924.0932 3497.801 3918.0937 3492.501 3906.2937 C 3484.801 3890.2937 3477.1002 3885.5928 3459.9002 3885.5928 C 3442.7002 3885.5928 3414.2 3890.294 3381.5 3896.294 C 3371.5 3898.094 3354.2997 3900.3929 3343.5997 3902.1929 C 3277.0997 3911.0929 3260.4992 3917.5935 3247.5992 3938.3935 C 3241.6992 3948.3935 3240.4998 3952.0945 3240.4998 3969.2945 C 3240.4998 3986.4945 3241.1 3991.1918 3245.2 4000.1918 C 3252.9 4015.5918 3258.3004 4018.5917 3276.7004 4018.5917 C 3311.7004 4018.5917 3316.4017 4022.0929 3318.8017 4047.6929 C 3320.6017 4062.4929 3314.7015 4112.993 3310.4015 4124.193 C 3304.5015 4139.593 3302.0001 4144.3922 3295.0001 4155.0922 C 3284.9001 4170.4922 3269.4013 4187.6924 3227.4013 4233.4924 C 3182.3013 4282.1924 3177.5994 4282.7927 3200.6994 4236.3927 C 3216.0994 4206.0927 3224.3996 4195.4931 3256.9996 4161.0931 C 3285.9996 4130.1931 3290.8009 4122.5917 3292.6009 4104.1917 C 3294.4009 4085.7917 3290.2002 4076.292 3276.6002 4065.692 C 3268.8002 4059.192 3239.8002 4047.2939 3231.5002 4047.2939 C 3223.2002 4047.2939 3205.9006 4013.4937 3205.9006 3990.9937 C 3205.9006 3968.4937 3204.6995 3980.8939 3203.4995 3977.2939 C 3202.2995 3973.1939 3199.4006 3959.4929 3197.6006 3946.3929 C 3192.9006 3920.2929 3190.4987 3906.6934 3179.1987 3860.9934 C 3167.8987 3812.2934 3160.1996 3781.4929 3156.5996 3769.5929 C 3154.7996 3763.6929 3151.8995 3753.5921 3150.0995 3747.0921 C 3148.2995 3740.5921 3143.5995 3726.3926 3139.9995 3715.0926 C 3136.4995 3703.7926 3132.8993 3691.9932 3131.5993 3687.7932 C 3130.9993 3683.6932 3125.1001 3667.093 3119.1001 3649.893 C 3113.1001 3632.693 3105.4001 3611.3937 3102.5001 3602.3937 C 3093.1001 3575.0937 3076.9 3535.3931 3059.2 3497.9931 C 3040.2 3457.0931 2994.5001 3365.0927 2987.4001 3355.0927 C 2985.0001 3351.5927 2977.3019 3339.0922 2970.8019 3327.1922 C 2908.5019 3221.5922 2794.6006 3094.0939 2681.9006 3003.8939 C 2634.4006 2965.9939 2603.5007 2943.8919 2565.0007 2919.0919 C 2556.6007 2913.7919 2546.6016 2907.1947 2542.4016 2904.7947 C 2518.7016 2889.3947 2422.0001 2839.493 2415.5001 2839.493 C 2409.0001 2839.493 2410.8 2838.2918 2409 2837.0918 C 2397.7 2831.1918 2353.2001 2815.7943 2308.7001 2803.2943 C 2254.7001 2787.2943 2149.1 2774.1931 2082.1 2774.1931 C 2029.3 2774.7931 1939.0993 2782.592 1907.6993 2790.192 C 1901.7993 2791.392 1891.7004 2793.0947 1885.2004 2794.2947 C 1863.8004 2797.7947 1847.3 2801.993 1827 2807.293 C 1794.4 2816.793 1782.601 2814.3928 1806.301 2802.5928 C 1813.401 2799.6928 1819.9992 2796.6921 1821.0992 2796.6921 C 1822.1992 2796.6921 1827.0016 2794.8931 1832.4016 2792.5931 C 1856.1016 2781.8931 1860.2012 2780.092 1864.4012 2780.092 C 1868.6012 2780.092 1870.9003 2778.2924 1873.2003 2776.5924 C 1875.5003 2774.8924 1879.101 2773.0928 1880.901 2773.0928 C 1882.701 2773.0928 1892.7999 2770.1933 1903.3999 2765.9933 C 1942.4999 2751.6933 1997.201 2733.9932 2031.001 2724.4932 C 2096.901 2705.4932 2109.8004 2701.8933 2136.6004 2695.9933 C 2145.4004 2693.5933 2157.3 2691.2925 2162.2 2690.0925 C 2172.2 2687.1925 2181.8001 2685.3933 2230.4001 2677.5933 C 2258.9001 2672.8933 2270.6995 2672.1917 2352.5995 2672.1917 z M 1785.7306 2813.6892 C 1788.0743 2813.6002 1789.1237 2815.269 1787.6987 2817.894 C 1785.2987 2820.794 1782.3993 2820.794 1780.5993 2817.894 C 1779.3993 2816.694 1780.6004 2814.9925 1783.0004 2814.3925 C 1784.0254 2813.9425 1784.9493 2813.7189 1785.7306 2813.6892 z M 4020.2502 3115.7836 C 4020.861 3115.7936 4021.5516 3116.0082 4022.3016 3116.4926 C 4024.1016 3117.6926 4033.6006 3127.094 4043.0006 3138.394 C 4066.1006 3165.694 4105.3008 3210.1934 4121.4008 3227.3934 C 4144.5008 3252.2934 4206.8006 3337.6933 4231.8006 3379.2933 C 4245.5006 3401.7933 4273.2996 3452.1924 4287.4996 3480.1924 C 4304.6996 3514.5924 4344.4011 3599.9931 4344.4011 3602.9931 C 4344.4011 3605.9931 4347.2995 3611.2925 4350.9995 3620.1925 C 4362.2995 3644.5925 4395.9989 3726.993 4403.1989 3744.793 C 4404.9989 3750.093 4407.3004 3756.6932 4408.5004 3759.5932 C 4411.4004 3764.8932 4428.1003 3813.5932 4445.3003 3864.5932 C 4451.2003 3882.3932 4462.5009 3919.7918 4471.4009 3947.6918 C 4479.7009 3975.5918 4488.6008 4005.8913 4491.6008 4014.6913 C 4497.5008 4034.8913 4505.2995 4063.9928 4519.4995 4123.1928 C 4536.6995 4193.1928 4539.1 4203.8919 4539.1 4217.5919 C 4539.1 4231.2919 4534.9992 4234.7914 4533.1992 4224.6914 C 4518.3992 4157.0914 4502.8996 4094.6945 4490.9996 4056.7945 C 4476.6996 4007.4945 4450.1004 3923.3933 4443.5004 3906.0933 C 4442.3004 3901.9933 4440.0014 3896.0942 4439.4014 3891.7942 C 4438.2014 3887.6942 4434.702 3878.6925 4432.302 3871.5925 C 4429.402 3864.4925 4426.3998 3856.1937 4425.6998 3853.7937 C 4425.0998 3851.3937 4423.3014 3846.6931 4422.8014 3844.2931 C 4418.1014 3832.9931 4406.1994 3798.5941 4406.1994 3796.8941 C 4406.1994 3795.1941 4404.3998 3792.1929 4402.6998 3787.9929 C 4400.8998 3783.8929 4398.6009 3777.3927 4396.8009 3773.1927 C 4392.7009 3761.3927 4344.6003 3639.6932 4335.7003 3617.7932 C 4317.9003 3574.9932 4275.1997 3487.1925 4264.4997 3470.0925 C 4260.9997 3464.6925 4255.0018 3454.0923 4250.8018 3446.9923 C 4247.3018 3439.8923 4242.4021 3432.1942 4240.8021 3430.3942 C 4239.0021 3427.9942 4237.8999 3425.6928 4237.8999 3425.0928 C 4237.8999 3423.8928 4233.8007 3417.3945 4229.1007 3410.2945 C 4223.8007 3402.4945 4217.2006 3392.4916 4214.3006 3387.6916 C 4206.6006 3376.3916 4184.0012 3343.8925 4170.4012 3325.4925 C 4165.1012 3317.6925 4157.4012 3307.093 4153.8012 3301.793 C 4141.9012 3285.193 4128.1993 3269.1945 4127.0993 3270.2945 C 4125.8993 3270.8945 4128.3014 3274.9932 4131.8014 3279.7932 C 4135.3014 3283.8932 4138.3015 3288.5917 4138.3015 3289.1917 C 4138.3015 3290.3917 4140.6993 3293.8929 4143.6993 3298.0929 C 4160.8993 3322.3929 4163.8995 3343.0928 4158.4995 3398.3928 C 4151.8995 3461.8928 4151.3992 3482.5927 4155.5992 3496.8927 C 4157.9992 3503.9927 4161.0018 3511.6927 4163.3018 3513.4927 C 4166.2018 3516.9927 4166.2011 3518.1935 4163.9011 3519.3935 C 4160.4011 3521.7935 4147.9016 3508.0928 4131.9016 3484.9928 C 4116.5016 3462.3928 4114.7004 3459.9927 4112.9004 3461.8927 C 4110.5004 3464.2927 4118.3005 3484.9935 4127.7005 3502.7935 C 4152.6005 3551.4935 4180.5008 3608.3928 4200.6008 3653.4928 C 4207.1008 3667.1928 4213.701 3681.2923 4215.401 3685.4923 C 4223.801 3703.8923 4245.7004 3755.4923 4249.2004 3765.5923 C 4251.6004 3773.9923 4252.101 3778.0933 4250.401 3779.8933 C 4248.601 3781.6933 4244.5 3775.1928 4236.1 3758.4928 C 4198.7 3680.0928 4175.6012 3635.6928 4158.4012 3608.3928 C 4153.0012 3599.9928 4144.7005 3586.4924 4140.6005 3578.6924 C 4135.9005 3570.9924 4128.6998 3559.6927 4124.5998 3553.0927 C 4120.4998 3547.1927 4116.901 3540.593 4116.901 3539.393 C 4116.901 3538.193 4115.6992 3536.9937 4115.0992 3536.9937 C 4113.8992 3536.9937 4108.6 3528.5931 4102.6 3519.1931 C 4092.6 3501.3931 4088.8993 3497.2926 4086.5993 3499.5926 C 4084.7993 3501.3926 4092.0011 3530.4939 4098.5011 3549.9939 C 4112.2011 3589.0939 4112.8009 3592.0943 4110.4009 3594.3943 C 4106.9009 3597.2943 4099.7003 3587.893 4084.3003 3560.593 C 4077.8003 3549.293 4070.6015 3540.394 4068.3015 3539.894 C 4064.8015 3539.294 4064.8018 3541.6931 4064.8018 3562.4931 C 4064.8018 3583.2931 4071.4007 3620.5923 4080.8007 3644.9923 C 4082.0007 3647.3923 4086.2013 3658.0918 4090.3013 3668.6918 C 4094.4013 3679.3918 4099.7999 3690.5934 4101.5999 3694.2934 C 4103.3999 3698.3934 4105.0995 3701.994 4105.0995 3703.794 C 4105.0995 3705.594 4109.8007 3717.4933 4115.8007 3731.0933 C 4130.1007 3764.8933 4129.5009 3763.6914 4137.1009 3782.6914 C 4140.6009 3791.4914 4147.7991 3810.5916 4153.6991 3824.1916 C 4180.8991 3891.7916 4193.4009 3928.5927 4190.5009 3931.5927 C 4188.1009 3933.9927 4183.3991 3926.8934 4178.5991 3914.3934 C 4171.4991 3896.5934 4106.8009 3751.1935 4102.1009 3744.0935 C 4099.7009 3739.9935 4098.0001 3735.1936 4098.0001 3733.9936 C 4098.0001 3732.7936 4089.6994 3717.3935 4080.1994 3698.9935 C 4052.8994 3647.3935 4021.3999 3601.0921 3986.4999 3561.9921 C 3976.9999 3551.9921 3969.8999 3542.3931 3969.8999 3541.2931 C 3969.8999 3540.1931 3968.7006 3539.4932 3967.5006 3539.4932 C 3964.6006 3539.4932 3964.0013 3550.7917 3966.9013 3552.5917 C 3968.1013 3553.1917 3969.8009 3556.6943 3970.4009 3560.2943 C 3972.2009 3566.1943 3973.9008 3570.2929 3990.6008 3606.5929 C 3994.7008 3615.3929 3998.3014 3623.7929 3998.3014 3624.9929 C 3998.3014 3626.1929 4000.7003 3632.0933 4004.2003 3638.0933 C 4007.1003 3644.6933 4010.0992 3650.5931 4010.0992 3651.7931 C 4010.0992 3652.9931 4013.0008 3660.1931 4017.3008 3668.3931 C 4020.8008 3676.7931 4024.4002 3684.3925 4024.4002 3685.5925 C 4024.4002 3686.7925 4027.2997 3693.8926 4031.4997 3702.1926 C 4034.9997 3710.5926 4038.6993 3718.1945 4038.6993 3718.7945 C 4038.6993 3719.3945 4041.1007 3725.8924 4044.0007 3732.4924 C 4051.8007 3749.6924 4059.4003 3768.6936 4065.9003 3786.4936 C 4068.8003 3794.8936 4072.4993 3802.4942 4073.6993 3804.2942 C 4074.8993 3805.4942 4077.2001 3812.0933 4079.6001 3818.5933 C 4082.0001 3825.0933 4092.0992 3850.5929 4102.1992 3875.4929 C 4120.5992 3921.7929 4135.3992 3961.4925 4137.1992 3971.0925 C 4138.3992 3975.1925 4137.8019 3976.394 4134.8019 3976.394 C 4131.8019 3976.394 4131.3004 3974.5931 4131.3004 3972.2931 C 4131.3004 3969.9931 4129.5007 3965.7921 4127.8007 3963.4921 C 4125.4007 3961.0921 4124.3011 3956.3934 4124.3011 3953.9934 C 4124.3011 3951.5934 4122.5015 3946.8928 4120.8015 3944.4928 C 4119.0015 3942.0928 4115.4013 3933.8921 4112.4013 3926.6921 C 4109.5013 3919.4921 4102.3999 3903.5928 4096.9999 3891.0928 C 4091.0999 3878.5928 4082.7006 3859.5938 4078.0006 3848.2938 C 4072.7006 3836.9938 4066.1005 3822.1918 4063.2005 3815.0918 C 4057.3005 3802.5918 3949.3007 3583.0936 3938.1007 3561.7936 C 3932.8007 3551.7936 3926.8003 3546.9939 3925.0003 3551.7939 C 3923.8003 3556.4939 3897.7002 3585.5918 3883.5002 3598.6918 C 3868.7002 3612.3918 3862.8015 3614.0929 3847.3015 3607.4929 C 3842.0015 3605.0929 3831.8995 3600.9931 3824.1995 3597.4931 C 3815.8995 3594.5931 3802.9004 3588.6921 3795.2004 3584.9921 C 3786.8004 3580.8921 3775.6001 3576.1947 3770.2001 3574.2947 C 3764.3001 3571.8947 3757.7 3569.5939 3755.4 3568.3939 C 3752.5 3567.1939 3744.7994 3564.2944 3737.5994 3561.2944 C 3729.8994 3558.3944 3722.2007 3555.3931 3719.8007 3554.1931 C 3716.9007 3552.9931 3709.2 3550.6942 3702 3548.2942 C 3675.9 3539.8942 3667.0006 3536.9929 3659.9006 3532.8929 C 3650.4006 3527.5929 3649.2003 3531.0935 3657.0003 3540.5935 C 3659.4003 3544.0935 3661.7005 3547.6925 3661.7005 3548.3925 C 3661.7005 3549.5925 3669.4011 3566.7941 3679.5011 3586.8941 C 3698.5011 3625.9941 3706.7021 3643.1916 3728.8021 3690.6916 C 3736.5021 3706.0916 3744.8014 3724.4931 3747.8014 3730.9931 C 3754.9014 3744.6931 3769.701 3778.3921 3773.401 3786.6921 C 3775.201 3790.1921 3776.8994 3794.3918 3778.0994 3796.6918 C 3779.8994 3800.1918 3797.0993 3839.4929 3806.5993 3862.5929 C 3808.3993 3866.0929 3810.7 3871.3931 3812.5 3875.5931 C 3813.7 3879.6931 3817.1995 3887.4937 3819.5995 3893.3937 C 3821.9995 3899.2937 3826.7006 3910.5938 3830.3006 3918.2938 C 3833.2006 3925.9938 3838.6999 3937.8926 3840.9999 3944.3926 C 3843.3999 3950.9926 3845.7007 3957.4917 3846.9007 3958.6917 C 3848.1007 3959.8917 3849.3018 3962.1931 3849.3018 3963.9931 C 3849.3018 3965.7931 3850.5002 3971.0924 3852.2002 3974.6924 C 3854.0002 3978.7924 3858.1005 3988.3926 3860.6005 3995.9926 C 3863.5005 4003.7926 3866.4999 4011.3932 3867.6999 4013.7932 C 3868.8999 4016.1932 3874.7991 4030.3936 3880.1991 4045.2936 C 3885.4991 4060.0936 3890.8002 4075.5924 3892.7002 4079.6924 C 3894.5002 4083.7924 3897.4015 4090.9931 3899.8015 4095.6931 C 3902.2015 4101.0931 3903.9005 4106.3923 3903.9005 4108.1923 C 3903.9005 4109.9923 3905.1008 4115.2928 3906.8008 4119.4928 C 3909.2008 4123.5928 3913.8994 4136.6937 3918.0994 4148.4937 C 3922.1994 4160.3937 3926.3998 4172.2925 3927.4998 4174.5925 C 3928.0998 4176.9925 3929.9001 4181.6929 3930.4001 4183.9929 C 3931.0001 4186.3929 3937.5002 4205.8938 3945.2002 4226.7938 C 3952.3002 4247.4938 3959.4997 4268.2924 3960.5997 4273.0924 C 3962.9997 4280.1924 3974.9006 4316.893 3981.3006 4335.993 C 3982.5006 4340.093 3987.2003 4354.3925 3991.3003 4367.9925 C 3995.4003 4381.6925 4000.8002 4398.8928 4003.2002 4405.8928 C 4008.5002 4421.2928 4014.4999 4439.6928 4016.8999 4450.9928 C 4018.0999 4455.6928 4020.4001 4462.2941 4021.6001 4466.3941 C 4027.5001 4484.1941 4038.8014 4521.5917 4038.8014 4525.0917 C 4038.8014 4528.5917 4039.3988 4529.7932 4041.1988 4530.3932 C 4042.3988 4530.9932 4043.5999 4533.8939 4043.5999 4536.2939 C 4043.5999 4538.6939 4046.0007 4549.993 4049.5007 4560.693 C 4052.4007 4571.393 4057.8998 4587.9936 4060.0998 4596.8936 C 4062.9998 4605.7936 4067.9003 4623.0939 4071.4003 4634.7939 C 4075.5003 4646.6939 4079.1007 4660.393 4080.8007 4665.693 C 4082.0007 4671.093 4086.7006 4686.3918 4090.9006 4700.0918 C 4095.0006 4713.7918 4099.6992 4730.9921 4102.1992 4737.9921 C 4103.9992 4745.0921 4106.8993 4755.1931 4108.6993 4760.5931 C 4111.0993 4769.3931 4118.7005 4794.3924 4127.7005 4824.6924 C 4131.2005 4838.3924 4136.4989 4855.5927 4140.6989 4870.8927 C 4141.8989 4876.7927 4144.7996 4885.6926 4146.5996 4891.0926 C 4148.3996 4896.3926 4151.2991 4907.0939 4153.6991 4914.7939 C 4155.4991 4922.5939 4159.0004 4933.1918 4160.8004 4938.5918 C 4162.6004 4943.8918 4167.3014 4959.2924 4171.4014 4972.9924 C 4175.6014 4986.6924 4179.8007 5000.1929 4180.3007 5002.6929 C 4181.5007 5005.0929 4185.6005 5018.6934 4190.3005 5032.3934 C 4194.4005 5046.0934 4202.0992 5070.8924 4208.0992 5088.0924 C 4228.2992 5149.7924 4244.2987 5203.7924 4250.1987 5228.0924 C 4251.9987 5235.7924 4257.3011 5255.3933 4261.5011 5270.8933 C 4271.5011 5309.3933 4275.7992 5325.4928 4278.0992 5339.6928 C 4279.2992 5346.1928 4282.8018 5362.194 4285.8018 5375.294 C 4289.3018 5388.294 4292.4002 5401.3933 4292.4002 5404.3933 C 4292.4002 5407.3933 4293.0001 5412.093 4294.2001 5414.393 C 4296.0001 5416.793 4297.7003 5424.3917 4298.9003 5432.1917 C 4300.7003 5439.8917 4303.0005 5454.6913 4305.4005 5464.1913 C 4307.2005 5474.2913 4309.5012 5488.5939 4311.3012 5496.7939 C 4312.5012 5504.4939 4314.1995 5513.9929 4315.9995 5517.4929 C 4317.1995 5520.9929 4318.4007 5526.8927 4318.4007 5531.1927 C 4318.4007 5535.4927 4319.601 5543.692 4321.301 5550.192 C 4325.401 5566.192 4330.1996 5589.2936 4332.5996 5608.9936 C 4333.7996 5617.3936 4336.101 5632.6943 4337.901 5643.3943 C 4339.701 5654.0943 4342.6018 5670.6946 4343.8018 5681.2946 C 4345.6018 5691.9946 4347.2994 5707.3914 4349.0994 5715.6914 C 4354.3994 5755.3914 4358.6012 5782.6921 4361.0012 5803.4921 C 4362.2012 5815.9921 4365.1 5836.6945 4366.9 5849.7945 C 4368.7 5862.8945 4370.4002 5881.2922 4371.6002 5890.0922 C 4372.2002 5898.8922 4374.5004 5919.7921 4376.3004 5935.1921 C 4378.1004 5950.5921 4379.8019 5969.5935 4379.8019 5977.2935 C 4379.8019 5989.7935 4376.9012 5996.2926 4373.9012 5991.5926 C 4373.3012 5990.3926 4372.1 5982.6932 4371.5 5974.3932 C 4369.7 5961.2932 4365.6001 5928.0926 4353.1001 5841.4926 C 4351.9001 5832.0926 4349.5999 5818.9927 4348.3999 5812.9927 C 4347.1999 5806.9927 4345.4988 5794.5936 4344.1988 5785.7936 C 4342.9988 5776.9936 4340.1018 5760.1936 4338.3018 5748.9936 C 4335.9018 5737.6936 4333.6011 5722.2936 4332.4011 5713.9936 C 4331.2011 5706.1936 4329.499 5694.393 4327.699 5687.893 C 4326.499 5681.993 4323.6005 5667.6926 4321.1005 5656.3926 C 4319.3005 5645.0926 4315.8011 5628.4923 4314.0011 5618.4923 C 4312.2011 5608.9923 4309.3003 5595.3937 4308.1003 5588.7937 C 4305.2003 5571.5937 4298.5999 5541.2938 4294.9999 5525.2938 C 4293.1999 5517.5938 4292.0996 5509.2945 4292.0996 5506.2945 C 4292.0996 5503.2945 4290.3 5496.1932 4288.6 5489.0932 C 4286.8 5482.4932 4283.3005 5468.8922 4281.5005 5458.1922 C 4276.8005 5435.6922 4270.8008 5408.8927 4267.8008 5397.6927 C 4266.6008 5392.9927 4262.5021 5375.1932 4258.3021 5357.3932 C 4254.8021 5339.5932 4249.4992 5320.5925 4247.6992 5314.6925 C 4245.8992 5308.7925 4243.6014 5298.6934 4242.3014 5292.0934 C 4240.5014 5285.5934 4237.6007 5272.4935 4234.6007 5263.5935 C 4232.2007 5254.7935 4229.3006 5243.3915 4228.1006 5238.6915 C 4221.0006 5212.5915 4207.4006 5168.0922 4201.4006 5149.6922 C 4197.3006 5137.8922 4192.5994 5123.5927 4190.6994 5117.6927 C 4189.4994 5111.7927 4184.2008 5096.3939 4179.4008 5083.2939 C 4175.3008 5070.2939 4168.1013 5048.2922 4164.0013 5034.5922 C 4159.9013 5020.8922 4155.2009 5007.2936 4154.6009 5004.8936 C 4148.7009 4988.8936 4145.7015 4980.4923 4137.4015 4952.6923 C 4132.7015 4935.4923 4124.3003 4908.7935 4120.2003 4893.3935 C 4115.5003 4877.9935 4108.2995 4854.2922 4104.1995 4841.1922 C 4100.6995 4828.1922 4094.6991 4809.1934 4091.0991 4798.4934 C 4088.1991 4787.7934 4082.7005 4769.992 4079.8005 4758.192 C 4076.9005 4746.292 4070.2995 4723.1926 4065.4995 4705.9926 C 4060.7995 4688.7926 4054.9003 4669.1915 4053.0003 4662.1915 C 4050.6003 4655.0915 4047.7002 4644.9924 4046.5002 4639.5924 C 4044.7002 4634.2924 4042.3994 4625.8931 4040.5994 4620.5931 C 4037.0994 4606.8931 4024.6014 4563.0925 4020.4014 4549.3925 C 4018.0014 4542.7925 4011.4994 4520.2923 4005.5994 4499.5923 C 3999.6994 4478.8923 3992.5006 4453.8937 3989.6006 4444.9937 C 3986.7006 4436.1937 3978.9006 4411.1931 3973.0006 4390.3931 C 3966.5006 4369.6931 3961.1001 4350.0924 3959.9001 4347.6924 C 3958.7001 4345.2924 3954.5997 4331.6938 3950.4997 4317.9938 C 3930.8997 4257.4938 3927.9007 4247.9936 3926.1007 4243.2936 C 3924.9007 4240.8936 3914.8005 4209.4923 3903.0005 4174.4923 C 3882.8005 4113.3923 3872.7005 4085.493 3859.7005 4048.693 C 3856.2005 4039.893 3851.9999 4028.493 3850.1999 4023.793 C 3846.6999 4013.093 3843.7002 4005.3936 3840.2002 3996.4936 C 3837.3002 3989.3936 3833.1011 3978.6931 3825.9011 3960.2931 C 3789.7011 3864.1931 3733.3997 3738.9921 3705.4997 3694.5921 C 3688.8997 3667.8921 3681.8005 3657.794 3661.7005 3632.894 L 3656.3008 3626.2937 L 3656.3008 3632.894 C 3656.3008 3641.294 3663.3995 3667.8926 3674.0995 3697.5926 C 3678.1995 3710.0926 3681.7989 3721.3935 3681.1989 3721.9935 C 3678.7989 3724.3935 3669.9013 3714.8939 3657.5013 3696.3939 C 3651.0013 3686.9939 3642.1014 3673.894 3637.3014 3667.894 C 3626.0014 3651.294 3573.1999 3600.8943 3560.0999 3594.3943 C 3554.1999 3590.8943 3544.7015 3585.9919 3538.8015 3583.0919 C 3533.4015 3580.6919 3526.9005 3577.7943 3524.5005 3577.7943 C 3522.1005 3577.7943 3517.4012 3576.594 3513.8012 3574.894 C 3510.3012 3573.094 3500.0992 3570.7924 3490.6992 3569.4924 C 3474.6992 3568.2924 3473.5004 3568.2926 3466.4004 3574.1926 C 3458.6004 3580.6926 3452.1003 3581.2931 3449.8003 3575.3931 C 3448.6003 3573.5931 3446.9001 3569.4921 3445.1001 3566.5921 C 3443.3001 3563.0921 3440.4007 3554.6934 3438.0007 3546.9934 C 3435.1007 3539.2934 3431.4004 3529.7944 3429.6004 3526.2944 C 3422.5004 3511.9944 3422.9987 3511.4924 3452.6987 3511.4924 C 3482.3987 3511.4924 3523.2995 3518.5918 3563.5995 3528.6918 C 3566.8995 3528.6918 3567.5006 3524.4928 3566.9006 3502.4928 C 3566.9006 3472.7928 3562.8002 3433.0931 3557.5002 3412.3931 C 3555.1002 3404.5931 3549.0992 3386.7942 3543.1992 3373.2942 C 3536.0992 3356.0942 3533.7004 3347.6932 3535.5004 3346.0932 C 3537.3004 3344.2932 3538.3994 3344.8937 3539.5994 3347.2937 C 3540.7994 3349.0937 3545.5 3355.5928 3549.1 3361.5928 C 3558.6 3375.2928 3590.0012 3425.0928 3594.8012 3433.3928 C 3600.7012 3444.6928 3620.4004 3476.6926 3623.9004 3482.0926 C 3626.8004 3486.1926 3629.2001 3487.3915 3633.9001 3486.1915 C 3636.8001 3484.9915 3645.1989 3485.594 3651.6989 3487.394 C 3658.7989 3489.194 3671.2988 3492.0924 3680.1988 3493.9924 C 3688.5988 3495.7924 3705.7991 3500.4921 3718.0991 3503.9921 C 3729.9991 3507.4921 3746.6009 3512.3914 3754.9009 3514.6914 C 3762.7009 3517.0914 3771.5008 3519.3922 3775.1008 3520.5922 C 3778.0008 3521.7922 3785.702 3522.9918 3792.302 3524.0918 C 3802.302 3525.2918 3804.101 3524.6924 3814.801 3515.1924 C 3827.901 3503.3924 3861.101 3467.7926 3866.401 3459.9926 C 3869.301 3455.2926 3869.3003 3453.4918 3858.7003 3435.6918 C 3848.7003 3419.0918 3840.2998 3404.794 3822.4998 3376.894 C 3820.0998 3373.994 3808.8003 3356.6937 3797.0003 3338.9937 C 3784.5003 3321.1937 3775.1008 3305.793 3775.1008 3304.593 C 3775.1008 3296.193 3786.3996 3307.4938 3815.9996 3345.4938 C 3853.3996 3392.3938 3869.4018 3411.393 3872.3018 3411.393 C 3875.2018 3411.393 3878.8015 3401.293 3882.3015 3384.693 L 3884.6989 3370.9932 L 3896.6006 3370.9932 C 3907.2006 3370.9932 3921.0006 3372.7935 3958.3006 3379.3935 C 3964.8006 3381.1935 3967.1004 3380.5917 3968.3004 3377.5917 C 3970.1004 3372.8917 3958.8009 3344.394 3952.9009 3337.294 C 3951.1009 3334.894 3947.0007 3328.9929 3944.5007 3324.7929 C 3938.6007 3315.3929 3904.7004 3268.4916 3888.2004 3247.6916 C 3847.9004 3196.0916 3839.5014 3183.5923 3845.4014 3183.5923 C 3851.3014 3183.5923 3868.5005 3205.4933 3894.7005 3232.8933 C 3960.6005 3301.6933 4037.1003 3378.1929 4040.1003 3378.1929 C 4044.8003 3378.1929 4043 3373.4942 4033.5 3360.3942 C 4028.2 3353.2942 4024.0996 3346.6932 4024.0996 3346.0932 C 4024.0996 3344.8932 4020.6001 3340.1939 4017.0001 3335.3939 C 4012.9001 3330.6939 4009.8005 3325.8941 4009.8005 3325.3941 C 4009.8005 3324.1941 4002.7003 3314.6927 3995.0003 3303.4927 C 3986.6003 3292.1927 3979.001 3281.5917 3977.801 3279.0917 C 3976.001 3276.6917 3970.7018 3269.0936 3965.3018 3262.4936 C 3959.4018 3255.3936 3955.302 3248.7916 3955.302 3247.6916 C 3955.302 3246.5916 3946.4001 3233.9933 3938.7001 3224.5933 C 3935.2001 3220.4933 3935.8007 3214.4933 3939.9007 3214.4933 C 3944.0007 3214.4933 3943.4003 3216.293 3943.4003 3217.993 C 3943.4003 3219.693 3944.6006 3221.4919 3946.3006 3222.0919 C 3951.7006 3224.4919 4024.7003 3316.9924 4040.1003 3340.1924 C 4061.4003 3373.9924 4064.401 3378.0938 4064.401 3380.4938 C 4064.401 3382.8938 4066.1993 3383.9921 4069.0993 3385.1921 C 4072.5993 3386.9921 4073.801 3386.9928 4074.501 3384.5928 C 4075.101 3382.7928 4076.3002 3354.2929 4076.9002 3321.0929 C 4078.7002 3255.1929 4076.9002 3233.8917 4068.6002 3213.6917 C 4062.0002 3198.8917 4024.7004 3131.793 4019.9004 3125.893 C 4015.9348 3121.9274 4016.9521 3115.7536 4020.2502 3115.7836 z M 2745.3003 3202.5935 C 2750.1003 3202.5935 2820.0004 3271.3923 2848.5004 3306.9923 C 2862.8004 3325.3923 2878.199 3346.0924 2878.199 3348.4924 C 2878.199 3350.8924 2882.8987 3356.1931 2888.1987 3364.4931 C 2902.9987 3385.7931 2907.8011 3394.7939 2936.3011 3450.4939 L 2961.9007 3500.8933 L 2974.3999 3493.0924 C 2983.8999 3487.1924 2991.601 3484.7921 3003.501 3483.6921 C 3023.101 3481.2921 3027.8005 3484.2927 3037.3005 3501.4927 C 3049.2005 3524.5927 3058.6007 3544.7925 3058.6007 3548.3925 C 3058.6007 3551.9925 3059.801 3553.7947 3061.501 3556.7947 C 3063.301 3559.6947 3067.402 3569.2937 3070.302 3577.4937 C 3072.702 3585.8937 3077.4007 3597.0933 3079.8007 3603.0933 C 3086.3007 3616.7933 3083.2994 3621.4924 3072.6994 3613.6924 C 3061.9994 3605.9924 3025.8013 3587.592 3011.0013 3582.192 C 2992.0013 3575.092 2989.1014 3576.8918 2990.8014 3594.0918 C 2992.0014 3602.8918 2991.4002 3608.3928 2990.2002 3608.3928 C 2987.8002 3608.3928 2961.0988 3559.6946 2958.1988 3550.2946 C 2951.0988 3525.8946 2867.4995 3398.9924 2840.6995 3370.5924 C 2835.9995 3365.8924 2831.3009 3359.8933 2829.4009 3356.2933 C 2824.1009 3346.2933 2819.4007 3348.5922 2816.4007 3362.1922 C 2814.6007 3369.2922 2811.0012 3379.9931 2809.3012 3386.5931 C 2797.4012 3420.3931 2796.8007 3423.9941 2798.0007 3435.8941 C 2798.6007 3448.8941 2800.9005 3456.0914 2811.7005 3479.6914 C 2815.2005 3488.0914 2818.8018 3495.0933 2818.8018 3496.2933 C 2818.8018 3497.4933 2821.1988 3503.3925 2824.6988 3510.5925 C 2836.5988 3536.7925 2837.8011 3539.6931 2837.8011 3544.9931 C 2837.8011 3550.2931 2837.2003 3549.093 2833.7003 3546.793 C 2831.9003 3544.993 2824.2002 3535.4921 2817.1002 3526.0921 C 2805.2002 3510.6921 2786.2002 3492.2946 2782.1002 3492.2946 C 2778.0002 3492.2946 2787.3999 3532.5933 2793.8999 3545.0933 C 2795.6999 3548.5933 2797.4014 3552.8914 2797.4014 3555.1914 C 2797.4014 3557.4914 2798.6017 3562.2938 2800.3017 3566.4938 C 2802.1017 3570.5938 2808.1002 3584.8933 2813.4002 3598.4933 C 2819.9002 3614.4933 2823.4008 3625.0928 2822.9008 3630.4928 L 2822.3015 3638.1916 L 2817 3629.7933 C 2814.1 3625.0933 2807.4999 3612.5929 2802.1999 3601.9929 C 2786.1999 3568.7929 2763.6988 3539.6917 2754.6988 3539.6917 C 2745.6988 3539.6917 2752.3014 3544.9934 2752.3014 3551.5934 C 2752.3014 3572.8934 2747.5999 3576.4926 2740.4999 3560.3926 C 2738.0999 3555.0926 2733.9005 3548.4935 2731.6005 3546.0935 C 2727.5005 3542.5935 2726.2998 3542.5941 2715.5998 3547.2941 C 2709.0998 3550.1941 2701.9016 3553.8935 2700.8016 3554.3935 C 2696.7016 3557.0935 2696.7009 3590.3931 2701.4009 3607.5931 C 2705.5009 3624.1931 2705.5009 3631.8938 2701.4009 3631.8938 C 2697.3009 3631.8938 2695.5 3627.1918 2680.7 3598.6918 C 2677.2 3592.7918 2671.2003 3582.6941 2667.0003 3576.7941 L 2659.3015 3565.4936 L 2605.3003 3565.4936 C 2556.0003 3565.4936 2550.6999 3564.8928 2547.0999 3561.3928 C 2545.2999 3558.9928 2543.6003 3555.9927 2543.6003 3554.8927 C 2543.6003 3553.7927 2540.1021 3547.7929 2535.3021 3541.1929 C 2531.2021 3534.0929 2523.4009 3521.5925 2518.1009 3513.3925 C 2513.4009 3504.9925 2506.1995 3493.1938 2502.6995 3487.2938 C 2499.1995 3481.3938 2496.1994 3474.2943 2496.1994 3471.8943 C 2496.1994 3469.4943 2502.0996 3461.1924 2509.1996 3453.4924 C 2522.2996 3439.1924 2540.1019 3416.6922 2557.3019 3393.4922 L 2565.0007 3382.8931 L 2559.1 3369.7946 C 2555.6 3362.0946 2545.3991 3343.6938 2536.5991 3328.8938 C 2513.4991 3288.5938 2509.2995 3280.7928 2510.9995 3279.5928 C 2512.7995 3277.1928 2529.4003 3296.1917 2543.6003 3318.6917 C 2557.9003 3340.5917 2561.999 3344.2922 2569.699 3340.0922 C 2575.599 3337.1922 2592.8002 3333.4935 2615.4002 3330.5935 C 2633.8002 3328.7935 2637.3021 3326.4917 2633.8021 3318.6917 C 2632.6021 3315.1917 2629.0995 3304.9922 2626.0995 3294.9922 C 2615.3995 3257.5922 2613.0011 3249.2925 2604.8011 3231.5925 C 2599.5011 3219.0925 2599.5011 3216.7943 2604.8011 3216.7943 C 2610.1011 3216.7943 2631.5012 3242.9928 2656.4012 3274.9928 C 2673.6012 3298.0928 2687.2987 3313.4942 2690.1987 3315.2942 C 2692.5987 3316.4942 2702.0006 3310.5932 2751.9006 3274.2932 C 2763.2006 3265.8932 2773.2021 3259.4931 2773.8021 3259.4931 C 2775.0021 3259.4931 2776.2005 3257.6935 2776.7005 3255.9935 C 2778.5005 3251.8935 2771.4003 3240.5929 2753.6003 3219.7929 C 2743.0003 3207.2929 2740.5003 3202.5935 2745.3003 3202.5935 z M 2316.588 3282.9184 C 2319.5505 3282.9184 2326.9514 3289.4425 2338.8014 3302.4925 C 2380.9014 3347.5925 2443.2011 3429.4933 2469.4011 3475.0933 C 2475.3011 3485.0933 2482.4999 3496.3921 2485.3999 3501.1921 C 2496.6999 3518.3921 2548.3021 3623.9921 2558.3021 3649.4921 C 2560.1021 3654.7921 2564.8995 3667.2933 2568.9995 3676.7933 C 2572.4995 3686.7933 2577.4001 3698.094 2578.5001 3702.894 C 2580.3001 3707.594 2584.4007 3719.4914 2588.0007 3730.1914 C 2601.0007 3766.9914 2602.8009 3774.5932 2601.0009 3777.0932 C 2599.8009 3778.2932 2585.0003 3765.1918 2564.8003 3745.0918 L 2531.0009 3711.2942 L 2532.3017 3730.3937 C 2533.5017 3740.9937 2535.2006 3764.1931 2536.4006 3782.5931 C 2538.2006 3814.0931 2542.2992 3849.5936 2547.6992 3882.2936 C 2549.4992 3889.9936 2550.5995 3897.0943 2550.5995 3898.2943 C 2550.5995 3901.7943 2545.9001 3900.0932 2543.5001 3895.8932 C 2542.3001 3893.4932 2538.8 3881.5934 2535.2 3869.2934 C 2531.7 3856.7934 2525.6996 3837.7925 2522.0996 3826.4925 C 2517.9996 3815.1925 2512.1017 3796.7924 2508.4017 3784.9924 C 2504.9017 3773.0924 2500.7011 3760.5925 2498.9011 3756.4925 C 2497.1011 3752.3925 2492.4021 3740.4913 2488.3021 3729.1913 C 2480.5021 3708.4913 2477.6011 3702.9923 2474.0011 3702.9923 C 2470.4011 3702.9923 2471.5999 3737.3926 2471.5999 3779.5926 C 2470.9999 3828.8926 2469.7996 3856.0928 2468.6996 3856.0928 C 2466.8996 3855.4928 2460.3021 3844.7927 2453.3021 3831.1927 C 2442.0021 3808.5927 2427.7018 3783.6932 2393.3018 3727.3932 C 2381.5018 3707.7932 2374.9004 3702.493 2377.9004 3714.393 C 2379.1004 3717.893 2380.8013 3727.3914 2382.0013 3735.6914 C 2383.2013 3744.0914 2384.4015 3751.6927 2384.9015 3752.8927 C 2385.5015 3753.4927 2388.4004 3771.8934 2390.8004 3793.7934 C 2393.7004 3815.1934 2396.7001 3838.1935 2398.0001 3845.3935 C 2401.5001 3860.7935 2401.4994 3883.2938 2398.5994 3883.2938 C 2395.6994 3883.2938 2395.7002 3879.7931 2394.4002 3875.5931 C 2391.5002 3861.2931 2368.3011 3787.7932 2363.5011 3777.0932 C 2361.7011 3773.5932 2360.6008 3768.6926 2360.6008 3767.5926 C 2360.6008 3762.1926 2351.6997 3750.3932 2348.0997 3750.3932 C 2344.4997 3750.3932 2336.8004 3753.2926 2329.1004 3757.4926 C 2307.2004 3767.4926 2297.0998 3771.7936 2294.6998 3771.7936 C 2292.2998 3771.7936 2290.5996 3774.1938 2288.1996 3776.4938 C 2284.0996 3780.5938 2284.1002 3782.3927 2289.4002 3809.0927 C 2294.1002 3835.1927 2294.1002 3849.3927 2289.4002 3844.0927 C 2288.2002 3842.8927 2285.1987 3834.0934 2282.1987 3825.0934 C 2279.2987 3816.2934 2274.5013 3804.8915 2271.5013 3800.1915 C 2261.5013 3784.7915 2206.2 3757.3933 2165.9 3748.5933 C 2160 3747.3933 2148.1013 3744.4925 2139.8013 3742.6925 C 2131.0013 3740.2925 2121.401 3738.5923 2118.501 3737.9923 C 2115.601 3737.9923 2110.7013 3735.0922 2108.5013 3731.4922 C 2103.1013 3723.6922 2087.7998 3662.0916 2086.5998 3643.6916 C 2086.5998 3635.9916 2087.2004 3635.2934 2104.4004 3627.0934 C 2113.9004 3622.3934 2126.9003 3616.4932 2132.9003 3614.0932 C 2138.8003 3611.6932 2146.5991 3608.7937 2150.6991 3606.9937 C 2159.0991 3603.4937 2165.5014 3601.092 2180.4014 3595.092 C 2213.0014 3582.592 2216.0006 3579.6938 2211.3006 3561.8938 C 2207.8006 3545.8938 2206.0003 3530.9931 2208.4003 3527.4931 C 2211.9003 3522.7931 2213.1001 3524.5927 2222.1001 3549.3927 C 2226.2001 3561.2927 2230.8998 3574.3926 2232.0998 3577.8926 C 2233.8998 3581.9926 2235.0001 3585.5918 2235.0001 3586.6918 C 2235.0001 3590.1918 2242.8007 3605.693 2244.5007 3605.693 C 2246.2007 3605.693 2260.502 3591.9931 2278.302 3575.3931 L 2310.9009 3545.0933 L 2309.0991 3529.692 C 2307.8991 3514.292 2302.5011 3493.4925 2288.9011 3452.5925 C 2282.4011 3431.1925 2280.099 3418.1918 2284.199 3418.1918 C 2288.299 3418.1918 2292 3432.4922 2298.5 3449.6922 C 2316.9 3495.9922 2318.0996 3498.3915 2324.0996 3503.6915 L 2329.401 3509.0932 L 2337.0998 3503.1924 C 2341.1998 3499.6924 2345.5011 3496.5921 2346.0011 3496.5921 C 2350.1011 3496.5921 2353.1021 3503.1933 2354.8021 3515.5933 C 2357.2021 3535.7933 2363.1995 3560.593 2365.4995 3560.593 C 2369.5995 3560.593 2370.801 3542.7942 2369.001 3501.2942 C 2368.401 3477.5942 2366.1008 3451.4947 2364.3008 3440.7947 C 2358.9008 3416.3947 2353.6004 3392.6935 2351.2004 3386.7935 C 2350.0004 3383.8935 2347.1015 3374.893 2345.3015 3367.193 C 2340.0015 3349.393 2328.7008 3319.0925 2321.0008 3302.4925 C 2315.1008 3289.4425 2313.6255 3282.9184 2316.588 3282.9184 z M 3772.8017 3294.8939 C 3774.6017 3294.8939 3775.1991 3296.0932 3775.1991 3297.2932 C 3775.1991 3298.4932 3774.0017 3299.6924 3772.8017 3299.6924 C 3771.0017 3299.6924 3770.4006 3298.3932 3770.4006 3297.2932 C 3770.4006 3296.0932 3771.0017 3294.8939 3772.8017 3294.8939 z M 1099.2467 3310.0022 C 1099.8264 3309.9742 1100.3508 3310.094 1100.8008 3310.3936 C 1102.6008 3311.5936 1102.0006 3313.2937 1097.9006 3316.8937 C 1088.3006 3323.9937 1085.4002 3322.1939 1093.1002 3313.2939 C 1095.2752 3311.4939 1097.5076 3310.0865 1099.2467 3310.0022 z M 1509.4929 3323.3503 C 1509.6614 3323.3503 1509.7974 3323.3935 1509.9013 3323.4921 C 1512.3013 3325.8921 1513.4012 3323.4943 1493.3012 3361.3943 C 1474.3012 3398.7943 1424.5002 3502.5918 1414.5002 3528.6918 C 1413.3002 3531.0918 1409.1996 3541.1923 1404.9996 3550.0923 C 1400.8996 3559.4923 1397.9001 3567.8922 1397.9001 3568.4922 C 1397.9001 3569.6922 1394.4007 3576.8923 1390.8007 3585.0923 C 1387.3007 3593.4923 1382.3988 3604.0932 1380.6988 3609.4932 C 1378.2988 3614.7932 1374.1008 3626.0933 1370.6008 3634.3933 C 1367.1008 3642.7933 1364.7 3651.5926 1364.7 3653.3926 C 1364.7 3655.1926 1362.9004 3659.2947 1361.2004 3661.7947 C 1358.8004 3664.6947 1357.6989 3668.8913 1357.6989 3671.1913 C 1357.6989 3673.4913 1356.5015 3677.0945 1355.3015 3678.2945 C 1354.1015 3679.4945 1351.1 3687.7933 1348.1 3696.0933 C 1345.2 3704.4933 1341.6005 3713.8931 1341.0005 3716.2931 C 1336.9005 3725.7931 1319.101 3775.5935 1317.301 3782.7935 C 1316.101 3786.8935 1312.5997 3795.8934 1310.1997 3802.9934 C 1307.2997 3810.0934 1304.3002 3819.5937 1303.1002 3824.2937 C 1301.9002 3828.9937 1298.9994 3838.592 1297.1994 3845.592 C 1294.7994 3852.692 1290.5989 3868.1927 1287.6989 3879.9927 C 1278.8989 3916.7927 1276.9996 3910.2934 1276.9996 3842.5934 C 1276.9996 3774.8934 1275.8003 3781.4941 1274.6003 3780.2941 C 1273.4003 3779.6941 1269.9009 3783.1924 1267.5009 3788.6924 C 1264.6009 3793.9924 1261.6014 3798.193 1260.4014 3798.193 C 1256.2014 3798.193 1256.8997 3790.3924 1265.0997 3753.6924 C 1266.2997 3747.7924 1266.9003 3742.3928 1266.3003 3741.8928 C 1265.7003 3741.2928 1259.2012 3744.2929 1252.0012 3748.3929 C 1244.9012 3752.4929 1231.8001 3758.3933 1222.9001 3761.4933 C 1214.1001 3764.3933 1201.6007 3769.193 1195.6007 3771.493 C 1184.3007 3776.193 1170.0011 3791.693 1170.0011 3798.193 C 1170.0011 3804.693 1168.1996 3804.093 1166.4996 3806.493 C 1164.6996 3809.393 1161.8001 3817.193 1159.4001 3824.893 L 1154.6999 3838.5928 L 1116.2003 3838.5928 C 1090.1003 3838.5928 1077.6988 3837.9916 1077.6988 3836.1916 C 1076.9988 3834.1916 1080.7014 3825.292 1085.4014 3815.192 C 1090.1014 3805.092 1095.9999 3792.0928 1098.4999 3786.0928 C 1101.3999 3780.1928 1107.4009 3767.0942 1112.8009 3756.3942 C 1118.2009 3745.6942 1122.3015 3736.7914 1122.3015 3735.6914 C 1122.3015 3734.5914 1128.2 3723.1918 1135.4 3710.0918 C 1142.5 3696.9918 1148.5005 3685.193 1148.5005 3683.993 C 1148.5005 3682.793 1150.9019 3678.0937 1153.8019 3673.2937 C 1165.1019 3656.0937 1171.6015 3644.2928 1179.4015 3630.4928 C 1183.5015 3622.7928 1188.9014 3613.893 1191.3014 3610.293 C 1193.1014 3607.393 1195.4009 3602.5942 1196.6009 3600.7942 C 1197.2009 3598.3942 1201.9006 3590.7936 1206.6006 3582.9936 C 1212.0006 3575.2936 1217.9016 3565.1926 1220.9016 3560.3926 C 1223.3016 3555.6926 1233.9992 3538.4923 1244.5992 3522.4923 C 1284.2992 3461.8923 1304.5996 3443.5917 1276.0996 3494.5917 C 1236.2996 3563.9917 1187.7007 3660.6917 1173.5007 3698.0917 C 1171.1007 3703.9917 1167.6019 3712.3919 1165.8019 3716.5919 C 1162.9019 3724.2919 1161.7008 3736.1924 1163.4008 3736.1924 C 1165.1008 3736.1924 1171.8002 3732.0939 1180.6002 3726.7939 C 1189.4002 3721.3939 1198.4019 3716.0941 1200.8019 3714.8941 C 1202.6019 3713.6941 1210.3001 3709.5943 1217.4001 3704.8943 C 1234.6001 3694.7943 1258.2991 3675.7939 1273.0991 3660.4939 C 1285.5991 3646.1939 1306.3001 3615.9914 1332.5001 3572.6914 C 1377.5001 3496.6914 1395.4008 3470.0925 1461.8008 3381.6925 C 1493.7523 3339.0589 1506.5803 3323.4136 1509.4929 3323.3503 z M 1083.1666 3324.3184 C 1083.476 3324.3044 1083.851 3324.3675 1084.301 3324.4923 C 1085.501 3325.0923 1086.7002 3326.8938 1086.7002 3327.9938 C 1086.7002 3329.0938 1085.501 3330.3931 1084.301 3330.3931 C 1082.401 3330.4931 1081.9017 3328.6934 1081.9017 3326.8934 C 1081.9017 3325.0934 1082.2385 3324.3606 1083.1666 3324.3184 z M 1075.7174 3330.6407 C 1078.7263 3330.7227 1069.319 3343.1132 1048.401 3365.2929 C 1002.701 3413.9929 951.69874 3479.7918 920.19874 3529.5918 C 915.49874 3536.6918 911.40213 3543.2928 910.80213 3543.8928 C 909.00213 3545.6928 891.20053 3572.3933 887.00053 3580.0933 C 884.60053 3583.5933 877.60049 3595.4933 870.40049 3606.7933 C 863.30049 3618.0933 854.40118 3631.6925 851.40118 3637.6925 C 844.30118 3650.7925 802.70121 3732.5924 798.00121 3744.4924 C 795.60121 3749.7924 790.89881 3760.4919 786.69881 3768.1919 C 776.69881 3791.2919 761.09919 3826.3929 761.09919 3827.5929 C 761.09919 3828.7929 758.70154 3834.0921 755.80154 3840.0921 C 752.90154 3846.5921 748.00037 3857.293 745.10037 3864.493 C 734.40037 3888.193 698.8004 3965.3936 691.7004 3978.9936 C 688.2004 3986.6936 685.10008 3994.3943 685.10008 3996.7943 C 685.10008 3999.1943 683.89894 4002.1927 682.69894 4003.3927 C 680.89894 4005.7927 673.90095 4022.9934 662.50095 4054.3934 C 656.60095 4070.9934 651.80167 4075.6931 651.80167 4064.3931 C 651.80167 4053.0931 666.09883 3999.6927 676.19883 3971.1927 C 677.99883 3966.4927 682.7 3952.1913 686.9 3939.1913 C 691 3926.0913 695.70162 3913.0914 696.90162 3910.6914 C 701.60162 3898.8914 712.30038 3870.9914 723.00038 3840.6914 C 725.90038 3832.2914 728.89983 3824.0927 730.09983 3822.8927 C 731.29983 3821.6927 732.50097 3819.3929 732.50097 3817.4929 C 732.50097 3815.5929 734.3006 3810.3924 736.0006 3806.1924 C 743.1006 3792.5924 737.80017 3793.7929 722.90017 3809.1929 C 709.20017 3823.4929 704.50021 3826.9931 704.50021 3822.1931 C 704.50021 3817.3931 708.59966 3805.593 711.59966 3799.093 C 719.99966 3778.893 722.89928 3755.1919 715.09928 3768.1919 C 709.19928 3777.6919 703.80104 3783.5933 700.30104 3783.5933 C 696.80104 3783.5933 697.4 3774.7926 704.4 3757.4926 C 706.8 3751.5926 713.19911 3735.5933 718.69911 3721.8933 C 724.19911 3708.1933 730.60048 3692.1939 734.10048 3686.2939 C 737.00048 3680.3939 743.59995 3666.6929 749.49995 3655.3929 C 754.89995 3644.0929 761.40095 3632.2929 763.80095 3628.6929 C 766.20095 3625.7929 768.50115 3621.5946 768.50115 3620.2946 C 768.50115 3618.9946 788.10052 3598.9929 812.40052 3575.2929 C 836.70052 3552.1929 885.90075 3504.6917 922.10075 3469.6917 C 986.80075 3406.1917 1036.5996 3360.5945 1061.4996 3340.2945 C 1069.4949 3333.7101 1074.1952 3330.5993 1075.7174 3330.6407 z M 1761.1992 3416.3938 C 1763.5992 3413.9938 1764.0994 3443.0934 1764.0994 3546.9934 C 1764.0994 3650.8934 1765.9012 3714.2926 1776.0012 3779.5926 C 1781.9012 3819.8926 1779.5009 3833.5937 1769.4009 3810.4937 C 1767.0009 3804.5937 1763.5002 3796.1918 1761.7002 3792.0918 C 1746.9002 3760.5918 1739.1994 3741.0938 1739.1994 3736.8938 C 1739.1994 3732.6938 1736.8011 3730.3928 1734.5011 3728.0928 C 1731.3678 3725.3595 1729.201 3725.3595 1728.001 3728.0928 C 1727.401 3730.4928 1727.401 3739.3937 1728.001 3748.7937 C 1731.501 3787.8937 1732.1002 3805.0921 1730.4002 3805.0921 C 1728.7002 3805.0921 1724.5003 3797.3927 1720.3003 3787.8927 C 1716.2003 3778.4927 1709.7001 3764.1942 1705.5001 3756.3942 C 1702.0001 3747.9942 1699 3739.7923 1699 3737.9923 C 1699 3736.1923 1696.6005 3732.5922 1693.7005 3731.4922 C 1689.0005 3728.5922 1678.2993 3731.4926 1639.6993 3744.5926 C 1630.7993 3747.4926 1614.6999 3752.2938 1604.0999 3755.2938 C 1592.7999 3758.1938 1579.8007 3762.393 1575.0007 3764.093 C 1565.5007 3767.593 1564.9 3769.9932 1559 3803.7932 C 1553.7 3831.6932 1549.5013 3825.193 1549.5013 3790.793 C 1549.5013 3756.393 1548.9012 3766.9946 1543.0012 3765.7946 C 1535.3012 3763.3946 1485.5012 3771.1921 1444.5012 3781.1921 C 1415.4012 3788.2921 1412.5003 3787.6926 1401.7003 3775.8926 C 1361.4003 3730.1926 1363.8004 3733.0944 1364.9004 3724.2944 C 1365.5004 3719.5944 1366.7 3712.9931 1368.4 3708.8931 C 1369.6 3704.7931 1372.5008 3696.3938 1374.3008 3689.8938 C 1376.1008 3683.2938 1381.4005 3667.2944 1386.1005 3654.2944 C 1390.8005 3641.1944 1397.4021 3623.9941 1399.8021 3616.3941 C 1402.7021 3608.6941 1406.3003 3600.3929 1408.1003 3597.3929 C 1409.9003 3594.9929 1411.5999 3590.8929 1411.5999 3589.0929 C 1411.5999 3587.2929 1412.7995 3583.6935 1415.0995 3581.9935 C 1419.7995 3577.8935 1442.4015 3587.8925 1483.3015 3610.9925 C 1514.2015 3628.7925 1558.0003 3647.8926 1561.0003 3644.1926 C 1561.6003 3643.5926 1565.7014 3628.7918 1569.8014 3611.5918 C 1574.0014 3594.3918 1578.6006 3575.9917 1580.5006 3570.0917 C 1582.9006 3564.1917 1585.8001 3552.8916 1587.6001 3545.1916 C 1592.3001 3527.3916 1611.3 3462.6934 1616.1 3450.2934 C 1619.6 3440.2934 1623.2002 3438.3938 1624.5002 3446.7938 C 1624.5002 3449.1938 1621.0009 3466.9921 1615.6009 3486.4921 C 1610.9009 3505.4921 1603.8017 3532.1916 1601.3017 3545.1916 C 1598.4017 3558.1916 1594.7009 3572.4927 1593.5009 3576.0927 C 1592.3009 3580.1927 1591.6991 3586.0931 1591.6991 3589.1931 C 1591.6991 3592.2931 1589.8994 3600.9937 1588.1994 3608.7937 C 1582.4994 3633.6937 1579.6013 3655.5932 1580.8013 3657.3932 C 1581.4013 3657.9932 1587.901 3656.7921 1594.501 3654.9921 C 1601.701 3653.1921 1614.1009 3649.6933 1623.0009 3647.2933 C 1653.3009 3639.5933 1657.4011 3638.4935 1672.8011 3633.5935 C 1691.2011 3626.9935 1696.502 3622.2925 1701.802 3602.6925 C 1709.602 3576.5925 1724.9012 3529.1919 1730.9012 3513.0919 C 1734.4012 3504.6919 1738.0015 3494.6928 1739.3015 3490.4928 C 1740.5015 3486.3928 1743.4016 3475.6933 1745.8016 3466.7933 C 1748.7016 3457.9933 1752.3007 3443.0925 1754.6007 3434.1925 C 1756.4007 3425.7925 1759.2992 3417.5938 1761.1992 3416.3938 z M 1626.9997 3422.9922 C 1628.1997 3422.9922 1629.9005 3424.1934 1631.1005 3425.3934 C 1632.9005 3428.2934 1628.7003 3435.4936 1626.4003 3433.7936 C 1624.0003 3430.7936 1624.5997 3422.9922 1626.9997 3422.9922 z M 1087.897 3437.7621 C 1087.9413 3437.7609 1087.985 3437.7609 1088.0275 3437.7659 C 1088.9178 3437.8229 1089.4001 3438.441 1089.4001 3439.6925 C 1089.4001 3448.5925 1070.9996 3469.9943 1059.6996 3484.7943 C 1057.2996 3488.2943 1046.7001 3504.3924 1036.0001 3521.5924 C 1024.7001 3538.7924 1013.5001 3555.3926 1011.1001 3559.4926 C 999.80014 3575.4926 990.40049 3590.3927 989.20049 3594.4927 C 986.80049 3599.7927 991.60166 3603.2937 999.90166 3603.2937 C 1008.2016 3603.2937 1011.7016 3605.6916 1018.3016 3608.6916 C 1032.0016 3614.5916 1033.0991 3613.9937 1045.5991 3594.9937 C 1050.2991 3588.4937 1059.3008 3575.3938 1065.8008 3566.4938 C 1083.0008 3541.5938 1090.1007 3532.0923 1094.3007 3526.1923 C 1101.4007 3516.1923 1146.5004 3457.3929 1153.1004 3449.0929 C 1160.2004 3441.2929 1166.8007 3440.6935 1161.5007 3448.4935 C 1148.4007 3468.0935 1097.401 3551.0925 1088.001 3567.6925 C 1084.501 3573.5925 1080.9008 3579.5929 1079.6008 3580.7929 C 1077.2008 3584.2929 1049.301 3634.1934 1049.301 3635.3934 C 1049.301 3635.3934 1044.6004 3643.7928 1039.8004 3652.5928 C 1030.3004 3667.9928 1027.899 3676.9938 1032.699 3676.9938 C 1037.499 3676.9938 1040.4 3674.593 1047 3671.093 C 1057.6 3666.393 1064.2009 3665.1942 1089.8009 3663.3942 L 1120.7001 3662.1917 L 1136.6989 3636.5921 C 1144.9989 3622.2921 1153.3008 3610.992 1155.1008 3611.692 C 1158.0008 3612.292 1156.3016 3621.6938 1150.9016 3631.8938 C 1146.8016 3640.2938 1123.7013 3688.1931 1113.0013 3712.5931 C 1109.5013 3719.6931 1103.6011 3732.793 1100.0011 3741.093 C 1095.8011 3749.493 1088.7004 3765.9929 1084.0004 3777.8929 C 1079.3004 3789.7929 1073.8999 3801.6936 1072.6999 3803.9936 C 1069.7999 3809.3936 1059.5998 3836.5938 1056.0998 3847.3938 C 1054.8998 3851.4938 1053.2015 3855.793 1051.4015 3856.193 C 1050.2015 3856.793 1049.5997 3859.6931 1049.5997 3862.6931 C 1049.5997 3865.6931 1046.1007 3876.3921 1041.8007 3887.0921 C 1035.934 3902.4921 1029.4002 3919.4929 1022.2002 3938.0929 C 1009.7002 3971.8929 1005.6002 3969.5921 1012.1002 3932.1921 C 1018.3002 3894.0921 1022.5015 3860.8924 1021.9015 3854.9924 C 1021.3015 3852.0924 1019.5006 3849.0923 1017.8006 3848.4923 C 1013.6006 3847.2923 994.70059 3868.0938 982.80059 3886.9938 C 968.00059 3911.3938 966.20128 3908.8939 963.80128 3866.7939 C 962.60128 3848.9939 960.8992 3836.4913 959.0992 3834.1913 C 956.1992 3830.6913 955.60049 3830.6928 949.60049 3837.6928 C 946.70049 3841.7928 942.50026 3845.3935 941.20026 3845.3935 C 937.70026 3845.3935 938.79951 3828.7941 943.59951 3809.7941 C 952.49951 3776.5941 952.50198 3755.1935 944.80198 3765.2935 C 935.40198 3776.5935 892.60196 3867.2926 874.80196 3913.0926 C 871.30196 3923.7926 865.9991 3935.6945 864.1991 3939.7945 C 862.3991 3943.8945 861.30071 3949.7924 861.30071 3951.6924 C 861.30071 3953.5924 859.50109 3958.1935 857.80109 3960.4935 C 855.40109 3963.3935 854.30146 3966.9945 854.30146 3969.2945 C 854.30146 3971.5945 852.50184 3976.9925 850.80184 3981.1925 C 849.00184 3985.2925 846.1005 3992.9938 843.7005 3998.3938 C 839.0005 4011.3938 814.00003 4097.4926 814.00003 4100.9926 C 814.00003 4104.4926 809.3016 4106.8945 807.4016 4102.7945 C 805.6016 4097.3945 817.40044 4043.3917 831.70044 3993.6917 C 833.50044 3987.1917 835.79998 3978.2937 836.99998 3973.4937 C 839.89998 3963.3937 853.60051 3918.292 856.60051 3908.192 C 857.80051 3904.092 861.29997 3893.893 863.69997 3885.693 C 874.99997 3851.893 880.90136 3836.3937 887.40136 3823.3937 C 895.20136 3809.0937 893.30021 3802.6927 885.00021 3814.5927 C 882.10021 3818.0927 880.3019 3822.2937 880.3019 3823.3937 C 880.3019 3828.0937 869.60047 3828.794 840.00047 3826.294 C 823.40047 3825.094 803.7992 3823.8937 796.0992 3823.3937 C 782.9992 3822.7937 781.80198 3822.1923 781.80198 3818.0923 C 782.40198 3810.9923 791.29997 3786.5943 801.99997 3762.8943 C 805.49997 3754.4943 809.09942 3746.893 809.09942 3745.693 C 809.09942 3744.493 809.70122 3741.5929 810.90122 3739.1929 C 812.10122 3736.7929 815.60002 3730.3928 818.60002 3724.3928 C 821.50002 3718.4928 824.49947 3711.8918 825.69947 3710.0918 C 838.19947 3683.3918 854.80051 3648.9925 856.60051 3645.9925 C 857.80051 3644.1925 861.3014 3637.5915 864.4014 3631.6915 C 867.3014 3625.7915 870.30085 3619.8913 871.50085 3618.6913 C 872.10085 3617.4913 878.09939 3609.1926 884.59939 3600.8926 L 895.8999 3585.4931 L 916.09978 3585.4931 C 926.69978 3586.0931 942.69913 3586.693 951.69913 3587.293 L 967.10049 3589.0929 L 980.80215 3568.3939 C 1001.0021 3538.0939 1015.201 3518.5932 1031.801 3498.9932 C 1033.001 3497.1932 1038.2996 3490.1919 1043.0996 3483.5919 C 1061.6258 3458.4673 1081.9432 3438.0676 1087.7628 3437.7659 C 1087.8088 3437.7659 1087.8528 3437.7634 1087.897 3437.7621 z M 2016.199 3491.7936 C 2017.999 3491.7936 2019.1017 3494.1914 2020.3017 3497.1914 C 2022.1017 3504.2914 2032.8005 3540.4936 2036.3005 3553.4936 C 2038.1005 3559.3936 2041.6012 3570.6936 2044.0012 3578.3936 C 2045.8012 3586.0936 2048.7001 3594.9935 2049.9001 3598.5935 C 2051.1001 3601.4935 2053.4009 3608.693 2054.0009 3613.993 C 2055.2009 3619.293 2058.7004 3632.3916 2061.1004 3643.6916 C 2071.1004 3683.3916 2074.2 3695.8925 2086.7 3756.4925 C 2089.1 3767.0925 2090.7996 3783.1931 2091.9996 3792.6931 C 2092.5996 3802.1931 2092.0009 3809.8925 2090.8009 3809.8925 C 2089.6009 3809.8925 2083.1007 3799.2917 2076.0007 3785.5917 C 2060.0007 3753.5917 2051.1003 3739.8922 2044.5003 3735.1922 C 2036.8003 3730.4922 1962.0005 3726.3935 1909.2005 3727.4935 C 1863.0005 3728.6935 1864.7004 3729.2932 1857.6004 3714.4932 C 1855.8004 3710.2932 1852.3016 3706.693 1849.9016 3706.093 C 1846.4016 3705.493 1845.7996 3708.4934 1845.1996 3733.8934 C 1844.5996 3750.4934 1843.4012 3762.3933 1842.3012 3762.3933 C 1840.5012 3762.9933 1837.6003 3754.6933 1834.5003 3743.9933 C 1831.6003 3733.8933 1826.2011 3716.6937 1822.0011 3705.4937 C 1817.9011 3694.1937 1812.6 3678.1943 1809.5 3669.8943 C 1807.1 3661.5943 1803.6006 3652.6938 1802.4006 3650.2938 C 1794.1006 3634.2938 1786.4003 3570.893 1789.4003 3547.693 L 1791.2002 3536.3925 L 1818.0004 3538.0922 C 1844.1004 3539.2922 1855.4004 3540.4921 1914.7004 3548.1921 C 1950.9004 3552.2921 1964.4993 3554.7944 1990.5993 3561.2944 C 2009.9993 3565.6277 2019.1006 3558.8927 2017.9006 3541.0927 C 2017.3006 3529.2927 2015.5003 3513.2933 2015.0003 3505.4933 C 2013.8003 3496.5933 2014.399 3491.7936 2016.199 3491.7936 z M 1166.0005 3591.5924 C 1167.8005 3591.5924 1168.9016 3592.7935 1168.4016 3593.9935 C 1167.2016 3595.1935 1165.5007 3596.3928 1164.3007 3596.3928 C 1163.1007 3596.3928 1162.5008 3595.1935 1162.5008 3593.9935 C 1162.5008 3592.7935 1163.6005 3591.5924 1166.0005 3591.5924 z M 1160.0997 3601.093 C 1161.2997 3601.093 1162.5008 3602.7926 1162.5008 3604.5926 C 1162.5008 3608.0926 1159.6001 3609.2937 1156.6001 3606.9937 C 1154.8001 3604.5937 1157.1997 3601.093 1160.0997 3601.093 z M 2996.912 3612.989 C 2998.0734 3613.005 2999.1998 3614.7487 2999.1998 3616.4924 C 2999.1998 3619.9924 2996.3009 3621.1936 2993.3009 3618.8936 C 2991.5009 3616.4936 2993.9005 3612.9928 2996.8005 3612.9928 L 2996.912 3612.9928 L 2996.912 3612.989 z M 2827.6294 3639.534 C 2828.6828 3639.499 2829.7559 3640.0425 2830.5996 3641.3925 C 2831.7996 3643.1925 2832.5021 3646.1933 2831.8021 3647.2933 C 2830.6021 3651.3933 2825.8995 3651.3933 2824.0995 3647.2933 C 2822.3745 3643.4839 2824.9375 3639.6222 2827.6294 3639.534 z M 4254.4999 3783.7937 C 4255.5999 3783.7937 4256.8009 3786.6926 4256.8009 3789.6926 C 4256.8009 3796.1926 4256.2013 3796.8934 4253.3013 3793.7934 C 4250.9013 3791.3934 4251.4999 3783.7937 4254.4999 3783.7937 z M 4261.1797 3800.6641 C 4262.1159 3800.6641 4262.9318 3801.443 4264.0005 3802.793 C 4265.2005 3804.493 4266.3015 3806.8925 4266.3015 3808.0925 C 4266.3015 3810.9925 4259.2002 3810.4932 4257.4002 3807.4932 C 4256.8002 3805.6932 4257.4008 3803.3918 4258.6008 3802.1918 C 4259.6508 3801.1418 4260.4515 3800.6661 4261.1797 3800.6641 z M 1816.4009 3848.6057 C 1817.2103 3848.5777 1817.8873 3849.2253 1818.5998 3850.2941 C 1819.1998 3852.0941 1819.2004 3854.392 1818.0004 3855.692 C 1816.2004 3856.692 1815.0015 3856.6924 1813.9015 3854.9924 C 1812.7015 3853.1924 1812.7008 3851.4929 1814.5008 3849.6929 C 1815.2321 3848.9617 1815.8471 3848.6252 1816.4009 3848.6057 z M 1819.8873 3866.9395 L 1819.8873 3866.9433 C 1819.9343 3866.9433 1819.9796 3866.9441 1820.0272 3866.9433 C 1821.21 3867.0203 1822.6432 3868.3643 1823.9995 3870.9893 C 1826.3995 3875.6893 1838.8015 3917.8882 1838.8015 3921.9882 C 1838.8015 3926.0882 1839.9999 3927.8904 1841.6999 3931.3904 C 1843.4999 3935.4904 1845.8001 3942.0883 1846.4001 3945.0883 C 1847.6001 3950.9883 1853.501 3968.8891 1868.901 4012.6891 C 1873.001 4025.7891 1877.3015 4039.3896 1878.4015 4042.3896 C 1879.0015 4045.8896 1880.8007 4050.7888 1882.6007 4053.0888 C 1884.4007 4055.4888 1886.1003 4059.6899 1886.1003 4061.8899 C 1886.1003 4064.0899 1887.9 4070.2884 1889.6 4074.9884 C 1896.2 4089.7884 1899.1017 4096.8889 1909.8017 4123.0889 C 1915.1017 4136.7889 1925.2007 4160.4902 1932.3007 4175.2902 C 1939.4007 4190.6902 1945.4011 4203.7892 1945.4011 4204.2892 C 1945.4011 4207.7892 1981.0004 4277.1886 1999.4004 4309.8886 C 2010.0004 4328.8886 2019.0009 4344.8891 2019.0009 4346.0891 C 2019.0009 4347.2891 2020.2012 4349.5887 2021.9012 4351.3887 C 2023.7012 4353.1887 2029.0011 4361.3905 2033.8011 4369.7905 C 2048.1011 4394.6905 2061.102 4416.0884 2062.802 4418.4884 C 2070.602 4427.2884 2080.5995 4446.2888 2079.9995 4449.9888 C 2079.3995 4452.8888 2075.8994 4454.6896 2065.1994 4455.8896 C 2056.8994 4456.4896 2043.9008 4458.2885 2035.5008 4459.9885 C 2011.2008 4463.4885 2005.3001 4462.8883 2001.1001 4457.0883 C 1990.4001 4440.4883 1956.7007 4372.8888 1940.6007 4336.6888 C 1936.5007 4327.1888 1931.1014 4315.9906 1929.9014 4311.7906 C 1928.1014 4307.6906 1923.4004 4295.1907 1919.3004 4283.2907 C 1915.2004 4271.3907 1910.4017 4259.4881 1909.8017 4257.1881 C 1903.9017 4243.4881 1885.5004 4184.7888 1876.0004 4151.5888 C 1874.8004 4146.8888 1870.6994 4131.9887 1867.1994 4118.3887 C 1863.0994 4104.0887 1860.0999 4091.0888 1860.0999 4088.0888 C 1860.0999 4085.0888 1858.3003 4079.1906 1856.6003 4073.2906 C 1853.1003 4061.3906 1840.0004 4006.29 1836.4004 3985.49 C 1835.2004 3978.29 1831.701 3960.5891 1829.301 3946.3891 C 1821.601 3904.2891 1817.4011 3878.7895 1817.4011 3872.8895 C 1817.4011 3868.9661 1818.4399 3866.9704 1819.8873 3866.9395 z M 4194.4807 3939.0779 C 4194.6693 3939.0779 4194.8759 3939.1161 4195.1009 3939.1913 C 4196.3009 3939.7913 4197.5001 3942.1934 4197.5001 3943.8934 C 4197.5001 3945.6934 4196.3009 3947.393 4195.1009 3947.393 C 4193.3009 3947.393 4192.6997 3944.9928 4192.6997 3942.6928 C 4192.6997 3940.6803 4193.16 3939.0519 4194.4807 3939.0779 z M 4140.6005 3983.0926 C 4141.8005 3983.0926 4142.9998 3985.3947 4142.9998 3987.7947 C 4142.9998 3990.1947 4141.8005 3992.493 4140.6005 3992.493 C 4138.8005 3992.493 4138.1994 3990.0947 4138.1994 3987.7947 C 4138.1994 3985.4947 4138.8005 3983.0926 4140.6005 3983.0926 z M 4541.59 4237.3305 C 4543.1613 4237.2445 4545.0441 4241.0283 4545.7003 4248.1923 C 4546.3003 4257.6923 4544.6008 4260.6924 4540.4008 4256.4924 C 4539.8008 4255.8924 4539.2002 4251.0931 4539.2002 4245.7931 C 4539.2002 4240.129 4540.2882 4237.4014 4541.59 4237.3305 z M 4548.7802 4273.5008 C 4551.4405 4273.6108 4553.8598 4283.4655 4552.2004 4286.692 C 4551.0004 4287.892 4549.2996 4289.0931 4548.0996 4289.0931 C 4545.0996 4289.1931 4545.0996 4275.4918 4548.0996 4273.6918 C 4548.3262 4273.5512 4548.5548 4273.4915 4548.7802 4273.5008 z M 1332.6324 4292.0407 C 1332.8495 4292.0307 1333.0767 4292.0796 1333.3017 4292.1919 C 1334.5017 4292.6919 1335.6991 4293.8922 1335.6991 4295.0922 C 1335.6991 4296.2922 1334.5017 4297.9925 1333.3017 4297.9925 C 1332.1017 4298.5925 1330.9006 4297.3922 1330.9006 4295.0922 C 1330.9006 4293.2235 1331.6917 4292.0816 1332.6324 4292.0407 z M 1336.8883 4301.0724 C 1337.0711 4301.0717 1337.2759 4301.0913 1337.5009 4301.0913 C 1339.9009 4301.0913 1347.5006 4309.4925 1347.5006 4311.7925 C 1347.5006 4314.0925 1351.0008 4320.0919 1355.9008 4327.1919 C 1360.0008 4333.7919 1364.3011 4339.6924 1364.3011 4340.2924 C 1364.3011 4341.4924 1392.1 4383.0937 1405.2 4400.7937 C 1443.7 4455.3937 1529.2015 4538.3927 1570.8015 4561.4927 C 1585.6015 4570.2927 1596.9004 4570.9917 1611.7004 4565.5917 C 1620.5004 4562.6917 1637.8016 4557.8915 1657.4016 4552.5915 C 1663.3016 4550.7915 1680.5005 4546.6935 1741.6005 4532.3935 C 1785.4005 4521.7935 1789.0007 4521.0924 1791.4007 4523.5924 C 1793.2007 4525.3924 1790.2004 4529.491 1783.0004 4536.691 C 1770.0004 4548.491 1743.3009 4578.7925 1732.6009 4593.5925 C 1715.4009 4617.2925 1699.999 4657.0924 1707.699 4657.0924 C 1715.399 4657.0924 1716.5003 4654.1929 1724.9003 4649.9929 C 1733.3003 4645.8929 1742.1015 4642.8935 1743.9015 4642.8935 C 1748.6015 4642.8935 1775.4004 4628.092 1783.0004 4620.992 C 1785.9004 4618.592 1792.5006 4613.8927 1797.8006 4610.2927 C 1803.1006 4606.7927 1814.4019 4598.9914 1823.3019 4593.0914 C 1848.9019 4575.8914 1852.4002 4573.493 1866.7002 4565.293 C 1902.3002 4545.093 1951.4992 4521.9929 1959.1992 4521.9929 C 1966.8992 4521.9929 1965.0994 4520.1933 1967.5994 4518.4933 C 1970.4994 4516.6933 1975.2999 4514.9918 1978.8999 4514.9918 C 1982.4999 4514.9918 1986.0006 4513.7919 1986.6006 4513.1919 C 1987.8006 4511.9919 1991.2993 4510.2923 1996.0993 4509.6923 C 2005.5993 4507.8923 2034.6001 4497.8932 2053.6001 4488.9932 C 2061.3001 4485.4932 2074.3 4481.1927 2082.1 4479.4927 C 2101.7 4475.9927 2098.0989 4472.3924 2149.6989 4542.8924 C 2155.5989 4550.6924 2161.4996 4555.9915 2165.6996 4557.1915 C 2169.1996 4557.7915 2196.599 4557.1922 2226.199 4555.3934 C 2256.499 4553.5934 2308.0997 4551.8914 2340.6997 4550.6914 C 2401.2997 4549.4914 2529.4016 4551.291 2542.4016 4554.191 C 2547.8016 4555.391 2550.8008 4554.7926 2554.9008 4551.2926 C 2560.8008 4547.1926 2560.8009 4545.994 2561.4009 4490.294 C 2562.0009 4458.794 2563.202 4431.4925 2563.802 4429.6925 C 2565.602 4424.3925 2570.9013 4435.593 2574.5013 4451.093 C 2575.7013 4458.193 2578.6002 4469.493 2580.4002 4475.993 C 2589.9002 4507.493 2594.7002 4527.5923 2597.0002 4540.0923 C 2598.8002 4554.3923 2605.8001 4559.6927 2625.5001 4561.4927 C 2654.0001 4564.3927 2711.5009 4572.7927 2746.5009 4579.8927 C 2770.8009 4584.5927 2796.2995 4592.3927 2801.0995 4596.4927 C 2802.8995 4597.6927 2805.2003 4605.2928 2807.0003 4613.0928 C 2811.1003 4633.7928 2812.9021 4912.1928 2808.8021 4956.5928 C 2807.6021 4974.3928 2805.2994 4999.3937 2804.6994 5012.2937 C 2802.2994 5041.3937 2795.2001 5101.2923 2794.0001 5103.6923 C 2792.8001 5106.0923 2791.6005 5116.1924 2790.5005 5128.5924 C 2787.6005 5153.4924 2784 5180.193 2777.4 5216.393 C 2775 5228.293 2772.7012 5244.891 2771.5012 5253.191 C 2770.3012 5261.591 2768.001 5273.8922 2766.801 5280.4922 C 2765.601 5286.9922 2762.7002 5302.3929 2760.9002 5314.8929 C 2758.5002 5327.3929 2754.9995 5343.8941 2753.1995 5352.2941 C 2751.3995 5360.6941 2750.3011 5369.4931 2750.3011 5372.9931 C 2750.3011 5376.4931 2749.1 5383.6919 2747.9 5388.9919 C 2746.7 5394.2919 2744.3998 5404.9921 2743.1998 5412.0921 C 2741.3998 5425.0921 2733.7003 5462.4936 2727.8003 5493.8936 C 2725.4003 5502.7936 2722.499 5518.8924 2720.699 5528.2924 C 2718.899 5538.3924 2715.3995 5554.3923 2713.5995 5565.0923 C 2711.7995 5575.7923 2709.5012 5586.9911 2708.9012 5591.1911 C 2706.5012 5609.5911 2702.301 5632.092 2700.501 5638.592 C 2699.301 5642.692 2696.4002 5656.393 2694.6002 5669.493 C 2690.5002 5694.493 2685.1004 5722.8927 2680.9004 5742.9927 C 2679.7004 5749.5927 2677.4002 5761.3914 2676.2002 5769.0914 C 2673.3002 5789.2914 2667.7992 5824.793 2663.6992 5850.893 C 2661.2992 5863.393 2658.3991 5881.1925 2657.1991 5891.1925 C 2655.9991 5900.6925 2654.2994 5909.5931 2653.6994 5910.7931 C 2653.0994 5911.9931 2651.2998 5920.7929 2650.1998 5930.9929 C 2647.7998 5955.9929 2641.4005 5997.9922 2639.5005 6003.3922 C 2638.3005 6007.4922 2637.7017 6014.0933 2631.8017 6069.2933 C 2630.6017 6081.0933 2628.2996 6097.0926 2627.0996 6104.8926 C 2625.8996 6111.9926 2622.9989 6132.6929 2621.1989 6151.0929 C 2618.7989 6169.4929 2615.9001 6197.9916 2613.5001 6213.9916 C 2611.1001 6235.8916 2609.9998 6268.5928 2610.5998 6337.9928 C 2610.5998 6439.4928 2610.6008 6445.3925 2624.9008 6516.4925 C 2628.4008 6536.0925 2630.8003 6554.3933 2630.2003 6557.3933 C 2629.6003 6559.7933 2611.2015 6578.0918 2589.3015 6597.1918 C 2568.0015 6616.7918 2539.9989 6642.1921 2528.1989 6653.4921 C 2516.3989 6664.7921 2505.0995 6674.1911 2502.6995 6674.1911 C 2500.2995 6674.1911 2494.3008 6665.3924 2484.9008 6646.2924 C 2457.0008 6591.6924 2428.002 6545.4926 2388.802 6492.5926 C 2343.102 6431.5926 2295.1007 6376.3919 2266.6007 6353.1919 C 2217.9007 6313.4919 2191.9007 6305.6923 2134.9007 6314.6923 C 2123.1007 6316.4923 2101.099 6319.3936 2086.199 6321.7936 C 2070.499 6323.7936 2048.0001 6327.2916 2036.1001 6329.0916 C 2023.6001 6331.4916 2006.3998 6333.7924 1998.1998 6334.9924 C 1989.3998 6336.1924 1971.6003 6338.4931 1957.9003 6340.8931 C 1910.4003 6347.9931 1894.5 6349.6924 1866.6 6351.5924 C 1850.6 6352.7924 1826.2995 6355.0926 1811.9995 6356.2926 C 1765.0995 6360.4926 1704.1009 6358.6917 1658.9009 6352.1917 C 1642.9009 6349.7917 1606.7003 6337.394 1596.0003 6330.294 C 1591.9003 6327.894 1584.7008 6323.793 1580.6008 6321.493 C 1565.2008 6312.693 1533.7004 6281.193 1519.6004 6259.793 C 1505.3004 6238.493 1490.5012 6214.0931 1490.5012 6212.8931 C 1490.5012 6211.6931 1487.0017 6206.2927 1483.4017 6199.7927 C 1479.3017 6193.2927 1469.1002 6176.0931 1461.5002 6161.2931 C 1453.2002 6146.4931 1441.3004 6125.0926 1434.9004 6113.1926 C 1348.3004 5956.8926 1322.1011 5906.4932 1275.9011 5806.7932 C 1259.9011 5771.7932 1240.9007 5723.6936 1236.1007 5704.7936 C 1234.9007 5700.6936 1232.6005 5694.7926 1231.4005 5690.4926 C 1227.3005 5680.9926 1219.5995 5654.8934 1217.0995 5642.9934 C 1215.8995 5637.6934 1212.3993 5623.9924 1208.6993 5612.0924 C 1205.7993 5600.1924 1201.6001 5581.1934 1199.9001 5569.2934 C 1197.5001 5557.4934 1194.6006 5540.2931 1192.8006 5531.3931 C 1188.7006 5509.4931 1188.7006 5375.3924 1192.8006 5348.6924 C 1197.5006 5315.4924 1201.1998 5287.5931 1201.5998 5267.9931 C 1202.7998 5247.7931 1206.2993 5240.093 1208.6993 5251.393 C 1217.0993 5292.893 1225.3017 5311.9926 1244.9017 5338.6926 C 1258.6017 5357.6926 1288.2 5387.8932 1313.1 5409.8932 C 1338 5431.1932 1352.1999 5450.192 1358.1999 5470.992 C 1365.8999 5496.592 1361.7002 5525.5916 1348.2002 5544.4916 C 1317.9002 5586.5916 1314.4015 5595.4931 1320.3015 5619.7931 C 1322.1015 5628.6931 1325.0004 5638.1921 1326.2004 5640.4921 C 1327.4004 5642.8921 1330.3017 5651.1927 1333.3017 5658.2927 C 1342.2017 5679.5927 1350.4994 5693.2919 1373.5994 5724.1919 C 1390.7994 5747.2919 1394.9012 5754.4923 1392.0012 5755.6923 C 1387.9012 5758.5923 1380.7 5756.2934 1373 5749.7934 C 1370.1 5746.2934 1366.5012 5743.8926 1365.3012 5743.8926 C 1362.4012 5743.8926 1364.1009 5757.5928 1368.8009 5766.9928 C 1373.5009 5777.6928 1383.1 5815.6931 1383.1 5826.9931 C 1383.1 5838.2931 1402.7 5868.4937 1434.7 5896.3937 C 1447.8 5907.6937 1459.1015 5917.0928 1460.3015 5917.0928 C 1461.5015 5917.0928 1465.6021 5919.9922 1469.8021 5924.1922 C 1478.6021 5931.8922 1485.2001 5932.9918 1490.0001 5927.6918 C 1493.5001 5922.9918 1488.2 5913.9935 1475.2 5906.3935 C 1470.5 5902.8935 1466.4008 5899.7926 1466.4008 5898.5926 C 1466.4008 5896.7926 1478.2015 5893.2922 1500.8015 5889.1922 C 1510.8015 5886.7922 1515.0992 5885.0915 1541.0992 5873.1915 C 1566.0992 5861.8915 1572.0004 5851.8924 1550.0004 5858.8924 C 1522.1004 5867.6924 1501.9002 5870.1921 1471.6002 5868.8921 C 1439.0002 5868.2921 1433.0994 5865.992 1420.5994 5854.092 C 1410.5994 5844.592 1404.6006 5830.9939 1404.6006 5817.2939 C 1404.6006 5803.5939 1405.2005 5804.1914 1416.5005 5791.1914 C 1430.2005 5774.5914 1438.3997 5770.4919 1463.9997 5767.4919 C 1473.3997 5766.2919 1490.1015 5763.3925 1500.8015 5760.3925 C 1516.8015 5756.2925 1524.4998 5755.6935 1550.5998 5756.2935 C 1578.4998 5757.4935 1590.4015 5758.6927 1640.8015 5768.7927 C 1659.8015 5772.2927 1681.7003 5778.1913 1683.5003 5780.0913 C 1686.4003 5782.9913 1682.3002 5788.8924 1677.0002 5788.8924 C 1664.5002 5788.8924 1625.4002 5809.093 1625.4002 5814.993 C 1625.4002 5820.893 1627.7992 5817.8919 1646.0992 5812.5919 C 1688.1992 5799.4919 1707.8012 5792.3918 1714.3012 5787.6918 C 1717.8012 5784.7918 1724.9988 5781.7923 1729.6988 5780.5923 C 1733.7988 5779.9923 1742.2006 5778.1934 1748.1006 5776.4934 L 1758.1987 5774.0922 L 1758.1987 5761.593 C 1758.1987 5750.893 1756.9992 5747.8932 1751.0992 5741.3932 C 1742.7992 5732.9932 1738.5999 5732.5914 1732.0999 5739.5914 C 1727.9999 5743.6914 1725.6005 5744.2929 1714.9005 5743.0929 C 1694.7005 5740.6929 1675.1993 5732.9921 1634.1993 5710.4921 C 1631.7993 5709.2921 1627.7012 5706.9938 1625.9012 5705.7938 C 1623.5012 5704.5938 1608.0999 5695.7914 1592.0999 5686.1914 C 1544.5999 5657.6914 1527.4002 5650.5928 1483.6002 5638.0928 C 1462.2002 5632.1928 1428.4007 5636.8915 1416.6007 5647.5915 C 1410.1007 5653.4915 1404.1017 5650.4918 1395.9017 5637.5918 C 1391.8017 5631.6918 1380.5021 5616.8929 1370.3021 5604.9929 C 1357.8021 5590.6929 1352.5001 5583.0929 1353.7001 5580.0929 C 1354.3001 5578.2929 1356.1004 5574.1926 1356.6004 5571.6926 C 1357.2004 5569.2926 1361.2991 5559.8928 1366.0991 5551.4928 C 1379.7991 5527.0928 1381.4992 5521.1916 1382.6992 5497.4916 C 1383.2992 5476.1916 1383.3002 5474.3926 1374.9002 5458.3926 C 1364.8002 5437.6926 1354.6994 5425.1919 1315.5994 5388.9919 C 1282.3994 5358.0919 1272.302 5345.693 1253.302 5313.093 C 1235.502 5283.393 1227.8006 5257.8917 1229.6006 5234.1917 C 1230.8006 5220.4917 1232 5214.5919 1236.7 5207.5919 C 1242.6 5198.0919 1271.1003 5174.3927 1293.0003 5160.0927 C 1309.0003 5148.7927 1339.2011 5122.192 1350.5011 5109.092 C 1359.4011 5098.392 1370.0991 5082.9928 1389.0991 5053.2928 C 1402.0991 5033.0928 1420.6002 4992.2931 1426.5002 4971.4931 C 1428.9002 4963.6931 1431.9005 4954.2927 1433.1005 4950.0927 C 1434.9005 4945.9927 1436.5995 4928.1919 1437.1995 4909.1919 C 1437.7995 4879.4919 1437.8005 4873.5912 1433.1005 4858.1912 C 1427.2005 4839.1912 1418.3 4820.7929 1405.2 4800.0929 C 1393.9 4782.2929 1357.1008 4746.0918 1339.3008 4734.1918 C 1331.0008 4729.4918 1319.7002 4721.6918 1313.2002 4717.5918 C 1285.3002 4700.3918 1245.5994 4689.0925 1245.5994 4698.5925 C 1245.5994 4708.0925 1246.2012 4702.0921 1247.4012 4702.0921 C 1248.6012 4702.0921 1256.9012 4707.4913 1265.8012 4714.5913 C 1274.7012 4721.0913 1288.4003 4729.3925 1296.7003 4733.5925 C 1304.4003 4737.0925 1312.1009 4741.2936 1314.5009 4742.3936 C 1316.3009 4743.5936 1328.1997 4750.793 1340.5997 4757.793 C 1357.7997 4767.293 1367.3008 4774.994 1378.0008 4786.794 C 1386.3008 4795.694 1392.801 4803.9933 1392.801 4805.7933 C 1392.801 4810.4933 1386.2003 4809.2921 1376.8003 4803.3921 C 1360.8003 4793.3921 1312.0993 4779.6934 1286.0993 4777.2934 C 1268.8993 4775.4934 1228.5988 4782.5931 1223.1988 4787.2931 C 1221.9988 4788.4931 1219.1018 4789.6923 1217.3018 4789.6923 C 1215.5018 4789.6923 1210.2006 4792.5912 1206.6006 4795.5912 L 1199.5012 4801.4939 L 1214.3013 4795.5931 C 1235.6013 4787.1931 1275.402 4785.4929 1300.302 4790.8929 C 1309.802 4793.2929 1322.1995 4795.5937 1327.5995 4796.7937 C 1343.5995 4800.2937 1357.9005 4804.4941 1371.4005 4809.8941 C 1378.5005 4812.2941 1386.8005 4814.5924 1389.8005 4814.5924 C 1392.8005 4814.5924 1398.2003 4817.4936 1403.5003 4825.2936 C 1407.7003 4831.1936 1411.3011 4837.7927 1411.3011 4839.5927 C 1411.3011 4841.3927 1412.5004 4844.2935 1413.7004 4845.4935 C 1416.1004 4848.3935 1422.5009 4872.7918 1425.0009 4885.1918 C 1425.6009 4890.5918 1424.9991 4894.6936 1423.1991 4895.2936 C 1421.9991 4896.4936 1412.6014 4888.6923 1401.3014 4878.0923 C 1380.0014 4856.6923 1371.0016 4848.9931 1344.3016 4830.5931 C 1335.9016 4825.2931 1319.4005 4818.0926 1296.8005 4810.9926 C 1285.5005 4807.4926 1241.5994 4808.0913 1232.6994 4812.1913 C 1218.3994 4818.0913 1192.4008 4827.5926 1184.6008 4829.3926 C 1175.2008 4831.7926 1165.0002 4816.293 1140.1002 4762.393 C 1133.0002 4747.593 1125.7991 4723.8915 1127.5991 4720.1915 C 1129.3991 4715.4915 1162.6005 4695.8924 1178.0005 4691.1924 C 1184.5005 4689.3924 1191.7006 4686.4935 1194.6006 4685.2935 C 1199.9006 4682.8935 1210.6001 4681.1928 1234.9001 4679.3928 C 1250.9001 4677.5928 1272.3007 4679.9924 1297.8007 4686.5924 C 1315.6007 4690.6924 1319.1009 4688.3918 1310.8009 4677.0918 C 1303.1009 4667.5918 1291.8 4659.2926 1268 4647.9926 C 1254.3 4641.4926 1252.5998 4639.6921 1254.9998 4636.6921 C 1256.1998 4634.8921 1259.7005 4632.5938 1262.7005 4631.9938 C 1265.6005 4630.7938 1271.0997 4629.0936 1275.1997 4627.2936 C 1284.6997 4623.1936 1300.8006 4617.7926 1318.0006 4612.9926 C 1325.7006 4610.5926 1335.7995 4607.5931 1340.4995 4605.8931 C 1362.3995 4597.4931 1402.1995 4588.0931 1445.4995 4580.9931 C 1453.7995 4579.7931 1460.9002 4578.0941 1461.5002 4576.8941 C 1462.7002 4575.6941 1458.0009 4566.7913 1450.8009 4556.1913 C 1423.5009 4515.1913 1389.2007 4447.0934 1359.5007 4375.7934 C 1349.4007 4350.8934 1335.6991 4311.0934 1335.6991 4305.7934 C 1335.6991 4301.4871 1336.0961 4301.0752 1336.8883 4301.0724 z M 2041.8005 4591.7925 C 1996.7005 4590.5925 1978.9013 4592.3928 1940.9013 4600.1928 C 1890.5013 4610.1928 1879.7996 4614.9931 1857.1996 4638.0931 C 1817.3996 4680.1931 1796.1011 4708.6933 1799.0011 4716.4933 C 1801.7011 4721.3933 1815.9005 4717.8938 1833.7005 4706.5938 C 1845.0005 4699.4938 1850.3001 4697.7936 1855.6001 4698.1936 C 1860.3001 4699.3936 1862.201 4698.7924 1863.401 4695.7924 C 1864.601 4689.2924 1900.2006 4667.8934 1903.7006 4671.3934 C 1904.9006 4672.5934 1905.5011 4674.2937 1904.9011 4674.2937 C 1904.3011 4674.8937 1900.8011 4677.1932 1896.6011 4679.5932 C 1892.5011 4682.4932 1882.9002 4689.5926 1875.9002 4696.7926 C 1868.8002 4703.2926 1860.4996 4709.8923 1858.0996 4710.4923 C 1855.1996 4711.0923 1853.4013 4713.3925 1853.4013 4715.1925 C 1853.4013 4716.9925 1848.7003 4722.8935 1842.8003 4729.4935 C 1837.4003 4735.3935 1833.3009 4740.7932 1833.9009 4741.2932 C 1836.3009 4743.6932 1843.4001 4742.4939 1846.4001 4738.8939 C 1849.3001 4734.7939 1858.2004 4734.7939 1859.4004 4738.8939 C 1860.6004 4741.7939 1854.1012 4746.5936 1828.5012 4762.6936 C 1806.0012 4776.9936 1816.0012 4776.3924 1845.1012 4762.0924 C 1852.2012 4758.5924 1858.1004 4756.7922 1859.4004 4757.3922 C 1861.2004 4759.1922 1859.4004 4762.0934 1841.0004 4784.6934 C 1826.2004 4802.4934 1820.8003 4813.1929 1824.4003 4816.6929 C 1825.6003 4817.8929 1829.1006 4816.6927 1832.8006 4813.7927 C 1835.7006 4811.3927 1839.3013 4809.0925 1840.5013 4809.0925 C 1841.7013 4809.0925 1846.4012 4805.593 1850.6012 4801.993 C 1855.3012 4797.893 1860.1005 4796.0935 1861.3005 4796.6935 C 1861.9005 4797.8935 1860.7002 4805.4929 1858.4002 4813.8929 C 1854.3002 4827.5929 1854.3009 4828.6931 1857.8009 4835.1931 C 1862.5009 4843.9931 1864.3011 4843.9925 1866.2011 4835.7925 C 1870.9011 4817.9925 1888.1003 4788.8931 1903.6003 4773.4931 C 1922.0003 4754.4931 1948.6999 4733.1928 1960.4999 4727.2928 C 1964.6999 4724.8928 1970.5998 4721.8938 1972.3998 4719.4938 C 1977.0998 4715.3938 1980.1 4719.4927 1977.1 4725.3927 C 1968.7 4741.9927 1962.3006 4759.1929 1959.9006 4768.7929 C 1948.6006 4819.7929 1951.5 4830.4922 1977.1 4841.1922 C 1982.4 4843.5922 1988.4011 4846.5925 1989.6011 4847.7925 C 1990.8011 4848.9925 1987.8004 4853.693 1981.9004 4859.093 L 1971.8005 4867.8922 L 1975.3001 4876.2924 C 1985.4001 4899.9924 2024 4940.9939 2047.1 4951.5939 C 2061.4 4958.0939 2064.2995 4958.6933 2089.1995 4958.6933 C 2114.0995 4958.6933 2118.2997 4958.0938 2128.8997 4953.3938 C 2144.8997 4946.2938 2173.4003 4923.0921 2190.0003 4904.6921 C 2201.3003 4891.5921 2213.7013 4869.0927 2214.4013 4862.5927 C 2214.4013 4860.7927 2209.0995 4855.3922 2202.4995 4849.4922 C 2185.2995 4835.1922 2187.1004 4829.8922 2210.3004 4824.5922 C 2216.8004 4822.7922 2226.3011 4813.2921 2226.3011 4807.9921 C 2226.3011 4802.6921 2223.4008 4800.293 2219.7008 4793.693 C 2210.9008 4776.493 2215.0013 4771.7932 2231.0013 4779.9932 C 2235.1013 4782.8932 2249.4005 4789.9933 2261.9005 4796.5933 C 2273.7005 4803.0933 2292.8006 4814.3934 2303.4006 4821.4934 L 2322.3999 4834.5938 L 2321.8006 4846.4936 C 2321.2006 4864.8936 2306.9998 4892.1933 2289.1998 4909.8933 C 2254.7998 4942.4933 2219.8003 4960.2927 2150.4003 4980.4927 C 2127.8003 4986.9927 2104.0998 4989.2937 2060.7998 4989.2937 C 1996.0998 4989.2937 1959.3 4982.7938 1907.1 4960.7938 C 1878.6 4949.4938 1863.1997 4948.2923 1847.0997 4957.2923 C 1837.0997 4963.7923 1832.3008 4972.6922 1841.2008 4969.1922 C 1850.1008 4965.6922 1871.5011 4963.2939 1879.1011 4964.4939 C 1883.8011 4965.6939 1894.4999 4969.7926 1903.3999 4973.9926 C 1921.7999 4983.3926 1923.0004 4986.4932 1914.7004 5000.0932 C 1907.6004 5012.5932 1911.7997 5014.8921 1925.3997 5005.9921 C 1933.0997 5001.2921 1939.7006 4998.8927 1946.1006 4998.8927 L 1954.8998 4998.8927 L 1955.501 5011.3937 L 1956.6997 5023.1934 L 1966.7996 5014.8934 C 1972.6996 5010.1934 1978.1012 5006.0923 1978.6012 5006.0923 C 1982.1012 5006.0923 1986.4002 5011.9939 1986.4002 5017.8939 C 1986.4002 5023.7939 1987.0001 5025.5926 1988.2001 5027.3926 C 1990.0001 5029.7926 1991.1009 5029.7939 1994.1009 5026.1939 C 2006.0009 5011.8939 2008.4002 5010.7937 2013.1002 5011.3937 C 2016.6002 5011.9937 2018.5005 5014.2921 2019.7005 5019.7921 C 2022.6005 5033.4921 2025.5999 5034.5936 2036.8999 5023.2936 C 2052.8999 5007.2936 2060.0009 5009.5923 2067.8009 5032.7923 C 2068.4009 5035.1923 2071.2998 5036.8932 2073.6998 5036.8932 C 2078.3998 5036.8932 2078.9998 5035.693 2081.9998 5022.093 C 2083.1998 5017.993 2085.5007 5014.9921 2089.8007 5014.2921 C 2096.9007 5012.4921 2101.1001 5014.2939 2115.3001 5026.1939 C 2123.7001 5032.6939 2124.2005 5032.6931 2128.4005 5028.5931 C 2131.3005 5026.1931 2133.7001 5022.0921 2133.7001 5019.7921 C 2134.3001 5015.0921 2136.5996 5014.3932 2149.0996 5013.8932 C 2162.1996 5012.8932 2163.9001 5013.4936 2177.0001 5022.3936 C 2193.0001 5033.0936 2197.7011 5031.8928 2191.3011 5018.2928 L 2187.2003 5009.3934 L 2193.8006 5004.0939 C 2200.9006 4997.5939 2212.2007 4997.5939 2235.3007 5004.0939 C 2242.4007 5006.4939 2250.7007 5008.7934 2253.7007 5009.3934 C 2261.5007 5011.7934 2260.3005 5006.4933 2249.0005 4994.5933 C 2243.7005 4989.2933 2240.2004 4983.2931 2240.7004 4981.5931 C 2241.9004 4976.8931 2292.2996 4976.2937 2302.8996 4980.9937 C 2307.5996 4982.7937 2312.3995 4983.893 2312.9995 4983.393 C 2315.3995 4980.993 2304.1009 4971.5936 2293.4009 4966.1936 C 2279.7009 4959.0936 2277.9996 4956.1935 2284.4996 4951.3935 C 2287.9996 4948.4935 2296.4013 4947.2939 2314.8013 4946.0939 C 2340.9013 4944.2939 2350.9996 4941.3932 2337.8996 4938.3932 C 2334.3996 4937.7932 2328.4004 4935.9936 2325.4004 4934.8936 C 2322.4004 4933.7936 2317.5999 4932.4925 2314.0999 4932.4925 C 2310.5999 4932.4925 2308.7001 4931.2923 2308.7001 4927.7923 C 2308.7001 4920.6923 2317.1001 4918.2936 2343.7001 4918.2936 C 2368.0001 4917.6936 2377.4995 4916.4935 2379.2995 4911.7935 C 2379.8995 4908.8935 2369.2005 4905.2924 2353.1005 4902.9924 C 2346.6005 4902.3924 2341.8 4900.5928 2341.8 4899.4928 C 2341.8 4895.3928 2351.3001 4894.7932 2375.0001 4895.9932 C 2395.7001 4897.7932 2398.8004 4897.1939 2400.0004 4893.5939 C 2402.4004 4887.6939 2397.0995 4885.1937 2379.2995 4885.1937 C 2346.0995 4885.1937 2342.5012 4875.6932 2374.6012 4873.8932 C 2388.3012 4873.2932 2394.1998 4871.4923 2394.1998 4869.7923 C 2394.1998 4866.2923 2398.8995 4863.8934 2405.9995 4863.8934 C 2413.0995 4863.8934 2420.3004 4859.1924 2426.7004 4855.0924 C 2430.8004 4852.6924 2418.3996 4849.6926 2404.1996 4849.6926 C 2389.9996 4849.6926 2387.0002 4848.4934 2387.0002 4847.2934 C 2387.0002 4846.0934 2390.5012 4843.1939 2395.8012 4840.1939 C 2400.5012 4837.7939 2408.3006 4832.9921 2413.0006 4830.0921 C 2420.7006 4825.3921 2444.501 4816.3932 2471.201 4807.5932 C 2481.801 4804.0932 2491.4009 4798.7921 2491.4009 4795.0921 C 2491.4009 4791.3921 2476.6001 4793.8934 2458.8001 4793.8934 C 2425.6001 4793.8934 2413.1008 4792.0926 2413.1008 4787.9926 C 2413.1008 4783.8926 2416.0011 4784.4924 2419.7011 4783.2924 C 2431.0011 4778.5924 2448.7005 4768.9938 2455.3005 4763.6938 C 2462.4005 4757.7938 2462.3998 4758.3935 2430.9998 4769.0935 C 2410.2998 4776.1935 2384.0996 4779.0931 2381.1996 4774.3931 C 2380.5996 4773.1931 2376.5009 4771.4922 2371.7009 4770.2922 C 2360.4009 4768.4922 2348.6013 4761.8936 2349.8013 4758.9936 C 2351.0013 4754.8936 2360.4004 4753.6937 2364.1004 4757.1937 C 2367.0004 4760.0937 2377.8002 4760.693 2377.8002 4757.793 C 2377.8002 4754.893 2367.2001 4745.9937 2352.9001 4738.7937 C 2344.5001 4735.2937 2327.9998 4726.8938 2314.9998 4720.3938 C 2301.8998 4713.8938 2273.5012 4699.6923 2252.1012 4688.3923 C 2230.2012 4677.0923 2205.8006 4664.593 2197.5006 4661.093 C 2188.7006 4657.593 2179.7001 4653.9928 2177.9001 4652.6928 C 2175.5001 4651.4928 2172.0011 4650.2935 2170.1011 4650.2935 C 2166.6011 4650.2935 2154.7012 4645.5924 2141.6012 4639.5924 C 2138.1012 4637.7924 2132.1001 4636.0927 2129.1001 4636.0927 C 2126.1001 4636.0927 2121.4002 4634.8935 2119.0002 4633.6935 C 2116.6002 4632.4935 2107.7011 4630.7933 2098.3011 4628.9933 C 2044.9011 4620.5933 2030.7012 4618.8928 2018.2012 4617.6928 C 2003.9012 4615.8928 1998.6013 4611.7936 2006.3013 4608.8936 C 2008.7013 4608.2936 2024.1001 4606.4921 2040.7001 4605.3921 C 2070.4001 4602.9921 2078.6007 4604.1928 2120.2007 4613.0928 C 2133.9007 4615.9928 2171.2007 4627.8935 2181.9007 4632.7935 C 2185.4007 4634.5935 2193.8013 4637.493 2199.7013 4639.893 C 2210.4013 4643.993 2224.0998 4649.8927 2231.1998 4653.5927 C 2232.9998 4654.7927 2235.9006 4655.3927 2237.1006 4655.3927 C 2238.3006 4655.3927 2248.9008 4660.0924 2260.2008 4665.3924 C 2272.0008 4670.6924 2282.1009 4676.0936 2283.3009 4676.0936 C 2283.9009 4676.6936 2285.1008 4676.093 2285.1008 4674.893 C 2285.1008 4673.693 2280.4011 4670.7927 2275.1011 4668.2927 C 2269.2011 4665.8927 2260.3012 4660.5922 2254.9012 4656.9922 C 2249.6012 4653.4922 2243.6001 4650.4921 2242.4001 4650.4921 C 2240.6001 4650.4921 2232.9001 4647.5926 2225.8001 4643.3926 C 2213.3001 4637.4926 2207.9997 4634.5926 2185.9997 4624.9926 C 2180.6997 4623.1926 2174.7012 4620.2938 2172.9012 4619.0938 C 2170.5012 4618.4938 2166.3009 4617.2939 2164.5009 4617.2939 C 2162.7009 4617.2939 2158.0003 4616.0936 2155.0003 4614.3936 C 2152.6003 4612.5936 2144.3004 4609.6922 2136.6004 4607.2922 C 2128.2004 4604.8922 2118.8001 4601.8928 2115.3001 4600.1928 C 2098.7001 4594.7928 2084.4005 4593.0925 2041.8005 4591.7925 z M 1874.4009 4635.5936 C 1877.3009 4635.5936 1879.0999 4636.7939 1878.4999 4638.4939 C 1876.6999 4643.1939 1869.7007 4643.7932 1869.7007 4639.0932 C 1869.7007 4637.3932 1871.4009 4635.5936 1874.4009 4635.5936 z M 1911.9741 4641.4736 C 1913.3569 4641.4798 1914.5748 4641.8683 1915.2998 4642.7933 C 1917.0998 4644.5933 1917.1004 4645.6935 1914.7004 4647.4935 C 1910.0004 4650.3935 1905.8012 4650.3935 1904.0012 4647.4935 C 1902.2012 4644.8685 1907.8257 4641.4548 1911.9741 4641.4736 z M 1864.8871 4643.1147 C 1866.4004 4643.0505 1867.2996 4644.0898 1867.2996 4646.2929 C 1867.2996 4650.9929 1865.4999 4649.7925 1863.7999 4649.7925 C 1862.0999 4649.7925 1860.3003 4650.9937 1860.3003 4652.1937 C 1860.3003 4653.3937 1858.5007 4654.5929 1856.8007 4654.5929 C 1851.8007 4654.5929 1851.8009 4653.3935 1857.8009 4647.4935 C 1860.6696 4644.6778 1863.1719 4643.1874 1864.8871 4643.1147 z M 1897.9057 4648.5976 C 1901.5572 4648.5367 1902.5505 4650.3173 1900.0005 4653.3923 C 1897.1005 4656.8923 1892.9006 4658.0923 1889.9006 4655.1923 C 1886.9006 4652.7923 1888.1002 4650.4934 1893.4002 4649.2934 C 1895.1752 4648.8434 1896.6885 4648.6179 1897.9057 4648.5976 z M 1881.1506 4655.0675 C 1882.2756 4655.0675 1883.3504 4655.9436 1885.2004 4657.6936 C 1888.7004 4660.5936 1888.101 4661.7936 1880.901 4665.9936 C 1876.801 4668.8936 1864.301 4677.2936 1854.201 4684.3936 C 1844.101 4691.4936 1832.2997 4699.1936 1828.6997 4700.9936 C 1820.2997 4705.0936 1819.8004 4705.093 1819.8004 4701.593 C 1819.8004 4698.093 1825.7998 4691.9921 1835.1998 4685.4921 C 1838.0998 4683.6921 1847.1004 4677.0923 1854.8004 4671.7923 C 1863.2004 4666.3923 1870.2004 4661.7926 1871.4004 4661.7926 C 1872.6004 4661.7926 1874.3002 4659.9936 1876.8002 4657.6936 C 1878.8502 4655.9436 1880.0256 4655.0675 1881.1506 4655.0675 z M 2295.7623 4678.5023 C 2295.1365 4678.5269 2294.4748 4678.6686 2293.7998 4678.8936 C 2291.9998 4680.1936 2292.6004 4680.6936 2295.0004 4680.6936 C 2297.4004 4680.6936 2299.2 4680.093 2298.5 4679.493 C 2297.75 4678.743 2296.8053 4678.4613 2295.7623 4678.5023 z M 3524.8011 4748.1922 C 3574.6011 4750.5922 3611.3995 4763.5926 3651.0995 4792.5926 C 3668.8995 4805.8926 3694.5004 4834.3929 3693.9004 4839.6929 C 3693.3004 4842.0929 3688.5005 4843.7924 3675.5005 4844.9924 C 3618.0005 4850.2924 3619.1997 4850.2929 3599.5997 4839.6929 C 3563.9997 4821.1929 3549.8005 4818.2943 3498.7005 4818.2943 C 3462.5005 4817.6943 3455.3987 4818.892 3435.1987 4823.592 C 3422.6987 4827.092 3405.5003 4833.0936 3397.3003 4837.2936 C 3380.1003 4845.5936 3367.6014 4846.092 3356.4014 4840.192 C 3352.3014 4838.392 3343.2996 4834.8932 3336.1996 4832.4932 C 3318.3996 4827.0932 3316.0006 4822.9939 3325.6006 4813.4939 C 3336.2006 4802.1939 3361.2015 4784.4937 3381.3015 4773.7937 C 3421.1015 4753.0937 3461.4011 4745.8922 3524.8011 4748.1922 z M 1864.2272 4873.5169 C 1864.05 4873.5126 1863.8732 4873.5363 1863.6997 4873.5925 C 1860.1997 4874.7925 1859.001 4890.7927 1862.501 4896.6927 C 1866.101 4903.7927 1872.1 4902.5928 1872.1 4894.8928 C 1872.1 4885.8381 1867.8312 4873.6049 1864.2272 4873.5169 z M 1257.2005 4883.6925 L 1267.8015 4883.6925 L 1268.4008 4915.1929 L 1269.0002 4946.092 L 1276.8011 4953.1915 C 1281.5011 4956.6915 1288.0993 4961.9939 1291.5993 4964.4939 L 1298.0994 4968.5928 L 1290.4006 4975.1913 C 1282.3006 4982.0913 1281.7005 4985.5913 1287.6005 5004.6913 C 1297.1005 5035.5913 1316.6993 5067.5925 1332.0993 5077.0925 C 1340.8993 5082.3925 1339.1994 5085.3918 1320.1994 5096.0918 C 1308.8994 5102.5918 1303.6012 5103.7929 1287.0012 5104.8929 L 1266.8013 5106.0934 L 1258.5013 5097.2943 C 1254.3013 5092.5943 1248.3996 5084.1943 1246.5996 5078.8943 C 1244.1996 5073.5943 1240.7001 5065.793 1239.5001 5061.693 C 1231.1001 5043.293 1225.7991 4997.5919 1225.1991 4944.1919 C 1225.1991 4916.3919 1225.8012 4910.9918 1229.9012 4902.6918 C 1235.8012 4890.1918 1244.7005 4884.2925 1257.2005 4883.6925 z M 1226.7608 5129.1028 C 1231.3246 5129.2723 1239.0465 5135.7127 1241.9996 5142.294 L 1245.5011 5151.0932 L 1255.5008 5144.5931 C 1267.4008 5137.9931 1276.1998 5136.7919 1276.1998 5142.1919 C 1276.1998 5147.5919 1273.2997 5146.8933 1269.6997 5149.2933 C 1255.3997 5158.1933 1231.2003 5179.5917 1225.8003 5187.1917 C 1216.3003 5201.4917 1213.2992 5198.4939 1215.0992 5175.3939 C 1216.8992 5156.3939 1221.6998 5132.5927 1224.5998 5129.6927 C 1225.1779 5129.2552 1225.9156 5129.0714 1226.7608 5129.1028 z M 1393.7369 5328.9689 C 1391.865 5328.9015 1390.2884 5328.9689 1389.1009 5329.1939 C 1384.9009 5329.7939 1386.7004 5330.9921 1396.2004 5335.6921 C 1423.4004 5349.3921 1451.3998 5372.4939 1475.0998 5400.9939 C 1479.1998 5406.3939 1481.0005 5406.8935 1482.8005 5404.4935 C 1485.2005 5400.3935 1483.3996 5384.893 1478.6996 5374.793 C 1475.1996 5365.893 1458.5008 5349.8922 1444.3008 5342.1922 C 1434.4133 5336.5047 1406.84 5329.4406 1393.7369 5328.9689 z M 4044.7135 5577.9867 C 4044.9983 5577.9687 4045.3254 5578.0426 4045.7004 5578.1927 C 4053.4004 5580.5927 4063.5017 5718.1939 4062.9017 5817.2939 C 4062.9017 5891.3939 4059.4004 5935.3927 4045.7004 6020.1927 C 4043.3004 6035.5927 4041.0003 6046.2927 4039.2003 6046.8927 C 4034.4003 6048.5927 4035.0006 6033.6937 4042.1006 5977.3937 C 4048.0006 5931.6937 4048.6013 5918.0927 4049.8013 5816.6927 C 4050.4013 5715.2927 4049.8005 5677.9926 4043.9005 5598.3926 C 4042.8505 5582.8176 4042.7201 5578.1153 4044.7135 5577.9867 z M 1350.6618 5601.8733 C 1350.9846 5601.8733 1351.3311 5601.9174 1351.6998 5601.9925 C 1353.4998 5602.5925 1356.3995 5605.4926 1357.0995 5608.4926 C 1359.4995 5619.1926 1365.9017 5631.5934 1378.4017 5647.5934 C 1384.9017 5656.3934 1390.3015 5664.1941 1390.3015 5665.3941 C 1390.3015 5677.8941 1357.0988 5643.4926 1351.1988 5625.0926 C 1346.1363 5609.6239 1345.8201 5601.8018 1350.6618 5601.8733 z M 1455.1722 5643.6325 C 1457.4743 5643.6655 1459.5864 5644.3679 1462.6989 5645.4929 C 1467.9989 5647.2929 1477.0007 5649.5937 1482.9007 5651.3937 C 1488.8007 5653.1937 1496.6001 5655.4944 1500.1001 5657.2944 C 1503.6001 5659.6944 1507.8007 5660.7941 1509.6007 5660.7941 C 1514.3007 5660.7941 1542.1995 5675.5928 1542.1995 5678.5928 C 1542.1995 5681.5928 1534.5018 5682.093 1520.3018 5683.293 C 1464.5018 5686.793 1455.4996 5686.7924 1443.6996 5682.0924 C 1429.9996 5677.3924 1414.7008 5664.8941 1417.6008 5660.7941 C 1418.2008 5658.9941 1427.1002 5654.2931 1436.6002 5650.1931 C 1446.9752 5645.3806 1451.3353 5643.5768 1455.1722 5643.6325 z M 1441.9715 5694.4233 C 1447.1324 5694.5874 1454.501 5697.268 1454.501 5699.893 C 1454.301 5702.293 1451.4002 5703.3927 1444.9002 5703.3927 C 1437.8002 5703.3927 1435.4998 5702.193 1435.4998 5699.893 C 1435.4998 5697.593 1436.1009 5695.7928 1437.9009 5695.1928 C 1438.7759 5694.5928 1440.2512 5694.3686 1441.9715 5694.4233 z M 1479.3576 5709.4522 C 1484.8778 5709.5242 1483.9192 5716.6733 1474.5004 5726.092 C 1468.6004 5731.992 1464.3991 5734.3939 1459.0991 5734.3939 C 1453.7991 5734.3939 1451.9996 5733.7945 1451.9996 5727.2945 C 1451.9996 5720.7945 1453.2011 5720.0929 1455.5011 5720.0929 C 1457.3011 5720.0929 1463.2003 5717.1921 1468.0003 5714.1921 C 1473.0003 5710.8484 1476.8485 5709.4195 1479.3576 5709.4522 z M 3190.2251 5727.7728 C 3191.9516 5727.8108 3193.0273 5740.9413 3194.1993 5768.0931 C 3196.5993 5828.0931 3200.0995 5895.6945 3202.5995 5925.2945 C 3204.3995 5939.5945 3206.6996 5970.392 3209.0996 5994.092 C 3213.1996 6042.792 3218.6 6094.9941 3222.2 6113.8941 C 3224 6125.6941 3224.0016 6127.5928 3219.3016 6131.6928 C 3216.4016 6134.5928 3203.9 6142.3929 3192.7 6148.2929 C 3164.2 6163.0929 3165.3994 6163.092 3138.0994 6179.192 C 3107.1994 6196.992 3042.5007 6239.6935 3023.6007 6254.4935 C 3015.2007 6260.3935 3008.2 6265.794 3007.6 6265.794 C 3004.1 6265.794 3005.2003 6258.0937 3010.5003 6244.4937 C 3013.4003 6236.0937 3017.1012 6226.0927 3018.3012 6221.8927 C 3020.1012 6215.9927 3024.2012 6202.8926 3034.9012 6172.0926 C 3036.1012 6167.9926 3040.8005 6153.0925 3045.6005 6138.8925 C 3050.3005 6124.5925 3055.1004 6110.3933 3055.7004 6107.9933 C 3056.9004 6105.5933 3059.8018 6096.0934 3062.8018 6087.7934 C 3068.7018 6068.7934 3072.901 6057.4935 3075.301 6050.9935 C 3077.501 6045.6935 3093.9993 5996.4924 3101.1993 5973.9924 C 3104.0993 5965.5924 3107.8002 5955.5932 3109.0002 5951.3932 C 3110.8002 5947.2932 3114.9012 5937.0943 3117.8012 5928.8943 C 3120.7012 5920.4943 3126.6015 5903.2921 3130.8015 5890.9921 C 3135.5015 5878.4921 3140.9 5862.4928 3143.9 5855.3928 C 3146.3 5848.2928 3153.4014 5828.6934 3159.3014 5811.4934 C 3165.2014 5794.2934 3170.5991 5778.2947 3171.0991 5775.2947 C 3173.9991 5762.7947 3187.7003 5728.9936 3190.1003 5727.7936 C 3190.1283 5727.7836 3190.1555 5727.7777 3190.1835 5727.7747 L 3190.2251 5727.7747 L 3190.2251 5727.7728 z M 4584.6008 5732.7944 C 4598.1008 5851.0944 4638.7017 6014.393 4657.8017 6122.593 C 4680.0017 6246.593 4690.9006 6330.8926 4689.5006 6479.6926 C 4688.9006 6544.2926 4679.7012 6618.6914 4672.3012 6676.1914 C 4666.1012 6724.2914 4660.1004 6771.4935 4646.1004 6830.0935 C 4644.9004 6835.2935 4636.3019 6856.5937 4635.8019 6852.2937 C 4634.8019 6843.1937 4649.3014 6755.1927 4650.3014 6742.1927 C 4655.1014 6684.1927 4654.4003 6687.092 4659.9003 6627.692 C 4694.9003 6247.692 4601.5008 6017.8944 4584.6008 5732.7944 z M 1475.701 5781.7929 C 1469.801 5781.7929 1460.3011 5794.2929 1455.5011 5808.4929 C 1451.4011 5819.1929 1451.4011 5820.9928 1455.5011 5828.6928 C 1457.3011 5833.3928 1460.7999 5838.7926 1463.1999 5840.5926 C 1467.8999 5844.6926 1469.8004 5842.9928 1474.5004 5828.6928 C 1476.9004 5822.1928 1481.101 5813.2935 1484.001 5809.6935 C 1492.901 5798.9935 1493.6003 5793.6924 1486.4003 5787.0924 C 1482.9003 5784.1924 1478.101 5781.7929 1475.701 5781.7929 z M 4035.1033 6058.8851 C 4035.1377 6058.8851 4035.1726 6058.8877 4035.2073 6058.8927 L 4035.2073 6058.8889 C 4036.2477 6058.9449 4037.3389 6060.1055 4037.9014 6061.793 C 4038.6014 6062.993 4036.8012 6064.1922 4035.0012 6064.1922 C 4033.2012 6064.1922 4031.4997 6062.993 4031.4997 6061.793 C 4032.0997 6059.993 4033.9012 6058.8927 4035.0012 6058.8927 C 4035.0357 6058.8877 4035.0688 6058.8851 4035.1033 6058.8851 z M 3892.9384 6082.4013 C 3894.0203 6082.3523 3895.0472 6084.6215 3895.5003 6087.7934 C 3896.7003 6094.3934 3891.9995 6099.6937 3889.5995 6094.3937 C 3887.8995 6089.6937 3889 6083.0939 3892.6 6082.4939 C 3892.7125 6082.4379 3892.8265 6082.4063 3892.9384 6082.4013 z M 3887.4025 6107.4091 C 3888.3943 6107.3651 3888.8999 6110.3466 3888.8999 6116.3935 C 3888.8999 6133.5935 3853.2999 6265.8923 3845.5999 6274.1923 C 3844.3999 6275.3923 3843.8019 6278.8937 3843.8019 6281.2937 C 3843.8019 6283.6937 3842.0004 6287.7918 3840.3004 6289.5918 C 3834.5004 6294.3918 3833.9 6285.9931 3839.2 6271.7931 C 3846.3 6252.1931 3868.3003 6173.8931 3877.1003 6138.2931 C 3882.0933 6117.8673 3885.5733 6107.491 3887.4025 6107.4091 z M 3240.8609 6277.5596 C 3244.7733 6277.6116 3246.0999 6281.1681 3246.0999 6288.3931 C 3246.0999 6301.9931 3247.2996 6302.0921 3249.5996 6309.0921 C 3251.3996 6316.8921 3253.0992 6325.6927 3253.0992 6328.6927 C 3253.0992 6331.6927 3254.9 6342.3924 3257.2 6352.4924 C 3259.6 6363.0924 3263.7988 6380.9938 3266.6988 6392.7938 C 3269.5988 6404.6938 3274.3999 6425.3918 3277.3999 6439.6918 C 3280.8999 6453.9918 3283.9 6467.5922 3283.9 6471.1922 C 3283.9 6483.4922 3232.9005 6535.6943 3198.5005 6558.7943 C 3182.5005 6569.3943 3154.0005 6583.0929 3138.6005 6588.4929 C 3120.3005 6594.4929 3078.1002 6593.2932 3055.6002 6586.7932 C 3043.1002 6583.2932 3020.5998 6564.8932 3011.1998 6549.9932 C 2989.8998 6516.7932 2974.4009 6471.6931 2978.6009 6455.0931 C 2981.0009 6445.5931 3002.9001 6423.5927 3026.1001 6406.9927 C 3043.9001 6395.0927 3074.2001 6376.0934 3114.5001 6352.9934 C 3116.9001 6351.1934 3124.5002 6346.4941 3131.1002 6342.2941 C 3138.2002 6338.1941 3145.9008 6333.4944 3148.9008 6332.2944 C 3151.8008 6331.0944 3157.7012 6327.5918 3162.0012 6324.5918 C 3166.1012 6321.6918 3177.9991 6313.8943 3188.5991 6307.3943 C 3199.2991 6300.7943 3215.2991 6290.7928 3223.5991 6285.4928 C 3231.9429 6280.1959 3237.4088 6277.5137 3240.8609 6277.5596 z M 3833.3011 6294.2939 C 3835.6011 6294.2939 3836.8008 6296.6933 3836.8008 6301.3933 C 3836.8008 6306.0933 3835.6011 6308.4928 3833.3011 6308.4928 C 3831.0011 6308.4928 3829.8015 6306.0933 3829.8015 6301.3933 C 3829.8015 6296.6933 3831.0011 6294.2939 3833.3011 6294.2939 z M 3825.9559 6314.0665 C 3826.3929 6314.0665 3826.8489 6314.1969 3827.302 6314.4938 C 3828.502 6315.6938 3829.6994 6317.4921 3829.6994 6319.1921 C 3829.6994 6323.2921 3825.6005 6323.8926 3823.8005 6320.3926 C 3821.7755 6317.9457 3823.5959 6314.0751 3825.9559 6314.0665 z M 1409.9285 6664.9174 C 1411.6713 6665.0246 1411.5167 6668.698 1410.4995 6678.1917 C 1401.6995 6760.6917 1392.0994 6818.7924 1385.5994 6835.9924 C 1384.3994 6840.0924 1383.2002 6845.4928 1383.2002 6849.0928 C 1383.2002 6852.6928 1381.3987 6859.6941 1379.6987 6866.2941 C 1376.1987 6876.3941 1368.3998 6904.1943 1363.6998 6924.3943 C 1362.4998 6929.6943 1360.1997 6935.0941 1358.9997 6936.2941 C 1357.7997 6937.4941 1357.1997 6940.3942 1357.1997 6942.7942 C 1357.1997 6945.1942 1355.4001 6950.4922 1353.7001 6954.6922 C 1351.9001 6958.7922 1346.6003 6973.0932 1341.8003 6985.5932 C 1323.4003 7036.5932 1284.3009 7105.3925 1254.6009 7138.0925 C 1228.5009 7167.7925 1212.4989 7183.1939 1194.6989 7196.7939 C 1166.1989 7218.0939 1143.0998 7228.7933 1103.9998 7238.8933 C 1098.5998 7240.0933 1074.3012 7241.2945 1049.4012 7241.2945 C 1000.7012 7240.6945 979.39891 7237.1925 956.19891 7224.6925 C 941.39891 7216.9925 915.30009 7196.1937 905.20009 7183.7937 C 895.10009 7171.2937 881.5005 7146.9928 883.3005 7144.6928 C 884.5005 7144.0928 913.00164 7142.8935 947.40164 7142.2935 C 1017.4016 7141.0935 1052.3999 7136.9929 1093.8999 7124.4929 C 1124.7999 7114.9929 1165.6996 7094.1925 1187.6996 7076.3925 C 1220.8996 7049.6925 1263.0001 7000.9944 1287.4001 6961.2944 C 1292.7001 6952.8944 1300.4995 6939.9945 1304.5995 6932.7945 C 1316.3995 6914.3945 1340.2003 6865.7934 1345.5003 6850.2934 C 1347.9003 6842.4934 1351.3997 6834.8934 1352.5997 6831.8934 C 1354.3997 6829.4934 1356.1018 6824.7923 1357.3018 6821.1923 C 1358.5018 6818.2923 1361.4013 6809.293 1364.4013 6802.193 C 1372.7013 6780.293 1381.6008 6751.7915 1396.4008 6700.1915 C 1399.3008 6687.6915 1403.4996 6675.2916 1404.0996 6671.6916 C 1405.2996 6668.7916 1407.0017 6665.7915 1408.8017 6665.1915 C 1409.1642 6665.029 1409.4794 6664.9371 1409.7546 6664.9193 C 1409.8148 6664.9154 1409.8723 6664.9139 1409.9285 6664.9174 z M 2672.901 6681.1922 C 2681.901 6681.1922 2676.4007 6682.9918 2676.4007 6684.6918 C 2676.4007 6688.1918 2681.0997 6700.0924 2686.9997 6712.5924 C 2688.7997 6716.6924 2690.5012 6720.2935 2690.5012 6721.3935 C 2690.5012 6722.4935 2695.2005 6733.8931 2701.2005 6746.9931 C 2739.3005 6828.2931 2785.5991 6876.7934 2903.0991 6959.8934 C 2910.7991 6965.7934 2920.8999 6973.5928 2925.5999 6977.0928 C 2955.2999 7001.9928 3006.3012 7032.2931 3057.9012 7055.4931 C 3071.0012 7061.3931 3079.1991 7066.7923 3078.0991 7067.9923 C 3077.4991 7069.7923 3065.6012 7077.9928 3051.5012 7087.5928 C 3037.8012 7096.3928 3025.9006 7104.7927 3025.4006 7105.9927 C 3024.8006 7107.1927 3021.3012 7108.8929 3018.3012 7110.6929 C 3014.8012 7112.4929 3008.201 7117.1927 3003.501 7120.6927 C 2992.801 7129.4927 2948.3012 7160.3924 2919.8012 7179.4924 C 2907.9012 7187.1924 2895.5007 7195.4936 2891.9007 7198.4936 C 2888.4007 7200.8936 2884.7 7203.1919 2884.2 7203.1919 C 2883.7 7203.1919 2872.8998 7209.0921 2861.0998 7216.1921 C 2837.9998 7230.4921 2791.6994 7254.0934 2759.5994 7268.3934 C 2748.2994 7273.0934 2729.9018 7281.4934 2719.3018 7286.7934 C 2708.0018 7292.0934 2694.3994 7298.0938 2689.5994 7299.8938 C 2684.2994 7302.2938 2678.2992 7305.1939 2676.5992 7306.3939 C 2674.1992 7308.1939 2670.0005 7309.8922 2667.1005 7311.0922 C 2663.6005 7312.2922 2657.1014 7314.593 2652.8014 7316.993 C 2642.2014 7322.893 2559.7004 7361.9927 2558.4004 7361.9927 C 2558.4004 7361.9927 2545.4005 7367.8925 2529.9005 7375.6925 C 2514.5005 7382.7925 2494.9005 7391.5918 2486.6005 7394.6918 C 2461.7005 7404.1918 2458.1 7404.1936 2456.9 7396.4936 C 2454 7383.9936 2440.9011 7342.4936 2434.4011 7326.4936 C 2424.9011 7301.5936 2405.3011 7265.9923 2381.0011 7229.1923 C 2368.5011 7210.1923 2347.1993 7177.5939 2334.0993 7156.2939 C 2320.3993 7134.8939 2298.5021 7100.4931 2284.8021 7080.3931 C 2248.0021 7023.4931 2223.1002 6981.2925 2223.1002 6974.1925 C 2223.1002 6967.0925 2236.1987 6968.2936 2264.6987 6968.2936 C 2293.1987 6968.2936 2320.4009 6963.5925 2337.6009 6957.5925 C 2342.3009 6955.7925 2348.3001 6954.0929 2350.1001 6954.0929 C 2351.9001 6954.0929 2367.3014 6947.5937 2383.9014 6939.7937 L 2413.6 6924.9936 L 2502.5993 6835.3931 C 2587.3993 6751.1931 2663.901 6681.1922 2672.901 6681.1922 z M 4635.3179 6866.262 C 4637.0194 6866.332 4637.4982 6870.6089 4635.3009 6877.8933 C 4632.4009 6886.9933 4629.6015 6889.092 4627.3015 6883.692 C 4627.0015 6882.892 4628.1999 6878.1933 4630.1999 6873.2933 C 4632.1827 6868.3995 4634.0762 6866.2108 4635.3179 6866.262 z M 4628.1561 6902.4777 C 4631.3531 6902.3526 4629.8556 6913.6315 4627.0009 6916.0924 C 4625.5009 6916.7924 4623.4007 6917.1917 4622.3007 6916.6917 C 4619.5007 6915.6917 4624.601 6902.9928 4628.001 6902.4928 C 4628.054 6902.4828 4628.1055 6902.4797 4628.1561 6902.4777 z "+ transform="matrix(1.0330354,0,0,1.0330354,-145.41428,-2499.328)" />+</svg>diff --git a/apps/cua-spaces-web/public/onboarding/marks/mark-openai.svg b/apps/cua-spaces-web/public/onboarding/marks/mark-openai.svgnew file mode 100644index 0000000000..5aea168226--- /dev/null+++ b/apps/cua-spaces-web/public/onboarding/marks/mark-openai.svg@@ -0,0 +1 @@+<svg xmlns="http://www.w3.org/2000/svg" fill="#0b0c0e" viewBox="1.68 1.75 16.65 16.5"><path d="M11.248 18.25q-.825 0-1.568-.314a4.3 4.3 0 0 1-1.32-.874 4 4 0 0 1-1.304.214 4 4 0 0 1-2.046-.544 4.27 4.27 0 0 1-1.518-1.485 4 4 0 0 1-.56-2.095q0-.48.131-1.04A4.4 4.4 0 0 1 2.04 10.71a4.07 4.07 0 0 1 .017-3.4 4.2 4.2 0 0 1 1.056-1.418 3.8 3.8 0 0 1 1.6-.842 3.9 3.9 0 0 1 .76-1.683q.593-.759 1.451-1.188a4.04 4.04 0 0 1 1.832-.429q.825 0 1.567.313.742.314 1.32.875a4 4 0 0 1 1.304-.215q1.106 0 2.046.545a4.14 4.14 0 0 1 1.501 1.485q.578.941.578 2.095 0 .48-.132 1.04.66.61 1.023 1.419.363.792.363 1.666 0 .892-.38 1.717a4.3 4.3 0 0 1-1.072 1.435 3.8 3.8 0 0 1-1.584.825 3.8 3.8 0 0 1-.775 1.683 4.06 4.06 0 0 1-1.436 1.188 4.04 4.04 0 0 1-1.832.429m-4.076-2.062q.825 0 1.435-.347l3.103-1.782a.36.36 0 0 0 .164-.313v-1.42L7.881 14.62a.67.67 0 0 1-.726 0l-3.118-1.798a.5.5 0 0 1-.017.115v.198q0 .841.396 1.551.413.693 1.139 1.089a3.2 3.2 0 0 0 1.617.412m.165-2.69a.4.4 0 0 0 .181.05q.083 0 .165-.05l1.238-.71-3.977-2.31a.7.7 0 0 1-.363-.643v-3.58q-.825.362-1.32 1.122a2.9 2.9 0 0 0-.495 1.65q0 .809.413 1.55.412.743 1.072 1.123zm3.91 3.663q.875 0 1.585-.396a2.96 2.96 0 0 0 1.534-2.64v-3.564a.32.32 0 0 0-.165-.297l-1.254-.726v4.604a.7.7 0 0 1-.363.643l-3.119 1.799a3 3 0 0 0 1.783.577m.627-6.039V8.878L10.01 7.822 8.129 8.878v2.244l1.881 1.056zM7.057 5.859a.7.7 0 0 1 .363-.644l3.119-1.798a3 3 0 0 0-1.782-.578q-.874 0-1.584.396A2.96 2.96 0 0 0 6.05 4.324a3.07 3.07 0 0 0-.396 1.551v3.547q0 .199.165.314l1.237.726zm8.383 7.887q.825-.364 1.303-1.123.495-.758.495-1.65a3.15 3.15 0 0 0-.412-1.55q-.413-.743-1.073-1.123l-3.086-1.782q-.099-.065-.181-.049a.3.3 0 0 0-.165.05l-1.238.692 3.993 2.327a.6.6 0 0 1 .264.264.64.64 0 0 1 .1.363zm-3.317-8.382a.63.63 0 0 1 .726 0l3.135 1.831v-.297q0-.792-.396-1.501a2.86 2.86 0 0 0-1.105-1.155q-.71-.43-1.65-.43-.825 0-1.436.347L8.294 5.941a.36.36 0 0 0-.165.314v1.418z"/></svg>\ No newline at end of filediff --git a/apps/cua-spaces-web/public/onboarding/marks/mark-openclaw.svg b/apps/cua-spaces-web/public/onboarding/marks/mark-openclaw.svgnew file mode 100644index 0000000000..35415f310f--- /dev/null+++ b/apps/cua-spaces-web/public/onboarding/marks/mark-openclaw.svg@@ -0,0 +1,18 @@+<svg viewBox="0 0 120 120" fill="none" xmlns="http://www.w3.org/2000/svg">+ <defs>+ <linearGradient id="lobster-gradient" x1="0%" y1="0%" x2="100%" y2="100%">+ <stop offset="0%" stop-color="#ff4d4d"/>+ <stop offset="100%" stop-color="#991b1b"/>+ </linearGradient>+ </defs>+ <!-- OpenClaw mascot (static): the Clawd lobster, mirroring ui/public/favicon.svg base pose. -->+ <path d="M60 10 C30 10 15 35 15 55 C15 75 30 95 45 100 L45 110 L55 110 L55 100 C55 100 60 102 65 100 L65 110 L75 110 L75 100 C90 95 105 75 105 55 C105 35 90 10 60 10Z" fill="url(#lobster-gradient)"/>+ <path d="M20 45 C5 40 0 50 5 60 C10 70 20 65 25 55 C28 48 25 45 20 45Z" fill="url(#lobster-gradient)"/>+ <path d="M100 45 C115 40 120 50 115 60 C110 70 100 65 95 55 C92 48 95 45 100 45Z" fill="url(#lobster-gradient)"/>+ <path d="M45 15 Q35 5 30 8" stroke="#ff4d4d" stroke-width="3" stroke-linecap="round"/>+ <path d="M75 15 Q85 5 90 8" stroke="#ff4d4d" stroke-width="3" stroke-linecap="round"/>+ <circle cx="45" cy="35" r="6" fill="#050810"/>+ <circle cx="75" cy="35" r="6" fill="#050810"/>+ <circle cx="46" cy="34" r="2.5" fill="#00e5cc"/>+ <circle cx="76" cy="34" r="2.5" fill="#00e5cc"/>+</svg>diff --git a/apps/cua-spaces-web/public/onboarding/sky.jpg b/apps/cua-spaces-web/public/onboarding/sky.jpgnew file mode 100644index 0000000000..d026536665Binary files /dev/null and b/apps/cua-spaces-web/public/onboarding/sky.jpg differdiff --git a/apps/cua-spaces-web/src/__tests__/first-run-parity.test.ts b/apps/cua-spaces-web/src/__tests__/first-run-parity.test.tsnew file mode 100644index 0000000000..4bb0fea3be--- /dev/null+++ b/apps/cua-spaces-web/src/__tests__/first-run-parity.test.ts@@ -0,0 +1,31 @@+// SPDX-License-Identifier: FSL-1.1-MIT+// Copyright (c) 2026 Cua AI, Inc.++// The first-run parity flow (cua-spaces-app-core/parity/first-run.json),+// replayed on the wasm core through the calls the page makes+// (`firstRunView`, `firstRunTodos`), must equal its golden.++import { readFileSync } from "node:fs";+import { join } from "node:path";+import { describe, expect, it } from "vitest";++import { testCore, wasmBuilt } from "@/bridge/__tests__/testCore";+import type { FirstRunInput } from "@/bridge/contracts/first-run";+import { firstRunTodos, firstRunView } from "@/bridge/first-run";++const DIR = join(import.meta.dirname, "..", "..", "..", "..", "libs", "cua", "crates", "cua-spaces-app-core", "parity");++describe.skipIf(!wasmBuilt)("first-run parity (wasm core)", () => {+ it("replays the flow through the page's calls and matches the golden", async () => {+ const core = await testCore();+ const flow = readFileSync(join(DIR, "first-run.json"), "utf8");+ const golden = JSON.parse(readFileSync(join(DIR, "golden", "first-run.json"), "utf8")) as unknown;+ const out = core.parity!.run("first-run", flow, (method, args) => {+ const input = (args as { input: FirstRunInput }).input;+ if (method === "firstRun.view") return firstRunView(core, input);+ if (method === "firstRun.todos") return firstRunTodos(core, input);+ throw new Error(`unexpected core call ${method}`);+ });+ expect(out).toEqual(golden);+ });+});diff --git a/apps/cua-spaces-web/src/__tests__/first-run.test.tsx b/apps/cua-spaces-web/src/__tests__/first-run.test.tsxnew file mode 100644index 0000000000..3e4ddc0c6c--- /dev/null+++ b/apps/cua-spaces-web/src/__tests__/first-run.test.tsx@@ -0,0 +1,123 @@+// SPDX-License-Identifier: FSL-1.1-MIT+// Copyright (c) 2026 Cua AI, Inc.++// The 0.10.0 first run on its real route with the wasm core: connect the+// agent, then "Your agent can use this ..." with This computer as the first+// Space; the extra Space never blocks Done and asks the host to notify when+// it is ready; a fix left turns Done into Finish later and Home keeps the+// to-do list.++import { cleanup, fireEvent, screen, waitFor } from "@testing-library/react";+import { afterEach, beforeEach, describe, expect, it } from "vitest";++import { testCore, wasmBuilt } from "@/bridge/__tests__/testCore";+import type { HostStatus } from "@/bridge/contracts/host";+import type { NewSpaceOptions } from "@/bridge/contracts/new-space";+import { readFirstRun, resetFirstRunCache, writeFirstRun } from "@/bridge/first-run";+import { CLOSED_NEW_SPACE, updateNewSpaceSession } from "@/bridge/new-space";+import { resetSavedOnboardingCache } from "@/bridge/onboarding";+import { mountApp, stubBrowserApis } from "./app-harness";++stubBrowserApis();+beforeEach(() => {+ localStorage.clear();+ resetSavedOnboardingCache();+ resetFirstRunCache();+ updateNewSpaceSession(() => CLOSED_NEW_SPACE);+});+afterEach(cleanup);++type Calls = { op: string; args: unknown }[];++async function mount(opts: { host?: (h: HostStatus) => HostStatus; local?: (l: NonNullable<NewSpaceOptions["local"]>) => NewSpaceOptions["local"] } = {}) {+ await testCore();+ const calls: Calls = [];+ await mountApp("/onboarding", {+ failsCreates: false,+ listsGhost: false,+ intercept: (op, args) => {+ calls.push({ op, args });+ return undefined;+ },+ answer: (op, out) => {+ if (op === "host.status" && opts.host) return opts.host(out as HostStatus);+ if (op === "spaces.createOptions" && opts.local) {+ const o = out as NewSpaceOptions;+ return { ...o, local: o.local ? opts.local(o.local) : o.local };+ }+ return out;+ },+ });+ return calls;+}++const heading = () => document.querySelector("[data-onboarding-heading]")?.textContent ?? "";+const primary = () => document.querySelector<HTMLButtonElement>("[data-first-run-primary]");++describe.skipIf(!wasmBuilt)("the first run (real route, wasm core)", () => {+ it("connects the agent, then says it can use this computer, with Done on", async () => {+ const calls = await mount();+ await waitFor(() => expect(heading()).toBe("A shared Space for every agent."));+ const connect = await screen.findByRole("button", { name: /^Connect / });+ fireEvent.click(connect);+ await waitFor(() => expect(calls.find((c) => c.op === "agents.configure")).toBeTruthy());+ expect((calls.find((c) => c.op === "agents.configure")!.args as { agents: string[] }).agents).toHaveLength(1);+ await waitFor(() => expect(heading()).toMatch(/^Your agent can use this (Mac|PC|computer)\.$/), { timeout: 5000 });+ expect(primary()!.disabled).toBe(false);+ expect(primary()!.textContent).toBe("Done");+ expect(document.querySelector('[data-first-run-row="computer"]')!.textContent).toMatch(/is your first Space/);+ // Nothing in the app's own words calls a computer a VM or a container.+ expect(document.body.textContent).not.toMatch(/\bVM\b|virtual machine|container|daemon|MCP/i);+ });++ it("makes the extra Space in the background, asks the host to notify, and keeps Done on", async () => {+ writeFirstRun({ step: "setup", agent: "claude-code", setupStartedMs: Date.now() });+ const calls = await mount({ local: (l) => ({ ...l, backends: ["docker"], macosImage: null, hostArch: "amd64" }) });+ const linux = await waitFor(() => {+ const b = document.querySelector<HTMLButtonElement>('[data-first-run-extra-choice="linux"]');+ expect(b && !b.disabled).toBe(true);+ return b!;+ }, { timeout: 8000 });+ // An Intel Mac or a PC can't run macOS: it isn't offered.+ expect(document.querySelector('[data-first-run-extra-choice="macos"]')).toBeNull();+ fireEvent.click(linux);+ await waitFor(() => expect(calls.find((c) => c.op === "spaces.create")).toBeTruthy());+ const create = calls.find((c) => c.op === "spaces.create")!.args as { config: { kind: string }; notifyWhenReady?: boolean };+ expect(create.notifyWhenReady).toBe(true);+ expect(create.config.kind).toBe("container");+ expect(readFirstRun().extraPendingId).toBeTruthy();+ await waitFor(() => expect(primary()!.disabled).toBe(false));+ });++ it("names the fix, turns Done into Finish later, and keeps a to-do list on Home", async () => {+ writeFirstRun({ step: "setup", agent: "claude-code", setupStartedMs: Date.now() });+ const calls = await mount({+ host: (h) => ({ ...h, permissions: [{ id: "accessibility", label: "Accessibility", granted: false, settingsUrl: "x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility" }] }),+ });+ await waitFor(() => expect(heading()).toBe("One step left."), { timeout: 5000 });+ expect(document.querySelector('[data-first-run-row="computer"]')!.textContent).toMatch(/^Let Cua control this/);+ fireEvent.click(document.querySelector('[data-first-run-action="open-settings"]')!);+ await waitFor(() => expect(calls.find((c) => c.op === "host.openSettings")).toBeTruthy());+ expect(primary()!.textContent).toBe("Finish later");+ fireEvent.click(primary()!);+ await waitFor(() => expect(calls.find((c) => c.op === "session.completeOnboarding")).toBeTruthy());+ await waitFor(() => expect(document.querySelector("[data-first-run-todos]")).toBeTruthy(), { timeout: 5000 });+ expect(document.querySelector('[data-first-run-todo="computer"]')!.textContent).toMatch(/Let Cua control/);+ });++ it("offers the host's runtime fix when nothing can be made here", async () => {+ writeFirstRun({ step: "setup", agent: "claude-code", setupStartedMs: Date.now() });+ await mount({+ local: (l) => ({+ ...l,+ available: false,+ backends: [],+ error: "Local Spaces on Windows run in Docker Desktop, which isn't installed yet.",+ fix: { action: "install-docker", label: "Install Docker Desktop", note: "About 600 MB.", busy: false, termsUrl: "https://www.docker.com/legal/" },+ }),+ });+ expect(await screen.findByRole("button", { name: "Install Docker Desktop" }, { timeout: 8000 })).toBeTruthy();+ // Done never waits for an extra Space.+ await waitFor(() => expect(primary()!.disabled).toBe(false));+ });+});diff --git a/apps/cua-spaces-web/src/__tests__/onboarding-first-space.test.tsx b/apps/cua-spaces-web/src/__tests__/onboarding-first-space.test.tsxdeleted file mode 100644index dec838f67a..0000000000--- a/apps/cua-spaces-web/src/__tests__/onboarding-first-space.test.tsx+++ /dev/null@@ -1,136 +0,0 @@-// SPDX-License-Identifier: FSL-1.1-MIT-// Copyright (c) 2026 Cua AI, Inc.--// The last onboarding page's "Create your first Space" offers only what-// this machine can create, by the Spaces page's one-click rule: on Windows-// and Linux every macOS Create was enabled, and on a Windows box with no-// runtime every Create was.--import { cleanup, fireEvent, screen, waitFor, within } from "@testing-library/react";-import { afterEach, beforeEach, describe, expect, it } from "vitest";-import type { NewSpaceOptions } from "@/bridge/contracts/new-space";-import { testCore, wasmBuilt } from "@/bridge/__tests__/testCore";-import { CLOSED_NEW_SPACE, updateNewSpaceSession } from "@/bridge/new-space";-import { onboardingInitial, resetSavedOnboardingCache, writeSavedOnboarding } from "@/bridge/onboarding";-import { mountApp, stubBrowserApis } from "./app-harness";--stubBrowserApis();-beforeEach(() => {- localStorage.clear();- resetSavedOnboardingCache();- // The host's options are kept for the page's life: each test reads its own host's.- updateNewSpaceSession(() => CLOSED_NEW_SPACE);-});-afterEach(cleanup);--/** The demo host with `local` changed as `edit` says. */-async function mountDone(edit: (local: NonNullable<NewSpaceOptions["local"]>) => NewSpaceOptions["local"], intercept?: (op: string, args: unknown) => unknown) {- const core = await testCore();- writeSavedOnboarding({ state: { ...onboardingInitial(core, null), step: "done" }, skipped: false });- return mountApp("/onboarding", {- failsCreates: false,- listsGhost: false,- intercept,- answer: (op, out) => {- if (op !== "spaces.createOptions") return out;- const o = out as NewSpaceOptions;- return { ...o, local: o.local ? edit(o.local) : o.local };- },- });-}--const card = (os: string) => document.querySelector<HTMLElement>(`[data-first-space="${os}"]`);-const createOf = (os: string) => within(card(os)!).getByRole("button") as HTMLButtonElement;--describe.skipIf(!wasmBuilt)("the first Space on the last onboarding page (real routes, wasm core)", () => {- it("offers no macOS off an Apple silicon Mac, and says why", async () => {- await mountDone((local) => ({ ...local, backends: ["docker"], macosImage: null, hostArch: "amd64" }));- await screen.findByText("Create your first Space");- await waitFor(() => expect(card("macos")?.querySelector("[data-first-space-blocked]")).toBeTruthy());- expect(createOf("macos").disabled).toBe(true);- expect(createOf("linux").disabled).toBe(false);- expect(card("linux")!.querySelector("[data-first-space-blocked]")).toBeNull();- });-- it("offers nothing on a machine with no runtime", async () => {- await mountDone((local) => ({ ...local, available: false, backends: [], error: "No local runtime found (Docker or Lume)." }));- await screen.findByText("Create your first Space");- await waitFor(() => expect(card("linux")?.querySelector("[data-first-space-blocked]")).toBeTruthy());- for (const os of ["macos", "linux", "windows"]) expect(createOf(os).disabled, os).toBe(true);- // Another computer can run them: Add a machine is right here.- expect(await screen.findByRole("button", { name: "Add a machine" })).toBeTruthy();- });-- // CUA-1712: Create sent no `kind`, and the Electron host (Linux, Windows)- // refused it with "config.kind: container | vm".- it("Create sends the image's kind, as the hosts' create needs", async () => {- const creates: { config: Record<string, unknown> }[] = [];- await mountDone(- (local) => ({ ...local, backends: ["docker"], macosImage: null, hostArch: "amd64" }),- (op, args) => {- if (op === "spaces.create") creates.push(args as { config: Record<string, unknown> });- return undefined;- },- );- await screen.findByText("Create your first Space");- await waitFor(() => expect(createOf("linux").disabled).toBe(false));- fireEvent.click(createOf("linux"));- await waitFor(() => expect(creates).toHaveLength(1));- expect(creates[0]!.config.kind).toBe("container");- expect(creates[0]!.config.image).toBeTruthy();- });-- // A10 (15 Oct clean Windows 11): no Docker Desktop, and nothing to do- // about it from the app. The host now offers the install; Windows' words.- it("offers the host's runtime fix under the cards, and runs it", async () => {- const fixes: unknown[] = [];- await mountDone(- (local) => ({- ...local,- available: false,- backends: [],- error: "Local Spaces on Windows run in Docker Desktop, which isn't installed yet.",- fix: { action: "install-docker", label: "Install Docker Desktop", note: "About 600 MB.", busy: false, termsUrl: "https://www.docker.com/legal/" },- }),- (op, args) => {- if (op === "spaces.fixRuntime") {- fixes.push(args);- return null;- }- return undefined;- },- );- await screen.findByText("Create your first Space");- const install = await screen.findByRole("button", { name: "Install Docker Desktop" });- expect(screen.getByRole("button", { name: "Docker's terms" })).toBeTruthy();- for (const os of ["macos", "linux", "windows"]) expect(createOf(os).disabled, os).toBe(true);- fireEvent.click(install);- await waitFor(() => expect(fixes).toEqual([{ action: "install-docker" }]));- });-- it("shows a running fix as busy, with no action to press", async () => {- await mountDone((local) => ({- ...local,- available: false,- backends: [],- error: "Docker Desktop is starting.",- fix: { action: null, label: "Waiting for Docker Desktop…", note: null, busy: true, termsUrl: null },- }));- const waiting = (await screen.findByRole("button", { name: "Waiting for Docker Desktop…" })) as HTMLButtonElement;- expect(waiting.disabled).toBe(true);- });-- it("offers no fix once a runtime is ready", async () => {- await mountDone((local) => ({- ...local,- backends: ["docker"],- macosImage: null,- hostArch: "amd64",- fix: { action: "start-docker", label: "Start Docker Desktop", note: null, busy: false, termsUrl: null },- }));- await screen.findByText("Create your first Space");- await waitFor(() => expect(createOf("linux").disabled).toBe(false));- expect(screen.queryByRole("button", { name: "Start Docker Desktop" })).toBeNull();- expect(screen.queryByRole("button", { name: "Add a machine" })).toBeNull();- });-});diff --git a/apps/cua-spaces-web/src/bridge/__tests__/hosts.test.ts b/apps/cua-spaces-web/src/bridge/__tests__/hosts.test.tsindex 0d8a3d8466..ddf2ead049 100644--- a/apps/cua-spaces-web/src/bridge/__tests__/hosts.test.ts+++ b/apps/cua-spaces-web/src/bridge/__tests__/hosts.test.ts@@ -543,7 +543,9 @@ describe("webkit adapter", () => {const { win } = webkitHost((req) =>req.method === "session.get"? ok({ identity: "[email protected]", signedIn: true, cloudConfigured: true, signIn: "idle" })- : ok({+ : req.method === "onboarding.get"+ ? ok({ completed: false, mode: "client" })+ : ok({availability: "ready",busy: false,error: null,@@ -558,8 +560,8 @@ describe("webkit adapter", () => {);const a = createWebkitAdapter(win);expect((await a.call("session.get", {})).fleet).toMatchObject({ identity: "[email protected]", authMode: "user" });- // The SwiftUI app's first run is its own window: the page never shows one there.- expect((await a.call("session.get", {})).onboarding).toEqual({ completed: true, mode: "client" });+ // The first run is this page's on the SwiftUI host too (`onboarding.get`).+ expect((await a.call("session.get", {})).onboarding).toEqual({ completed: false, mode: "client" });const kv = await a.call("keyvault.overview", {});expect(kv.status).toMatchObject({ unlocked: true, os_protector_available: true });expect(kv.items[0]).toMatchObject({ provider_id: "chrome", app_display: "Google Chrome", policy: { unattended: true, ttl_secs: 0 }, updated_ms: 2 });diff --git a/apps/cua-spaces-web/src/bridge/__tests__/settings.test.tsx b/apps/cua-spaces-web/src/bridge/__tests__/settings.test.tsxindex c06cdea6c7..a73ac59906 100644--- a/apps/cua-spaces-web/src/bridge/__tests__/settings.test.tsx+++ b/apps/cua-spaces-web/src/bridge/__tests__/settings.test.tsx@@ -156,7 +156,8 @@ describe.skipIf(!wasmBuilt)("Settings and Notifications through the core", () =>await expect(hooks.spaces.createSpace({ image: "macos-tahoe", name: "boom", os: "macos" })).rejects.toThrow(/exceeds the limit/);await waitFor(() => expect(hooks.notifications.data?.unread).toBe(4));const texts = hooks.notifications.data!.view!.rows.map((r) => r.text);- expect(texts).toContain("qa-gui-linux-local is ready");+ // With what it is, in plain words (never "VM" or "container").+ expect(texts.find((t) => t.startsWith("qa-gui-linux-local is ready"))).toMatch(/A fresh Linux computer inside this (Mac|PC|computer)\. Your agent can use it now\./);// The reason in the failed row's words (the core names the macOS limit).expect(texts.find((t) => t.startsWith("Couldn't create boom: "))).toMatch(/This Mac is already running/);await hooks.notifications.markAllRead();diff --git a/apps/cua-spaces-web/src/bridge/adapters/demo.ts b/apps/cua-spaces-web/src/bridge/adapters/demo.tsindex 14781e430f..b4302272ec 100644--- a/apps/cua-spaces-web/src/bridge/adapters/demo.ts+++ b/apps/cua-spaces-web/src/bridge/adapters/demo.ts@@ -86,7 +86,7 @@ export interface DemoOptions {const DEMO_NOTES = "https://github.com/trycua/cua/releases/tag/cua-spaces-v0.9.3";-/** `?demo=fresh` (signed out, first run), `?demo=locked` (Keyvault locked), `?demo=novault` (no Keyvault yet),+/** `?demo=fresh` (signed out, first run), `?demo=slow` (slow answers), `?demo=locked` (Keyvault locked), `?demo=novault` (no Keyvault yet),* `?demo=empty` (no Spaces yet), `?demo=keychain` (the startup screen),* `?demo=mac-host` (New Space options and the Keyvault's Settings rows in the* SwiftUI host's shape), `?demo=unenrolled` (this device not enrolled),@@ -94,6 +94,8 @@ const DEMO_NOTES = "https://github.com/trycua/cua/releases/tag/cua-spaces-v0.9.3export function demoOptionsFromSearch(search: string): DemoOptions {const flags = new Set((new URLSearchParams(search).get("demo") ?? "").split(",").filter(Boolean));return {+ // `?demo=slow`: every answer takes a few seconds (the first run's "Checking" in screenshots).+ ...(flags.has("slow") ? { latencyMs: 4000 } : {}),signedIn: !flags.has("fresh"),onboarded: !flags.has("fresh"),keyvaultLocked: flags.has("locked"),@@ -477,6 +479,14 @@ export function createDemoAdapter(options: DemoOptions = {}): DataAdapter & { restate.agentSetup = state.agentSetup.map((r) =>wanted(r) ? { ...r, configured: true, skillsInstalled: r.skillsTotal, detail: "Skills and MCP server set up" } : r,);+ // The demo plays the agent's first request a little later: a line in this computer's access log.+ const used = state.agentSetup.find(wanted);+ if (used && agents?.length === 1) {+ setTimeout(() => {+ const line = { atMs: now(), via: "token", who: used.name, what: "MCP" };+ state.host = { ...state.host, recentAccess: [line, ...(state.host.recentAccess ?? [])] };+ }, step * 30);+ }return state.agentSetup.map((r) => ({ ...r }));},...newSpaceDemoHandlers({ state, wait, emit, step, now }),diff --git a/apps/cua-spaces-web/src/bridge/adapters/demo/host-setup.ts b/apps/cua-spaces-web/src/bridge/adapters/demo/host-setup.tsindex cc7cafc4a4..61df1deb46 100644--- a/apps/cua-spaces-web/src/bridge/adapters/demo/host-setup.ts+++ b/apps/cua-spaces-web/src/bridge/adapters/demo/host-setup.ts@@ -70,6 +70,11 @@ export function demoHostSetupHandlers({ state, now, wait, emit, stepMs }: DemoCo// A browser can't open System Settings; the pane only has to be one."host.openSettings": ({ url }) => {if (!isSettingsPane(url)) throw new HostError("Only System Settings panes open here", "bad_args");+ // The demo plays the user turning it on in System Settings.+ setTimeout(() => {+ state.host = { ...state.host, permissions: state.host.permissions.map((p) => (p.settingsUrl === url ? { ...p, granted: true } : p)) };+ emit({ type: "machines.changed" });+ }, stepMs * 4);return null;},};diff --git a/apps/cua-spaces-web/src/bridge/adapters/webkit.ts b/apps/cua-spaces-web/src/bridge/adapters/webkit.tsindex b4237f58bf..ee46e97223 100644--- a/apps/cua-spaces-web/src/bridge/adapters/webkit.ts+++ b/apps/cua-spaces-web/src/bridge/adapters/webkit.ts@@ -19,9 +19,8 @@* `spaces.createProgress`); the host's menu items ask for the wizard with* `spaces.newRequested`. By design: a passphrase never* crosses the bridge, so `keyvault.unlock` with one fails with `native_only`.- * The SwiftUI app's first run is native, so there `session.completeOnboarding`- * resolves without a call; the Electron shell's is this page's- * (`onboarding.get`, `onboarding.complete`). Appearance and the hotkey are page-side; an appearance change sets+ * The first run is this page's on both hosts (`onboarding.get`,+ * `onboarding.complete`). Appearance and the hotkey are page-side; an appearance change sets* the window's background (`window.setBackgroundColor`). The page tells the* window where it drags (`window.setDragRegions`, `../drag-regions.ts`), and* where its Space tiles are for a real window dragged onto one@@ -513,9 +512,10 @@ export function createWebkitAdapter(const ops: { [K in OpName]: (args: OpArgs<K>) => Promise<OpResult<K>> } = {"spaces.list": async () => (await listSpaces()).spaces.filter((s) => !ownCreates.has(s.space.id)).map((s) => spaceToRow(s.space)),- "spaces.create": async ({ config, pendingId, os }) => {+ "spaces.create": async ({ config, pendingId, os, notifyWhenReady }) => {ownCreates.add(pendingId);- return spaceToRow(await request<WkSpace>("spaces.create", { config, pendingId, os: os ?? null }, null));+ const args = notifyWhenReady ? { config, pendingId, os: os ?? null, notifyWhenReady } : { config, pendingId, os: os ?? null };+ return spaceToRow(await request<WkSpace>("spaces.create", args, null));},"spaces.cancelCreate": ({ pendingId }) => request<CancelOutcome>("spaces.cancelCreate", { pendingId }),"spaces.setPower": async ({ spaceId, on }): Promise<SpacePowerReport> => {@@ -594,8 +594,8 @@ export function createWebkitAdapter(},"keyvault.revokeGrant": async ({ id }) => Number(await request<number>("keyvault.revokeGrant", { id })),"session.get": async () => {- if (!electron) return toSessionSnapshot(await request<WkSession>("session.get"));- const [s, onboarding] = await Promise.all([request<WkSession>("session.get"), request<WkOnboarding>("onboarding.get")]);+ // A SwiftUI host from before the shared first run has no `onboarding.get`: it ran its own.+ const [s, onboarding] = await Promise.all([request<WkSession>("session.get"), request<WkOnboarding>("onboarding.get").catch(() => null)]);return toSessionSnapshot(s, onboarding);},"session.signIn": async () => {@@ -608,7 +608,7 @@ export function createWebkitAdapter(return null;},"session.completeOnboarding": async ({ mode, launchAtLogin }) => {- if (electron) await request("onboarding.complete", launchAtLogin === undefined ? { mode } : { mode, launchAtLogin });+ await request("onboarding.complete", launchAtLogin === undefined ? { mode } : { mode, launchAtLogin });return null;},diff --git a/apps/cua-spaces-web/src/bridge/contracts/bridge-shapes.json b/apps/cua-spaces-web/src/bridge/contracts/bridge-shapes.jsonindex e8a0b650f0..17b0c84c5b 100644--- a/apps/cua-spaces-web/src/bridge/contracts/bridge-shapes.json+++ b/apps/cua-spaces-web/src/bridge/contracts/bridge-shapes.json@@ -3647,6 +3647,24 @@"signedIn"]},+ "WkOnboarding": {+ "type": "object",+ "properties": {+ "completed": {+ "type": "boolean"+ },+ "mode": {+ "enum": [+ "client",+ "host"+ ]+ }+ },+ "required": [+ "completed",+ "mode"+ ]+ },"WkSession": {"type": "object","properties": {@@ -6151,6 +6169,12 @@"notifications.markRead": {"type": "null"},+ "onboarding.complete": {+ "$ref": "#/$defs/WkOnboarding"+ },+ "onboarding.get": {+ "$ref": "#/$defs/WkOnboarding"+ },"relay.usage": {"type": ["object",diff --git a/apps/cua-spaces-web/src/bridge/contracts/first-run.ts b/apps/cua-spaces-web/src/bridge/contracts/first-run.tsnew file mode 100644index 0000000000..811285514f--- /dev/null+++ b/apps/cua-spaces-web/src/bridge/contracts/first-run.ts@@ -0,0 +1,199 @@+// SPDX-License-Identifier: FSL-1.1-MIT+// Copyright (c) 2026 Cua AI, Inc.++/**+ * The 0.10.0 first run: hand-written mirror of+ * `libs/cua/crates/cua-spaces-app-core/src/first_run.rs` (camelCase JSON).+ * Rust is the source of truth.+ */++export type FirstRunStep = "connect" | "setup";++export interface FirstRunAgent {+ agent: string;+ name: string;+ installed: boolean;+ configured: boolean;+}++export interface FirstRunPermission {+ id: string;+ granted: boolean;+ settingsUrl?: string | null;+}++export interface FirstRunHost {+ configured: boolean;+ running: boolean;+ online?: boolean | null;+ permissions: FirstRunPermission[];+ error?: string | null;+}++export interface FirstRunOffer {+ os: string;+ time?: string | null;+ size?: string | null;+ blocked?: string | null;+}++export type FirstRunExtraPhase = "none" | "not-now" | "creating" | "ready" | "failed";++export interface FirstRunExtra {+ phase: FirstRunExtraPhase;+ name?: string | null;+ os?: string | null;+ detail?: string | null;+ fraction?: number | null;+ error?: string | null;+}++export interface FirstRunPlan {+ metered: boolean;+ plan: string;+ sessionsLimit?: number | null;+ hoursLimit?: number | null;+ teammates: boolean;+ dismissed: boolean;+ accountApp: string;+}++export interface FirstRunInput {+ step: FirstRunStep;+ hostOs: string;+ agents: FirstRunAgent[] | null;+ agent: string | null;+ connecting: boolean;+ connectError: string | null;+ agentOpenBeforeSetup: boolean | null;+ agentUsedAt: string | null;+ signedIn: boolean;+ signingIn: boolean;+ host: FirstRunHost | null;+ hostSettingUp: boolean;+ offers: FirstRunOffer[];+ extra: FirstRunExtra;+ plan: FirstRunPlan | null;+}++export interface FirstRunButton {+ id: string;+ label: string;+}++export interface FirstRunAgentChoice {+ agent: string;+ name: string;+ installed: boolean;+}++export interface FirstRunConnectView {+ title: string;+ accent: string;+ lede: string;+ primary: FirstRunButton;+ agent: FirstRunAgentChoice;+ note: string;+ noteMore: string;+ orLabel: string;+ others: FirstRunAgentChoice[];+ otherLabel: string;+ busy: string | null;+ error: string | null;+}++export type FirstRunRowState = "checking" | "ok" | "fix";++export interface FirstRunRow {+ id: "agent" | "computer";+ state: FirstRunRowState;+ title: string;+ note: string;+ action: FirstRunButton | null;+ settingsUrl: string | null;+}++export interface FirstRunPromptView {+ heading: string;+ text: string;+ note: string;+ copy: string | null;+}++export interface FirstRunExtraChoice {+ os: string;+ label: string;+ detail: string;+ blocked: string | null;+}++export interface FirstRunExtraView {+ phase: "choose" | "creating" | "ready" | "failed" | "not-now";+ title: string;+ tag: string | null;+ note: string;+ choices: FirstRunExtraChoice[];+ action: FirstRunButton | null;+ fraction: number | null;+ footnote: string | null;+}++export interface FirstRunUpsell {+ plan: "pro" | "teams";+ title: string;+ lines: string[];+ price: string;+ cta: FirstRunButton;+ url: string;+ dismiss: string;+}++export interface FirstRunPrimary {+ id: "done" | "finish-later";+ label: string;+ enabled: boolean;+ note: string | null;+}++export interface FirstRunSetupView {+ title: string;+ rows: FirstRunRow[];+ prompt: FirstRunPromptView;+ extra: FirstRunExtraView;+ upsell: FirstRunUpsell | null;+ primary: FirstRunPrimary;+}++export interface FirstRunArt {+ agent: string;+ computer: "on" | "faded";+ extra: "none" | "outline" | "filling" | "on";+}++export interface FirstRunView {+ step: FirstRunStep;+ later: string;+ connect: FirstRunConnectView | null;+ setup: FirstRunSetupView | null;+ art: FirstRunArt;+ dots: number;+ current: number;+}++export interface FirstRunTodo {+ id: "agent" | "computer" | "prompt" | "extra" | "sign-in";+ title: string;+ note: string;+ done: boolean;+ optional: boolean;+ action: FirstRunButton | null;+ settingsUrl: string | null;+}++export interface FirstRunTodos {+ title: string;+ lede: string;+ progress: string;+ items: FirstRunTodo[];+ complete: boolean;+}diff --git a/apps/cua-spaces-web/src/bridge/contracts/shapes.ts b/apps/cua-spaces-web/src/bridge/contracts/shapes.tsindex d4fc9e635f..7b14281b4b 100644--- a/apps/cua-spaces-web/src/bridge/contracts/shapes.ts+++ b/apps/cua-spaces-web/src/bridge/contracts/shapes.ts@@ -65,7 +65,7 @@ import type { PresenceCursorWire, PresenceJoinInfo, PresenceParticipantWire } frimport type { StartupState } from "../ops/startup";import type { StreamTicket } from "../ops/stream";import type { GlobalShortcut, HostSettings, HostSignIn, OpName, SessionSnapshot, SettingsSnapshot, SettingsValues } from "../protocol";-import type { WebkitMethod, WkHostState, WkMachines, WkSession, WkSettings, WkSettingsRow, WkSpace, WkSpaces } from "../webkit-protocol";+import type { WebkitMethod, WkHostState, WkMachines, WkOnboarding, WkSession, WkSettings, WkSettingsRow, WkSpace, WkSpaces } from "../webkit-protocol";import { Defs, any, bool, dict, list, nul, nullable, num, obj, object, oneOf, opt, optNull, str, union, type Schema } from "./schema";const defs = new Defs();@@ -1107,6 +1107,9 @@ export const WEBKIT_SHAPES: Partial<Record<WebkitMethod, Schema>> = {"session.get": WkSessionShape,"session.signIn": WkSessionShape,"session.signOut": WkSessionShape,+ // The first run is this page's on both hosts (`WkOnboarding`).+ "onboarding.get": ref("WkOnboarding", obj<WkOnboarding>()({ completed: bool, mode: oneOf("client", "host") })),+ "onboarding.complete": ref("WkOnboarding", obj<WkOnboarding>()({ completed: bool, mode: oneOf("client", "host") })),"spaces.list": WkSpacesShape,"spaces.setPower": WkSpacesShape,"spaces.delete": WkSpacesShape,diff --git a/apps/cua-spaces-web/src/bridge/coverage.ts b/apps/cua-spaces-web/src/bridge/coverage.tsindex a47c6d328e..792d24fd11 100644--- a/apps/cua-spaces-web/src/bridge/coverage.ts+++ b/apps/cua-spaces-web/src/bridge/coverage.ts@@ -95,15 +95,13 @@ export const HOST_COVERAGE = {"keyvault.deny": { webkit: { methods: ["keyvault.deny"] }, tauri: ["keyvault_deny"] },"keyvault.revokeGrant": { webkit: { methods: ["keyvault.revokeGrant"] }, tauri: ["keyvault_revoke_grant"] },"session.get": {- webkit: { methods: ["session.get"] },- electron: { methods: ["session.get", "onboarding.get"] },+ webkit: { methods: ["session.get", "onboarding.get"] },tauri: ["fleet_status", "onboarding_state", "daemon_status"],},"session.signIn": { webkit: { methods: ["session.signIn"] }, tauri: ["begin_sign_in"] },"session.signOut": { webkit: { methods: ["session.signOut"] }, tauri: ["sign_out"] },"session.completeOnboarding": {- webkit: { methods: [], byDesign: "the SwiftUI app's first run is its own window; resolves without a call" },- electron: { methods: ["onboarding.complete"] },+ webkit: { methods: ["onboarding.complete"] },tauri: ["complete_onboarding"],},"session.openExternal": {diff --git a/apps/cua-spaces-web/src/bridge/first-run.ts b/apps/cua-spaces-web/src/bridge/first-run.tsnew file mode 100644index 0000000000..fe800bf24b--- /dev/null+++ b/apps/cua-spaces-web/src/bridge/first-run.ts@@ -0,0 +1,563 @@+// SPDX-License-Identifier: FSL-1.1-MIT+// Copyright (c) 2026 Cua AI, Inc.++/**+ * The first run every host shows (0.10.0): connect your agent, then "Your+ * agent can use this Mac". The words, the rows, when Done is on and the+ * to-do list on Home are the app core's (`firstRun.view`, `firstRun.todos`,+ * `cua-spaces-app-core/src/first_run.rs`); this module gathers what the+ * core reads (the agent setup, `host.status`, the sign-in, the extra+ * Space's create) and runs the buttons.+ *+ * What is real and what isn't (see `first_run.rs` for the detail):+ * - "Cua is in the agent's settings": `agents.setup`'s `configured`. Real.+ * - "The open session reloaded": no process check exists yet, so the row+ * only says to restart the agent if it was open, until the agent uses Cua.+ * - "The agent used Cua": a connection in this computer's access log+ * (`host.status` `recentAccess`) since the setup screen opened. Partly+ * real: only some calls are logged, and an agent names itself.+ * - This computer: `host.status` and the sign-in. Real.+ *+ * The extra Space's create runs in the host (the store's create), so it+ * keeps going when the window closes; the host also posts a system+ * notification when it is ready (`notifyWhenReady`).+ */++import { useContext, useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";++import { BridgeContext } from "./BridgeProvider";+import type { CoreClient } from "./core";+import type { AgentSetupRow } from "./contracts/agents";+import type { HostStatus } from "./contracts/host";+import type {+ FirstRunAgent,+ FirstRunExtra,+ FirstRunInput,+ FirstRunOffer,+ FirstRunPlan,+ FirstRunStep,+ FirstRunTodos,+ FirstRunView,+} from "./contracts/first-run";+import { useSession, useSettings, useSpaces } from "./hooks";+import { hostOs } from "./host-os";+import { useFirstSpaceOffers } from "./new-space-hooks";+import { onboardingInitial, onboardingTelemetry, readSavedOnboarding, writeSavedOnboarding } from "./onboarding";+import type { OnboardingFlowState } from "./contracts/onboarding";+import { useRelayUsage } from "./relay-usage";+import { newPendingId } from "./store";+import { extraName, spokenName } from "./space-names";++export { extraName, spokenName };+import { spaceState } from "../lib/spaces";++++/* ---- The core ------------------------------------------------------------------- */++export function firstRunView(core: CoreClient, input: FirstRunInput): FirstRunView {+ return core.tryCall<FirstRunView>("firstRun.view", { input }) ?? fallbackView(input);+}++export function firstRunTodos(core: CoreClient, input: FirstRunInput): FirstRunTodos | null {+ return core.tryCall<FirstRunTodos>("firstRun.todos", { input }) ?? null;+}++/** When the agent used Cua since `sinceMs` (ms), from the access log. */+export function agentUsedMs(core: CoreClient, status: HostStatus | null, sinceMs: number, agentName: string): number | null {+ const lines = status?.recentAccess ?? [];+ if (!lines.length) return null;+ const fromCore = core.tryCall<number | null>("firstRun.agentUsed", { lines, sinceMs, agentName });+ if (fromCore !== undefined) return fromCore;+ const hits = lines.filter((l) => l.atMs >= sinceMs && !/\(background\)$|\(thumbnail|^refused /.test(l.what) && l.who !== "refused");+ return hits.length ? Math.max(...hits.map((l) => l.atMs)) : null;+}++/** "18:12", in the user's own clock. */+export function clockTime(ms: number): string {+ return new Date(ms).toLocaleTimeString([], { hour: "numeric", minute: "2-digit" });+}++/** Without the core: the two screens in their plainest state. Not the+ * product's behaviour; the demo and tests without wasm use it. */+function fallbackView(input: FirstRunInput): FirstRunView {+ const name = input.agents?.find((a) => a.agent === input.agent)?.name ?? "Claude Code";+ const place = input.hostOs === "macos" ? "this Mac" : input.hostOs === "windows" ? "this PC" : "this computer";+ const art = { agent: input.agent ?? "claude-code", computer: "on" as const, extra: "outline" as const };+ if (input.step === "connect") {+ return {+ step: "connect",+ later: "Set up later",+ connect: {+ title: "A shared Space for every agent.",+ accent: "agent",+ lede: `Connect your agents and give them computers to work on: macOS, Linux or Windows, right here on ${place}.`,+ primary: { id: "connect", label: `Connect ${name}` },+ agent: { agent: input.agent ?? "claude-code", name, installed: true },+ note: `Your agent will use ${place}.`,+ noteMore: "You can add a separate Space later.",+ orLabel: "Or",+ others: [],+ otherLabel: "Other",+ busy: input.connecting ? `Adding Cua to ${name}…` : null,+ error: input.connectError,+ },+ setup: null,+ art: { ...art, extra: "none" },+ dots: 2,+ current: 0,+ };+ }+ const ok = input.signedIn && Boolean(input.host?.configured);+ return {+ step: "setup",+ later: "Set up later",+ connect: null,+ setup: {+ title: ok ? `Your agent can use ${place}.` : "Checking your setup.",+ rows: [+ { id: "agent", state: "ok", title: `${name} can use Cua`, note: `We added Cua to ${name}'s settings.`, action: null, settingsUrl: null },+ ok+ ? { id: "computer", state: "ok", title: `${place[0]!.toUpperCase()}${place.slice(1)} is your first Space`, note: "Ready now. Your agent can see the screen, click and type.", action: null, settingsUrl: null }+ : { id: "computer", state: "fix", title: "Sign in to Cua", note: `So your agent can find ${place} and your other computers.`, action: { id: "sign-in", label: "Sign in" }, settingsUrl: null },+ ],+ prompt: { heading: `Try this in ${name}`, text: "List my computers and tell me what's on this Mac", note: `This works now, on ${place}.`, copy: "Copy" },+ extra: { phase: "not-now", title: "No extra Space for now", tag: null, note: "Add one from Home whenever you like.", choices: [], action: { id: "add", label: "Add a Space" }, fraction: null, footnote: null },+ upsell: null,+ primary: ok ? { id: "done", label: "Done", enabled: true, note: null } : { id: "finish-later", label: "Finish later", enabled: true, note: "We'll keep a to-do list on Home." },+ },+ art,+ dots: 2,+ current: 1,+ };+}++/* ---- What the page keeps between launches ----------------------------------------- */++/** The first run's progress (resumes after a relaunch, and feeds Home's+ * to-do list after Finish later). */+export interface FirstRunSaved {+ step: FirstRunStep;+ /** The agent connected (setup id). */+ agent: string | null;+ /** When the setup screen first showed (the access log counts from here). */+ setupStartedMs: number | null;+ /** When the agent was first seen using Cua. */+ usedAtMs: number | null;+ /** The extra Space's create (its pending row id). */+ extraPendingId: string | null;+ extraOs: string | null;+ /** "Not now" on the extra Space card. */+ extraNotNow: boolean;+ /** Finish later: Home shows the to-do list until it is done or closed. */+ finishedLater: boolean;+ /** The to-do list was closed. */+ todosClosed: boolean;+}++const KEY = "cua-spaces:first-run";+const EMPTY: FirstRunSaved = {+ step: "connect",+ agent: null,+ setupStartedMs: null,+ usedAtMs: null,+ extraPendingId: null,+ extraOs: null,+ extraNotNow: false,+ finishedLater: false,+ todosClosed: false,+};+/** "Not now" on the plan card: never again. */+export const UPSELL_DISMISSED_KEY = "cua.upsell.dismissed.onboarding";+/** The user entered teammates' emails (a share with other people). */+export const TEAMMATES_KEY = "cua.firstRun.teammates";++let saved: FirstRunSaved | undefined;+const listeners = new Set<() => void>();++function storage(): Storage | undefined {+ try {+ return globalThis.localStorage;+ } catch {+ return undefined;+ }+}++export function readFirstRun(): FirstRunSaved {+ if (saved) return saved;+ try {+ const raw = storage()?.getItem(KEY);+ saved = raw ? { ...EMPTY, ...(JSON.parse(raw) as Partial<FirstRunSaved>) } : EMPTY;+ } catch {+ saved = EMPTY;+ }+ return saved;+}++export function writeFirstRun(next: Partial<FirstRunSaved> | null): void {+ saved = next ? { ...readFirstRun(), ...next } : EMPTY;+ try {+ if (next) storage()?.setItem(KEY, JSON.stringify(saved));+ else storage()?.removeItem(KEY);+ } catch {+ // Not kept: the flow still works, it just won't resume.+ }+ for (const l of [...listeners]) l();+}++function flag(key: string): boolean {+ try {+ return storage()?.getItem(key) === "1";+ } catch {+ return false;+ }+}++function setFlag(key: string): void {+ try {+ storage()?.setItem(key, "1");+ } catch {+ // Not kept.+ }+ for (const l of [...listeners]) l();+}++/** The share sheet calls this when the user shares with other people. */+export function noteTeammates(): void {+ setFlag(TEAMMATES_KEY);+}++/** Tests: forget the cached copy. */+export function resetFirstRunCache(): void {+ saved = undefined;+}++const subscribe = (l: () => void) => {+ listeners.add(l);+ return () => void listeners.delete(l);+};++export function useFirstRunSaved(): FirstRunSaved {+ return useSyncExternalStore(subscribe, readFirstRun, readFirstRun);+}++/** Usage events never get in the way of the flow. */+function track(send: () => void): void {+ try {+ send();+ } catch {+ // An older core that reads the state differently: no event.+ }+}++/* ---- The hook ---------------------------------------------------------------------- */++/** How often the setup screen reads the agent setup and this computer. */+export const FIRST_RUN_POLL_MS = 2_500;++export interface FirstRunHook {+ view: FirstRunView;+ input: FirstRunInput;+ saved: FirstRunSaved;+ /** Every agent the setup knows (for "Other"). */+ agents: AgentSetupRow[];+ connect(agent?: string): Promise<void>;+ /** A row's or a to-do's button (`sign-in`, `set-up`, `open-settings`, `restart-check`, `connect`). */+ act(id: string, settingsUrl?: string | null): Promise<void>;+ copyPrompt(): Promise<void>;+ /** The extra Space card: `macos`/`linux` start it; `cancel`, `not-now`, `add`, `retry`. */+ extra(id: string): Promise<void>;+ upsell(action: "shown" | "click" | "dismiss"): void;+ /** Done or Finish later. */+ finish(): Promise<void>;+ /** "Set up later": leave for now (the sidebar offers it again). */+ later(): void;+ back(): void;+}++/** Live readings while `active` (the first run, or Home's to-do list). */+export function useFirstRun(active = true, pollMs = FIRST_RUN_POLL_MS): FirstRunHook {+ const ctx = useContext(BridgeContext);+ if (!ctx) throw new Error("bridge hooks need a <BridgeProvider> above them");+ const { core, adapter, store } = ctx;+ const s = useFirstRunSaved();+ const session = useSession();+ const settings = useSettings();+ const spaces = useSpaces();+ const offersHook = useFirstSpaceOffers();+ const usage = useRelayUsage();+ const flags = useSyncExternalStore(subscribe, () => `${flag(UPSELL_DISMISSED_KEY)}:${flag(TEAMMATES_KEY)}`, () => "false:false");+ const [agents, setAgents] = useState<AgentSetupRow[] | null>(null);+ const [host, setHost] = useState<HostStatus | null>(null);+ const [connecting, setConnecting] = useState(false);+ const [connectError, setConnectError] = useState<string | null>(null);+ const [settingUp, setSettingUp] = useState(false);+ const [setupError, setSetupError] = useState<string | null>(null);+ const [tick, setTick] = useState(0);+ const shownRef = useRef(false);+ const agentsRef = useRef(agents);+ agentsRef.current = agents;++ const signedIn = Boolean(session.data?.signedIn);+ const signingIn = session.data?.signIn.kind === "starting" || session.data?.signIn.kind === "waiting";++ // The agent setup and this computer, now and every few seconds.+ useEffect(() => {+ if (!active || !adapter) return;+ let live = true;+ let n = 0;+ const read = () => {+ // The agent setup runs a command on the host: once connected, it's read now and then.+ const connected = agentsRef.current?.some((a) => a.agent === (readFirstRun().agent ?? "") && a.configured);+ if (!connected || n++ % 6 === 0) {+ void adapter+ .call("agents.setup", {})+ .then((rows) => live && setAgents(rows))+ .catch(() => live && setAgents((a) => a ?? []));+ }+ if (s.step === "setup" || s.finishedLater) {+ void adapter+ .call("host.status", {})+ .then((h) => live && setHost(h))+ .catch(() => {});+ }+ };+ read();+ const timer = setInterval(read, pollMs);+ return () => {+ live = false;+ clearInterval(timer);+ };+ }, [active, adapter, s.step, s.finishedLater, tick, pollMs]);++ const rows: FirstRunAgent[] | null = agents+ ? agents.map((a) => ({ agent: a.agent, name: a.name, installed: a.installed, configured: a.configured }))+ : null;+ const lead = core.tryCall<string>("firstRun.leadAgent", { agents: rows ?? [] }) ?? rows?.find((a) => a.installed)?.agent ?? "claude-code";+ const agentId = s.agent ?? lead;+ const agentName = rows?.find((a) => a.agent === agentId)?.name ?? null;++ // The first time the agent uses Cua since the setup screen opened.+ const usedMs = s.usedAtMs ?? (s.setupStartedMs && agentName ? agentUsedMs(core, host, s.setupStartedMs, agentName) : null);+ useEffect(() => {+ if (usedMs && !s.usedAtMs) writeFirstRun({ usedAtMs: usedMs });+ }, [usedMs, s.usedAtMs]);++ // The extra Space, as the Spaces list shows its create.+ const extra = useMemo<FirstRunExtra>(() => {+ if (s.extraPendingId) {+ const id = store?.createdId(s.extraPendingId) ?? null;+ const row = spaces.data?.find((x) => x.id === (id ?? s.extraPendingId));+ if (row) {+ const state = spaceState(row);+ if (state === "creating") {+ return {+ phase: "creating",+ name: spokenName(row.name),+ os: row.os,+ detail: row.progress?.transfer ?? row.progress?.label ?? null,+ fraction: row.progress ? row.progress.permille / 1000 : null,+ };+ }+ if (state === "failed") return { phase: "failed", name: spokenName(row.name), os: row.os, error: row.progress?.error ?? null };+ return { phase: "ready", name: spokenName(row.name), os: row.os };+ }+ // Asked for, not listed yet.+ return { phase: "creating", os: s.extraOs, name: null, detail: null, fraction: null };+ }+ return { phase: s.extraNotNow ? "not-now" : "none" };+ }, [s.extraPendingId, s.extraOs, s.extraNotNow, spaces.data, store]);++ const offers: FirstRunOffer[] = offersHook.offers.map((o) => ({ os: o.os, time: o.time, size: o.size, blocked: o.blocked }));+ const [dismissed, teammates] = flags.split(":").map((f) => f === "true");+ const plan: FirstRunPlan | null = usage+ ? {+ metered: usage.metered,+ plan: usage.plan,+ sessionsLimit: usage.liveSessionsLimit,+ hoursLimit: usage.hoursLimit,+ teammates: Boolean(teammates),+ dismissed: Boolean(dismissed),+ accountApp: settings.data?.accountUrl ?? "https://app.cua.ai",+ }+ : null;++ const input: FirstRunInput = {+ step: s.step,+ hostOs: hostOs(),+ agents: rows,+ agent: agentId,+ connecting,+ connectError,+ // No process check yet (see the module comment).+ agentOpenBeforeSetup: null,+ agentUsedAt: usedMs ? clockTime(usedMs) : null,+ signedIn,+ signingIn,+ host: host+ ? {+ configured: host.configured,+ running: Boolean(host.service?.running),+ online: host.online ?? null,+ permissions: host.permissions.map((p) => ({ id: p.id, granted: Boolean(p.granted), settingsUrl: p.settingsUrl ?? null })),+ error: setupError ?? host.error ?? null,+ }+ : null,+ hostSettingUp: settingUp,+ offers,+ extra,+ plan,+ };+ const view = firstRunView(core, input);++ // The run starts (once a page shows): the usage event the old Welcome sent.+ useEffect(() => {+ const t = settings.data?.telemetry;+ if (!active || shownRef.current || !store || !t) return;+ shownRef.current = true;+ track(() => store.trackOnboarding({ ...onboardingInitial(core, null), telemetry: onboardingTelemetry(t) }, { type: "start" }));+ }, [active, store, settings.data?.telemetry]);++ // The funnel's events, in the old flow's shape: started on step 1, left on step 2.+ const telemetryState = (): OnboardingFlowState => ({+ ...onboardingInitial(core, session.data?.identity ?? null),+ step: s.step === "connect" ? "welcome" : "agents",+ runCounted: true,+ telemetry: settings.data?.telemetry ? onboardingTelemetry(settings.data.telemetry) : null,+ });++ const refresh = () => setTick((n) => n + 1);++ const setUpThisComputer = async () => {+ if (!store || settingUp) return;+ setSettingUp(true);+ setSetupError(null);+ try {+ const ok = await store.thisMachine.quickSetUp(session.data?.identity ?? null);+ if (!ok) setSetupError(store.thisMachine.get().setupError?.message ?? "Couldn't set it up.");+ } finally {+ setSettingUp(false);+ refresh();+ }+ };++ // Signed in on a computer that isn't set up yet: set it up, once.+ const autoSetUp = useRef(false);+ useEffect(() => {+ if (!active || s.step !== "setup" || !signedIn || !host || host.configured || autoSetUp.current) return;+ autoSetUp.current = true;+ void setUpThisComputer();+ // eslint-disable-next-line react-hooks/exhaustive-deps+ }, [active, s.step, signedIn, host?.configured]);++ const connect = async (agent?: string) => {+ const id = agent ?? agentId;+ if (!adapter || connecting) return;+ setConnecting(true);+ setConnectError(null);+ writeFirstRun({ agent: id });+ try {+ const next = await adapter.call("agents.configure", { agents: [id] });+ setAgents(next);+ writeFirstRun({ step: "setup", agent: id, setupStartedMs: readFirstRun().setupStartedMs ?? Date.now() });+ } catch (e) {+ setConnectError(e instanceof Error ? e.message : String(e));+ } finally {+ setConnecting(false);+ }+ };++ const copyPrompt = async () => {+ const text = view.setup?.prompt.text ?? firstRunView(core, { ...input, step: "setup" }).setup?.prompt.text ?? "";+ await navigator.clipboard?.writeText(text).catch(() => {});+ };++ const extraAct = async (id: string) => {+ if (id === "macos" || id === "linux") {+ const offer = offersHook.offers.find((o) => o.os === id);+ if (!offer || offer.blocked) return;+ const pendingId = newPendingId();+ writeFirstRun({ extraPendingId: pendingId, extraOs: id, extraNotNow: false });+ spaces.createSpace({ ...offer.args, name: extraName(id, spaces.data ?? []), os: offer.os, notifyWhenReady: true }, pendingId).catch(() => {+ // The row shows the failure; the card reads it from there.+ });+ } else if (id === "cancel" && s.extraPendingId) {+ await spaces.cancelCreate(s.extraPendingId).catch(() => {});+ writeFirstRun({ extraPendingId: null, extraOs: null });+ } else if (id === "not-now") {+ writeFirstRun({ extraNotNow: true });+ } else if (id === "add") {+ writeFirstRun({ extraNotNow: false, extraPendingId: null, extraOs: null });+ } else if (id === "retry" && s.extraPendingId) {+ const next = spaces.retryCreate(s.extraPendingId);+ writeFirstRun({ extraPendingId: next ?? null });+ }+ };++ return {+ view,+ input,+ saved: s,+ agents: agents ?? [],+ connect,+ copyPrompt,+ extra: extraAct,+ async act(id, settingsUrl) {+ switch (id) {+ case "sign-in":+ await session.signIn().catch(() => {});+ break;+ case "set-up":+ autoSetUp.current = true;+ await setUpThisComputer();+ break;+ case "open-settings":+ if (settingsUrl && adapter) {+ await (settingsUrl.startsWith("x-apple.systempreferences:")+ ? adapter.call("host.openSettings", { url: settingsUrl })+ : session.openExternal(settingsUrl)+ ).catch(() => {});+ }+ break;+ case "connect":+ await connect();+ break;+ case "copy":+ await copyPrompt();+ break;+ case "add":+ await extraAct("add");+ break;+ }+ refresh();+ },+ upsell(action) {+ const card = view.setup?.upsell;+ if (!card) return;+ try {+ const signals = core.tryCall<unknown[]>("telemetry.upsell", { surface: "onboarding", action });+ if (signals?.length && store) void store.telemetry.track(signals);+ } catch {+ // An older core without the surface: no event.+ }+ if (action === "click") void session.openExternal(card.url).catch(() => {});+ else if (action === "dismiss") setFlag(UPSELL_DISMISSED_KEY);+ },+ async finish() {+ const later = view.setup?.primary.id === "finish-later";+ if (store) track(() => store.trackOnboardingFinished(telemetryState()));+ await session.completeOnboarding(host?.configured ? "host" : "client");+ writeFirstRun({ finishedLater: later, todosClosed: false });+ },+ later() {+ if (store) track(() => store.trackOnboardingSkipped(telemetryState()));+ store?.cancelSignIn();+ // The shell stops opening it (the sidebar offers it again).+ writeSavedOnboarding({ ...readSavedOnboarding(), skipped: true });+ writeFirstRun({ finishedLater: true });+ },+ back() {+ writeFirstRun({ step: "connect" });+ },+ };+}diff --git a/apps/cua-spaces-web/src/bridge/index.ts b/apps/cua-spaces-web/src/bridge/index.tsindex 8d102a5a08..cecbdf8452 100644--- a/apps/cua-spaces-web/src/bridge/index.ts+++ b/apps/cua-spaces-web/src/bridge/index.ts@@ -152,3 +152,19 @@ export {type UpsellSurface,} from "./upsell";export type { CreateReport, ReportPart, ReportSend } from "./diagnostic-report";+export {+ FIRST_RUN_POLL_MS,+ TEAMMATES_KEY,+ UPSELL_DISMISSED_KEY,+ firstRunTodos,+ firstRunView,+ noteTeammates,+ readFirstRun,+ resetFirstRunCache,+ useFirstRun,+ useFirstRunSaved,+ writeFirstRun,+ type FirstRunHook,+ type FirstRunSaved,+} from "./first-run";+export type * from "./contracts/first-run";diff --git a/apps/cua-spaces-web/src/bridge/protocol.ts b/apps/cua-spaces-web/src/bridge/protocol.tsindex 5d9a128acb..efd5e52497 100644--- a/apps/cua-spaces-web/src/bridge/protocol.ts+++ b/apps/cua-spaces-web/src/bridge/protocol.ts@@ -191,7 +191,7 @@ export interface HostOperationsRuntimeFixOps {"spaces.list": { args: Record<string, never>; result: SpaceRow[] };/** `os`: the plan's OS, for a host that draws its own pending row (the SwiftUI app's notch). */- "spaces.create": { args: { config: SpaceCreateConfig; pendingId: string; os?: SpaceOs }; result: SpaceRow };+ "spaces.create": { args: { config: SpaceCreateConfig; pendingId: string; os?: SpaceOs; notifyWhenReady?: boolean }; result: SpaceRow };"spaces.cancelCreate": { args: { pendingId: string }; result: CancelOutcome };"spaces.setPower": { args: { spaceId: string; on: boolean }; result: SpacePowerReport };/** Deletes the Space, or with `removeOnly` only forgets it here (a Spacediff --git a/apps/cua-spaces-web/src/bridge/share.ts b/apps/cua-spaces-web/src/bridge/share.tsindex cf5104e940..00f3b4e799 100644--- a/apps/cua-spaces-web/src/bridge/share.ts+++ b/apps/cua-spaces-web/src/bridge/share.ts@@ -9,6 +9,7 @@* shows that a request is running.*/+import { noteTeammates } from "./first-run";import { useContext, useSyncExternalStore } from "react";import type { DataAdapter } from "./adapter";import { BridgeContext } from "./BridgeProvider";@@ -113,7 +114,11 @@ export class ShareStore {: await this.adapter.call("sharing.unshare", { spaceId: request.space, who: request.who });this.setShares(spaceId, shares);outcome = { type: "done" };- if (request.kind === "share") this.onShared();+ if (request.kind === "share") {+ this.onShared();+ // Teammates' emails entered: the first run's plan card offers Teams, not Pro.+ if (request.who.includes("@")) noteTeammates();+ }} catch (e) {outcome = { type: "failed", error: words(e) };}diff --git a/apps/cua-spaces-web/src/bridge/space-names.ts b/apps/cua-spaces-web/src/bridge/space-names.tsnew file mode 100644index 0000000000..d62fced8cd--- /dev/null+++ b/apps/cua-spaces-web/src/bridge/space-names.ts@@ -0,0 +1,17 @@+// SPDX-License-Identifier: FSL-1.1-MIT+// Copyright (c) 2026 Cua AI, Inc.++/** "macos-1", "linux-2": the first name of that system's not taken yet+ * (Space names are DNS labels). */+export function extraName(os: "macos" | "linux", taken: { name: string }[]): string {+ const names = new Set(taken.map((t) => t.name.toLowerCase()));+ let n = 1;+ while (names.has(`${os}-${n}`)) n++;+ return `${os}-${n}`;+}++/** How the card says a name: "macos-1" is "macOS 1". */+export function spokenName(name: string): string {+ const m = /^(macos|linux)-(\d+)$/.exec(name);+ return m ? `${m[1] === "macos" ? "macOS" : "Linux"} ${m[2]}` : name;+}diff --git a/apps/cua-spaces-web/src/bridge/store.ts b/apps/cua-spaces-web/src/bridge/store.tsindex 5665d963e2..2fca149893 100644--- a/apps/cua-spaces-web/src/bridge/store.ts+++ b/apps/cua-spaces-web/src/bridge/store.ts@@ -9,6 +9,8 @@* `state/cloud.tsx` does. Hooks read it with `useSyncExternalStore`.*/+import { hostOs } from "./host-os";+import { spokenName } from "./space-names";import { isUnsupported, type DataAdapter } from "./adapter";import type { AgentRunStatus, AgentSetupRow, PersistentAgent, SpaceAgentRun } from "./contracts/agents";import type { CoreClient } from "./core";@@ -174,6 +176,9 @@ const timelineKey = (r: RunRef) => `${r.spaceId}\n${r.runId}`;/** `createSpace`'s request: the SDK's create config, plus the OS when the image doesn't say. */export interface CreateSpaceRequest extends SpaceCreateConfig {os?: SpaceOs;+ /** The host also posts a system notification when it is ready (the+ * first run's extra Space, which keeps going after the window closes). */+ notifyWhenReady?: boolean;}export interface StoreOptions {@@ -539,7 +544,7 @@ export class BridgeStore {}private async runCreate(req: CreateSpaceRequest, pendingId: string): Promise<Space> {- const { os: _os, ...config } = req;+ const { os: _os, notifyWhenReady, ...config } = req;const os = osOf(req);const on = config.on ?? this.settingsSnap?.values.defaultLocation ?? "local";// A Space on one of your machines or in your own cloud lists as a relay machine.@@ -564,13 +569,16 @@ export class BridgeStore {hostName: machine?.name ?? null,});try {- const row = await this.adapter.call("spaces.create", { config, pendingId, os });+ const row = await this.adapter.call("spaces.create", notifyWhenReady ? { config, pendingId, os, notifyWhenReady } : { config, pendingId, os });this.createdIds.set(pendingId, row.id);this.dispatch({ type: "finish", id: pendingId, spaceId: row.id });this.createRequests.delete(pendingId);await this.refresh("spaces");const space = (this.resources.spaces.data as Space[] | undefined)?.find((s) => s.id === row.id) ?? rowsToSpaces(this.core, [row], this.now())[0]!;- this.extras.record({ kind: "message", title: `${space.name} is ready`, space: space.id });+ // Plain words: a fresh computer inside this one (never "VM" or "container").+ const system = space.os === "macos" ? "macOS" : space.os === "windows" ? "Windows" : space.os === "linux" ? "Linux" : null;+ const body = system ? `A fresh ${system} computer inside ${({ macos: "this Mac", windows: "this PC", linux: "this computer" } as const)[hostOs()]}. Your agent can use it now.` : undefined;+ this.extras.record({ kind: "message", title: `${spokenName(space.name)} is ready`, ...(body && !machine ? { body } : {}), space: space.id });return space;} catch (e) {const message = toError(e).message;diff --git a/apps/cua-spaces-web/src/bridge/this-machine.ts b/apps/cua-spaces-web/src/bridge/this-machine.tsindex 0b901f68f4..44e1031f5f 100644--- a/apps/cua-spaces-web/src/bridge/this-machine.ts+++ b/apps/cua-spaces-web/src/bridge/this-machine.ts@@ -129,6 +129,17 @@ export class ThisMachineStore {if (name && this.state.form && !this.state.form.name) this.send({ type: "set-name", name });}+ /** Sets this computer up with the form's defaults and its own name, in+ * one step (the first run's "Set up"). Resolves to whether it worked. */+ async quickSetUp(identity: string | null, profile = "desktop"): Promise<boolean> {+ let form = hostFormInitial(this.core);+ form = hostFormReduce(this.core, form, { type: "set-profile", profile });+ this.failedRequest = null;+ this.set({ form, error: null, setupError: null });+ await this.prefillName();+ return this.submit(identity);+ }+closeForm(): void {this.failedRequest = null;this.set({ form: null, setupError: null });diff --git a/apps/cua-spaces-web/src/bridge/webkit-protocol.ts b/apps/cua-spaces-web/src/bridge/webkit-protocol.tsindex 1a6d81ab6f..2fc9a663fd 100644--- a/apps/cua-spaces-web/src/bridge/webkit-protocol.ts+++ b/apps/cua-spaces-web/src/bridge/webkit-protocol.ts@@ -50,6 +50,8 @@ export const WEBKIT_METHODS = ["session.get","session.signIn","session.signOut",+ "onboarding.get",+ "onboarding.complete","spaces.list","spaces.open","spaces.createOptions",@@ -160,11 +162,10 @@ export type WebkitMethod = (typeof WEBKIT_METHODS)[number];/** What only the Electron host answers: it draws a Space's video in the* page (WebCodecs), so the page asks it for a media ticket- * (`ops/stream.ts`), and its first run is this page's (`onboarding.get`,- * `onboarding.complete`); the Mac app draws video and its first run- * natively. It also joins presence for the video the page draws+ * (`ops/stream.ts`); the Mac app draws video natively. (Both hosts run+ * this page's first run: `onboarding.get`, `onboarding.complete`.) It also joins presence for the video the page draws* (`presence.*`, `ops/presence.ts`). */-export const ELECTRON_HOST_METHODS = ["onboarding.get", "onboarding.complete", "spaces.openStream", "presence.join", "presence.publish", "presence.leave", "spaces.fixRuntime"] as const;+export const ELECTRON_HOST_METHODS = ["spaces.openStream", "presence.join", "presence.publish", "presence.leave", "spaces.fixRuntime"] as const;/** `onboarding.get` and `onboarding.complete`'s answer: whether the first run finished, and as what. */export interface WkOnboarding {diff --git a/apps/cua-spaces-web/src/components/__tests__/onboarding-keys.test.tsx b/apps/cua-spaces-web/src/components/__tests__/onboarding-keys.test.tsxdeleted file mode 100644index 7348872b0b..0000000000--- a/apps/cua-spaces-web/src/components/__tests__/onboarding-keys.test.tsx+++ /dev/null@@ -1,46 +0,0 @@-// SPDX-License-Identifier: FSL-1.1-MIT-// Copyright (c) 2026 Cua AI, Inc.--import { cleanup, fireEvent, render, screen } from "@testing-library/react";-import { afterEach, describe, expect, it, vi } from "vitest";--import { pressPrimaryOnReturn } from "@/components/onboarding-keys";--afterEach(cleanup);--function page(primaryDisabled = false) {- const primary = vi.fn();- const other = vi.fn();- render(- <div data-testid="page" tabIndex={-1} onKeyDown={pressPrimaryOnReturn}>- <h1 tabIndex={-1} data-testid="heading">Sign in</h1>- <button type="button" onClick={other}>Skip</button>- <input data-testid="field" />- <button type="button" data-onboarding-primary="" disabled={primaryDisabled} onClick={primary}>- Continue- </button>- </div>,- );- return { primary, other };-}--describe("Return on a first-run page", () => {- it("presses the primary button from the page (the heading has focus after a step change)", () => {- const { primary, other } = page();- fireEvent.keyDown(screen.getByTestId("heading"), { key: "Enter" });- expect(primary).toHaveBeenCalledTimes(1);- expect(other).not.toHaveBeenCalled();- });-- it("leaves Return to a focused control, and to a disabled primary", () => {- const { primary } = page();- fireEvent.keyDown(screen.getByText("Skip"), { key: "Enter" });- fireEvent.keyDown(screen.getByTestId("field"), { key: "Enter" });- fireEvent.keyDown(screen.getByTestId("heading"), { key: "Enter", metaKey: true });- expect(primary).not.toHaveBeenCalled();- cleanup();- const disabled = page(true);- fireEvent.keyDown(screen.getByTestId("heading"), { key: "Enter" });- expect(disabled.primary).not.toHaveBeenCalled();- });-});diff --git a/apps/cua-spaces-web/src/components/__tests__/onboarding-mode.test.tsx b/apps/cua-spaces-web/src/components/__tests__/onboarding-mode.test.tsxdeleted file mode 100644index 34719fbe36..0000000000--- a/apps/cua-spaces-web/src/components/__tests__/onboarding-mode.test.tsx+++ /dev/null@@ -1,116 +0,0 @@-// SPDX-License-Identifier: FSL-1.1-MIT-// Copyright (c) 2026 Cua AI, Inc.--import { act, cleanup, fireEvent, render, screen, waitFor } from "@testing-library/react";-import { afterEach, beforeEach, describe, expect, it } from "vitest";--import { BridgeProvider, useOnboarding, useSession, useThisMachine, type OnboardingHook } from "@/bridge";-import { createDemoAdapter } from "@/bridge/adapters/demo";-import { readSavedOnboarding, resetSavedOnboardingCache } from "@/bridge/onboarding";-import { testCore, wasmBuilt } from "@/bridge/__tests__/testCore";-import { ModeCard, ModeContinue, useModeChoice } from "@/components/onboarding-mode";-import { pressPrimaryOnReturn } from "@/components/onboarding-keys";--beforeEach(() => {- localStorage.clear();- resetSavedOnboardingCache();-});-afterEach(cleanup);--const probe = {} as { flow: OnboardingHook };--function Page() {- const flow = useOnboarding();- const { data: session } = useSession();- const host = useThisMachine(session?.identity ?? null);- const choice = useModeChoice(flow, flow.view, host);- probe.flow = flow;- if (flow.view?.step !== "mode") return null;- return (- <div onKeyDown={pressPrimaryOnReturn}>- <h1 tabIndex={-1} data-testid="heading">- {flow.view.title}- </h1>- <ModeCard flow={flow} view={flow.view} host={host} choice={choice} />- <ModeContinue view={flow.view} host={host} choice={choice} />- </div>- );-}--async function toMode() {- const adapter = createDemoAdapter({ latencyMs: 1, stepMs: 1, signedIn: true, onboarded: false });- render(- <BridgeProvider adapter={adapter} core={await testCore()} storeOptions={{ tickMs: 5 }}>- <Page />- </BridgeProvider>,- );- await waitFor(() => expect(probe.flow.state).toBeTruthy());- act(() => probe.flow.send({ type: "start" }));- act(() => probe.flow.send({ type: "signin-done" }));- act(() => probe.flow.send({ type: "agents-done", configured: [] }));- act(() => probe.flow.send({ type: "presentation-done" }));-}--describe.skipIf(!wasmBuilt)("This machine in the first run", () => {- it("opens host setup from the host choice instead of a dead end, and moves on once it worked", async () => {- const adapter = createDemoAdapter({ latencyMs: 1, stepMs: 1, signedIn: true, onboarded: false });- render(- <BridgeProvider adapter={adapter} core={await testCore()} storeOptions={{ tickMs: 5 }}>- <Page />- </BridgeProvider>,- );- await waitFor(() => expect(probe.flow.state).toBeTruthy());- act(() => probe.flow.send({ type: "start" }));- act(() => probe.flow.send({ type: "signin-done" }));- act(() => probe.flow.send({ type: "agents-done", configured: [] }));- act(() => probe.flow.send({ type: "presentation-done" }));- const hostChoice = await screen.findByTestId("onboarding-host");- expect(hostChoice).not.toHaveProperty("disabled", true);- expect(screen.queryByText(/Available once this machine is set up/)).toBeNull();- expect(hostChoice.textContent).toMatch(/Next: name it and choose who else can use it/);-- // Choosing only selects; Continue opens the form.- fireEvent.click(hostChoice);- expect(document.querySelector("[data-host-form]")).toBeNull();- fireEvent.click(await screen.findByRole("button", { name: /Continue/ }));- const form = await waitFor(() => {- const f = document.querySelector("[data-host-form]");- if (!f) throw new Error("no host form");- return f as HTMLFormElement;- });- // Name starts as what the system calls this computer.- await waitFor(() => expect(form.querySelector<HTMLInputElement>('[data-host-field="name"] input')?.value).toBe("Ada’s MacBook Pro"));- await waitFor(() => expect(form.querySelector<HTMLButtonElement>("[data-host-submit]")?.disabled).toBe(false));- fireEvent.submit(form);- await waitFor(() => expect(readSavedOnboarding().state?.step).toBe("done"), { timeout: 5000 });- expect(readSavedOnboarding().state?.mode).toBe("host");- });-- it("finishes the page at once for the open-other-computers choice", async () => {- const adapter = createDemoAdapter({ latencyMs: 1, stepMs: 1, signedIn: true, onboarded: false });- render(- <BridgeProvider adapter={adapter} core={await testCore()} storeOptions={{ tickMs: 5 }}>- <Page />- </BridgeProvider>,- );- await waitFor(() => expect(probe.flow.state).toBeTruthy());- act(() => probe.flow.send({ type: "start" }));- act(() => probe.flow.send({ type: "signin-done" }));- act(() => probe.flow.send({ type: "agents-done", configured: [] }));- act(() => probe.flow.send({ type: "presentation-done" }));- fireEvent.click(await screen.findByTestId("onboarding-client"));- expect(readSavedOnboarding().state?.step).toBe("mode");- fireEvent.click(await screen.findByRole("button", { name: /Continue/ }));- expect(readSavedOnboarding().state).toMatchObject({ step: "done", mode: "client" });- });-- it("always has an enabled Continue, with the open-other-computers choice selected, and Return continues", async () => {- await toMode();- const next = (await screen.findByRole("button", { name: /Continue/ })) as HTMLButtonElement;- expect(next.disabled).toBe(false);- expect(screen.getByRole("radio", { name: /open my other computers/ }).getAttribute("aria-checked")).toBe("true");- expect(screen.getByRole("radio", { name: /Let my other devices reach/ }).getAttribute("aria-checked")).toBe("false");- fireEvent.keyDown(screen.getByTestId("heading"), { key: "Enter" });- expect(readSavedOnboarding().state).toMatchObject({ step: "done", mode: "client" });- });-});diff --git a/apps/cua-spaces-web/src/components/__tests__/onboarding-presentation.test.tsx b/apps/cua-spaces-web/src/components/__tests__/onboarding-presentation.test.tsxdeleted file mode 100644index 2d24889bd5..0000000000--- a/apps/cua-spaces-web/src/components/__tests__/onboarding-presentation.test.tsx+++ /dev/null@@ -1,66 +0,0 @@-// SPDX-License-Identifier: FSL-1.1-MIT-// Copyright (c) 2026 Cua AI, Inc.--import { act, cleanup, fireEvent, render, screen, waitFor } from "@testing-library/react";-import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";--import { BridgeProvider, useOnboarding, type OnboardingHook } from "@/bridge";-import { createDemoAdapter } from "@/bridge/adapters/demo";-import { resetSavedOnboardingCache } from "@/bridge/onboarding";-import { testCore, wasmBuilt } from "@/bridge/__tests__/testCore";-import { PresentationCards } from "@/components/onboarding-presentation";--beforeEach(() => {- localStorage.clear();- resetSavedOnboardingCache();-});-afterEach(() => {- cleanup();- vi.restoreAllMocks();-});--const probe = {} as { flow: OnboardingHook };--function Page() {- const flow = useOnboarding();- probe.flow = flow;- if (flow.view?.step !== "presentation") return null;- return <PresentationCards flow={flow} view={flow.view} />;-}--async function toMenuBarPage() {- const adapter = createDemoAdapter({ latencyMs: 1, stepMs: 1, signedIn: false, onboarded: false });- render(- <BridgeProvider adapter={adapter} core={await testCore()} storeOptions={{ tickMs: 5 }}>- <Page />- </BridgeProvider>,- );- await waitFor(() => expect(probe.flow.state).toBeTruthy());- act(() => probe.flow.send({ type: "start" }));- act(() => probe.flow.send({ type: "signin-done" }));- act(() => probe.flow.send({ type: "agents-done", configured: [] }));- return adapter;-}--describe.skipIf(!wasmBuilt)("Menu bar in the first run", () => {- it("offers the notch on a Mac and writes the pick to the setting", async () => {- vi.spyOn(navigator, "platform", "get").mockReturnValue("MacIntel");- const adapter = await toMenuBarPage();- const notch = await screen.findByTestId("onboarding-notch");- const menuBar = screen.getByTestId("onboarding-menu-bar");- expect(notch.textContent).toBe("Notch and menu bar");- expect(notch.getAttribute("aria-checked")).toBe("true");- expect(screen.getByRole("img", { name: "The menu bar menu alone" })).toBeTruthy();-- fireEvent.click(menuBar);- await waitFor(() => expect(adapter.state.settings.menuBar).toBe(true));- expect(screen.getByTestId("onboarding-menu-bar").getAttribute("aria-checked")).toBe("true");- });-- it("passes through off a Mac", async () => {- vi.spyOn(navigator, "platform", "get").mockReturnValue("Win32");- await toMenuBarPage();- expect(probe.flow.view?.step).toBe("mode");- expect(screen.queryByTestId("onboarding-notch")).toBeNull();- });-});diff --git a/apps/cua-spaces-web/src/components/__tests__/onboarding-prompts.test.tsx b/apps/cua-spaces-web/src/components/__tests__/onboarding-prompts.test.tsxdeleted file mode 100644index d22edbb41e..0000000000--- a/apps/cua-spaces-web/src/components/__tests__/onboarding-prompts.test.tsx+++ /dev/null@@ -1,31 +0,0 @@-// SPDX-License-Identifier: FSL-1.1-MIT-// Copyright (c) 2026 Cua AI, Inc.--import { act, cleanup, fireEvent, render, screen } from "@testing-library/react";-import { afterEach, describe, expect, it, vi } from "vitest";--import { ExamplePrompts } from "@/components/onboarding-prompts";--afterEach(cleanup);--const PROMPTS = ["Open a Linux Space and run my test suite in it", "Share this Space with a teammate as a viewer"];--describe("Done's example prompts", () => {- it("lists each prompt under 'Try asking your agent:' and copies one on click", async () => {- const writeText = vi.fn().mockResolvedValue(undefined);- Object.defineProperty(navigator, "clipboard", { value: { writeText }, configurable: true });- render(<ExamplePrompts prompts={PROMPTS} />);- expect(screen.getByText("Try asking your agent:")).toBeTruthy();- expect(screen.getAllByRole("button")).toHaveLength(2);- await act(async () => {- fireEvent.click(screen.getByText(`“${PROMPTS[1]}”`));- });- expect(writeText).toHaveBeenCalledWith(PROMPTS[1]);- expect(screen.getByText("Copied")).toBeTruthy();- });-- it("shows nothing without prompts", () => {- const { container } = render(<ExamplePrompts prompts={[]} />);- expect(container.textContent).toBe("");- });-});diff --git a/apps/cua-spaces-web/src/components/__tests__/onboarding-skip.test.tsx b/apps/cua-spaces-web/src/components/__tests__/onboarding-skip.test.tsxdeleted file mode 100644index c7b9fdb8ee..0000000000--- a/apps/cua-spaces-web/src/components/__tests__/onboarding-skip.test.tsx+++ /dev/null@@ -1,26 +0,0 @@-// SPDX-License-Identifier: FSL-1.1-MIT-// Copyright (c) 2026 Cua AI, Inc.--import { cleanup, fireEvent, render, screen } from "@testing-library/react";-import { afterEach, describe, expect, it, vi } from "vitest";--import { SetUpLater } from "@/components/onboarding-skip";--afterEach(cleanup);--describe("Set up later", () => {- it("sits left of the window controls overlay, not under it", () => {- render(<SetUpLater onClick={() => {}} />);- const button = screen.getByRole("button", { name: "Set up later" });- expect(button.style.right).toBe("calc(var(--titlebar-right-inset) + 1rem)");- expect(button.className).not.toMatch(/\bright-\d/);- expect(button.className).toMatch(/app-no-drag/);- });-- it("leaves the first run when clicked", () => {- const onClick = vi.fn();- render(<SetUpLater onClick={onClick} />);- fireEvent.click(screen.getByRole("button", { name: "Set up later" }));- expect(onClick).toHaveBeenCalledTimes(1);- });-});diff --git a/apps/cua-spaces-web/src/components/first-run-todos.tsx b/apps/cua-spaces-web/src/components/first-run-todos.tsxnew file mode 100644index 0000000000..10a1e2c257--- /dev/null+++ b/apps/cua-spaces-web/src/components/first-run-todos.tsx@@ -0,0 +1,101 @@+// SPDX-License-Identifier: FSL-1.1-MIT+// Copyright (c) 2026 Cua AI, Inc.++import { useNavigate } from "@tanstack/react-router";+import { CheckIcon, XIcon } from "lucide-react";+import { useEffect, useState } from "react";++import { firstRunTodos, useBridge, useFirstRun, useFirstRunSaved, writeFirstRun } from "@/bridge";+import { Button } from "@/components/ui/button";+import { cn } from "@/lib/utils";++/** Whether Home shows the first run's to-do list (after Finish later). */+export function useFirstRunTodosShown(): boolean {+ const saved = useFirstRunSaved();+ return saved.finishedLater && !saved.todosClosed;+}++/**+ * "Finish setting up" on Home after the first run's Finish later: the same+ * checks, kept, each with its fix (the core's `firstRun.todos`). It goes+ * away once everything required is done, or when closed.+ */+export function FirstRunTodosCard() {+ const shown = useFirstRunTodosShown();+ return shown ? <TodosCard /> : null;+}++function TodosCard() {+ // Home reads more slowly than the first run.+ const fr = useFirstRun(true, 10_000);+ const { core } = useBridge();+ const todos = firstRunTodos(core, { ...fr.input, step: "setup" });+ const [copied, setCopied] = useState(false);+ const navigate = useNavigate();+ useEffect(() => {+ if (todos?.complete) writeFirstRun({ todosClosed: true });+ }, [todos?.complete]);+ if (!todos) return null;+ return (+ <section className="mb-6 overflow-hidden rounded-xl border bg-card" aria-labelledby="first-run-todos" data-first-run-todos="">+ <header className="flex items-start justify-between gap-4 border-b px-5 py-3.5">+ <div>+ <h2 id="first-run-todos" className="text-[14px] font-semibold">+ {todos.title}+ </h2>+ <p className="text-[13px] text-muted-foreground">{todos.lede}</p>+ </div>+ <div className="flex items-center gap-2">+ <span className="text-[13px] text-muted-foreground">{todos.progress}</span>+ <Button variant="ghost" size="icon-sm" aria-label="Close" onClick={() => writeFirstRun({ todosClosed: true })}>+ <XIcon className="size-3.5" />+ </Button>+ </div>+ </header>+ <ul className="divide-y">+ {todos.items.map((t) => (+ <li key={t.id} className="flex items-center gap-3.5 px-5 py-2.5" data-first-run-todo={t.id} data-done={t.done ? "" : undefined}>+ <span+ aria-hidden+ className={cn(+ "flex size-5 shrink-0 items-center justify-center rounded-full border",+ t.done ? "border-brand bg-brand text-white" : "border-foreground/25",+ )}+ >+ {t.done ? <CheckIcon className="size-3" strokeWidth={3} /> : null}+ </span>+ <div className="min-w-0 flex-1">+ <p className={cn("text-[13px] font-medium", t.done && "text-muted-foreground")}>+ {t.title}+ <span className="sr-only">{t.done ? " (done)" : ""}</span>+ </p>+ <p className="truncate text-xs text-muted-foreground">{t.note}</p>+ </div>+ {t.action ? (+ <Button+ variant="outline"+ size="sm"+ className="shrink-0"+ onClick={() => {+ if (t.action!.id === "copy") {+ void fr.copyPrompt().then(() => {+ setCopied(true);+ setTimeout(() => setCopied(false), 1500);+ });+ } else if (t.action!.id === "add") {+ // Back to the first run's choice of system (macOS or Linux).+ void fr.extra("add").then(() => navigate({ to: "/onboarding" }));+ } else {+ void fr.act(t.action!.id, t.settingsUrl);+ }+ }}+ >+ {t.action.id === "copy" && copied ? "Copied" : t.action.label}+ </Button>+ ) : null}+ </li>+ ))}+ </ul>+ </section>+ );+}diff --git a/apps/cua-spaces-web/src/components/onboarding-keys.ts b/apps/cua-spaces-web/src/components/onboarding-keys.tsdeleted file mode 100644index e942a09bf2..0000000000--- a/apps/cua-spaces-web/src/components/onboarding-keys.ts+++ /dev/null@@ -1,16 +0,0 @@-// SPDX-License-Identifier: FSL-1.1-MIT-// Copyright (c) 2026 Cua AI, Inc.--import type { KeyboardEvent } from "react";--/** Return presses the page's primary button, unless a control that takes- * Return itself (a button, a field, a link, a switch) has focus. */-export function pressPrimaryOnReturn(e: KeyboardEvent<HTMLDivElement>) {- if (e.key !== "Enter" || e.defaultPrevented || e.nativeEvent.isComposing || e.metaKey || e.ctrlKey || e.altKey || e.shiftKey) return;- const target = e.target as HTMLElement;- if (target.closest("button, a, input, textarea, select, [role=switch], [role=checkbox], [contenteditable=true], form")) return;- const primary = e.currentTarget.querySelector<HTMLButtonElement>("[data-onboarding-primary]:not(:disabled)");- if (!primary) return;- e.preventDefault();- primary.click();-}diff --git a/apps/cua-spaces-web/src/components/onboarding-mode.tsx b/apps/cua-spaces-web/src/components/onboarding-mode.tsxdeleted file mode 100644index b920598568..0000000000--- a/apps/cua-spaces-web/src/components/onboarding-mode.tsx+++ /dev/null@@ -1,111 +0,0 @@-// SPDX-License-Identifier: FSL-1.1-MIT-// Copyright (c) 2026 Cua AI, Inc.--import { useState } from "react";--import { useMachines, useThisMachine, type OnboardingHook, type OnboardingMode, type OnboardingView } from "@/bridge";-import { Button } from "@/components/ui/button";-import { JoinWithCodeDialog } from "@/components/join-with-code-dialog";-import { HostSetupForm } from "@/components/this-machine";-import { cn } from "@/lib/utils";--type HostSetup = ReturnType<typeof useThisMachine>;--/**- * The This machine page's choice: the cards only select, and Continue (Return- * too) moves on, like every other page. "Access other machines" is selected- * to begin with, so Continue is always there. Continuing with Access other- * machines finishes the page; with Set up this machine it opens host setup's- * form (as the SwiftUI app does), and the page moves on once setup worked. A- * machine already set up goes straight on.- */-export function useModeChoice(flow: OnboardingHook, view: OnboardingView | null | undefined, host: HostSetup) {- const [picked, setPicked] = useState<OnboardingMode | null>(null);- const selected: OnboardingMode = picked ?? view?.preselectedMode ?? "client";- const advance = () => {- if (selected === "host" && !flow.hostConfigured) host.openForm();- else flow.send({ type: "mode-chosen", mode: selected });- };- return { selected, select: setPicked, advance };-}--export type ModeChoice = ReturnType<typeof useModeChoice>;--/** The page's Continue button (not shown while host setup's form is open: it has its own). */-export function ModeContinue({ view, host, choice }: { view: OnboardingView; host: HostSetup; choice: ModeChoice }) {- if (host.formView) return null;- return (- <Button size="lg" data-onboarding-primary="" data-mode-continue="" onClick={choice.advance}>- {view.primaryLabel}- </Button>- );-}--export function ModeCard({ flow, view, host, choice }: { flow: OnboardingHook; view: OnboardingView; host: HostSetup; choice: ModeChoice }) {- const { data: machines } = useMachines();- const [joining, setJoining] = useState(false);- if (host.formView) {- const done = (ok: boolean) => {- if (ok) flow.send({ type: "mode-chosen", mode: "host" });- return ok;- };- return (- <HostSetupForm- view={host.formView}- failure={host.setupError}- progress={machines?.find((m) => m.current)?.hostProgress}- onRetry={() => void host.retrySetUp().then(done)}- host={{- send: host.send,- closeForm: host.closeForm,- submit: async () => done(await host.submit()),- }}- />- );- }- return (- <div className="flex flex-col gap-2.5" role="radiogroup" aria-label={view.title}>- {view.choices.map((c) => {- const setUp = c.mode === "host" && !flow.hostConfigured;- const on = c.mode === choice.selected;- return (- <button- key={c.mode}- type="button"- role="radio"- aria-checked={on}- onClick={() => {- choice.select(c.mode);- // Return then continues, as on every other page.- requestAnimationFrame(() => document.querySelector<HTMLElement>("[data-mode-continue]")?.focus());- }}- data-testid={`onboarding-${c.mode}`}- className={cn(- "rounded-xl border bg-card px-4 py-3.5 text-left shadow-xs outline-none transition-[border-color,box-shadow]",- "hover:border-foreground/20 focus-visible:border-brand focus-visible:ring-3 focus-visible:ring-brand/25",- on && "border-foreground/60 ring-1 ring-foreground/30",- )}- >- <div className="text-[13px] font-semibold">{c.label}</div>- {setUp ? (- <div className="mt-0.5 text-xs text-muted-foreground">Next: name it and choose who else can use it.</div>- ) : null}- </button>- );- })}- {flow.hostConfigured ? null : (- <>- <button- type="button"- onClick={() => setJoining(true)}- data-testid="onboarding-join-with-code"- className="self-start px-1 pt-1 text-xs text-muted-foreground outline-none hover:text-foreground focus-visible:text-foreground"- >- Have a code from another device? Join with a code- </button>- <JoinWithCodeDialog open={joining} onOpenChange={setJoining} />- </>- )}- </div>- );-}diff --git a/apps/cua-spaces-web/src/components/onboarding-presentation.tsx b/apps/cua-spaces-web/src/components/onboarding-presentation.tsxdeleted file mode 100644index af74923f71..0000000000--- a/apps/cua-spaces-web/src/components/onboarding-presentation.tsx+++ /dev/null@@ -1,54 +0,0 @@-// SPDX-License-Identifier: FSL-1.1-MIT-// Copyright (c) 2026 Cua AI, Inc.--import type { OnboardingHook, OnboardingView } from "@/bridge";-import { cn } from "@/lib/utils";--/** The Menu bar page's choices, side by side, as the SwiftUI page draws them:- * a miniature of the top of the screen, and the card's title. */-export function PresentationCards({ flow, view }: { flow: OnboardingHook; view: OnboardingView }) {- return (- <div role="radiogroup" aria-label={view.title} className="grid grid-cols-2 gap-3">- {(view.presentations ?? []).map((card) => (- <button- key={card.id}- type="button"- role="radio"- aria-checked={card.selected}- data-testid={card.id}- onClick={() => flow.send({ type: "presentation-picked", menuBar: card.menuBar })}- className={cn(- "flex flex-col items-center gap-2 rounded-xl border bg-card p-2 shadow-xs outline-none transition-[border-color,box-shadow]",- "hover:border-foreground/20 focus-visible:border-brand focus-visible:ring-3 focus-visible:ring-brand/25",- card.selected && "border-foreground/40",- )}- >- <ScreenTop notch={!card.menuBar} label={card.imageLabel} />- <span className="text-[12.5px] font-medium">{card.title}</span>- </button>- ))}- </div>- );-}--/** The top of a Mac's screen: the menu bar with the app's icon, and the- * notch where the Spaces tiles open (when it shows there). */-function ScreenTop({ notch, label }: { notch: boolean; label: string }) {- return (- <div role="img" aria-label={label} className="relative h-20 w-full overflow-hidden rounded-md bg-gradient-to-b from-sky-200 to-indigo-300 dark:from-slate-700 dark:to-indigo-950">- <div className="absolute inset-x-0 top-0 flex h-3 items-center justify-end gap-1 bg-white/50 px-1.5 dark:bg-black/40">- <span className="size-1.5 rounded-full bg-foreground/70" />- <span className="h-1 w-3 rounded-full bg-foreground/30" />- </div>- {notch ? (- <div className="absolute top-0 left-1/2 h-3 w-12 -translate-x-1/2 rounded-b-md bg-black">- <div className="absolute top-3 left-1/2 flex -translate-x-1/2 gap-1 rounded-b-md bg-black px-1.5 pt-0.5 pb-1.5">- <span className="h-3 w-4 rounded-[2px] bg-white/70" />- <span className="h-3 w-4 rounded-[2px] bg-white/40" />- <span className="h-3 w-4 rounded-[2px] bg-white/40" />- </div>- </div>- ) : null}- </div>- );-}diff --git a/apps/cua-spaces-web/src/components/onboarding-prompts.tsx b/apps/cua-spaces-web/src/components/onboarding-prompts.tsxdeleted file mode 100644index 2ce83243d0..0000000000--- a/apps/cua-spaces-web/src/components/onboarding-prompts.tsx+++ /dev/null@@ -1,52 +0,0 @@-// SPDX-License-Identifier: FSL-1.1-MIT-// Copyright (c) 2026 Cua AI, Inc.--import { useEffect, useRef, useState } from "react";--/**- * Done's example prompts (the core's three static lines, as the SwiftUI app- * shows them under both columns): "Try asking your agent:" and a few things- * to say once a coding agent has the cua skills and tools. Each copies to the- * clipboard on click and says "Copied". They show on every system, whether or- * not an agent was set up here: the lines work with any agent that has them.- */-export function ExamplePrompts({ prompts }: { prompts: string[] }) {- const [copied, setCopied] = useState<string | null>(null);- const timer = useRef<number | undefined>(undefined);- useEffect(() => () => window.clearTimeout(timer.current), []);- if (prompts.length === 0) return null;- const copy = (text: string) => {- void navigator.clipboard?.writeText(text).then(- () => {- setCopied(text);- window.clearTimeout(timer.current);- timer.current = window.setTimeout(() => setCopied(null), 1500);- },- () => {},- );- };- return (- <section className="mt-8" aria-labelledby="onboarding-prompts" data-onboarding-prompts="">- <h2 id="onboarding-prompts" className="mb-2 text-[13px] font-semibold">- Try asking your agent:- </h2>- <ul className="flex flex-col gap-1">- {prompts.map((p) => (- <li key={p}>- <button- type="button"- onClick={() => copy(p)}- title="Copies this prompt"- className="flex w-full items-center justify-between gap-4 rounded-lg px-3 py-1.5 text-left text-[13px] text-muted-foreground outline-none hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-brand/25"- >- <span className="truncate">{`“${p}”`}</span>- <span className="shrink-0 text-xs" aria-live="polite">- {copied === p ? "Copied" : ""}- </span>- </button>- </li>- ))}- </ul>- </section>- );-}diff --git a/apps/cua-spaces-web/src/components/onboarding-skip.tsx b/apps/cua-spaces-web/src/components/onboarding-skip.tsxdeleted file mode 100644index e7f600d607..0000000000--- a/apps/cua-spaces-web/src/components/onboarding-skip.tsx+++ /dev/null@@ -1,23 +0,0 @@-// SPDX-License-Identifier: FSL-1.1-MIT-// Copyright (c) 2026 Cua AI, Inc.--import { Button } from "@/components/ui/button";--/**- * "Set up later", top right in the title bar. It keeps clear of the window- * controls overlay (Electron's titleBarOverlay on Windows and Linux), which- * otherwise covers it and takes its clicks.- */-export function SetUpLater({ onClick }: { onClick: () => void }) {- return (- <Button- variant="ghost"- size="sm"- className="app-no-drag absolute -top-9 text-muted-foreground"- style={{ right: "calc(var(--titlebar-right-inset) + 1rem)" }}- onClick={onClick}- >- Set up later- </Button>- );-}diff --git a/apps/cua-spaces-web/src/components/shell/sidebar.tsx b/apps/cua-spaces-web/src/components/shell/sidebar.tsxindex 0e7d1dd447..088a8384ea 100644--- a/apps/cua-spaces-web/src/components/shell/sidebar.tsx+++ b/apps/cua-spaces-web/src/components/shell/sidebar.tsx@@ -6,13 +6,16 @@ import { useRef, type PointerEvent } from "react";import { LogOutIcon } from "lucide-react";+import type { Space } from "@/bridge";+import { spokenName } from "@/bridge/space-names";+import { signInCodeText, useBridge, useMachines, useNotifications, useRelayUsageView, useSession, useSpaces, useTrackPlanClick } from "@/bridge";import { CuaKey } from "@/components/cua-key";import { Button } from "@/components/ui/button";import { toast } from "@/components/ui/toast";import { Tooltip } from "@/components/ui/tooltip";import { bindingFor } from "@/lib/keybindings";-import { realSpaces } from "@/lib/spaces";+import { realSpaces, spaceState } from "@/lib/spaces";import { cn } from "@/lib/utils";import { SIDEBAR_DEFAULT, useUiStore } from "@/stores/ui";import { Shortcut } from "@/components/ui/kbd";@@ -70,6 +73,7 @@ export function Sidebar() {})}</nav><div className="mt-auto">+ <SidebarCreating spaces={spaces ?? []} /><SidebarUpdateIndicator /><AccountFooter /></div>@@ -78,9 +82,40 @@ export function Sidebar() {);}+/** Spaces being made, wherever the user is (a create started in the first+ * run keeps going after it): the name, the progress line and a bar. Opens+ * the Space's row. */+function SidebarCreating({ spaces }: { spaces: Space[] }) {+ const making = spaces.filter((s) => spaceState(s) === "creating");+ if (making.length === 0) return null;+ return (+ <div className="flex flex-col gap-1.5 px-2.5 pb-2" data-sidebar-creating="">+ {making.slice(0, 2).map((s) => {+ const p = s.progress;+ const fraction = p ? Math.max(0, Math.min(1, p.permille / 1000)) : 0;+ return (+ <Link+ key={s.id}+ to="/spaces"+ className="block rounded-lg border bg-background/70 px-3 py-2 text-left outline-none hover:bg-background focus-visible:ring-2 focus-visible:ring-ring/60"+ data-sidebar-creating-row={s.id}+ >+ <div className="text-2xs font-medium text-muted-foreground">Making</div>+ <div className="truncate text-xs font-medium">{spokenName(s.name)}</div>+ <div className="truncate text-2xs text-muted-foreground">{p?.transfer ?? p?.label ?? "Starting…"}</div>+ <div className="mt-1.5 h-1 overflow-hidden rounded-full bg-foreground/10" role="progressbar" aria-label={`Making ${s.name}`} aria-valuenow={Math.round(fraction * 100)} aria-valuemin={0} aria-valuemax={100}>+ <div className="h-full rounded-full bg-brand transition-[width]" style={{ width: `${Math.round(fraction * 100)}%` }} />+ </div>+ </Link>+ );+ })}+ </div>+ );+}+/** The account, or "Sign in"; and a way back into a first run left halfway. */export function AccountFooter() {- const { mode, core } = useBridge();+ const { core } = useBridge();const { data: session, signIn, signOut, cancelSignIn, openExternal } = useSession();const plan = useRelayUsageView()?.planCard;const trackPlanClick = useTrackPlanClick();@@ -89,8 +124,7 @@ export function AccountFooter() {const identity = session.signedIn ? (session.identity ?? "Signed in") : null;const phase = session.signIn.kind;const waiting = phase === "starting" || phase === "waiting";- // The SwiftUI host runs its own first run.- const unfinished = mode !== "webkit" && !session.onboarding.completed;+ const unfinished = !session.onboarding.completed;const run = (f: () => Promise<unknown>, what: string) =>f().catch((e: unknown) => toast(what, { description: e instanceof Error ? e.message : String(e) }));diff --git a/apps/cua-spaces-web/src/index.css b/apps/cua-spaces-web/src/index.cssindex 2147416099..605fe8fda3 100644--- a/apps/cua-spaces-web/src/index.css+++ b/apps/cua-spaces-web/src/index.css@@ -85,7 +85,14 @@--shadow-color: 220 40% 2%;}+/* The first run's headline type (Outfit) and its one accent word (Instrument Serif). */+@font-face { font-family: "Outfit"; font-weight: 500; font-display: swap; src: url(/onboarding/fonts/outfit-latin-500-normal.woff2) format("woff2"); }+@font-face { font-family: "Outfit"; font-weight: 600; font-display: swap; src: url(/onboarding/fonts/outfit-latin-600-normal.woff2) format("woff2"); }+@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url(/onboarding/fonts/instrument-serif-latin-400-italic.woff2) format("woff2"); }+@theme {+ --font-display: "Outfit", var(--font-sans);+ --font-accent: "Instrument Serif", ui-serif, Georgia, serif;--font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;--font-mono: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;diff --git a/apps/cua-spaces-web/src/routes/__root.tsx b/apps/cua-spaces-web/src/routes/__root.tsxindex 272ad87dee..9881046ce6 100644--- a/apps/cua-spaces-web/src/routes/__root.tsx+++ b/apps/cua-spaces-web/src/routes/__root.tsx@@ -51,9 +51,10 @@ function RootLayout() {if (pathname.startsWith("/onboarding")) {return (- <div className="flex h-full flex-col bg-background">- <div className="app-drag h-(--titlebar-height) shrink-0" />- <main className="min-h-0 flex-1">+ <div className="relative h-full bg-background">+ {/* The first run draws under the title bar; this keeps it draggable. */}+ <div className="app-drag absolute inset-x-0 top-0 z-20 h-(--titlebar-height)" />+ <main className="h-full"><Outlet /></main></div>@@ -82,11 +83,10 @@ function RootLayout() {/*** Opens the first run once per launch while the host says it isn't done,- * unless the user chose "Set up later" (the sidebar then offers it). The- * SwiftUI host runs its own.+ * unless the user chose "Set up later" (the sidebar then offers it). Every+ * host runs this one (the SwiftUI app opens its window here on a first run).*/function useFirstRun() {- const { mode } = useBridge();const { data: session } = useSession();const { skipped } = useSavedOnboarding();const { pathname } = useLocation();@@ -95,8 +95,8 @@ function useFirstRun() {useEffect(() => {if (checked.current || !session) return;checked.current = true;- if (mode !== "webkit" && !session.onboarding.completed && !skipped && !pathname.startsWith("/onboarding")) {+ if (!session.onboarding.completed && !skipped && !pathname.startsWith("/onboarding")) {void navigate({ to: "/onboarding", replace: true });}- }, [mode, session, skipped, pathname, navigate]);+ }, [session, skipped, pathname, navigate]);}diff --git a/apps/cua-spaces-web/src/routes/onboarding/index.tsx b/apps/cua-spaces-web/src/routes/onboarding/index.tsxindex 0b0f34a00f..9d53375572 100644--- a/apps/cua-spaces-web/src/routes/onboarding/index.tsx+++ b/apps/cua-spaces-web/src/routes/onboarding/index.tsx@@ -2,643 +2,454 @@// Copyright (c) 2026 Cua AI, Inc.import { createFileRoute, useNavigate } from "@tanstack/react-router";-import { CheckIcon } from "lucide-react";-import { lazy, Suspense, useEffect, useState, type ReactNode } from "react";+import { CheckIcon, CopyIcon, PlusIcon } from "lucide-react";+import { useEffect, useState, type ReactNode } from "react";-import {- useFirstSpaceOffers,- useMachines,- useOnboarding,- useOnboardingVolume,- useSession,- useSpaces,- useThisMachine,- type OnboardingHook,- type OnboardingView,- type SandboxImage,-} from "@/bridge";-import { AddMachineDialog } from "@/components/add-machine-dialog";+import { useFirstRun, type FirstRunArt, type FirstRunExtraView, type FirstRunHook, type FirstRunRow, type FirstRunUpsell, type FirstRunView } from "@/bridge";+import { CuaKey } from "@/components/cua-key";import { CuaLogo } from "@/components/cua-logo";-import { useAgentsStep, type AgentsStep } from "@/components/volume/use-agents-step";import { OsIcon } from "@/components/os-icon";-import { ExamplePrompts } from "@/components/onboarding-prompts";-import { ModeCard, ModeContinue, useModeChoice, type ModeChoice } from "@/components/onboarding-mode";-import { PresentationCards } from "@/components/onboarding-presentation";-import { pressPrimaryOnReturn } from "@/components/onboarding-keys";-import { SetUpLater } from "@/components/onboarding-skip";-import { SignInLink } from "@/components/sign-in-link";import { Button } from "@/components/ui/button";-import { Checkbox } from "@/components/ui/checkbox";-import { Switch } from "@/components/ui/switch";import { toast } from "@/components/ui/toast";-import { cn } from "@/lib/utils";import { RuntimeFixRow } from "@/components/new-space/runtime-fix";+import { cn } from "@/lib/utils";export const Route = createFileRoute("/onboarding/")({ component: OnboardingPage });-// The AI agents and Cua Volume cards load when their page shows.-const AgentsCard = lazy(() => import("@/components/volume/agents-step").then((m) => ({ default: m.AgentsCard })));-const DriveCardView = lazy(() => import("@/components/volume/drive-card").then((m) => ({ default: m.DriveCardView })));--/** Done's example prompts when the core doesn't send them (`OnboardingView.prompts` is the core's `PROMPTS`). */-const EXAMPLE_PROMPTS = [- "Open a Linux Space and run my test suite in it",- "Use my Space's browser to finish the checkout test and show me",- "Share this Space with a teammate as a viewer",-];--/** Sign in is optional: everything local works without an account. */-const NO_ACCOUNT_NEEDED = "No account needed to start.";-/**- * First run, laid out like the SwiftUI app's (`OnboardingView.swift`):- * Welcome centred, every other page in two columns, Back bottom-left, the- * page dots centred, Skip and the primary action bottom-right. Pages, copy,- * which buttons show and the answers come from the app core through- * `useOnboarding`; this file only places them.+ * The first run, the same on macOS, Windows and Linux: connect your agent,+ * then "Your agent can use this Mac". Every word and state is the app+ * core's (`firstRun.view`, through `useFirstRun`); this file places them+ * beside the keycap art.*/function OnboardingPage() {- const flow = useOnboarding();+ const fr = useFirstRun();const navigate = useNavigate();- const { view } = flow;- useOnboardingVolume(flow);- const agents = useAgentsStep(view?.step === "agents");- // Host setup's form and the choice on This machine, which the footer's Continue shares.- const { data: session } = useSession();- const host = useThisMachine(session?.identity ?? null);- const choice = useModeChoice(flow, view, host);-- // Return with nothing focused (the window just opened, or focus is on the- // page itself) presses the primary button too.- useEffect(() => {- const onKey = (e: KeyboardEvent) => {- if (e.key !== "Enter" || e.defaultPrevented || e.isComposing || e.metaKey || e.ctrlKey || e.altKey || e.shiftKey) return;- if (e.target !== document.body && e.target !== document.documentElement) return;- const primary = document.querySelector<HTMLButtonElement>("[data-step] [data-onboarding-primary]:not(:disabled)");- if (!primary) return;- e.preventDefault();- primary.click();- };- document.addEventListener("keydown", onKey);- return () => document.removeEventListener("keydown", onKey);- }, []);+ const { view } = fr;const leave = () => {- flow.skip();+ fr.later();void navigate({ to: "/spaces" });};const finish = async () => {try {- await flow.finish();+ await fr.finish();await navigate({ to: "/spaces" });} catch (e) {toast("Couldn't finish setup", { description: e instanceof Error ? e.message : String(e) });}};- // A new page: focus moves to its heading, so a screen reader reads it- // and Return goes to the page (Welcome focuses Get started itself).- const step = view?.step;+ // A new screen: focus moves to its heading, so a screen reader reads it.useEffect(() => {- if (step && step !== "welcome") document.querySelector<HTMLElement>("[data-onboarding-heading]")?.focus();- }, [step]);-- // Hold the frame while the session loads, so the page never flashes empty.- if (!view) return <div className="h-full" aria-busy="true" />;+ document.querySelector<HTMLElement>("[data-onboarding-heading]")?.focus();+ }, [view.step]);return (- <div className="relative flex h-full flex-col" data-step={view.step} onKeyDown={pressPrimaryOnReturn}>- {view.step !== "done" ? <SetUpLater onClick={leave} /> : null}- <div className="flex min-h-0 flex-1 flex-col items-center justify-center overflow-y-auto px-10 py-6">- {view.step === "welcome" ? <Welcome flow={flow} view={view} /> : <Columns flow={flow} view={view} agents={agents} host={host} choice={choice} />}+ <div className="relative flex h-full flex-col overflow-hidden bg-[#F4F5F7] dark:bg-[#07080a]" data-step={view.step}>+ <Backdrop />+ <Art art={view.art} step={view.step} />+ <header className="relative z-30 flex shrink-0 items-center justify-between px-10 pt-[calc(var(--titlebar-height)+12px)] pb-2">+ <CuaWordmark />+ <button type="button" onClick={leave} className="text-[13px] text-muted-foreground hover:text-foreground" data-onboarding-later="">+ {view.later}+ </button>+ </header>+ <div className="relative z-10 flex min-h-0 flex-1 flex-col overflow-y-auto px-10 pb-6 [@media(min-width:1000px)]:pr-[42%]">+ {view.connect ? <Connect fr={fr} view={view} /> : null}+ {view.setup ? <Setup fr={fr} view={view} onFinish={() => void finish()} /> : null}</div>- <Footer flow={flow} view={view} agents={agents} host={host} choice={choice} onFinish={() => void finish()} />+ <Dots view={view} /></div>);}-/* ---- Welcome ----------------------------------------------------------------- */+function CuaWordmark() {+ return (+ <span className="flex items-center gap-1.5">+ <CuaLogo className="size-5" />+ <span className="font-display text-[17px] font-medium tracking-[-0.01em]">Cua</span>+ </span>+ );+}-function Welcome({ flow, view }: { flow: OnboardingHook; view: OnboardingView }) {- const { openExternal } = useSession();- const usage = view.usage;- // Welcome is on screen: the core counts the run now when this machine- // already showed the usage notice (else when Welcome is left).- const settingRead = Boolean(flow.state?.telemetry);- useEffect(() => {- if (settingRead) flow.send({ type: "welcome-shown" });- // Once per showing, after the setting was read.- // eslint-disable-next-line react-hooks/exhaustive-deps- }, [settingRead]);+/* ---- Step 1: connect your agent --------------------------------------------------- */++const MARKS: Record<string, string> = {+ "claude-code": "/onboarding/marks/mark-claude.svg",+ codex: "/onboarding/marks/mark-openai.svg",+ hermes: "/onboarding/marks/mark-hermes.svg",+ openclaw: "/onboarding/marks/mark-openclaw.svg",+};++function AgentMark({ agent, className }: { agent: string; className?: string }) {+ const src = MARKS[agent];+ if (!src) return <PlusIcon className={cn("size-4", className)} aria-hidden />;+ return <img src={src} alt="" aria-hidden className={cn("size-4 shrink-0 object-contain", agent !== "claude-code" && agent !== "openclaw" && "dark:invert", className)} draggable={false} />;+}++function Connect({ fr, view }: { fr: FirstRunHook; view: FirstRunView }) {+ const c = view.connect!;+ const [others, setOthers] = useState(false);+ const [before, after] = c.title.split(c.accent);return (- <div className="flex w-full max-w-[520px] flex-col items-center text-center">- {view.showMark ? <CuaLogo className="mb-6 size-14" /> : null}- <h1 className="text-[26px] font-semibold tracking-[-0.015em]">{view.title}</h1>- <p className="mt-2 text-[14px] text-muted-foreground">{view.lede}</p>- <Button size="lg" className="mt-8 min-w-36" autoFocus onClick={() => flow.send({ type: "start" })}>- {view.primaryLabel}- </Button>- <div className="mt-10 flex flex-col items-center gap-2.5">- {usage ? (- <label className="flex items-center gap-2.5 text-[13px]" title={usage.help ?? undefined}>- <Switch- checked={usage.on}- disabled={!usage.enabled}- onCheckedChange={(on) => flow.send({ type: "usage-data-toggled", on })}- data-testid="onboarding-share-usage"- />- {usage.label}- <span className="text-muted-foreground">{usage.on ? "On" : "Off"}</span>- </label>- ) : null}- {usage?.help ? <p className="text-xs text-muted-foreground">{usage.help}</p> : null}- {view.notice ? (- <p className="text-xs text-pretty text-muted-foreground">- {view.notice}{" "}- {view.noticeLinkLabel && view.noticeLinkUrl ? (- <button- type="button"- className="text-foreground underline-offset-2 hover:underline"- onClick={() => void openExternal(view.noticeLinkUrl!)}- >- {view.noticeLinkLabel}- </button>- ) : null}- </p>+ <div className="my-auto flex max-w-[620px] flex-col py-8" data-first-run="connect">+ <h1+ tabIndex={-1}+ data-onboarding-heading=""+ className="font-display text-[clamp(40px,6vw,64px)] leading-[1.02] font-semibold tracking-[-0.03em] text-balance outline-none"+ >+ {before}+ {after !== undefined ? (+ <>+ <span className="font-accent font-normal tracking-normal italic">{c.accent}</span>+ {after}+ </>) : null}+ </h1>+ <p className="mt-5 max-w-[520px] text-[16px] leading-relaxed text-muted-foreground">{c.lede}</p>+ <div className="mt-10">+ <Button+ size="lg"+ className="h-12 gap-2.5 rounded-full px-6 text-[15px]"+ data-onboarding-primary=""+ data-first-run-connect={c.agent.agent}+ disabled={Boolean(c.busy)}+ autoFocus+ onClick={() => void fr.connect()}+ >+ <AgentMark agent={c.agent.agent} className={c.agent.agent === "claude-code" ? "" : "invert dark:invert-0"} />+ {c.busy ?? c.primary.label}+ </Button></div>+ {c.error ? (+ <p role="alert" className="mt-3 text-[13px] text-destructive">+ {c.error}+ </p>+ ) : null}+ <p className="mt-6 flex flex-wrap items-center gap-x-2 text-[13px]">+ <span>{c.note}</span>+ <span className="text-muted-foreground">{c.noteMore}</span>+ </p>+ <div className="mt-8 flex flex-wrap items-center gap-x-5 gap-y-2 text-[13px]">+ <span className="text-muted-foreground">{c.orLabel}</span>+ {c.others.map((o) => (+ <button+ key={o.agent}+ type="button"+ className="flex items-center gap-1.5 hover:underline disabled:opacity-50"+ disabled={Boolean(c.busy)}+ data-first-run-other={o.agent}+ onClick={() => void fr.connect(o.agent)}+ >+ <AgentMark agent={o.agent} />+ {o.name}+ </button>+ ))}+ <button type="button" className="flex items-center gap-1.5 hover:underline" aria-expanded={others} onClick={() => setOthers((v) => !v)}>+ <PlusIcon className="size-3.5" aria-hidden />+ {c.otherLabel}+ </button>+ </div>+ {others ? <OtherAgents fr={fr} known={[c.agent.agent, ...c.others.map((o) => o.agent)]} /> : null}</div>);}-/* ---- Two-column pages --------------------------------------------------------- */+/** "Other": every other agent the setup knows, installed ones first. */+function OtherAgents({ fr, known }: { fr: FirstRunHook; known: string[] }) {+ const rest = fr.agents.filter((a) => !known.includes(a.agent)).sort((a, b) => Number(b.installed) - Number(a.installed));+ return (+ <div className="mt-4 max-w-[520px] rounded-xl border bg-card p-1.5" data-first-run-others="">+ {rest.length === 0 ? <p className="px-3 py-2 text-[13px] text-muted-foreground">No other agents found on this computer.</p> : null}+ {rest.map((a) => (+ <div key={a.agent} className="flex items-center justify-between gap-3 px-3 py-1.5">+ <div className="min-w-0">+ <div className="text-[13px] font-medium">{a.name}</div>+ <div className="truncate text-xs text-muted-foreground">{a.installed ? (a.configured ? "Already uses Cua" : "Installed") : "Not installed"}</div>+ </div>+ <Button variant="outline" size="sm" disabled={!a.installed} onClick={() => void fr.connect(a.agent)}>+ Connect+ </Button>+ </div>+ ))}+ </div>+ );+}-type HostSetup = ReturnType<typeof useThisMachine>;+/* ---- Step 2: your agent can use this Mac ------------------------------------------- */-function Columns({- flow,- view,- agents,- host,- choice,-}: {- flow: OnboardingHook;- view: OnboardingView;- agents: AgentsStep;- host: HostSetup;- choice: ModeChoice;-}) {- const settingUpHost = view.step === "mode" && host.formView !== null;- // Leaving the page (Back) leaves the form too.- const formOpen = host.form !== null;- useEffect(() => {- if (view.step !== "mode" && formOpen) host.closeForm();- // eslint-disable-next-line react-hooks/exhaustive-deps- }, [view.step, formOpen]);+function Setup({ fr, view, onFinish }: { fr: FirstRunHook; view: FirstRunView; onFinish: () => void }) {+ const s = view.setup!;+ const [copied, setCopied] = useState(false);+ const copy = async () => {+ await fr.copyPrompt();+ setCopied(true);+ setTimeout(() => setCopied(false), 1500);+ };return (- <div className="w-full max-w-[860px]">- <div className="grid grid-cols-[minmax(0,1fr)_minmax(0,1.1fr)] items-center gap-14">- <div>- <h1 tabIndex={-1} data-onboarding-heading="" className="text-[22px] font-semibold tracking-[-0.01em] outline-none">- {view.title}- </h1>- <p className="mt-2 text-[14px] text-muted-foreground">{view.lede}</p>- {view.step === "signin" ? <SignInAside flow={flow} /> : null}- </div>- <div>- {view.step === "signin" ? <SignInCard flow={flow} /> : null}- {view.step === "agents" ? (- <Card>- <Suspense fallback={<p className="text-[13px] text-muted-foreground">{agents.copy.agentsLooking}</p>}>- <AgentsCard step={agents} />- </Suspense>- </Card>- ) : null}- {view.step === "presentation" ? <PresentationCards flow={flow} view={view} /> : null}- {view.step === "drive" && view.drive ? (- <Card>- <Suspense fallback={null}>- <DriveCardView- card={view.drive}- act={{- toggle: (on) => flow.send({ type: "drive-toggled", on }),- chooseStorage: (choice) => flow.send({ type: "storage-chosen", choice }),- storage: (action) => flow.send({ type: "drive-storage", action }),- }}- />- </Suspense>- </Card>- ) : null}- {view.step === "mode" ? <ModeCard flow={flow} view={view} host={host} choice={choice} /> : null}- {view.step === "done" ? <DoneCard view={view} flow={flow} /> : null}- </div>+ <div className="my-auto flex max-w-[600px] flex-col py-6" data-first-run="setup">+ <h1 tabIndex={-1} data-onboarding-heading="" className="font-display text-[clamp(32px,4.4vw,48px)] leading-[1.05] font-semibold tracking-[-0.03em] outline-none" role="status">+ {s.title}+ </h1>+ <Card className="mt-7 divide-y p-0">+ {s.rows.map((r) => (+ <Row key={r.id} row={r} onAct={() => void fr.act(r.action!.id, r.settingsUrl)} />+ ))}+ </Card>++ <h2 className="mt-7 text-[14px] font-semibold">{s.prompt.heading}</h2>+ {s.prompt.copy ? (+ <Card className="mt-2 flex items-center justify-between gap-3 py-2.5 pr-2.5">+ <span className="min-w-0 text-[14px] select-text">“{s.prompt.text}”</span>+ <Button variant="outline" size="sm" className="shrink-0 gap-1.5 rounded-full" onClick={() => void copy()} data-first-run-copy="">+ {copied ? <CheckIcon className="size-3.5" /> : <CopyIcon className="size-3.5" />}+ {copied ? "Copied" : s.prompt.copy}+ </Button>+ </Card>+ ) : (+ <p className="mt-1.5 text-[14px] select-text">“{s.prompt.text}”</p>+ )}+ <p className="mt-2 text-[13px] text-muted-foreground">{s.prompt.note}</p>++ <ExtraCard extra={s.extra} fr={fr} />+ {s.upsell ? <UpsellCard card={s.upsell} fr={fr} /> : null}++ <div className="mt-8 flex items-center gap-4">+ <Button+ size="lg"+ variant={s.primary.id === "done" ? "default" : "outline"}+ className="h-11 min-w-28 rounded-full px-6 text-[15px]"+ disabled={!s.primary.enabled}+ data-onboarding-primary=""+ data-first-run-primary={s.primary.id}+ onClick={onFinish}+ >+ {s.primary.label}+ </Button>+ {s.primary.note ? <span className="text-[13px] text-muted-foreground">{s.primary.note}</span> : null}</div>- {/* Only hosts need Screen Recording and Accessibility (the core's host setup). */}- {settingUpHost && (flow.permissions.length > 0 || flow.grantedPermissions.length > 0) ? <Permissions flow={flow} /> : null}- {view.step === "done" ? <ExamplePrompts prompts={view.prompts ?? EXAMPLE_PROMPTS} /> : null}- {view.step === "done" ? <FirstSpace images={flow.images} /> : null}+ {view.setup && !fr.saved.usedAtMs ? (+ <button type="button" onClick={fr.back} className="mt-5 self-start text-xs text-muted-foreground hover:text-foreground">+ Use a different agent+ </button>+ ) : null}</div>);}-function Card({ children, className, ...rest }: { children: ReactNode; className?: string } & Record<`data-${string}`, string>) {+function Card({ children, className, ...rest }: { children: ReactNode; className?: string } & Record<`data-${string}`, string | undefined>) {return (- <div className={cn("rounded-xl border bg-card px-5 py-4 shadow-xs", className)} {...rest}>+ <div className={cn("rounded-2xl border bg-card px-5 py-4 shadow-xs", className)} {...rest}>{children}</div>);}-function SignInAside({ flow }: { flow: OnboardingHook }) {- const { openExternal } = useSession();+function StateIcon({ state }: { state: FirstRunRow["state"] | "later" }) {+ if (state === "ok")+ return (+ <span className="flex size-5 shrink-0 items-center justify-center rounded-full bg-[#1f9d55] text-white" aria-label="Done">+ <CheckIcon className="size-3" strokeWidth={3} />+ </span>+ );+ if (state === "fix") return <span className="size-5 shrink-0 rounded-full border-[5px] border-[#d18a12]" aria-label="Needs a fix" />;+ if (state === "later") return <span className="size-5 shrink-0 rounded-full border border-dashed border-foreground/40" aria-hidden />;+ return <span className="size-5 shrink-0 animate-spin rounded-full border-2 border-foreground/15 border-t-foreground/60" aria-label="Checking" />;+}++function Row({ row, onAct }: { row: FirstRunRow; onAct: () => void }) {return (- <>- <p className="mt-4 text-[13px]">{NO_ACCOUNT_NEEDED}</p>- <p className="mt-3 text-xs text-muted-foreground">- {flow.copy.teams} ·{" "}- <button type="button" className="text-foreground underline-offset-2 hover:underline" onClick={() => void openExternal(flow.copy.teamsUrl)}>- {flow.copy.teamsLink}- </button>- </p>- </>+ <div className="flex items-center gap-3.5 px-5 py-3.5" data-first-run-row={row.id} data-state={row.state}>+ <StateIcon state={row.state} />+ <div className="min-w-0 flex-1">+ <div className="text-[14px] font-medium">{row.title}</div>+ <div className="text-[13px] text-muted-foreground">{row.note}</div>+ </div>+ {row.action ? (+ <Button size="sm" variant={row.action.id === "restart-check" ? "outline" : "default"} className="shrink-0 rounded-full" onClick={onAct} data-first-run-action={row.action.id}>+ {row.action.label}+ </Button>+ ) : null}+ </div>);}-function SignInCard({ flow }: { flow: OnboardingHook }) {- const { data: session, signOut, cancelSignIn, openExternal } = useSession();- const phase = session?.signIn.kind ?? "idle";- if (flow.state?.identity) {- return (- <Card className="flex items-center justify-between gap-4">- <span className="min-w-0 truncate text-[13px]">{flow.signInText}</span>- {session?.fleet.authMode === "user" ? (- <Button variant="ghost" size="sm" onClick={() => void signOut()}>- Sign out- </Button>- ) : null}- </Card>- );- }- if (phase === "starting" || phase === "waiting") {- // The code to confirm, the page to open again if the tab was closed,- // and a way out (it also times out by itself).- const url = session?.signInUrl;+function ExtraCard({ extra, fr }: { extra: FirstRunExtraView; fr: FirstRunHook }) {+ const act = (id: string) => void fr.extra(id);+ if (extra.phase === "choose") {return (- <Card data-signin="waiting">- <p className="text-[13px] text-muted-foreground select-text" role="status">- {phase === "starting" ? flow.copy.signInWaiting : flow.signInText}- </p>- {url ? <SignInLink url={url} /> : null}- <div className="mt-3 flex items-center gap-3 text-xs">- {url ? (+ <Card className="mt-6 border-dashed bg-card/60" data-first-run-extra="choose">+ <div className="flex items-baseline gap-2">+ <h2 className="text-[15px] font-semibold">{extra.title}</h2>+ {extra.tag ? <span className="text-[13px] text-muted-foreground">{extra.tag}</span> : null}+ </div>+ <p className="mt-1 text-[13px] text-muted-foreground">{extra.note}</p>+ <div className="mt-3 flex flex-wrap items-stretch gap-2.5">+ {extra.choices.map((c) => (<button+ key={c.os}type="button"- className="text-foreground underline-offset-2 hover:underline"- onClick={() => void openExternal(url)}- data-signin-reopen=""+ disabled={c.blocked !== null}+ title={c.blocked ?? undefined}+ onClick={() => act(c.os)}+ data-first-run-extra-choice={c.os}+ className="flex min-w-44 items-start gap-2.5 rounded-xl border px-3.5 py-2.5 text-left hover:bg-foreground/[0.03] disabled:cursor-not-allowed disabled:opacity-60">- Open the browser again+ <OsIcon os={c.os as "macos" | "linux"} className="mt-0.5 size-4 shrink-0" />+ <span className="min-w-0">+ <span className="block text-[14px] font-medium">{c.label}</span>+ <span className="block text-xs text-muted-foreground">{c.blocked ?? c.detail}</span>+ </span>+ </button>+ ))}+ {extra.action ? (+ <button type="button" className="px-2 text-[14px] font-medium underline decoration-foreground/25 underline-offset-4" onClick={() => act(extra.action!.id)}>+ {extra.action.label}</button>) : null}- <button- type="button"- className="text-muted-foreground underline-offset-2 hover:text-foreground hover:underline"- onClick={() => cancelSignIn()}- data-signin-cancel=""- >- Cancel- </button></div>+ {/* Windows without Docker Desktop: install or start it from here, and the choices follow. */}+ {extra.choices.some((c) => c.blocked !== null) ? <RuntimeFixRow /> : null}</Card>);}- if (phase === "failed") {- return (- <Card data-signin="failed">- <p className="text-[13px] text-destructive" role="alert">- {flow.signInText}- </p>- </Card>- );- }- return null;-}--/** Explainers only: the grant itself is macOS's, in System Settings. */-function Permissions({ flow }: { flow: OnboardingHook }) {- const { openExternal } = useSession();+ const icon = extra.phase === "ready" ? "ok" : extra.phase === "failed" ? "fix" : extra.phase === "not-now" ? "later" : "checking";return (- <section className="mt-10" aria-labelledby="onboarding-permissions">- <h2 id="onboarding-permissions" className="mb-1 text-[13px] font-semibold">- {flow.copy.permissionsTitle}- </h2>- <p className="mb-3 text-xs text-muted-foreground">macOS asks for each one itself. Cua Spaces can't turn them on for you.</p>- <Card className="divide-y p-0">- {flow.grantedPermissions.map((p) => (- <div key={p.id} className="flex items-center justify-between gap-6 px-4 py-3" data-granted="true">- <div className="text-[13px]">{p.title}</div>- <span className="text-xs text-muted-foreground" aria-label={`${p.title} granted`}>- ✓ Granted- </span>- </div>- ))}- {flow.permissions.map((p) => {- const url = p.settingsUrl?.startsWith("x-apple.systempreferences:") ? p.settingsUrl : null;- return (- <div key={p.id} className="flex items-center justify-between gap-6 px-4 py-3">- <div className="min-w-0">- <div className="text-[13px]">{p.title}</div>- {p.help ? <div className="mt-0.5 text-xs text-muted-foreground">{p.help}</div> : null}- </div>- {url ? (- <Button variant="outline" size="sm" onClick={() => void openExternal(url)}>- {flow.copy.openSettings}- </Button>- ) : null}+ <Card className="mt-6" data-first-run-extra={extra.phase}>+ <div className="flex items-start gap-3.5">+ <span className="mt-0.5 flex">+ <StateIcon state={icon} />+ </span>+ <div className="min-w-0 flex-1">+ <h2 className="text-[15px] font-semibold">{extra.title}</h2>+ <p className={cn("text-[13px] text-muted-foreground", extra.phase === "failed" && "text-destructive")}>{extra.note}</p>+ {extra.phase === "creating" ? (+ <div+ className="mt-2 h-1 max-w-[400px] overflow-hidden rounded-full bg-foreground/10"+ role="progressbar"+ aria-label={extra.title}+ aria-valuenow={extra.fraction === null ? undefined : Math.round(extra.fraction * 100)}+ >+ <div className={cn("h-full rounded-full bg-brand", extra.fraction === null && "w-1/4 animate-pulse")} style={extra.fraction === null ? undefined : { width: `${Math.max(2, extra.fraction * 100)}%` }} /></div>- );- })}- </Card>- </section>+ ) : null}+ {extra.footnote ? <p className="mt-2.5 text-[13px] text-muted-foreground">{extra.footnote}</p> : null}+ </div>+ {extra.action ? (+ <Button variant="outline" size="sm" className="shrink-0 rounded-full" onClick={() => act(extra.action!.id)} data-first-run-extra-action={extra.action.id}>+ {extra.action.label}+ </Button>+ ) : null}+ </div>+ </Card>);}-function DoneCard({ view, flow }: { view: OnboardingView; flow: OnboardingHook }) {- // "Launch at login", where the host applies it (the SwiftUI app's Done has it too).- const login = flow.launchAtLogin;- const todos = view.todos ?? [];+function UpsellCard({ card, fr }: { card: FirstRunUpsell; fr: FirstRunHook }) {+ useEffect(() => {+ // Counted once per showing.+ fr.upsell("shown");+ // eslint-disable-next-line react-hooks/exhaustive-deps+ }, [card.plan]);return (- <Card>- {todos.length ? (- <ul className="-mx-1 mb-3 flex flex-col divide-y" data-onboarding-todos="">- {todos.map((t) => (- <li key={t.id} className="flex items-center gap-3 px-1 py-2.5" data-onboarding-todo={t.id} data-done={t.done ? "" : undefined}>- <span- aria-hidden- className={cn(- "flex size-5 shrink-0 items-center justify-center rounded-full border",- t.done ? "border-brand bg-brand text-white" : "border-foreground/20",- )}- >- {t.done ? <CheckIcon className="size-3" strokeWidth={3} /> : null}- </span>- <div className="min-w-0 flex-1">- <p className={cn("text-[13px] font-medium", t.done && "text-muted-foreground")}>- {t.title}- <span className="sr-only">{t.done ? " (done)" : ""}</span>- {t.optional && !t.done ? <span className="font-normal text-muted-foreground"> (optional)</span> : null}- </p>- <p className="text-xs text-muted-foreground">{t.note}</p>- </div>- {t.action ? (- <Button variant="outline" size="sm" className="shrink-0" onClick={() => void flow.fixTodo(t.id)}>- {t.action}- </Button>- ) : null}- </li>+ <Card className="mt-4" data-first-run-upsell={card.plan}>+ <div className="flex items-start gap-3">+ <CuaKey size={20} className="mt-0.5" />+ <div className="min-w-0 flex-1">+ <h2 className="text-[15px] font-semibold">{card.title}</h2>+ {card.lines.map((l) => (+ <p key={l} className="text-[13px] text-muted-foreground">+ {l}+ </p>))}- </ul>- ) : null}- <dl className="grid grid-cols-[auto_minmax(0,1fr)] gap-x-6 gap-y-1.5 text-[13px]">- {view.summary.map((f) => (- <div key={f.label} className="contents">- <dt className="text-muted-foreground">{f.label}</dt>- <dd>{f.value}</dd>+ <div className="mt-3 flex items-center gap-2">+ <span className="flex-1 text-[14px] font-medium">{card.price}</span>+ <Button size="sm" className="rounded-full" onClick={() => fr.upsell("click")} data-first-run-upsell-cta="">+ {card.cta.label}+ </Button>+ <Button variant="outline" size="sm" className="rounded-full" onClick={() => fr.upsell("dismiss")} data-first-run-upsell-dismiss="">+ {card.dismiss}+ </Button></div>- ))}- </dl>- {login ? (- <div className="mt-4 flex flex-col gap-1">- <label className="flex items-center gap-2.5 text-[13px]">- <Checkbox- checked={login.checked}- onCheckedChange={(on) => flow.send({ type: "launch-at-login-toggled", on: Boolean(on) })}- data-onboarding-launch-at-login=""- />- {login.label}- </label>- {login.note ? <p className="pl-[26px] text-xs text-muted-foreground">{login.note}</p> : null}</div>- ) : null}+ </div></Card>);}-function FirstSpace({ images }: { images: SandboxImage[] }) {- const { createSpace } = useSpaces();- // What this machine can create: the Spaces page's one-click rule (no- // macOS off an Apple silicon Mac, nothing without a runtime).- const first = useFirstSpaceOffers();- const [started, setStarted] = useState<SandboxImage | null>(null);- const create = (image: SandboxImage) => {- setStarted(image);- // The hosts' create needs the kind (Electron and the SwiftUI bridge- // reject a config without one), as New Space's plan sends it.- createSpace({ image: image.ref, kind: image.variant, os: image.os }).catch((e: unknown) => {- setStarted(null);- toast(`Couldn't create ${image.name}`, { description: e instanceof Error ? e.message : String(e) });- });- };+/* ---- Art and chrome ------------------------------------------------------------------- */++/** Light: a plain field with far keys. Dark: the starfield, darker on the text side. */+function Backdrop() {return (- <section className="mt-10" aria-labelledby="onboarding-first-space">- <h2 id="onboarding-first-space" className="mb-1 text-[13px] font-semibold">- Create your first Space- </h2>- <p className="mb-3 text-xs text-muted-foreground">- {started ? `Creating ${started.name}. It shows in Spaces when it's ready.` : "A separate desktop for an agent. You can also do this later."}- </p>- <ul className="grid grid-cols-3 gap-3">- {images.map((image) => {- const blocked = first.blockedReason(image.ref);- return (- <li key={image.ref}>- <Card className="flex items-center gap-3 px-4 py-3" data-first-space={image.os}>- <OsIcon os={image.os} className="size-4 shrink-0 text-muted-foreground" />- <div className="min-w-0 flex-1">- <div className="truncate text-[13px] font-medium">{image.name}</div>- <div className="truncate text-xs text-muted-foreground">{image.variant === "vm" ? "Virtual machine" : "Container"}</div>- {blocked ? (- <p data-first-space-blocked="" title={blocked} className="mt-0.5 line-clamp-2 text-xs text-destructive">- {blocked}- </p>- ) : null}- </div>- <Button variant="outline" size="sm" disabled={started !== null || !first.known || blocked !== null} onClick={() => create(image)}>- {started?.ref === image.ref ? "Creating…" : "Create"}- </Button>- </Card>- </li>- );- })}- </ul>- {/* Windows without Docker Desktop: install or start it from here, and the cards follow. */}- {images.some((image) => first.blockedReason(image.ref) !== null) ? <RuntimeFixRow /> : null}- {/* Nothing runs here (no runtime, virtualization off): another computer can run them. */}- {first.known && images.length > 0 && images.every((image) => first.blockedReason(image.ref) !== null) ? <AnotherComputer /> : null}- </section>+ <div aria-hidden className="pointer-events-none absolute inset-0">+ <div className="absolute inset-0 hidden bg-[url(/onboarding/sky.jpg)] bg-cover bg-center brightness-[1.7] contrast-[1.08] dark:block" />+ <div className="absolute inset-0 hidden bg-gradient-to-r from-black/70 via-black/35 to-transparent dark:block" />+ <img src="/onboarding/depth.webp" alt="" className="absolute inset-0 size-full object-cover opacity-90" draggable={false} />+ </div>);}-/** "Or run Spaces on another computer": Add a machine, from the last page. */-function AnotherComputer() {- const [adding, setAdding] = useState(false);- const { setupGuide } = useMachines();+/**+ * The keys beside the page: the agent's key, the blue key for this+ * computer (faded while it is checked or needs a fix) and, on step 2, a+ * small dashed outline for the optional extra Space that fills in while+ * one is being made.+ */+function Art({ art, step }: { art: FirstRunArt; step: FirstRunView["step"] }) {+ const agent = ["claude-code", "codex", "hermes", "openclaw"].includes(art.agent) ? art.agent.replace("claude-code", "claude") : "other";+ const connect = step === "connect";return (- <div data-first-space-elsewhere="" className="mt-3 flex items-center gap-3">- <p className="text-xs text-muted-foreground">Or run Spaces on another computer you use: add it here and create Spaces on it from this one.</p>- <Button variant="outline" size="sm" onClick={() => setAdding(true)}>- Add a machine- </Button>- <AddMachineDialog open={adding} onOpenChange={setAdding} guide={setupGuide} />+ <div aria-hidden className="pointer-events-none absolute inset-y-0 right-0 hidden w-[46%] [@media(min-width:1000px)]:block" data-first-run-art={`${art.agent} ${art.computer} ${art.extra}`}>+ <img+ src={`/onboarding/agent-${agent}.webp`}+ alt=""+ draggable={false}+ className={cn("absolute w-[56%] max-w-[420px] transition-all duration-500", connect ? "top-[30%] left-[4%]" : "top-[34%] left-[10%]")}+ />+ <img+ src="/onboarding/cua.webp"+ alt=""+ draggable={false}+ className={cn("absolute top-[12%] right-[6%] w-[40%] max-w-[300px] transition-all duration-500", art.computer === "faded" && "opacity-40 blur-[1px]")}+ />+ {art.extra !== "none" ? (+ <div className="absolute right-[12%] bottom-[10%] w-[24%] max-w-[190px]">+ {art.extra === "outline" ? (+ <SlotOutline />+ ) : (+ <img src="/onboarding/extra.webp" alt="" draggable={false} className={cn("w-full transition-opacity", art.extra === "filling" ? "animate-pulse opacity-40" : "opacity-95")} />+ )}+ </div>+ ) : null}</div>);}-/* ---- Footer ---------------------------------------------------------------------- */--function Footer({- flow,- view,- agents,- host,- choice,- onFinish,-}: {- flow: OnboardingHook;- view: OnboardingView;- agents: AgentsStep;- host: HostSetup;- choice: ModeChoice;- onFinish: () => void;-}) {+/** The Spaces key's outline, dashed: an extra Space that doesn't exist yet. */+function SlotOutline() {return (- <div className="relative flex h-16 shrink-0 items-center px-6 pb-2">- <div className="z-10">- {view.canBack && view.step !== "welcome" ? (- <Button variant="ghost" size="lg" onClick={() => flow.send({ type: "back" })}>- {flow.copy.back}- </Button>- ) : null}- </div>- <Dots view={view} />- <div className="z-10 ml-auto flex items-center gap-2">{view.step !== "welcome" ? <Trailing flow={flow} view={view} agents={agents} host={host} choice={choice} onFinish={onFinish} /> : null}</div>- </div>+ <svg viewBox="0 0 486 470" className="w-full -rotate-6 text-foreground/35 dark:text-white/35">+ <polygon+ points="110,65 309,8 327,10 341,20 359,52 414,165 445,238 461,280 476,326 476,345 465,357 421,375 328,406 187,449 143,461 125,461 116,456 109,447 84,388 19,218 8,184 11,164 27,140 51,109 82,78 104,67"+ fill="currentColor"+ fillOpacity={0.05}+ stroke="currentColor"+ strokeWidth={4}+ strokeDasharray="14 16"+ strokeLinejoin="round"+ />+ </svg>);}-function Dots({ view }: { view: OnboardingView }) {- const current = view.dots.findIndex((d) => d.current);+function Dots({ view }: { view: FirstRunView }) {return (- <ol className="absolute inset-x-0 flex justify-center gap-2" aria-label={`Step ${current + 1} of ${view.dots.length}`}>- {view.dots.map((d) => (- <li- key={d.step}- title={d.label}- aria-current={d.current ? "step" : undefined}- className={cn("size-1.5 rounded-full bg-foreground/20", d.current && "bg-foreground/70")}- >- <span className="sr-only">{d.label}</span>- </li>+ <ol className="relative z-10 flex shrink-0 justify-center gap-2 pb-5" aria-label={`Step ${view.current + 1} of ${view.dots}`}>+ {Array.from({ length: view.dots }, (_, i) => (+ <li key={i} aria-current={i === view.current ? "step" : undefined} className={cn("h-0.5 w-6 rounded-full bg-foreground/20", i <= view.current && "bg-foreground/80")} />))}</ol>);}--function Trailing({- flow,- view,- agents,- host,- choice,- onFinish,-}: {- flow: OnboardingHook;- view: OnboardingView;- agents: AgentsStep;- host: HostSetup;- choice: ModeChoice;- onFinish: () => void;-}) {- const { data: session, signIn } = useSession();- const skip = view.canSkip ? (- <Button variant="ghost" size="lg" onClick={() => flow.send({ type: "signin-done" })}>- {flow.copy.skip}- </Button>- ) : null;-- switch (view.step) {- case "signin": {- if (flow.state?.identity) {- return (- <Button size="lg" data-onboarding-primary="" onClick={() => flow.send({ type: "signin-done" })}>- {view.primaryLabel}- </Button>- );- }- const phase = session?.signIn.kind ?? "idle";- const waiting = phase === "starting" || phase === "waiting";- return (- <>- {skip}- <Button- size="lg"- data-onboarding-primary=""- disabled={!session || waiting}- onClick={() => signIn().catch(() => {}) /* the failure shows on the page */}- >- {waiting ? flow.copy.signInWaiting : phase === "failed" ? flow.copy.tryAgain : flow.copy.signIn}- </Button>- </>- );- }- case "agents":- return (- <>- {agents.summaries ? null : (- <Button variant="ghost" size="lg" disabled={agents.busy} onClick={() => flow.send({ type: "agents-done", configured: [] })}>- {flow.copy.skip}- </Button>- )}- {agents.summaries ? (- <Button size="lg" data-onboarding-primary="" onClick={() => flow.send({ type: "agents-done", configured: agents.configured })}>- {view.primaryLabel}- </Button>- ) : (- <Button size="lg" data-onboarding-primary="" disabled={!agents.canSetUp} onClick={() => void agents.setUp()} data-agents-set-up="">- {agents.busy ? agents.copy.agentsSettingUp : agents.copy.agentsSetUp}- </Button>- )}- </>- );- case "presentation":- return (- <Button size="lg" data-onboarding-primary="" onClick={() => flow.send({ type: "presentation-done" })}>- {view.primaryLabel}- </Button>- );- case "drive":- return (- <Button- size="lg"- disabled={!view.drive || view.drive.busy || !view.drive.canContinue}- onClick={() => flow.send({ type: "drive-continue" })}- data-drive-continue=""- data-onboarding-primary=""- >- {view.primaryLabel}- </Button>- );- case "mode":- // The cards select; Continue (and Return) moves on.- return <ModeContinue view={view} host={host} choice={choice} />;- case "done":- return (- <Button size="lg" data-onboarding-primary="" onClick={onFinish}>- {view.primaryLabel}- </Button>- );- default:- // Welcome has its own button.- return null;- }-}diff --git a/apps/cua-spaces-web/src/routes/spaces/index.tsx b/apps/cua-spaces-web/src/routes/spaces/index.tsxindex 2ae18b986f..2f214a674c 100644--- a/apps/cua-spaces-web/src/routes/spaces/index.tsx+++ b/apps/cua-spaces-web/src/routes/spaces/index.tsx@@ -8,6 +8,7 @@ import { useEffect, useRef, useState, type DragEvent } from "react";import { emptyHome, useBridge, useFirstSpaceOffers, useMachines, useNewSpaceWizard, useSpaceAccess, useSpaceFiles, useSpaces, useSpaceThumbnail, useWindowDropTarget, type Space } from "@/bridge";import { EmptyHome } from "@/components/empty-home";import { GettingStarted } from "@/components/getting-started";+import { FirstRunTodosCard, useFirstRunTodosShown } from "@/components/first-run-todos";import { OsIcon } from "@/components/os-icon";import { EmptyState, Page, PageHeader } from "@/components/page";import { SpaceCanvas } from "@/components/space-canvas";@@ -49,6 +50,8 @@ function SpacesPage() {const shown = visibleSpaces(spaces, filter, (s) => matchesQuery(core, s, machineName(machines, s), query));const access = useSpaceAccess(spaces);const running = spaces.filter((s) => spaceState(s) === "running").length;+ // After the first run's Finish later, its to-do list stands in for the checklist.+ const firstRunTodos = useFirstRunTodosShown();return (<Page>@@ -61,7 +64,8 @@ function SpacesPage() {</Button>}/>- <GettingStarted />+ <FirstRunTodosCard />+ {firstRunTodos ? null : <GettingStarted />}<div className="mb-4 flex items-center gap-3"><Segmented aria-label="Filter by state" value={filter} options={FILTERS} onValueChange={setFilter} />{/* Find a Space by name, detail, id or machine (the SwiftUI sidebar's search). */}diff --git a/apps/cua-spaces/src/model/parity.test.ts b/apps/cua-spaces/src/model/parity.test.tsindex 41268e8b9a..c88c2337d9 100644--- a/apps/cua-spaces/src/model/parity.test.ts+++ b/apps/cua-spaces/src/model/parity.test.ts@@ -251,6 +251,7 @@ describe('app core parity flows (webview)', () => {'machines','checklist','create-stages',+ 'first-run',]);});diff --git a/libs/cua/crates/cua-spaces-app-core/parity/first-run.json b/libs/cua/crates/cua-spaces-app-core/parity/first-run.jsonnew file mode 100644index 0000000000..b88fc51c1f--- /dev/null+++ b/libs/cua/crates/cua-spaces-app-core/parity/first-run.json@@ -0,0 +1,37 @@+{+ "name": "first-run",+ "about": "The 0.10.0 first run, one screen state per storyboard frame (v2-01 to v2-09, 16, 17): connect your agent, then the agent and this computer checked, a first request that works on this computer, the optional extra Space (macOS first, never blocking Done), the plan card after the first success, and Home's to-do list after Finish later. Each case patches the base input; every app draws firstRun.view's words and must say the same.",+ "base": {+ "step": "setup",+ "hostOs": "macos",+ "agents": [+ { "agent": "claude-code", "name": "Claude Code", "installed": true, "configured": true },+ { "agent": "codex", "name": "Codex", "installed": true, "configured": false }+ ],+ "agent": "claude-code",+ "signedIn": true,+ "host": { "configured": true, "running": true, "online": true, "permissions": [{ "id": "accessibility", "granted": true }, { "id": "screen-recording", "granted": true }] },+ "offers": [+ { "os": "linux", "time": "about 2 min", "size": "1.2 GB download" },+ { "os": "macos", "time": "10 to 30 min the first time", "size": "22 GB download" }+ ],+ "extra": { "phase": "none" },+ "plan": { "metered": true, "plan": "free", "sessionsLimit": 2, "hoursLimit": 20, "accountApp": "https://app.cua.ai" }+ },+ "cases": [+ { "name": "01 connect", "patch": { "step": "connect", "agent": null } },+ { "name": "01 connect, only Codex installed", "patch": { "step": "connect", "agent": null, "agents": [{ "agent": "codex", "name": "Codex", "installed": true, "configured": false }] } },+ { "name": "02 checking", "patch": { "agents": null, "host": null } },+ { "name": "03 ready, choose", "patch": {} },+ { "name": "04 ready, creating macOS", "patch": { "extra": { "phase": "creating", "name": "macOS 1", "os": "macos", "detail": "Downloading macOS · 4.2 of 22.3 GB · 85 MB/s · about 4 min", "fraction": 0.19 } } },+ { "name": "05 restart the agent", "patch": { "agentOpenBeforeSetup": true, "extra": { "phase": "creating", "name": "macOS 1", "os": "macos", "detail": "Downloading macOS · 4.2 of 22.3 GB · 85 MB/s · about 4 min", "fraction": 0.19 } }, "todos": true },+ { "name": "06 let Cua control this Mac", "patch": { "host": { "configured": true, "running": true, "online": true, "permissions": [{ "id": "accessibility", "granted": false, "settingsUrl": "x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility" }] } }, "todos": true },+ { "name": "07 sign in", "patch": { "signedIn": false, "host": { "configured": false, "running": false, "permissions": [] } }, "todos": true },+ { "name": "08 first success, not now", "patch": { "agentUsedAt": "18:12", "extra": { "phase": "not-now" }, "plan": { "metered": true, "plan": "free", "dismissed": true } } },+ { "name": "16 first success, Pro card", "patch": { "agentUsedAt": "18:12", "extra": { "phase": "not-now" } } },+ { "name": "17 first success, Teams card", "patch": { "agentUsedAt": "18:12", "extra": { "phase": "not-now" }, "plan": { "metered": true, "plan": "free", "teammates": true, "accountApp": "https://app.cua.ai" } } },+ { "name": "macOS made, ready", "patch": { "agentUsedAt": "18:12", "extra": { "phase": "ready", "name": "macOS 1", "os": "macos" }, "plan": { "metered": true, "plan": "pro" } }, "todos": true },+ { "name": "an Intel Mac: Linux only", "patch": { "offers": [{ "os": "linux", "time": "about 2 min" }, { "os": "macos", "time": "10 to 30 min the first time", "blocked": "This Mac can't run macOS Spaces: they need Apple silicon." }] } },+ { "name": "a Windows PC", "patch": { "hostOs": "windows", "host": { "configured": true, "running": true, "online": true, "permissions": [] }, "offers": [{ "os": "linux", "time": "about 2 min" }] } }+ ]+}diff --git a/libs/cua/crates/cua-spaces-app-core/parity/golden/first-run.json b/libs/cua/crates/cua-spaces-app-core/parity/golden/first-run.jsonnew file mode 100644index 0000000000..445d02e342--- /dev/null+++ b/libs/cua/crates/cua-spaces-app-core/parity/golden/first-run.json@@ -0,0 +1,369 @@+{+ "flow": "first-run",+ "frames": [+ {+ "art": "claude-code on none",+ "case": "01 connect",+ "connect": {+ "lede": "Connect your agents and give them computers to work on: macOS, Linux or Windows, right here on this Mac.",+ "note": "Your agent will use this Mac. You can add a separate Space later.",+ "others": "Codex, Hermes, OpenClaw",+ "primary": "connect:Connect Claude Code",+ "title": "A shared Space for every agent."+ },+ "step": "connect"+ },+ {+ "art": "codex on none",+ "case": "01 connect, only Codex installed",+ "connect": {+ "lede": "Connect your agents and give them computers to work on: macOS, Linux or Windows, right here on this Mac.",+ "note": "Your agent will use this Mac. You can add a separate Space later.",+ "others": "Claude Code, Hermes, OpenClaw",+ "primary": "connect:Connect Codex",+ "title": "A shared Space for every agent."+ },+ "step": "connect"+ },+ {+ "art": "claude-code faded outline",+ "case": "02 checking",+ "setup": {+ "extra": {+ "action": "not-now:Not now",+ "choices": [+ "macOS: 22 GB download · 10 to 30 min the first time",+ "Linux: Ready in about 2 min"+ ],+ "footnote": null,+ "note": "A fresh computer inside this Mac, so your agent can't touch your files or your mouse.",+ "phase": "choose",+ "title": "Give your agent its own Space"+ },+ "primary": "done:Done (off)",+ "prompt": "Try this in Claude Code: List my computers and tell me what's on this Mac / This works now, on this Mac.",+ "rows": [+ "[checking] Claude Code — Checking that it can use Cua…",+ "[checking] This Mac — Checking that your agent can use it…"+ ],+ "title": "Checking your setup.",+ "upsell": null+ },+ "step": "setup"+ },+ {+ "art": "claude-code on outline",+ "case": "03 ready, choose",+ "setup": {+ "extra": {+ "action": "not-now:Not now",+ "choices": [+ "macOS: 22 GB download · 10 to 30 min the first time",+ "Linux: Ready in about 2 min"+ ],+ "footnote": null,+ "note": "A fresh computer inside this Mac, so your agent can't touch your files or your mouse.",+ "phase": "choose",+ "title": "Give your agent its own Space"+ },+ "primary": "done:Done",+ "prompt": "Try this in Claude Code: List my computers and tell me what's on this Mac / This works now, on this Mac.",+ "rows": [+ "[ok] Claude Code can use Cua — We added Cua to Claude Code's settings. If Claude Code was already open, restart it.",+ "[ok] This Mac is your first Space — Ready now. Your agent can see the screen, click and type."+ ],+ "title": "Your agent can use this Mac.",+ "upsell": null+ },+ "step": "setup"+ },+ {+ "art": "claude-code on filling",+ "case": "04 ready, creating macOS",+ "setup": {+ "extra": {+ "action": "cancel:Cancel",+ "choices": [],+ "footnote": "You can press Done now. We'll let you know when it's ready.",+ "note": "Downloading macOS · 4.2 of 22.3 GB · 85 MB/s · about 4 min",+ "phase": "creating",+ "title": "Making macOS 1 in the background"+ },+ "primary": "done:Done",+ "prompt": "Try this in Claude Code: List my computers and tell me what's on this Mac / This works now, on this Mac.",+ "rows": [+ "[ok] Claude Code can use Cua — We added Cua to Claude Code's settings. If Claude Code was already open, restart it.",+ "[ok] This Mac is your first Space — Ready now. Your agent can see the screen, click and type."+ ],+ "title": "Your agent can use this Mac.",+ "upsell": null+ },+ "step": "setup"+ },+ {+ "art": "claude-code on filling",+ "case": "05 restart the agent",+ "setup": {+ "extra": {+ "action": "cancel:Cancel",+ "choices": [],+ "footnote": "You can press Done now. We'll let you know when it's ready.",+ "note": "Downloading macOS · 4.2 of 22.3 GB · 85 MB/s · about 4 min",+ "phase": "creating",+ "title": "Making macOS 1 in the background"+ },+ "primary": "finish-later:Finish later",+ "prompt": "Try this in Claude Code: List my computers and tell me what's on this Mac / This works now, on this Mac.",+ "rows": [+ "[fix] Restart Claude Code — It was open when we added Cua. Close it, then open it again. (restart-check:Check again)",+ "[ok] This Mac is your first Space — Ready now. Your agent can see the screen, click and type."+ ],+ "title": "One step left.",+ "upsell": null+ },+ "step": "setup",+ "todos": {+ "complete": false,+ "items": [+ "[ ] Restart Claude Code — It was open when we added Cua. Close it, then open it again. (restart-check:Check again)",+ "[x] Make this Mac your first Space — Ready now. Your agent can see the screen, click and type.",+ "[ ] Try your first request — Ask Claude Code: “List my computers and tell me what's on this Mac” (copy:Copy)",+ "[x] Give your agent its own Space (optional) — A fresh computer inside this Mac, away from your files and your mouse.",+ "[x] Sign in — Signed in to Cua."+ ],+ "lede": "A couple of things are left.",+ "progress": "3 of 5 done"+ }+ },+ {+ "art": "claude-code faded outline",+ "case": "06 let Cua control this Mac",+ "setup": {+ "extra": {+ "action": "not-now:Not now",+ "choices": [+ "macOS: 22 GB download · 10 to 30 min the first time",+ "Linux: Ready in about 2 min"+ ],+ "footnote": null,+ "note": "A fresh computer inside this Mac, so your agent can't touch your files or your mouse.",+ "phase": "choose",+ "title": "Give your agent its own Space"+ },+ "primary": "finish-later:Finish later",+ "prompt": "Try this in Claude Code: List my computers and tell me what's on this Mac / This works now, on this Mac.",+ "rows": [+ "[ok] Claude Code can use Cua — We added Cua to Claude Code's settings. If Claude Code was already open, restart it.",+ "[fix] Let Cua control this Mac — So your agent can click and type. macOS asks you once. (open-settings:Open Settings)"+ ],+ "title": "One step left.",+ "upsell": null+ },+ "step": "setup",+ "todos": {+ "complete": false,+ "items": [+ "[x] Connect Claude Code — Claude Code can use Cua.",+ "[ ] Let Cua control this Mac — So your agent can click and type. macOS asks you once. (open-settings:Open Settings)",+ "[ ] Try your first request — Ask Claude Code: “List my computers and tell me what's on this Mac” (copy:Copy)",+ "[ ] Give your agent its own Space (optional) — A fresh computer inside this Mac, away from your files and your mouse. (add:Add a Space)",+ "[x] Sign in — Signed in to Cua."+ ],+ "lede": "Claude Code is connected. A couple of things are left.",+ "progress": "2 of 5 done"+ }+ },+ {+ "art": "claude-code faded outline",+ "case": "07 sign in",+ "setup": {+ "extra": {+ "action": "not-now:Not now",+ "choices": [+ "macOS: 22 GB download · 10 to 30 min the first time",+ "Linux: Ready in about 2 min"+ ],+ "footnote": null,+ "note": "A fresh computer inside this Mac, so your agent can't touch your files or your mouse.",+ "phase": "choose",+ "title": "Give your agent its own Space"+ },+ "primary": "finish-later:Finish later",+ "prompt": "Try this in Claude Code: List my computers and tell me what's on this Mac / This works now, on this Mac.",+ "rows": [+ "[ok] Claude Code can use Cua — We added Cua to Claude Code's settings. If Claude Code was already open, restart it.",+ "[fix] Sign in to Cua — So your agent can find this Mac and your other computers. (sign-in:Sign in)"+ ],+ "title": "One step left.",+ "upsell": null+ },+ "step": "setup",+ "todos": {+ "complete": false,+ "items": [+ "[x] Connect Claude Code — Claude Code can use Cua.",+ "[ ] Make this Mac your first Space — After you sign in.",+ "[ ] Try your first request — Ask Claude Code: “List my computers and tell me what's on this Mac” (copy:Copy)",+ "[ ] Give your agent its own Space (optional) — A fresh computer inside this Mac, away from your files and your mouse. (add:Add a Space)",+ "[ ] Sign in — So your agent can find this Mac and your other computers. (sign-in:Sign in)"+ ],+ "lede": "Claude Code is connected. A couple of things are left.",+ "progress": "1 of 5 done"+ }+ },+ {+ "art": "claude-code on none",+ "case": "08 first success, not now",+ "setup": {+ "extra": {+ "action": "add:Add a Space",+ "choices": [],+ "footnote": null,+ "note": "Add one from Home whenever you like.",+ "phase": "not-now",+ "title": "No extra Space for now"+ },+ "primary": "done:Done",+ "prompt": "You asked Claude Code: List my computers and tell me what's on this Mac / It answered in Claude Code. Ask it anything else.",+ "rows": [+ "[ok] Claude Code can use Cua — It used Cua at 18:12.",+ "[ok] This Mac is your first Space — Ready now. Your agent can see the screen, click and type."+ ],+ "title": "Your agent can use this Mac.",+ "upsell": null+ },+ "step": "setup"+ },+ {+ "art": "claude-code on none",+ "case": "16 first success, Pro card",+ "setup": {+ "extra": {+ "action": "add:Add a Space",+ "choices": [],+ "footnote": null,+ "note": "Add one from Home whenever you like.",+ "phase": "not-now",+ "title": "No extra Space for now"+ },+ "primary": "done:Done",+ "prompt": "You asked Claude Code: List my computers and tell me what's on this Mac / It answered in Claude Code. Ask it anything else.",+ "rows": [+ "[ok] Claude Code can use Cua — It used Cua at 18:12.",+ "[ok] This Mac is your first Space — Ready now. Your agent can see the screen, click and type."+ ],+ "title": "Your agent can use this Mac.",+ "upsell": "pro | More remote hours with Pro | Free: 20 remote hours a month · 2 connections at once / Pro: 200 remote hours a month · 5 connections at once | $18 a month | upsell:Try Pro"+ },+ "step": "setup"+ },+ {+ "art": "claude-code on none",+ "case": "17 first success, Teams card",+ "setup": {+ "extra": {+ "action": "add:Add a Space",+ "choices": [],+ "footnote": null,+ "note": "Add one from Home whenever you like.",+ "phase": "not-now",+ "title": "No extra Space for now"+ },+ "primary": "done:Done",+ "prompt": "You asked Claude Code: List my computers and tell me what's on this Mac / It answered in Claude Code. Ask it anything else.",+ "rows": [+ "[ok] Claude Code can use Cua — It used Cua at 18:12.",+ "[ok] This Mac is your first Space — Ready now. Your agent can see the screen, click and type."+ ],+ "title": "Your agent can use this Mac.",+ "upsell": "teams | Working with others? | Teams gives your team computers you share, with roles and device approval. | $30 per person a month, starting at 1 | upsell:Start Teams"+ },+ "step": "setup"+ },+ {+ "art": "claude-code on on",+ "case": "macOS made, ready",+ "setup": {+ "extra": {+ "action": "",+ "choices": [],+ "footnote": null,+ "note": "A fresh macOS computer inside this Mac. Your agent can use it now.",+ "phase": "ready",+ "title": "macOS 1 is ready"+ },+ "primary": "done:Done",+ "prompt": "You asked Claude Code: List my computers and tell me what's on this Mac / It answered in Claude Code. Ask it anything else.",+ "rows": [+ "[ok] Claude Code can use Cua — It used Cua at 18:12.",+ "[ok] This Mac is your first Space — Ready now. Your agent can see the screen, click and type."+ ],+ "title": "Your agent can use this Mac.",+ "upsell": null+ },+ "step": "setup",+ "todos": {+ "complete": true,+ "items": [+ "[x] Connect Claude Code — Claude Code can use Cua.",+ "[x] Make this Mac your first Space — Ready now. Your agent can see the screen, click and type.",+ "[x] Try your first request — Ask Claude Code: “List my computers and tell me what's on this Mac”",+ "[x] Give your agent its own Space (optional) — A fresh computer inside this Mac, away from your files and your mouse.",+ "[x] Sign in — Signed in to Cua."+ ],+ "lede": "Claude Code is connected. You're all set.",+ "progress": "5 of 5 done"+ }+ },+ {+ "art": "claude-code on outline",+ "case": "an Intel Mac: Linux only",+ "setup": {+ "extra": {+ "action": "not-now:Not now",+ "choices": [+ "Linux: Ready in about 2 min"+ ],+ "footnote": null,+ "note": "A fresh computer inside this Mac, so your agent can't touch your files or your mouse.",+ "phase": "choose",+ "title": "Give your agent its own Space"+ },+ "primary": "done:Done",+ "prompt": "Try this in Claude Code: List my computers and tell me what's on this Mac / This works now, on this Mac.",+ "rows": [+ "[ok] Claude Code can use Cua — We added Cua to Claude Code's settings. If Claude Code was already open, restart it.",+ "[ok] This Mac is your first Space — Ready now. Your agent can see the screen, click and type."+ ],+ "title": "Your agent can use this Mac.",+ "upsell": null+ },+ "step": "setup"+ },+ {+ "art": "claude-code on outline",+ "case": "a Windows PC",+ "setup": {+ "extra": {+ "action": "not-now:Not now",+ "choices": [+ "Linux: Ready in about 2 min"+ ],+ "footnote": null,+ "note": "A fresh computer inside this PC, so your agent can't touch your files or your mouse.",+ "phase": "choose",+ "title": "Give your agent its own Space"+ },+ "primary": "done:Done",+ "prompt": "Try this in Claude Code: List my computers and tell me what's on this PC / This works now, on this PC.",+ "rows": [+ "[ok] Claude Code can use Cua — We added Cua to Claude Code's settings. If Claude Code was already open, restart it.",+ "[ok] This PC is your first Space — Ready now. Your agent can see the screen, click and type."+ ],+ "title": "Your agent can use this PC.",+ "upsell": null+ },+ "step": "setup"+ }+ ]+}diff --git a/libs/cua/crates/cua-spaces-app-core/src/dispatch.rs b/libs/cua/crates/cua-spaces-app-core/src/dispatch.rsindex 81ec04f16d..d078af38b4 100644--- a/libs/cua/crates/cua-spaces-app-core/src/dispatch.rs+++ b/libs/cua/crates/cua-spaces-app-core/src/dispatch.rs@@ -291,6 +291,10 @@ pub const METHODS: &[&str] = &["relayUsage.view","upsell.prompt","upsell.allows",+ "firstRun.view",+ "firstRun.todos",+ "firstRun.agentUsed",+ "firstRun.leadAgent","telemetry.upsell",];@@ -495,6 +499,16 @@ pub fn call_value(method: &str, args: Value) -> Result<Value, CoreError> {))}"upsell.allows" => out(upsell::allows(&a.get("state")?)),+ "firstRun.view" => out(crate::first_run::view(&a.get("input")?)),+ "firstRun.todos" => out(crate::first_run::todos(&a.get("input")?)),+ "firstRun.agentUsed" => out(crate::first_run::agent_used(+ &a.get::<Vec<crate::first_run::AccessLine>>("lines")?,+ a.get::<u64>("sinceMs")?,+ &a.get::<String>("agentName")?,+ )),+ "firstRun.leadAgent" => out(crate::first_run::lead_agent(+ &a.get::<Vec<crate::first_run::FirstRunAgent>>("agents")?,+ )),"telemetry.upsell" => out(telemetry::upsell(&a.get::<String>("surface")?,&a.get::<String>("action")?,diff --git a/libs/cua/crates/cua-spaces-app-core/src/first_run.rs b/libs/cua/crates/cua-spaces-app-core/src/first_run.rsnew file mode 100644index 0000000000..bce555139c--- /dev/null+++ b/libs/cua/crates/cua-spaces-app-core/src/first_run.rs@@ -0,0 +1,1329 @@+// SPDX-License-Identifier: FSL-1.1-MIT+// Copyright (c) 2026 Cua AI, Inc.++//! The first run every app shows (0.10.0): two screens.+//!+//! 1. **Connect your agent.** One button for the agent this computer has+//! (Claude Code first), the others under it.+//! 2. **Your agent can use this Mac.** Two checked rows, the agent and this+//! computer, then a first request that works on this computer now. This+//! computer is the user's first Space and is ready at once; an extra+//! Space (a fresh macOS or Linux computer inside this one) is an+//! optional card that never blocks Done. A fix that is left moves to the+//! to-do list on Home ("Finish later").+//!+//! The words, which row needs what, and when Done is on are decided here, so+//! every app says the same thing. The page gathers the readings (the agent+//! setup, `host.status`, the sign-in, the create progress) and draws what+//! [`view`] returns; it decides nothing.+//!+//! What each reading is, and how real it is:+//!+//! * **"Cua is in the agent's settings"**: the agent setup reports the+//! agent `configured` (its MCP config and skills are in place). Real.+//! * **"The open agent session reloaded"**: an agent session that was open+//! when its settings changed only sees Cua after a restart. No process+//! check exists yet, so [`FirstRunInput::agent_open_before_setup`] is+//! `None` today and the row only tells the user to restart it if it was+//! open. Once the agent *uses* Cua (the next point), the session has+//! reloaded for certain and the advice goes away.+//! * **"The agent used Cua"**: a connection in this computer's access log+//! since the setup screen opened ([`agent_used`]). Partly real: the+//! host logs only some calls, and an agent names itself.+//! * **This computer**: `host.status` (`configured`, the service running,+//! online, every permission granted) and the app's sign-in. Real.++use serde::{Deserialize, Serialize};++use crate::relay_usage::{BUY_PRO_PATH, BUY_TEAMS_PATH, PRO_HOURS, PRO_SESSIONS, buy, plan_kind};++/// The agents step 1 offers by name, in order (setup ids). Any other agent+/// is under "Other".+pub const OFFERED: [&str; 4] = ["claude-code", "codex", "hermes", "openclaw"];++/// The first request: it works on this computer with nothing else set up.+pub const FIRST_PROMPT: &str = "List my computers and tell me what's on this Mac";+const FIRST_PROMPT_OTHER: &str = "List my computers and tell me what's on this computer";+const FIRST_PROMPT_PC: &str = "List my computers and tell me what's on this PC";++/// The two screens.+#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize)]+#[serde(rename_all = "kebab-case")]+pub enum FirstRunStep {+ #[default]+ Connect,+ Setup,+}++/// An agent the setup knows (`agents.setup`'s row, trimmed).+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]+#[serde(rename_all = "camelCase", default)]+pub struct FirstRunAgent {+ /// Setup id (`claude-code`, `codex`, `hermes`, `openclaw`, ...).+ pub agent: String,+ /// "Claude Code".+ pub name: String,+ pub installed: bool,+ pub configured: bool,+}++/// A permission this computer still needs (`host.status`'s hint).+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]+#[serde(rename_all = "camelCase", default)]+pub struct FirstRunPermission {+ /// `accessibility`, `screen-recording`, ...+ pub id: String,+ pub granted: bool,+ /// The Settings pane, when known.+ pub settings_url: Option<String>,+}++/// This computer as `host.status` reads it.+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]+#[serde(rename_all = "camelCase", default)]+pub struct FirstRunHost {+ pub configured: bool,+ /// The background service is running.+ pub running: bool,+ /// The relay sees it (none: not known).+ pub online: Option<bool>,+ pub permissions: Vec<FirstRunPermission>,+ /// The host setup failed with this.+ pub error: Option<String>,+}++/// An extra Space this computer can make in one click (the Spaces page's+/// one-click offer, `firstSpaceOffers`).+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]+#[serde(rename_all = "camelCase", default)]+pub struct FirstRunOffer {+ /// `macos` or `linux`.+ pub os: String,+ /// "about 2 min", "10 to 30 min the first time".+ pub time: Option<String>,+ /// "22 GB download", "Already downloaded".+ pub size: Option<String>,+ /// Why it can't be made here (the core's words).+ pub blocked: Option<String>,+}++/// The extra Space, as far as it got.+#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]+#[serde(rename_all = "camelCase", default)]+pub struct FirstRunExtra {+ /// `none` (not chosen yet), `not-now`, `creating`, `ready`, `failed`.+ pub phase: String,+ /// "macOS 1".+ pub name: Option<String>,+ /// `macos` or `linux`.+ pub os: Option<String>,+ /// The create's progress line ("Downloading macOS · 4.2 of 22.3 GB ...").+ pub detail: Option<String>,+ /// 0..1, when known.+ pub fraction: Option<f64>,+ /// Why it failed.+ pub error: Option<String>,+}++/// The plan, for the card after the first success.+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]+#[serde(rename_all = "camelCase", default)]+pub struct FirstRunPlan {+ /// The relay meters this account (`relay.usage`'s `metered`).+ pub metered: bool,+ /// `free`, `pro`, `team`.+ pub plan: String,+ /// Free's connections at once (default 2).+ pub sessions_limit: Option<u32>,+ /// Free's remote hours a month (default 20).+ pub hours_limit: Option<u32>,+ /// The user entered teammates' emails (a share with other people).+ pub teammates: bool,+ /// "Not now" was pressed on this card once: it never shows again.+ pub dismissed: bool,+ /// The account app (https).+ pub account_app: String,+}++/// Everything the first run reads.+#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]+#[serde(rename_all = "camelCase", default)]+pub struct FirstRunInput {+ pub step: FirstRunStep,+ /// `macos`, `windows`, `linux`.+ pub host_os: String,+ /// What the agent setup found (none yet: still looking).+ pub agents: Option<Vec<FirstRunAgent>>,+ /// The agent the user connected (setup id).+ pub agent: Option<String>,+ /// Adding Cua to the agent's settings is running.+ pub connecting: bool,+ /// Adding Cua to the agent's settings failed with this.+ pub connect_error: Option<String>,+ /// The agent was running when its settings changed (none: not known;+ /// no process check exists yet).+ pub agent_open_before_setup: Option<bool>,+ /// When the agent last used Cua, as the page shows times ("18:12").+ pub agent_used_at: Option<String>,+ pub signed_in: bool,+ /// Sign-in is waiting for the browser.+ pub signing_in: bool,+ /// `host.status` (none: not read yet).+ pub host: Option<FirstRunHost>,+ /// The host setup is running (after sign-in).+ pub host_setting_up: bool,+ /// The extra Space offers, macOS first.+ pub offers: Vec<FirstRunOffer>,+ pub extra: FirstRunExtra,+ pub plan: Option<FirstRunPlan>,+}++/// A button: what it says and what it does (`id`).+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]+#[serde(rename_all = "camelCase")]+pub struct FirstRunButton {+ pub id: String,+ pub label: String,+}++fn button(id: &str, label: &str) -> FirstRunButton {+ FirstRunButton {+ id: id.into(),+ label: label.into(),+ }+}++/// An agent step 1 offers.+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]+#[serde(rename_all = "camelCase")]+pub struct FirstRunAgentChoice {+ pub agent: String,+ pub name: String,+ pub installed: bool,+}++/// Step 1.+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]+#[serde(rename_all = "camelCase")]+pub struct ConnectView {+ /// "A shared Space for every agent." (the one serif accent word is+ /// `accent`, the only one in the app).+ pub title: String,+ pub accent: String,+ pub lede: String,+ /// "Connect Claude Code".+ pub primary: FirstRunButton,+ /// The agent the primary connects.+ pub agent: FirstRunAgentChoice,+ /// "Your agent will use this Mac."+ pub note: String,+ /// "You can add a separate Space later."+ pub note_more: String,+ /// "Or".+ pub or_label: String,+ /// The other offered agents.+ pub others: Vec<FirstRunAgentChoice>,+ /// "Other": every agent the setup knows.+ pub other_label: String,+ /// "Adding Cua to Claude Code…" while it runs.+ pub busy: Option<String>,+ pub error: Option<String>,+}++/// A checked row's state.+#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]+#[serde(rename_all = "kebab-case")]+pub enum RowState {+ Checking,+ Ok,+ Fix,+}++/// One of the two checked rows.+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]+#[serde(rename_all = "camelCase")]+pub struct CheckRow {+ /// `agent` or `computer`.+ pub id: String,+ pub state: RowState,+ pub title: String,+ pub note: String,+ /// The fix: `restart-check`, `connect`, `sign-in`, `open-settings`,+ /// `set-up`.+ pub action: Option<FirstRunButton>,+ /// The Settings pane `open-settings` opens.+ pub settings_url: Option<String>,+}++/// The first request.+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]+#[serde(rename_all = "camelCase")]+pub struct PromptView {+ /// "Try this in Claude Code", then "You asked Claude Code".+ pub heading: String,+ pub text: String,+ /// "This works now, on this Mac."+ pub note: String,+ /// "Copy", until the agent used Cua.+ pub copy: Option<String>,+}++/// A choice on the extra Space card.+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]+#[serde(rename_all = "camelCase")]+pub struct ExtraChoice {+ pub os: String,+ /// "macOS", "Linux".+ pub label: String,+ /// "Ready in about 2 min", "22 GB download · 10 to 30 min the first time".+ pub detail: String,+ /// Why it can't be made here.+ pub blocked: Option<String>,+}++/// The optional extra Space card.+#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]+#[serde(rename_all = "camelCase")]+pub struct ExtraView {+ /// `choose`, `creating`, `ready`, `failed`, `not-now`.+ pub phase: String,+ pub title: String,+ /// "(optional)" on `choose`.+ pub tag: Option<String>,+ pub note: String,+ pub choices: Vec<ExtraChoice>,+ /// "Not now", "Cancel", "Add a Space", "Try again".+ pub action: Option<FirstRunButton>,+ pub fraction: Option<f64>,+ /// Under the progress: "You can press Done now. ..."+ pub footnote: Option<String>,+}++/// The plan card after the first success (Pro, or Teams for someone who+/// shares with teammates). Only what the plans really include.+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]+#[serde(rename_all = "camelCase")]+pub struct UpsellCard {+ /// `pro` or `teams`.+ pub plan: String,+ pub title: String,+ pub lines: Vec<String>,+ pub price: String,+ pub cta: FirstRunButton,+ /// The checkout on the account app.+ pub url: String,+ /// "Not now": hides it for good.+ pub dismiss: String,+}++/// The main button.+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]+#[serde(rename_all = "camelCase")]+pub struct PrimaryView {+ /// `done` or `finish-later`.+ pub id: String,+ pub label: String,+ pub enabled: bool,+ /// "We'll keep a to-do list on Home." beside Finish later.+ pub note: Option<String>,+}++/// The art beside the page: which keys show. `agent` is the agent key's+/// mark (setup id). `computer`: `on`, `faded`. `extra`: `none`, `outline`,+/// `filling`.+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]+#[serde(rename_all = "camelCase")]+pub struct ArtView {+ pub agent: String,+ pub computer: String,+ pub extra: String,+}++/// Step 2.+#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]+#[serde(rename_all = "camelCase")]+pub struct SetupView {+ /// "Checking your setup.", "Your agent can use this Mac.", "One step left."+ pub title: String,+ pub rows: Vec<CheckRow>,+ pub prompt: PromptView,+ pub extra: ExtraView,+ pub upsell: Option<UpsellCard>,+ pub primary: PrimaryView,+}++/// The first run as drawn.+#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]+#[serde(rename_all = "camelCase")]+pub struct FirstRunView {+ pub step: FirstRunStep,+ /// "Set up later" (top right, both screens).+ pub later: String,+ pub connect: Option<ConnectView>,+ pub setup: Option<SetupView>,+ pub art: ArtView,+ /// Two page marks.+ pub dots: u8,+ pub current: u8,+}++/// A line of Home's "Finish setting up" list (frame 9), after Finish later.+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]+#[serde(rename_all = "camelCase")]+pub struct FirstRunTodo {+ /// `agent`, `computer`, `prompt`, `extra`, `sign-in`.+ pub id: String,+ pub title: String,+ pub note: String,+ pub done: bool,+ pub optional: bool,+ pub action: Option<FirstRunButton>,+ pub settings_url: Option<String>,+}++/// Home's "Finish setting up" card.+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]+#[serde(rename_all = "camelCase")]+pub struct FirstRunTodos {+ pub title: String,+ pub lede: String,+ /// "2 of 5 done".+ pub progress: String,+ pub items: Vec<FirstRunTodo>,+ /// Every required line is done (the card can go).+ pub complete: bool,+}++fn this_computer(os: &str) -> &'static str {+ match os {+ "macos" => "this Mac",+ "windows" => "this PC",+ _ => "this computer",+ }+}++fn cap(s: &str) -> String {+ let mut c = s.chars();+ c.next()+ .map(|f| f.to_uppercase().collect::<String>() + c.as_str())+ .unwrap_or_default()+}++fn os_name(os: &str) -> &'static str {+ match os {+ "macos" => "macOS",+ "linux" => "Linux",+ "windows" => "Windows",+ _ => "a computer",+ }+}++/// The first request's words on this system.+pub fn first_prompt(os: &str) -> &'static str {+ match os {+ "macos" => FIRST_PROMPT,+ "windows" => FIRST_PROMPT_PC,+ _ => FIRST_PROMPT_OTHER,+ }+}++fn default_name(agent: &str) -> &'static str {+ match agent {+ "claude-code" => "Claude Code",+ "codex" => "Codex",+ "hermes" => "Hermes",+ "openclaw" => "OpenClaw",+ _ => "your agent",+ }+}++fn choice(agents: &[FirstRunAgent], id: &str) -> FirstRunAgentChoice {+ let row = agents.iter().find(|a| a.agent == id);+ FirstRunAgentChoice {+ agent: id.into(),+ name: row+ .map(|a| a.name.clone())+ .filter(|n| !n.is_empty())+ .unwrap_or_else(|| default_name(id).into()),+ installed: row.is_some_and(|a| a.installed),+ }+}++/// The agent step 1 leads with: the first offered one installed here,+/// else Claude Code.+pub fn lead_agent(agents: &[FirstRunAgent]) -> String {+ OFFERED+ .iter()+ .find(|id| agents.iter().any(|a| a.agent == **id && a.installed))+ .unwrap_or(&OFFERED[0])+ .to_string()+}++fn agent_name(input: &FirstRunInput) -> String {+ let agents = input.agents.as_deref().unwrap_or(&[]);+ let id = input.agent.clone().unwrap_or_else(|| lead_agent(agents));+ choice(agents, &id).name+}++fn connect_view(input: &FirstRunInput) -> ConnectView {+ let agents = input.agents.as_deref().unwrap_or(&[]);+ let lead = input.agent.clone().unwrap_or_else(|| lead_agent(agents));+ let agent = choice(agents, &lead);+ let place = this_computer(&input.host_os);+ let others = OFFERED+ .iter()+ .filter(|id| **id != lead)+ .map(|id| choice(agents, id))+ .collect();+ ConnectView {+ title: "A shared Space for every agent.".into(),+ accent: "agent".into(),+ lede: format!(+ "Connect your agents and give them computers to work on: macOS, Linux or Windows, right here on {place}."+ ),+ primary: button("connect", &format!("Connect {}", agent.name)),+ busy: input+ .connecting+ .then(|| format!("Adding Cua to {}…", agent.name)),+ agent,+ note: format!("Your agent will use {place}."),+ note_more: "You can add a separate Space later.".into(),+ or_label: "Or".into(),+ others,+ other_label: "Other".into(),+ error: input+ .connect_error+ .as_ref()+ .map(|e| format!("Couldn't add Cua: {e}")),+ }+}++fn agent_row(input: &FirstRunInput) -> CheckRow {+ let name = agent_name(input);+ let id = input.agent.clone().unwrap_or_default();+ let found = input+ .agents+ .as_ref()+ .map(|a| a.iter().find(|r| r.agent == id).cloned());+ let row = |state, title: String, note: String, action: Option<FirstRunButton>| CheckRow {+ id: "agent".into(),+ state,+ title,+ note,+ action,+ settings_url: None,+ };+ match found {+ None => row(+ RowState::Checking,+ name.clone(),+ "Checking that it can use Cua…".into(),+ None,+ ),+ Some(None)+ | Some(Some(FirstRunAgent {+ configured: false, ..+ })) => {+ if input.connecting {+ return row(+ RowState::Checking,+ name.clone(),+ format!("Adding Cua to {name}'s settings…"),+ None,+ );+ }+ row(+ RowState::Fix,+ format!("Connect {name}"),+ input.connect_error.clone().map_or_else(+ || format!("Cua isn't in {name}'s settings yet."),+ |e| format!("Couldn't add Cua: {e}"),+ ),+ Some(button("connect", "Connect")),+ )+ }+ Some(Some(_)) => {+ if let Some(at) = &input.agent_used_at {+ return row(+ RowState::Ok,+ format!("{name} can use Cua"),+ format!("It used Cua at {at}."),+ None,+ );+ }+ if input.agent_open_before_setup == Some(true) {+ return row(+ RowState::Fix,+ format!("Restart {name}"),+ "It was open when we added Cua. Close it, then open it again.".into(),+ Some(button("restart-check", "Check again")),+ );+ }+ row(+ RowState::Ok,+ format!("{name} can use Cua"),+ format!(+ "We added Cua to {name}'s settings. If {name} was already open, restart it."+ ),+ None,+ )+ }+ }+}++fn missing_permission(host: &FirstRunHost, id: &str) -> Option<FirstRunPermission> {+ host.permissions+ .iter()+ .find(|p| p.id == id && !p.granted)+ .cloned()+}++fn computer_row(input: &FirstRunInput) -> CheckRow {+ let place = this_computer(&input.host_os);+ let row = |state, title: String, note: &str, action: Option<FirstRunButton>| CheckRow {+ id: "computer".into(),+ state,+ title,+ note: note.into(),+ action,+ settings_url: None,+ };+ let checking = |note: &str| row(RowState::Checking, cap(place), note, None);+ if !input.signed_in {+ if input.signing_in {+ return checking("Finish signing in to Cua in your browser.");+ }+ return row(+ RowState::Fix,+ "Sign in to Cua".into(),+ &format!("So your agent can find {place} and your other computers."),+ Some(button("sign-in", "Sign in")),+ );+ }+ let Some(host) = &input.host else {+ return checking("Checking that your agent can use it…");+ };+ if input.host_setting_up {+ return checking(&format!("Setting up {place} for your agent…"));+ }+ if !host.configured {+ return row(+ RowState::Fix,+ format!("Set up {place}"),+ &host.error.as_ref().map_or_else(+ || format!("Cua needs to add {place} to your account. It takes a few seconds."),+ |e| format!("Setting it up didn't work: {e}"),+ ),+ Some(button(+ "set-up",+ if host.error.is_some() {+ "Try again"+ } else {+ "Set up"+ },+ )),+ );+ }+ if !host.running {+ return row(+ RowState::Fix,+ format!("Start Cua on {place}"),+ "Cua's background service isn't running.",+ Some(button("set-up", "Start")),+ );+ }+ for (id, title, note) in [+ (+ "accessibility",+ format!("Let Cua control {place}"),+ format!(+ "So your agent can click and type. {} asks you once.",+ os_name(&input.host_os)+ ),+ ),+ (+ "screen-recording",+ format!(+ "Let Cua see {}",+ if input.host_os == "macos" {+ "this screen"+ } else {+ "the screen"+ }+ ),+ format!(+ "So your agent can see what's on {place}. {} asks you once.",+ os_name(&input.host_os)+ ),+ ),+ ] {+ if let Some(p) = missing_permission(host, id) {+ let mut r = row(+ RowState::Fix,+ title,+ ¬e,+ Some(button("open-settings", "Open Settings")),+ );+ r.settings_url = p.settings_url;+ return r;+ }+ }+ if let Some(p) = host.permissions.iter().find(|p| !p.granted) {+ let mut r = row(+ RowState::Fix,+ format!("Give Cua one more permission on {place}"),+ "Open Settings and turn Cua on.",+ Some(button("open-settings", "Open Settings")),+ );+ r.settings_url = p.settings_url.clone();+ return r;+ }+ if host.online == Some(false) {+ return row(+ RowState::Fix,+ format!("{} is offline", cap(place)),+ "Cua can't reach the internet from here. Check your connection.",+ Some(button("restart-check", "Check again")),+ );+ }+ row(+ RowState::Ok,+ format!("{} is your first Space", cap(place)),+ "Ready now. Your agent can see the screen, click and type.",+ None,+ )+}++fn os_label(os: &str) -> String {+ os_name(os).into()+}++fn offer_detail(o: &FirstRunOffer) -> String {+ let time = o.time.as_deref().map(|t| format!("Ready in {t}"));+ match o.os.as_str() {+ "macos" => [o.size.clone(), o.time.clone()]+ .into_iter()+ .flatten()+ .collect::<Vec<_>>()+ .join(" · "),+ _ => time.unwrap_or_default(),+ }+}++fn extra_view(input: &FirstRunInput) -> ExtraView {+ let place = this_computer(&input.host_os);+ let e = &input.extra;+ let name = e+ .name+ .clone()+ .unwrap_or_else(|| os_label(e.os.as_deref().unwrap_or("")));+ let base = |phase: &str, title: String, note: String| ExtraView {+ phase: phase.into(),+ title,+ tag: None,+ note,+ choices: vec![],+ action: None,+ fraction: None,+ footnote: None,+ };+ match e.phase.as_str() {+ "creating" => ExtraView {+ action: Some(button("cancel", "Cancel")),+ fraction: e.fraction.map(|f| f.clamp(0.0, 1.0)),+ footnote: Some("You can press Done now. We'll let you know when it's ready.".into()),+ ..base(+ "creating",+ format!("Making {name} in the background"),+ e.detail.clone().unwrap_or_else(|| "Starting…".into()),+ )+ },+ "ready" => base(+ "ready",+ format!("{name} is ready"),+ format!(+ "A fresh {} computer inside {place}. Your agent can use it now.",+ os_label(e.os.as_deref().unwrap_or(""))+ ),+ ),+ "failed" => ExtraView {+ action: Some(button("retry", "Try again")),+ ..base(+ "failed",+ format!("Couldn't make {name}"),+ e.error+ .clone()+ .unwrap_or_else(|| "Something went wrong.".into()),+ )+ },+ "not-now" => ExtraView {+ action: Some(button("add", "Add a Space")),+ ..base(+ "not-now",+ "No extra Space for now".into(),+ "Add one from Home whenever you like.".into(),+ )+ },+ _ => {+ // macOS first, then Linux; nothing else.+ let mut choices: Vec<ExtraChoice> = ["macos", "linux"]+ .iter()+ .filter_map(|os| input.offers.iter().find(|o| o.os == *os))+ .map(|o| ExtraChoice {+ os: o.os.clone(),+ label: os_label(&o.os),+ detail: offer_detail(o),+ blocked: o.blocked.clone(),+ })+ .collect();+ // A system this computer can't run at all isn't a choice.+ if choices.iter().any(|c| c.blocked.is_none()) {+ choices.retain(|c| !(c.os == "macos" && c.blocked.is_some()));+ }+ ExtraView {+ tag: Some("(optional)".into()),+ choices,+ action: Some(button("not-now", "Not now")),+ ..base(+ "choose",+ "Give your agent its own Space".into(),+ format!(+ "A fresh computer inside {place}, so your agent can't touch your files or your mouse."+ ),+ )+ }+ }+ }+}++/// The plan card after the first success: Teams for someone who entered+/// teammates' emails and isn't on Teams, else Pro for Free. Never after+/// "Not now", never before the agent used Cua, never on an unmetered+/// account. Only what the plans include: Pro is more remote hours and more+/// connections at once; Teams is computers a team shares, roles and device+/// approval.+pub fn upsell(plan: &FirstRunPlan, agent_used: bool) -> Option<UpsellCard> {+ if !agent_used || plan.dismissed || !plan.metered {+ return None;+ }+ let kind = plan_kind(&plan.plan);+ let app = if plan.account_app.starts_with("https://") {+ plan.account_app.clone()+ } else {+ "https://app.cua.ai".into()+ };+ if plan.teammates && kind != "teams" {+ return Some(UpsellCard {+ plan: "teams".into(),+ title: "Working with others?".into(),+ lines: vec![+ "Teams gives your team computers you share, with roles and device approval.".into(),+ ],+ price: "$30 per person a month, starting at 1".into(),+ cta: button("upsell", "Start Teams"),+ url: buy(&app, BUY_TEAMS_PATH, "app_onboarding"),+ dismiss: "Not now".into(),+ });+ }+ if kind != "free" {+ return None;+ }+ let sessions = plan.sessions_limit.unwrap_or(2);+ let hours = plan.hours_limit.unwrap_or(20);+ Some(UpsellCard {+ plan: "pro".into(),+ title: "More remote hours with Pro".into(),+ lines: vec![+ format!("Free: {hours} remote hours a month · {sessions} connections at once"),+ format!("Pro: {PRO_HOURS} remote hours a month · {PRO_SESSIONS} connections at once"),+ ],+ price: "$18 a month".into(),+ cta: button("upsell", "Try Pro"),+ url: buy(&app, BUY_PRO_PATH, "app_onboarding"),+ dismiss: "Not now".into(),+ })+}++/// The art for step 2: the computer key fades while its row is checked or+/// needs a fix; an extra Space is a dashed outline, filled faintly while+/// it is made.+fn art(input: &FirstRunInput, computer: &CheckRow) -> ArtView {+ let agents = input.agents.as_deref().unwrap_or(&[]);+ ArtView {+ agent: input.agent.clone().unwrap_or_else(|| lead_agent(agents)),+ computer: if input.step == FirstRunStep::Setup && computer.state != RowState::Ok {+ "faded"+ } else {+ "on"+ }+ .into(),+ extra: match (input.step, input.extra.phase.as_str()) {+ (FirstRunStep::Connect, _) => "none",+ (_, "creating") => "filling",+ (_, "ready") => "on",+ (_, "not-now") => "none",+ _ => "outline",+ }+ .into(),+ }+}++/// The first run as drawn.+pub fn view(input: &FirstRunInput) -> FirstRunView {+ let agent = agent_row(input);+ let computer = computer_row(input);+ let art = art(input, &computer);+ let later = "Set up later".to_string();+ if input.step == FirstRunStep::Connect {+ return FirstRunView {+ step: FirstRunStep::Connect,+ later,+ connect: Some(connect_view(input)),+ setup: None,+ art,+ dots: 2,+ current: 0,+ };+ }+ let place = this_computer(&input.host_os);+ let name = agent_name(input);+ let rows = vec![agent, computer];+ let checking = rows.iter().any(|r| r.state == RowState::Checking);+ let fixes = rows.iter().filter(|r| r.state == RowState::Fix).count();+ let ready = rows.iter().all(|r| r.state == RowState::Ok);+ let title = if ready {+ format!("Your agent can use {place}.")+ } else if fixes == 1 && !checking {+ "One step left.".into()+ } else if fixes > 1 && !checking {+ format!("{fixes} steps left.")+ } else {+ "Checking your setup.".into()+ };+ let used = input.agent_used_at.is_some();+ let prompt = if used {+ PromptView {+ heading: format!("You asked {name}"),+ text: first_prompt(&input.host_os).into(),+ note: format!("It answered in {name}. Ask it anything else."),+ copy: None,+ }+ } else {+ PromptView {+ heading: format!("Try this in {name}"),+ text: first_prompt(&input.host_os).into(),+ note: format!("This works now, on {place}."),+ copy: Some("Copy".into()),+ }+ };+ let finish_later = fixes > 0 && !checking;+ FirstRunView {+ step: FirstRunStep::Setup,+ later,+ connect: None,+ setup: Some(SetupView {+ title,+ rows,+ prompt,+ extra: extra_view(input),+ upsell: input.plan.as_ref().and_then(|p| upsell(p, used)),+ primary: if finish_later {+ PrimaryView {+ id: "finish-later".into(),+ label: "Finish later".into(),+ enabled: true,+ note: Some("We'll keep a to-do list on Home.".into()),+ }+ } else {+ PrimaryView {+ id: "done".into(),+ label: "Done".into(),+ enabled: ready,+ note: None,+ }+ },+ }),+ art,+ dots: 2,+ current: 1,+ }+}++/// Home's "Finish setting up" list after Finish later: the same checks,+/// kept (frame 9). Nothing left that is required: `complete`.+pub fn todos(input: &FirstRunInput) -> FirstRunTodos {+ let place = this_computer(&input.host_os);+ let name = agent_name(input);+ let agent = agent_row(input);+ let computer = computer_row(input);+ let used = input.agent_used_at.is_some();+ let mut items = vec![FirstRunTodo {+ id: "agent".into(),+ done: agent.state == RowState::Ok,+ title: if agent.state == RowState::Fix {+ agent.title.clone()+ } else {+ format!("Connect {name}")+ },+ note: if agent.state == RowState::Ok {+ format!("{name} can use Cua.")+ } else {+ agent.note.clone()+ },+ optional: false,+ action: agent.action.clone(),+ settings_url: None,+ }];+ // Sign-in is its own line; the computer line is what is left after it.+ items.push(FirstRunTodo {+ id: "computer".into(),+ done: computer.state == RowState::Ok,+ title: if computer.state == RowState::Ok || !input.signed_in {+ format!("Make {place} your first Space")+ } else {+ computer.title.clone()+ },+ note: if computer.state == RowState::Ok {+ "Ready now. Your agent can see the screen, click and type.".into()+ } else if !input.signed_in {+ "After you sign in.".into()+ } else {+ computer.note.clone()+ },+ optional: false,+ action: if input.signed_in {+ computer.action.clone()+ } else {+ None+ },+ settings_url: computer.settings_url.clone(),+ });+ items.push(FirstRunTodo {+ id: "prompt".into(),+ title: "Try your first request".into(),+ note: format!(+ "Ask {name}: \u{201c}{}\u{201d}",+ first_prompt(&input.host_os)+ ),+ done: used,+ optional: false,+ action: (!used).then(|| button("copy", "Copy")),+ settings_url: None,+ });+ let extra_done = matches!(input.extra.phase.as_str(), "creating" | "ready");+ items.push(FirstRunTodo {+ id: "extra".into(),+ title: "Give your agent its own Space (optional)".into(),+ note: format!("A fresh computer inside {place}, away from your files and your mouse."),+ done: extra_done,+ optional: true,+ action: (!extra_done).then(|| button("add", "Add a Space")),+ settings_url: None,+ });+ items.push(FirstRunTodo {+ id: "sign-in".into(),+ title: "Sign in".into(),+ note: if input.signed_in {+ "Signed in to Cua.".into()+ } else {+ format!("So your agent can find {place} and your other computers.")+ },+ done: input.signed_in,+ optional: false,+ action: (!input.signed_in).then(|| button("sign-in", "Sign in")),+ settings_url: None,+ });+ let done = items.iter().filter(|i| i.done).count();+ let complete = items.iter().all(|i| i.done || i.optional);+ let lede = if agent.state == RowState::Ok {+ let left = items.iter().filter(|i| !i.done && !i.optional).count();+ match left {+ 0 => format!("{name} is connected. You're all set."),+ 1 => format!("{name} is connected. One thing is left."),+ _ => format!("{name} is connected. A couple of things are left."),+ }+ } else {+ "A couple of things are left.".into()+ };+ FirstRunTodos {+ title: "Finish setting up".into(),+ lede,+ progress: format!("{done} of {} done", items.len()),+ items,+ complete,+ }+}++/// One access in this computer's log (`host.status`'s `recentAccess`).+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]+#[serde(rename_all = "camelCase", default)]+pub struct AccessLine {+ pub at_ms: u64,+ pub via: String,+ pub who: String,+ pub what: String,+}++/// When the agent first used Cua on this computer since `since_ms`: the+/// newest connection in the access log (not a background probe, a+/// thumbnail or a refusal) at or after it. An agent names itself, and the+/// host logs only some calls, so a line naming another agent doesn't+/// count, but an unnamed one does. None: no such line yet.+pub fn agent_used(lines: &[AccessLine], since_ms: u64, agent_name: &str) -> Option<u64> {+ let want = agent_name.to_ascii_lowercase();+ let others: Vec<String> = OFFERED+ .iter()+ .map(|id| default_name(id).to_ascii_lowercase())+ .filter(|n| *n != want)+ .collect();+ lines+ .iter()+ .filter(|l| l.at_ms >= since_ms)+ .filter(|l| cua_host_access_is_connection(&l.who, &l.what))+ .filter(|l| {+ let who = format!("{} {}", l.who, l.what).to_ascii_lowercase();+ who.contains(&want) || !others.iter().any(|o| who.contains(o.as_str()))+ })+ .map(|l| l.at_ms)+ .max()+}++/// `cua_host::access::classify(..).is_connection()`, without the host+/// crate (the core builds for wasm).+fn cua_host_access_is_connection(who: &str, what: &str) -> bool {+ !(who == "refused"+ || what.starts_with("refused ")+ || what.ends_with("(background)")+ || what.ends_with("(thumbnail)")+ || what.ends_with("(thumbnail, not owner)")+ || matches!(what, "SystemService" | "PresenceService"))+}++#[cfg(test)]+mod tests {+ use super::*;++ fn claude(configured: bool) -> FirstRunAgent {+ FirstRunAgent {+ agent: "claude-code".into(),+ name: "Claude Code".into(),+ installed: true,+ configured,+ }+ }++ fn ready_host() -> FirstRunHost {+ FirstRunHost {+ configured: true,+ running: true,+ online: Some(true),+ permissions: vec![FirstRunPermission {+ id: "accessibility".into(),+ granted: true,+ settings_url: None,+ }],+ error: None,+ }+ }++ fn setup() -> FirstRunInput {+ FirstRunInput {+ step: FirstRunStep::Setup,+ host_os: "macos".into(),+ agents: Some(vec![claude(true)]),+ agent: Some("claude-code".into()),+ signed_in: true,+ host: Some(ready_host()),+ offers: vec![+ FirstRunOffer {+ os: "linux".into(),+ time: Some("about 2 min".into()),+ ..Default::default()+ },+ FirstRunOffer {+ os: "macos".into(),+ time: Some("10 to 30 min the first time".into()),+ size: Some("22 GB download".into()),+ ..Default::default()+ },+ ],+ ..Default::default()+ }+ }++ fn s(v: &FirstRunView) -> &SetupView {+ v.setup.as_ref().unwrap()+ }++ #[test]+ fn connect_leads_with_an_installed_agent() {+ let mut i = FirstRunInput {+ host_os: "macos".into(),+ ..Default::default()+ };+ let v = view(&i);+ let c = v.connect.unwrap();+ assert_eq!(c.primary.label, "Connect Claude Code");+ assert_eq!(c.note, "Your agent will use this Mac.");+ assert_eq!(c.others.len(), 3);+ i.agents = Some(vec![FirstRunAgent {+ agent: "codex".into(),+ name: "Codex".into(),+ installed: true,+ configured: false,+ }]);+ assert_eq!(view(&i).connect.unwrap().primary.label, "Connect Codex");+ }++ #[test]+ fn ready_when_both_rows_pass() {+ let v = view(&setup());+ let s = s(&v);+ assert_eq!(s.title, "Your agent can use this Mac.");+ assert_eq!(s.rows[1].title, "This Mac is your first Space");+ assert!(s.primary.enabled);+ assert_eq!(s.primary.label, "Done");+ // macOS first, then Linux.+ assert_eq!(s.extra.choices[0].os, "macos");+ assert_eq!(s.extra.choices[1].detail, "Ready in about 2 min");+ assert!(s.upsell.is_none());+ }++ #[test]+ fn checking_keeps_done_off() {+ let mut i = setup();+ i.host = None;+ let v = view(&i);+ assert_eq!(s(&v).title, "Checking your setup.");+ assert!(!s(&v).primary.enabled);+ assert_eq!(v.art.computer, "faded");+ }++ #[test]+ fn fixes_turn_done_into_finish_later() {+ let mut i = setup();+ i.host.as_mut().unwrap().permissions[0].granted = false;+ i.host.as_mut().unwrap().permissions[0].settings_url =+ Some("x-apple.systempreferences:a".into());+ let v = view(&i);+ let s = s(&v);+ assert_eq!(s.title, "One step left.");+ assert_eq!(s.rows[1].title, "Let Cua control this Mac");+ assert_eq!(+ s.rows[1].settings_url.as_deref(),+ Some("x-apple.systempreferences:a")+ );+ assert_eq!(s.primary.id, "finish-later");++ let mut i = setup();+ i.signed_in = false;+ assert_eq!(s_title(&i), "One step left.");+ assert_eq!(+ view(&i).setup.unwrap().rows[1].action.as_ref().unwrap().id,+ "sign-in"+ );++ let mut i = setup();+ i.agent_open_before_setup = Some(true);+ assert_eq!(view(&i).setup.unwrap().rows[0].title, "Restart Claude Code");+ }++ fn s_title(i: &FirstRunInput) -> String {+ view(i).setup.unwrap().title+ }++ #[test]+ fn creating_never_blocks_done() {+ let mut i = setup();+ i.extra = FirstRunExtra {+ phase: "creating".into(),+ name: Some("macOS 1".into()),+ os: Some("macos".into()),+ detail: Some("Downloading macOS · 4.2 of 22.3 GB".into()),+ fraction: Some(0.19),+ error: None,+ };+ let v = view(&i);+ assert_eq!(s(&v).extra.title, "Making macOS 1 in the background");+ assert!(s(&v).primary.enabled);+ assert_eq!(v.art.extra, "filling");+ }++ #[test]+ fn the_card_shows_only_after_the_first_success() {+ let mut i = setup();+ i.plan = Some(FirstRunPlan {+ metered: true,+ plan: "free".into(),+ ..Default::default()+ });+ assert!(s(&view(&i)).upsell.is_none());+ i.agent_used_at = Some("18:12".into());+ let v = view(&i);+ let u = s(&v).upsell.clone().unwrap();+ assert_eq!(u.plan, "pro");+ assert_eq!(+ u.lines[1],+ "Pro: 200 remote hours a month · 5 connections at once"+ );+ assert!(!u.title.to_lowercase().contains("sleep"));+ assert_eq!(s(&v).rows[0].note, "It used Cua at 18:12.");+ i.plan.as_mut().unwrap().teammates = true;+ assert_eq!(s(&view(&i)).upsell.clone().unwrap().plan, "teams");+ i.plan.as_mut().unwrap().dismissed = true;+ assert!(s(&view(&i)).upsell.is_none());+ }++ #[test]+ fn access_log_finds_the_agent() {+ let line = |at, who: &str, what: &str| AccessLine {+ at_ms: at,+ via: "token".into(),+ who: who.into(),+ what: what.into(),+ };+ let lines = vec![+ line(5, "Claude Code", "MCP"),+ line(9, "Codex", "MCP"),+ line(12, "owner", "SystemService"),+ line(1, "Claude Code", "MCP"),+ ];+ assert_eq!(agent_used(&lines, 2, "Claude Code"), Some(5));+ assert_eq!(agent_used(&lines, 6, "Claude Code"), None);+ assert_eq!(+ agent_used(&[line(7, "local", "DesktopService")], 2, "Claude Code"),+ Some(7)+ );+ }++ #[test]+ fn todos_after_finish_later() {+ let mut i = setup();+ i.host.as_mut().unwrap().permissions[0].granted = false;+ let t = todos(&i);+ assert_eq!(t.progress, "2 of 5 done");+ assert!(!t.complete);+ assert_eq!(t.items[1].title, "Let Cua control this Mac");+ i.host = Some(ready_host());+ i.agent_used_at = Some("18:12".into());+ assert!(todos(&i).complete);+ }++ #[test]+ fn plain_words() {+ let mut i = setup();+ i.extra.phase = "creating".into();+ let all = serde_json::to_string(&view(&i)).unwrap().to_lowercase();+ for word in [+ "vm",+ "virtual machine",+ "container",+ "mcp",+ "daemon",+ "host",+ "your space is ready",+ ] {+ assert!(!all.contains(&format!(" {word}")), "{word}");+ }+ }+}diff --git a/libs/cua/crates/cua-spaces-app-core/src/lib.rs b/libs/cua/crates/cua-spaces-app-core/src/lib.rsindex 186ef262be..7a65ef4739 100644--- a/libs/cua/crates/cua-spaces-app-core/src/lib.rs+++ b/libs/cua/crates/cua-spaces-app-core/src/lib.rs@@ -68,6 +68,7 @@ pub mod drive_settings;pub mod driver_preview;pub mod errors;pub mod experiments;+pub mod first_run;pub mod host;pub mod installer;pub mod keyvault;diff --git a/libs/cua/crates/cua-spaces-app-core/src/parity.rs b/libs/cua/crates/cua-spaces-app-core/src/parity.rsindex 9ff8b7837b..29e6c96899 100644--- a/libs/cua/crates/cua-spaces-app-core/src/parity.rs+++ b/libs/cua/crates/cua-spaces-app-core/src/parity.rs@@ -212,6 +212,11 @@ pub const FLOWS: &[(&str, &str, &str)] = &[include_str!("../parity/create-stages.json"),include_str!("../parity/golden/create-stages.json"),),+ (+ "first-run",+ include_str!("../parity/first-run.json"),+ include_str!("../parity/golden/first-run.json"),+ ),];/// The core calls a flow makes, over JSON. A host implements it with its@@ -1947,6 +1952,7 @@ pub fn run(name: &str, flow_json: &str, h: &dyn Host) -> Result<Value, String> {"placement-picker" => run_placement_picker(&flow, h),"machines" => run_machines(&flow, h),"checklist" => run_checklist(&flow, h),+ "first-run" => run_first_run(&flow, h),other => Err(format!("unknown flow {other}")),}}@@ -3106,6 +3112,152 @@ fn run_checklist(f: &Value, h: &dyn Host) -> Result<Value, String> {Ok(json!({ "flow": "checklist", "frames": frames }))}+/// `patch` laid over `base`, object by object (any other value replaces).+fn patched(base: &Value, patch: &Value) -> Value {+ match (base, patch) {+ (Value::Object(b), Value::Object(p)) => {+ let mut out = b.clone();+ for (k, v) in p {+ let next = match (b.get(k), v) {+ // A nested object a case gives whole (host, extra, plan) replaces.+ (Some(_), v) => v.clone(),+ (None, v) => v.clone(),+ };+ out.insert(k.clone(), next);+ }+ Value::Object(out)+ }+ (_, p) => p.clone(),+ }+}++/// Each case's first-run screen (`firstRun.view`) as small frames: the+/// headline, the rows, the first request, the extra Space card, the plan+/// card, the main button and the art; with Home's to-do list+/// (`firstRun.todos`) where the case asks.+fn run_first_run(f: &Value, h: &dyn Host) -> Result<Value, String> {+ let mut frames = Vec::new();+ for case in f["cases"].as_array().into_iter().flatten() {+ let input = patched(&f["base"], &case["patch"]);+ let v = c(h, "firstRun.view", json!({ "input": input }))?;+ let s = |v: &Value| v.as_str().unwrap_or("").to_string();+ let btn = |b: &Value| {+ if b.is_object() {+ format!("{}:{}", s(&b["id"]), s(&b["label"]))+ } else {+ String::new()+ }+ };+ let mut frame = json!({+ "case": case["name"],+ "step": v["step"],+ "art": format!("{} {} {}", s(&v["art"]["agent"]), s(&v["art"]["computer"]), s(&v["art"]["extra"])),+ });+ if v["connect"].is_object() {+ let k = &v["connect"];+ let others: Vec<String> = k["others"]+ .as_array()+ .into_iter()+ .flatten()+ .map(|o| s(&o["name"]))+ .collect();+ frame["connect"] = json!({+ "title": k["title"],+ "lede": k["lede"],+ "primary": btn(&k["primary"]),+ "note": format!("{} {}", s(&k["note"]), s(&k["noteMore"])),+ "others": others.join(", "),+ });+ }+ if v["setup"].is_object() {+ let k = &v["setup"];+ let rows: Vec<String> = k["rows"]+ .as_array()+ .into_iter()+ .flatten()+ .map(|r| {+ format!(+ "[{}] {} — {}{}",+ s(&r["state"]),+ s(&r["title"]),+ s(&r["note"]),+ if r["action"].is_object() {+ format!(" ({})", btn(&r["action"]))+ } else {+ String::new()+ }+ )+ })+ .collect();+ let x = &k["extra"];+ let choices: Vec<String> = x["choices"]+ .as_array()+ .into_iter()+ .flatten()+ .map(|o| {+ format!(+ "{}: {}{}",+ s(&o["label"]),+ s(&o["detail"]),+ if o["blocked"].is_string() {+ format!(" (blocked: {})", s(&o["blocked"]))+ } else {+ String::new()+ }+ )+ })+ .collect();+ frame["setup"] = json!({+ "title": k["title"],+ "rows": rows,+ "prompt": format!("{}: {} / {}", s(&k["prompt"]["heading"]), s(&k["prompt"]["text"]), s(&k["prompt"]["note"])),+ "extra": {+ "phase": x["phase"],+ "title": x["title"],+ "note": x["note"],+ "choices": choices,+ "action": btn(&x["action"]),+ "footnote": x["footnote"],+ },+ "upsell": if k["upsell"].is_object() {+ let u = &k["upsell"];+ let lines: Vec<String> = u["lines"].as_array().into_iter().flatten().map(&s).collect();+ json!(format!("{} | {} | {} | {} | {}", s(&u["plan"]), s(&u["title"]), lines.join(" / "), s(&u["price"]), btn(&u["cta"])))+ } else { Value::Null },+ "primary": format!("{}{}", btn(&k["primary"]), if k["primary"]["enabled"].as_bool() == Some(true) { "" } else { " (off)" }),+ });+ }+ if case["todos"].as_bool() == Some(true) {+ let t = c(h, "firstRun.todos", json!({ "input": input }))?;+ let items: Vec<String> = t["items"]+ .as_array()+ .into_iter()+ .flatten()+ .map(|i| {+ format!(+ "[{}] {} — {}{}",+ if i["done"].as_bool() == Some(true) {+ "x"+ } else {+ " "+ },+ s(&i["title"]),+ s(&i["note"]),+ if i["action"].is_object() {+ format!(" ({})", btn(&i["action"]))+ } else {+ String::new()+ }+ )+ })+ .collect();+ frame["todos"] = json!({ "lede": t["lede"], "progress": t["progress"], "items": items, "complete": t["complete"] });+ }+ frames.push(frame);+ }+ Ok(json!({ "flow": "first-run", "frames": frames }))+}+fn run_space_facts(f: &Value, h: &dyn Host) -> Result<Value, String> {let mut frames = Vec::new();for case in f["cases"].as_array().into_iter().flatten() {diff --git a/libs/cua/crates/cua-spaces-app-core/src/telemetry.rs b/libs/cua/crates/cua-spaces-app-core/src/telemetry.rsindex 6f1dc6d7b2..36db0c7201 100644--- a/libs/cua/crates/cua-spaces-app-core/src/telemetry.rs+++ b/libs/cua/crates/cua-spaces-app-core/src/telemetry.rs@@ -209,7 +209,9 @@ pub fn feature_used(name: &str) -> Vec<TelemetrySignal> {/// Anything else: nothing.pub fn upsell(surface: &str, action: &str) -> Vec<TelemetrySignal> {let ok = match surface {- "meter" | "share" | "machine" => matches!(action, "shown" | "click" | "dismiss"),+ "meter" | "share" | "machine" | "onboarding" => {+ matches!(action, "shown" | "click" | "dismiss")+ }"plan_card" | "account_menu" => action == "click",_ => false,};diff --git a/libs/cua/crates/cua-spaces-app-core/src/upsell.rs b/libs/cua/crates/cua-spaces-app-core/src/upsell.rsindex 2f24a79eca..28864ddb15 100644--- a/libs/cua/crates/cua-spaces-app-core/src/upsell.rs+++ b/libs/cua/crates/cua-spaces-app-core/src/upsell.rs@@ -33,8 +33,10 @@ pub const REDISMISS_DAYS: u64 = 30;const DAY_MS: u64 = 86_400_000;-/// Where a prompt shows.-pub const SURFACES: [&str; 3] = ["meter", "share", "machine"];+/// Where a prompt shows. `onboarding` is the first run's plan card after the+/// first success ([`crate::first_run::upsell`]): its own rules (once, and+/// "Not now" is for good).+pub const SURFACES: [&str; 4] = ["meter", "share", "machine", "onboarding"];/// What an app remembers between launches, and what is going on now.#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]