Skip to content

armgit / cua

Public Imported from GitHub
0

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

fix(spaces): honest Done screen that sees the CLI and sign-in you already have (CUA-1862) (#5447)

Francesco Bonaccibea1cfd3f55b
diff --git a/apps/cua-spaces-desktop/src/native/generated/cua_spaces_ffi.ts b/apps/cua-spaces-desktop/src/native/generated/cua_spaces_ffi.ts
index 65cfc73d20..d7cdb5063b 100644
--- a/apps/cua-spaces-desktop/src/native/generated/cua_spaces_ffi.ts
+++ b/apps/cua-spaces-desktop/src/native/generated/cua_spaces_ffi.ts
@@ -12621,7 +12621,13 @@ export type AppCliInstallPlan = {
/**
* The line that would be added to `path_profile`.
*/
- pathLine?: string
+ pathLine?: string,
+ /**
+ * A working `cua` CLI already on this machine: `target`, else the
+ * first in the usual install folders or on PATH (a Finder-launched
+ * app's PATH lacks `~/.local/bin`, so the folders are searched too).
+ */
+ found?: string
}
/**
@@ -12656,7 +12662,8 @@ const FfiConverterTypeAppCliInstallPlan = (() => {
shadowedBy: FfiConverterOptionalString.read(from),
onPath: FfiConverterBool.read(from),
pathProfile: FfiConverterOptionalString.read(from),
- pathLine: FfiConverterOptionalString.read(from)
+ pathLine: FfiConverterOptionalString.read(from),
+ found: FfiConverterOptionalString.read(from)
};
}
write(value: TypeName, into: RustBuffer): void {
@@ -12672,6 +12679,7 @@ const FfiConverterTypeAppCliInstallPlan = (() => {
FfiConverterBool.write(value.onPath, into);
FfiConverterOptionalString.write(value.pathProfile, into);
FfiConverterOptionalString.write(value.pathLine, into);
+ FfiConverterOptionalString.write(value.found, into);
}
allocationSize(value: TypeName): number {
return FfiConverterOptionalString.allocationSize(value.source) +
@@ -12685,7 +12693,8 @@ const FfiConverterTypeAppCliInstallPlan = (() => {
FfiConverterOptionalString.allocationSize(value.shadowedBy) +
FfiConverterBool.allocationSize(value.onPath) +
FfiConverterOptionalString.allocationSize(value.pathProfile) +
- FfiConverterOptionalString.allocationSize(value.pathLine);
+ FfiConverterOptionalString.allocationSize(value.pathLine) +
+ FfiConverterOptionalString.allocationSize(value.found);
}
};
@@ -28198,7 +28207,12 @@ export type AppOnboardingState = {
* shown, else when Welcome was left. Once per run, however often
* Welcome shows again (Back).
*/
- runCounted: boolean
+ runCounted: boolean,
+ /**
+ * A page opened from Done's to-do list: leaving it (Continue, Skip or
+ * Back) comes back to Done.
+ */
+ revisit: boolean
}
/**
@@ -28246,7 +28260,8 @@ const FfiConverterTypeAppOnboardingState = (() => {
launchAtLogin: FfiConverterBool.read(from),
telemetry: FfiConverterOptionalTypeAppTelemetryInput.read(from),
experiments: FfiConverterTypeAppExperiments.read(from),
- runCounted: FfiConverterBool.read(from)
+ runCounted: FfiConverterBool.read(from),
+ revisit: FfiConverterBool.read(from)
};
}
write(value: TypeName, into: RustBuffer): void {
@@ -28275,6 +28290,7 @@ const FfiConverterTypeAppOnboardingState = (() => {
FfiConverterOptionalTypeAppTelemetryInput.write(value.telemetry, into);
FfiConverterTypeAppExperiments.write(value.experiments, into);
FfiConverterBool.write(value.runCounted, into);
+ FfiConverterBool.write(value.revisit, into);
}
allocationSize(value: TypeName): number {
return FfiConverterTypeAppOnboardingStep.allocationSize(value.step) +
@@ -28301,7 +28317,132 @@ const FfiConverterTypeAppOnboardingState = (() => {
FfiConverterBool.allocationSize(value.launchAtLogin) +
FfiConverterOptionalTypeAppTelemetryInput.allocationSize(value.telemetry) +
FfiConverterTypeAppExperiments.allocationSize(value.experiments) +
- FfiConverterBool.allocationSize(value.runCounted);
+ FfiConverterBool.allocationSize(value.runCounted) +
+ FfiConverterBool.allocationSize(value.revisit);
+
+ }
+ };
+ return new FFIConverter();
+})();
+
+export enum AppOnboardingTodoId {
+ /**
+ * The Cua CLI.
+ */
+ Cli = "cli",
+ /**
+ * The Cua account.
+ */
+ Signin = "signin",
+ /**
+ * A coding agent that uses cua.
+ */
+ Agents = "agents",
+ /**
+ * Cua Volume (optional).
+ */
+ Volume = "volume"
+}
+
+const FfiConverterTypeAppOnboardingTodoId = (() => {
+ const ordinalConverter = FfiConverterInt32;
+ type TypeName = AppOnboardingTodoId;
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
+ read(from: RustBuffer): TypeName {
+ switch (ordinalConverter.read(from)) {
+ case 1: return AppOnboardingTodoId.Cli;
+ case 2: return AppOnboardingTodoId.Signin;
+ case 3: return AppOnboardingTodoId.Agents;
+ case 4: return AppOnboardingTodoId.Volume;
+ default: throw new UniffiInternalError.UnexpectedEnumCase();
+ }
+ }
+ write(value: TypeName, into: RustBuffer): void {
+ switch (value) {
+ case AppOnboardingTodoId.Cli: return ordinalConverter.write(1, into);
+ case AppOnboardingTodoId.Signin: return ordinalConverter.write(2, into);
+ case AppOnboardingTodoId.Agents: return ordinalConverter.write(3, into);
+ case AppOnboardingTodoId.Volume: return ordinalConverter.write(4, into);
+ }
+ }
+ allocationSize(value: TypeName): number {
+ return ordinalConverter.allocationSize(0);
+ }
+ }
+ return new FFIConverter();
+})();
+
+export type AppOnboardingTodo = {
+ /**
+ * Which.
+ */
+ id: AppOnboardingTodoId,
+ /**
+ * "Cua CLI".
+ */
+ title: string,
+ /**
+ * One plain line under it.
+ */
+ note: string,
+ /**
+ * Set up.
+ */
+ done: boolean,
+ /**
+ * Nice to have: "You're all set" does not wait for it.
+ */
+ optional: boolean,
+ /**
+ * The fix's button ("Install the Cua CLI"), while not done.
+ */
+ action?: string
+}
+
+/**
+ * Generated factory for {@link AppOnboardingTodo} record objects.
+ */
+export const AppOnboardingTodo = (() => {
+ const defaults = () => ({
+ });
+ const create = (() => {
+ return uniffiCreateRecord<AppOnboardingTodo, ReturnType<typeof defaults>>(defaults);
+ })();
+ return Object.freeze({
+ create,
+ new: create,
+ defaults: () => Object.freeze(defaults()) as Partial<AppOnboardingTodo>,
+ });
+})();
+
+const FfiConverterTypeAppOnboardingTodo = (() => {
+ type TypeName = AppOnboardingTodo;
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
+ read(from: RustBuffer): TypeName {
+ return {
+ id: FfiConverterTypeAppOnboardingTodoId.read(from),
+ title: FfiConverterString.read(from),
+ note: FfiConverterString.read(from),
+ done: FfiConverterBool.read(from),
+ optional: FfiConverterBool.read(from),
+ action: FfiConverterOptionalString.read(from)
+ };
+ }
+ write(value: TypeName, into: RustBuffer): void {
+ FfiConverterTypeAppOnboardingTodoId.write(value.id, into);
+ FfiConverterString.write(value.title, into);
+ FfiConverterString.write(value.note, into);
+ FfiConverterBool.write(value.done, into);
+ FfiConverterBool.write(value.optional, into);
+ FfiConverterOptionalString.write(value.action, into);
+ }
+ allocationSize(value: TypeName): number {
+ return FfiConverterTypeAppOnboardingTodoId.allocationSize(value.id) +
+ FfiConverterString.allocationSize(value.title) +
+ FfiConverterString.allocationSize(value.note) +
+ FfiConverterBool.allocationSize(value.done) +
+ FfiConverterBool.allocationSize(value.optional) +
+ FfiConverterOptionalString.allocationSize(value.action);
}
};
@@ -28580,7 +28721,13 @@ export type AppOnboardingView = {
/**
* Done's "Launch at login" checkbox.
*/
- launchAtLogin?: AppOnboardingCheckbox
+ launchAtLogin?: AppOnboardingCheckbox,
+ /**
+ * Done's to-do list: the Cua CLI, the account, an AI agent and Cua
+ * Volume, each set up or with its fix. The title says "Almost done"
+ * until every one that is not optional is.
+ */
+ todos: Array<AppOnboardingTodo>
}
/**
@@ -28622,7 +28769,8 @@ const FfiConverterTypeAppOnboardingView = (() => {
noticeLinkUrl: FfiConverterOptionalString.read(from),
usage: FfiConverterOptionalTypeAppUsageToggle.read(from),
drive: FfiConverterOptionalTypeAppDriveCard.read(from),
- launchAtLogin: FfiConverterOptionalTypeAppOnboardingCheckbox.read(from)
+ launchAtLogin: FfiConverterOptionalTypeAppOnboardingCheckbox.read(from),
+ todos: FfiConverterSequenceTypeAppOnboardingTodo.read(from)
};
}
write(value: TypeName, into: RustBuffer): void {
@@ -28645,6 +28793,7 @@ const FfiConverterTypeAppOnboardingView = (() => {
FfiConverterOptionalTypeAppUsageToggle.write(value.usage, into);
FfiConverterOptionalTypeAppDriveCard.write(value.drive, into);
FfiConverterOptionalTypeAppOnboardingCheckbox.write(value.launchAtLogin, into);
+ FfiConverterSequenceTypeAppOnboardingTodo.write(value.todos, into);
}
allocationSize(value: TypeName): number {
return FfiConverterTypeAppOnboardingStep.allocationSize(value.step) +
@@ -28665,7 +28814,8 @@ const FfiConverterTypeAppOnboardingView = (() => {
FfiConverterOptionalString.allocationSize(value.noticeLinkUrl) +
FfiConverterOptionalTypeAppUsageToggle.allocationSize(value.usage) +
FfiConverterOptionalTypeAppDriveCard.allocationSize(value.drive) +
- FfiConverterOptionalTypeAppOnboardingCheckbox.allocationSize(value.launchAtLogin);
+ FfiConverterOptionalTypeAppOnboardingCheckbox.allocationSize(value.launchAtLogin) +
+ FfiConverterSequenceTypeAppOnboardingTodo.allocationSize(value.todos);
}
};
@@ -50438,7 +50588,9 @@ export enum AppOnboardingAction_Tags {
TelemetryLoaded = "TelemetryLoaded",
WelcomeShown = "WelcomeShown",
UsageDataToggled = "UsageDataToggled",
- ExperimentsLoaded = "ExperimentsLoaded"
+ ExperimentsLoaded = "ExperimentsLoaded",
+ TodoChosen = "TodoChosen",
+ AgentsDetected = "AgentsDetected"
}
export const AppOnboardingAction = (() => {
@@ -51292,6 +51444,77 @@ inner: {experiments: AppExperiments }): ExperimentsLoaded_ {
}
+ type TodoChosen__interface = {
+ tag: AppOnboardingAction_Tags.TodoChosen;
+ inner:
+Readonly<{id: AppOnboardingTodoId}>
+ };
+ /**
+ * A to-do on Done was clicked: its page opens, and leaving it comes
+ * back to Done. Cua Volume needs its experiment on first (the shell
+ * turns it on and sends `experiments-loaded`).
+ */
+ class TodoChosen_ extends UniffiEnum implements TodoChosen__interface {
+ /**
+ * @private
+ * This field is private and should not be used, use `tag` instead.
+ */
+ readonly [uniffiTypeNameSymbol] = "AppOnboardingAction";
+ readonly tag = AppOnboardingAction_Tags.TodoChosen;
+ readonly inner:
+Readonly<{id: AppOnboardingTodoId}>;
+ constructor(
+inner: {id: AppOnboardingTodoId }) {
+ super("AppOnboardingAction", "TodoChosen");
+
+ this.inner = Object.freeze(inner);
+ }
+ static new(
+inner: {id: AppOnboardingTodoId }): TodoChosen_ {
+ return new TodoChosen_(inner);
+ }
+
+ static instanceOf(obj: any): obj is TodoChosen_ {
+ return obj.tag === AppOnboardingAction_Tags.TodoChosen;
+ }
+
+ }
+
+ type AgentsDetected__interface = {
+ tag: AppOnboardingAction_Tags.AgentsDetected;
+ inner:
+Readonly<{configured: Array<string>}>
+ };
+ /**
+ * The coding agents that already use cua (set up earlier, from the
+ * CLI or Settings), as the shell read them. Any page.
+ */
+ class AgentsDetected_ extends UniffiEnum implements AgentsDetected__interface {
+ /**
+ * @private
+ * This field is private and should not be used, use `tag` instead.
+ */
+ readonly [uniffiTypeNameSymbol] = "AppOnboardingAction";
+ readonly tag = AppOnboardingAction_Tags.AgentsDetected;
+ readonly inner:
+Readonly<{configured: Array<string>}>;
+ constructor(
+inner: {configured: Array<string> }) {
+ super("AppOnboardingAction", "AgentsDetected");
+
+ this.inner = Object.freeze(inner);
+ }
+ static new(
+inner: {configured: Array<string> }): AgentsDetected_ {
+ return new AgentsDetected_(inner);
+ }
+
+ static instanceOf(obj: any): obj is AgentsDetected_ {
+ return obj.tag === AppOnboardingAction_Tags.AgentsDetected;
+ }
+
+ }
+
function instanceOf(obj: any): obj is AppOnboardingAction {
return obj[uniffiTypeNameSymbol] === "AppOnboardingAction";
}
@@ -51323,12 +51546,14 @@ inner: {experiments: AppExperiments }): ExperimentsLoaded_ {
TelemetryLoaded: TelemetryLoaded_,
WelcomeShown: WelcomeShown_,
UsageDataToggled: UsageDataToggled_,
- ExperimentsLoaded: ExperimentsLoaded_
+ ExperimentsLoaded: ExperimentsLoaded_,
+ TodoChosen: TodoChosen_,
+ AgentsDetected: AgentsDetected_
});
})();
export type AppOnboardingAction = InstanceType<
- typeof AppOnboardingAction['Start' | 'CliInstalled' | 'CliPlanned' | 'CliDone' | 'CliInstallFailed' | 'PresentationPicked' | 'PresentationDone' | 'SignedIn' | 'SigninDone' | 'AgentsDone' | 'ModeChosen' | 'DriveChecked' | 'DriveToggled' | 'DriveContinue' | 'DriveMounted' | 'DriveFailed' | 'DriveStorageLoaded' | 'StorageChosen' | 'DriveStorage' | 'DriveStorageSaved' | 'LaunchAtLoginToggled' | 'Back' | 'TelemetryLoaded' | 'WelcomeShown' | 'UsageDataToggled' | 'ExperimentsLoaded']
+ typeof AppOnboardingAction['Start' | 'CliInstalled' | 'CliPlanned' | 'CliDone' | 'CliInstallFailed' | 'PresentationPicked' | 'PresentationDone' | 'SignedIn' | 'SigninDone' | 'AgentsDone' | 'ModeChosen' | 'DriveChecked' | 'DriveToggled' | 'DriveContinue' | 'DriveMounted' | 'DriveFailed' | 'DriveStorageLoaded' | 'StorageChosen' | 'DriveStorage' | 'DriveStorageSaved' | 'LaunchAtLoginToggled' | 'Back' | 'TelemetryLoaded' | 'WelcomeShown' | 'UsageDataToggled' | 'ExperimentsLoaded' | 'TodoChosen' | 'AgentsDetected']
>;
// FfiConverter for enum AppOnboardingAction
@@ -51364,6 +51589,8 @@ const FfiConverterTypeAppOnboardingAction = (() => {
case 24: return new AppOnboardingAction.WelcomeShown();
case 25: return new AppOnboardingAction.UsageDataToggled({on: FfiConverterBool.read(from) });
case 26: return new AppOnboardingAction.ExperimentsLoaded({experiments: FfiConverterTypeAppExperiments.read(from) });
+ case 27: return new AppOnboardingAction.TodoChosen({id: FfiConverterTypeAppOnboardingTodoId.read(from) });
+ case 28: return new AppOnboardingAction.AgentsDetected({configured: FfiConverterSequenceString.read(from) });
default: throw new UniffiInternalError.UnexpectedEnumCase();
}
}
@@ -51515,6 +51742,18 @@ const FfiConverterTypeAppOnboardingAction = (() => {
FfiConverterTypeAppExperiments.write(inner.experiments, into);
return;
}
+ case AppOnboardingAction_Tags.TodoChosen: {
+ ordinalConverter.write(27, into);
+ const inner = value.inner;
+ FfiConverterTypeAppOnboardingTodoId.write(inner.id, into);
+ return;
+ }
+ case AppOnboardingAction_Tags.AgentsDetected: {
+ ordinalConverter.write(28, into);
+ const inner = value.inner;
+ FfiConverterSequenceString.write(inner.configured, into);
+ return;
+ }
default:
// Throwing from here means that AppOnboardingAction_Tags hasn't matched an ordinal.
throw new UniffiInternalError.UnexpectedEnumCase();
@@ -51662,6 +51901,18 @@ const FfiConverterTypeAppOnboardingAction = (() => {
size += FfiConverterTypeAppExperiments.allocationSize(inner.experiments);
return size;
}
+ case AppOnboardingAction_Tags.TodoChosen: {
+ const inner = value.inner;
+ let size = ordinalConverter.allocationSize(27);
+ size += FfiConverterTypeAppOnboardingTodoId.allocationSize(inner.id);
+ return size;
+ }
+ case AppOnboardingAction_Tags.AgentsDetected: {
+ const inner = value.inner;
+ let size = ordinalConverter.allocationSize(28);
+ size += FfiConverterSequenceString.allocationSize(inner.configured);
+ return size;
+ }
default: throw new UniffiInternalError.UnexpectedEnumCase();
}
}
@@ -60050,6 +60301,9 @@ const FfiConverterOptionalTypeAppDriveCard = new FfiConverterOptional(FfiConvert
// FfiConverter for AppOnboardingCheckbox | undefined
const FfiConverterOptionalTypeAppOnboardingCheckbox = new FfiConverterOptional(FfiConverterTypeAppOnboardingCheckbox);
+// FfiConverter for Array<AppOnboardingTodo>
+const FfiConverterSequenceTypeAppOnboardingTodo = new FfiConverterArray(FfiConverterTypeAppOnboardingTodo);
+
// FfiConverter for Array<AppPickerTile>
const FfiConverterSequenceTypeAppPickerTile = new FfiConverterArray(FfiConverterTypeAppPickerTile);
@@ -61741,6 +61995,8 @@ export default Object.freeze({
FfiConverterTypeAppOnboardingMode,
FfiConverterTypeAppOnboardingState,
FfiConverterTypeAppOnboardingStep,
+ FfiConverterTypeAppOnboardingTodo,
+ FfiConverterTypeAppOnboardingTodoId,
FfiConverterTypeAppOnboardingView,
FfiConverterTypeAppOpenApp,
FfiConverterTypeAppOpenFileInput,
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppModel.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppModel.swift
index 7ac87eaa3b..95f4ab7c16 100644
--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppModel.swift
+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppModel.swift
@@ -229,6 +229,12 @@ public final class AppModel {
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)
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/OnboardingModel.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/OnboardingModel.swift
index f9e41ad90c..faf1777d32 100644
--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/OnboardingModel.swift
+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/OnboardingModel.swift
@@ -344,6 +344,49 @@ public final class OnboardingModel {
// 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))
@@ -362,8 +405,15 @@ public final class OnboardingModel {
/// starts from it, as if it had been known from the start.
public func adoptIdentity(_ identity: String?) {
host.identity = identity
- guard !completed, state.step == .welcome, state.identity != identity else { return }
- state.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
+ }
}
/// Shows the flow again (Settings).
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/OnboardingView.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/OnboardingView.swift
index 898b638200..add2c3b459 100644
--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/OnboardingView.swift
+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/OnboardingView.swift
@@ -63,7 +63,8 @@ public struct OnboardingView: View {
teamsLine
}
}
- .frame(maxWidth: .infinity, alignment: .leading)
+ // Done's to-do list takes the room it needs.
+ .frame(maxWidth: v.step == .done ? 250 : .infinity, alignment: .leading)
card(v)
.frame(maxWidth: .infinity)
}
@@ -82,6 +83,9 @@ public struct OnboardingView: View {
}
.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() } }
}
@@ -281,16 +285,24 @@ public struct OnboardingView: View {
}
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)
- .font(f.label == "cua command" && onboarding.state.cliTarget != nil ? .body.monospaced() : .body)
- .lineLimit(1).truncationMode(.middle)
+ 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)
@@ -580,6 +592,39 @@ public struct OnboardingView: View {
}
}
+/// 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.
diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/DriveTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/DriveTests.swift
index b05061ecb7..37e3dc1c3b 100644
--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/DriveTests.swift
+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/DriveTests.swift
@@ -159,7 +159,7 @@ struct DriveTests {
await p.continueDrive()
#expect(p.view.step == .mode)
p.send(.modeChosen(mode: .client))
- #expect(p.view.summary.first { $0.label == "Cua Volume" }?.value == "In Finder")
+ #expect(p.view.todos.first { $0.id == .volume }?.done == true, "Done shows Cua Volume on")
}
@Test func theFirstRunSavesYourBucketThenMounts() async throws {
diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/OnboardingTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/OnboardingTests.swift
index ed6f212c80..637f387dde 100644
--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/OnboardingTests.swift
+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/OnboardingTests.swift
@@ -99,7 +99,7 @@ struct OnboardingTests {
#expect(o.view.step == .welcome)
o.send(.start)
#expect(o.view.step == .cli)
- #expect(o.view.title == "Install the cua command and add it to your PATH")
+ #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)
@@ -126,7 +126,7 @@ struct OnboardingTests {
o.send(.presentationDone)
o.send(.driveContinue)
o.send(.modeChosen(mode: .client))
- #expect(o.view.summary.first { $0.label == "cua command" }?.value == target)
+ #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())
@@ -191,7 +191,7 @@ struct OnboardingTests {
toMode(o)
o.send(.modeChosen(mode: .client))
#expect(o.view.step == .done)
- #expect(o.view.summary.first { $0.label == "cua command" }?.value == target, "Done shows the installed path")
+ #expect(o.view.todos.first { $0.id == .cli }?.done == true, "Done counts the installed Cua CLI")
}
@Test func withoutABundledCliNothingIsInstalled() async throws {
@@ -230,6 +230,30 @@ struct OnboardingTests {
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() {
@@ -343,7 +367,7 @@ struct OnboardingTests {
#expect(o.state.mode == .host)
#expect(o.hostPermissions.map(\.id) == ["accessibility"])
#expect(!o.showingHostForm)
- #expect(o.view.summary.last?.value == "Reachable from your other devices")
+ #expect(o.view.summary.last?.value == "Your other devices can reach it")
}
@Test func directSetupNeedsAnAddressAndSendsNoToken() async {
diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ParityTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ParityTests.swift
index c43804653d..620a0a3444 100644
--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ParityTests.swift
+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ParityTests.swift
@@ -1284,6 +1284,10 @@ struct ParityTests {
"showMark": v.showMark,
"dots": v.dots.map { "\($0.current ? "*" : "")\($0.label)" }.joined(separator: ","),
"summary": facts(v.summary),
+ // Done's to-do list: `[x] title ~note -> fix (optional)`.
+ "todos": v.todos.map { t in
+ "[\(t.done ? "x" : " ")] \(t.title) ~\(t.note)\(t.action.map { " -> \($0)" } ?? "")\(t.optional ? " (optional)" : "")"
+ },
"choices": v.choices.map { "\($0.mode): \($0.label)\($0.preselected ? " (preselected)" : "")" },
"presentations": v.presentations.map { "\($0.title) [\($0.id)]\($0.selected ? " (selected)" : "")" },
"prompts": v.prompts,
diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/SnapshotTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/SnapshotTests.swift
index e668f5c825..4dd0a41c94 100644
--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/SnapshotTests.swift
+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/SnapshotTests.swift
@@ -66,6 +66,11 @@ struct SnapshotTests {
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:
diff --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.png
new file mode 100644
index 0000000000..a83e95d97b
Binary files /dev/null and b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-done-all-set.png differ
diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-done.png b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-done.png
index fcf94f1d51..d6fcac2743 100644
Binary files a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-done.png and b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/Snapshots/onboarding-done.png differ
diff --git a/apps/cua-spaces-web/src/bridge/__tests__/onboarding.test.tsx b/apps/cua-spaces-web/src/bridge/__tests__/onboarding.test.tsx
index 2846a420f1..ec840f12a6 100644
--- a/apps/cua-spaces-web/src/bridge/__tests__/onboarding.test.tsx
+++ b/apps/cua-spaces-web/src/bridge/__tests__/onboarding.test.tsx
@@ -77,10 +77,20 @@ describe.each([
s = onboardingReduce(core, s, { type: "agents-done", configured: ["Codex"] }, ctx);
s = onboardingReduce(core, s, { type: "mode-chosen", mode: "client" }, ctx);
expect(s.step).toBe("done");
- const v = onboardingView(core, s, "linux");
+ // Not signed in yet: Done says so, with the fix (the web has no Cua CLI page, so no CLI line).
+ let v = onboardingView(core, s, "linux");
+ expect(v.title).toBe("Almost done");
+ expect(v.lede).toBe("One thing is left. You can finish it now, or later from the system tray.");
+ const required = (view: typeof v) => (view.todos ?? []).filter((t) => !t.optional);
+ expect(required(v).map((t) => [t.id, t.done, t.action ?? null])).toEqual([
+ ["signin", false, "Sign in"],
+ ["agents", true, null],
+ ]);
+ expect(v.summary.map((f) => f.label)).toEqual(["This machine"]);
+ expect(onboardingView(core, s, "windows").summary.map((f) => f.label)).toEqual(["This machine"]);
+ s = onboardingReduce(core, s, { type: "signed-in", identity: "[email protected]" }, ctx);
+ v = onboardingView(core, s, "linux");
expect(v.title).toBe("You're all set");
- expect(v.summary.map((f) => f.label)).toEqual(["Account", "AI agents", "This machine"]);
- expect(onboardingView(core, s, "windows").summary.map((f) => f.label)).toEqual(["Account", "AI agents", "This machine"]);
// Where the app stays: the menu bar on a Mac, the tray on Windows and Linux.
expect(onboardingView(core, s, "macos").lede).toBe("Cua Spaces is in your menu bar.");
expect(onboardingView(core, s, "windows").lede).toBe("Cua Spaces is in your system tray.");
@@ -120,7 +130,8 @@ describe.each([
s = onboardingReduce(core, s, { type: "presentation-done" }, { ...mac, menuBar: true });
s = onboardingReduce(core, s, { type: "mode-chosen", mode: "client" }, { ...mac, menuBar: true });
v = onboardingView(core, s, "macos");
- expect(v.summary.map((f) => f.label)).toEqual(["Account", "AI agents", "Shows in", "This machine"]);
+ expect(v.summary.map((f) => f.label)).toEqual(["Shows in", "This machine"]);
+ expect((v.todos ?? []).some((t) => t.id === "cli")).toBe(false);
expect(v.summary.find((f) => f.label === "Shows in")?.value).toBe("Menu bar only");
});
diff --git a/apps/cua-spaces-web/src/bridge/__tests__/volume.test.tsx b/apps/cua-spaces-web/src/bridge/__tests__/volume.test.tsx
index 7a4f785d1a..bd7ce47d30 100644
--- a/apps/cua-spaces-web/src/bridge/__tests__/volume.test.tsx
+++ b/apps/cua-spaces-web/src/bridge/__tests__/volume.test.tsx
@@ -127,6 +127,8 @@ describe.skipIf(!wasmBuilt)("the first run's Cua Volume page", () => {
await waitFor(() => expect(readSavedOnboarding().state?.step).toBe("mode"));
expect(adapter.state.volume.mounted).toBe(true);
act(() => probe.flow.send({ type: "mode-chosen", mode: "client" }));
- expect(probe.flow.view?.summary.find((f) => f.label === "Cua Volume")?.value).toBe("In Finder");
+ const volume = probe.flow.view?.todos?.find((t) => t.id === "volume");
+ expect(volume?.done).toBe(true);
+ expect(volume?.note).toBe("Shared folder: files your agents can share across your computers. In Finder.");
});
});
diff --git a/apps/cua-spaces-web/src/bridge/contracts/onboarding.ts b/apps/cua-spaces-web/src/bridge/contracts/onboarding.ts
index 7ac0bc1e04..cbdefcd6b8 100644
--- a/apps/cua-spaces-web/src/bridge/contracts/onboarding.ts
+++ b/apps/cua-spaces-web/src/bridge/contracts/onboarding.ts
@@ -71,7 +71,26 @@ export type OnboardingAction =
| { type: "drive-storage-loaded"; storage: DriveStorageInput; home: string | null }
| { type: "storage-chosen"; choice: StorageChoice }
| { type: "drive-storage"; action: StorageAction }
- | { type: "drive-storage-saved"; check: DriveCheckInput };
+ | { type: "drive-storage-saved"; check: DriveCheckInput }
+ /** A fix on Done's to-do list: its page opens, and leaving it comes back to Done. */
+ | { type: "todo-chosen"; id: OnboardingTodoId }
+ /** The coding agents that already use cua (set up earlier). */
+ | { type: "agents-detected"; configured: string[] };
+
+/** `OnboardingTodoId`: a line of Done's to-do list. */
+export type OnboardingTodoId = "cli" | "signin" | "agents" | "volume";
+
+/** `OnboardingTodo`: what is set up on Done, and a one-click fix for what is not. */
+export interface OnboardingTodo {
+ id: OnboardingTodoId;
+ title: string;
+ note: string;
+ done: boolean;
+ /** Nice to have: "You're all set" does not wait for it. */
+ optional: boolean;
+ /** The fix's button ("Sign in"), while not done. */
+ action?: string | null;
+}
export interface OnboardingDot {
step: OnboardingStep;
@@ -139,6 +158,8 @@ export interface OnboardingView {
prompts?: string[];
/** Done's "Launch at login" checkbox (on Done only). */
launchAtLogin?: OnboardingCheckbox | null;
+ /** Done's to-do list (on Done only). */
+ todos?: OnboardingTodo[];
}
/** `OnboardingCheckbox`: Done's "Launch at login". */
diff --git a/apps/cua-spaces-web/src/bridge/hooks.ts b/apps/cua-spaces-web/src/bridge/hooks.ts
index 4199cce420..cf85e02c05 100644
--- a/apps/cua-spaces-web/src/bridge/hooks.ts
+++ b/apps/cua-spaces-web/src/bridge/hooks.ts
@@ -15,7 +15,9 @@ import type {
OnboardingView,
PermissionRow,
SandboxImage,
+ OnboardingTodoId,
} from "./contracts/onboarding";
+import { NO_EXPERIMENTS, type Experiments } from "./contracts/volume";
import type { KvGrant, KvListView, KvSelection, VaultAction } from "./contracts/keyvault";
import type { KvAccessCommand } from "./ops/keyvault-manage";
import type { Space } from "./contracts/spaces";
@@ -383,6 +385,9 @@ export interface OnboardingHook {
/** Sends an action through the core. The usage-data switch and the Menu
* bar choice also write the machine's setting (telemetry, `menuBar`). */
send(action: OnboardingAction): void;
+ /** A fix on Done's to-do list: opens its page (Cua Volume turns its
+ * experiment on first); leaving the page comes back to Done. */
+ fixTodo(id: OnboardingTodoId): Promise<void>;
/** Leaves the flow for now; it resumes on the same page. */
skip(): void;
/** Done: records the choice with the host and forgets the saved progress. */
@@ -469,6 +474,28 @@ export function useOnboarding(): OnboardingHook {
if (missing.some((p) => !(p.id in shown))) setShown((cur) => ({ ...cur, ...Object.fromEntries(missing.map((p) => [p.id, p.label])) }));
}, [hints, shown]);
+ // Done counts the coding agents set up before (from the CLI or
+ // Settings), not only the ones this run set up.
+ const onDone = state?.step === "done";
+ useEffect(() => {
+ if (!onDone || !adapter) return;
+ let live = true;
+ adapter.call("agents.setup", {}).then(
+ (rows) => {
+ const names = rows.filter((r) => r.installed && r.configured).map((r) => r.name);
+ const cur = readSavedOnboarding().state;
+ const known = Array.isArray(cur?.agents) ? (cur.agents as string[]) : [];
+ if (!live || !cur || names.every((n) => known.includes(n))) return;
+ writeSavedOnboarding({ ...readSavedOnboarding(), state: onboardingReduce(core, cur, { type: "agents-detected", configured: names }, ctx) });
+ },
+ () => undefined,
+ );
+ return () => {
+ live = false;
+ };
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [onDone, adapter, core]);
+
const drawn = state ? onboardingView(core, state) : null;
// No switch until the host has said what the setting is: an "on" it
// could not write would not be true.
@@ -515,6 +542,17 @@ export function useOnboarding(): OnboardingHook {
images: firstSpaceImages(core),
launchAtLogin: mode === "electron" ? (view?.launchAtLogin ?? null) : null,
send,
+ fixTodo: async (id) => {
+ const current = readSavedOnboarding().state;
+ const experiments = (current?.experiments ?? null) as Experiments | null;
+ // Cua Volume is an experiment today: "Turn on" turns it on first.
+ if (id === "volume" && adapter && !experiments?.cuaVolume) {
+ const now = { ...NO_EXPERIMENTS, ...(await adapter.call("experiments.get", {}).catch(() => ({}))), cuaVolume: true };
+ await adapter.call("experiments.set", { experiments: now });
+ send({ type: "experiments-loaded", experiments: now });
+ }
+ send({ type: "todo-chosen", id });
+ },
skip: () => {
const current = readSavedOnboarding().state;
if (current) store?.trackOnboardingSkipped(current);
diff --git a/apps/cua-spaces-web/src/bridge/onboarding.ts b/apps/cua-spaces-web/src/bridge/onboarding.ts
index b70579e1d5..573819f776 100644
--- a/apps/cua-spaces-web/src/bridge/onboarding.ts
+++ b/apps/cua-spaces-web/src/bridge/onboarding.ts
@@ -31,6 +31,7 @@ import type {
OnboardingFlowState,
OnboardingStep,
OnboardingTelemetry,
+ OnboardingTodo,
OnboardingView,
PermissionRow,
SandboxImage,
@@ -49,10 +50,11 @@ export function passedSteps(os: HostOs = hostOs()): readonly OnboardingStep[] {
return hasNotch(os) ? [] : ["presentation"];
}
-/** Done's summary facts about pages the web passes through: the `cua`
- * install is the SwiftUI app's own page, Shows in follows Menu bar. */
+/** Done's summary facts about pages the web passes through: Shows in
+ * follows Menu bar. (The Cua CLI install is the SwiftUI app's own page:
+ * the core leaves it off Done for the web, `withoutCli`.) */
function passedFacts(os: HostOs): Set<string> {
- return new Set(hasNotch(os) ? ["cua command"] : ["cua command", "Shows in"]);
+ return new Set(hasNotch(os) ? [] : ["Shows in"]);
}
/** What the pass-through answers need from the host. */
@@ -119,7 +121,7 @@ export function onboardingReduce(
* passes through, in the words of the system the app runs on (the tray off
* a Mac). */
export function onboardingView(core: CoreClient, state: OnboardingFlowState, os: HostOs = hostOs()): OnboardingView {
- const v = core.tryCall<OnboardingView>("onboarding.view", { state, hostOs: os }) ?? fallbackView(state, os);
+ const v = core.tryCall<OnboardingView>("onboarding.view", { state, hostOs: os, withoutCli: true }) ?? fallbackView(state, os);
const passed = passedSteps(os);
const facts = passedFacts(os);
return {
@@ -212,6 +214,8 @@ function fallbackReduce(s: OnboardingFlowState, a: OnboardingAction): Onboarding
return at("signin") ? { ...s, step: "agents" } : s;
case "agents-done":
return at("agents") ? { ...s, agents: a.configured, step: "presentation" } : s;
+ case "agents-detected":
+ return { ...s, agents: [...new Set([...(Array.isArray(s.agents) ? (s.agents as string[]) : []), ...a.configured])] };
case "presentation-picked":
return at("presentation") ? { ...s, menuBar: a.menuBar } : s;
case "presentation-done":
@@ -232,6 +236,29 @@ function fallbackReduce(s: OnboardingFlowState, a: OnboardingAction): Onboarding
}
}
+/** Done's to-do list without the core (the core's `done_todos`, less the Cua CLI). */
+function fallbackTodos(s: OnboardingFlowState): OnboardingTodo[] {
+ const agents = Array.isArray(s.agents) ? (s.agents as string[]) : [];
+ return [
+ {
+ id: "signin",
+ title: "Account",
+ note: s.identity ? `Signed in as ${s.identity}.` : "Reach your computers from any device.",
+ done: Boolean(s.identity),
+ optional: false,
+ action: s.identity ? null : "Sign in",
+ },
+ {
+ id: "agents",
+ title: "AI agents",
+ note: agents.length ? `${agents.join(", ")} can use Cua.` : "Let Claude Code, Codex and others use Cua.",
+ done: agents.length > 0,
+ optional: false,
+ action: agents.length ? null : "Connect an AI agent",
+ },
+ ];
+}
+
/** How the copy names the computer the app runs on (the core's `this_computer`). */
function thisComputer(os: HostOs): string {
return os === "macos" ? "this Mac" : os === "windows" ? "this PC" : "this computer";
@@ -245,6 +272,18 @@ function fallbackView(s: OnboardingFlowState, os: HostOs): OnboardingView {
mode: [`How do you want to use ${thisComputer(os)}?`, "Use it only to open your other computers, or let your other devices reach it too. You can change this later.", "Continue"],
done: ["You're all set", os === "macos" ? "Cua Spaces is in your menu bar." : "Cua Spaces is in your system tray.", "Start using Cua Spaces"],
};
+ const todos = s.step === "done" ? fallbackTodos(s) : [];
+ const left = todos.filter((t) => !t.done && !t.optional).length;
+ const place = os === "macos" ? "the menu bar" : "the system tray";
+ if (left > 0) {
+ pages.done = [
+ "Almost done",
+ left === 1
+ ? `One thing is left. You can finish it now, or later from ${place}.`
+ : `${left} things are left. You can finish them now, or later from ${place}.`,
+ "Start using Cua Spaces",
+ ];
+ }
const [title, lede, primaryLabel] = pages[s.step] ?? ["", "", "Continue"];
const pre = s.installerMode ?? "client";
const locked = s.telemetry?.lockedBy || null;
@@ -261,12 +300,11 @@ function fallbackView(s: OnboardingFlowState, os: HostOs): OnboardingView {
summary:
s.step === "done"
? [
- { label: "Account", value: s.identity ?? "not signed in" },
- { label: "AI agents", value: Array.isArray(s.agents) && s.agents.length ? s.agents.join(", ") : "none" },
{ label: "Shows in", value: s.menuBar ? "Menu bar only" : "Notch and menu bar" },
- { label: "This machine", value: s.mode === "host" ? "Reachable from your other devices" : "Only used to open other computers" },
+ { label: "This machine", value: s.mode === "host" ? "Your other devices can reach it" : "Opens your other computers" },
]
: [],
+ todos,
choices:
s.step === "mode"
? [
diff --git a/apps/cua-spaces-web/src/routes/onboarding/index.tsx b/apps/cua-spaces-web/src/routes/onboarding/index.tsx
index 785dc3abea..0b0f34a00f 100644
--- a/apps/cua-spaces-web/src/routes/onboarding/index.tsx
+++ b/apps/cua-spaces-web/src/routes/onboarding/index.tsx
@@ -2,6 +2,7 @@
// 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 {
@@ -365,13 +366,44 @@ function Permissions({ flow }: { flow: OnboardingHook }) {
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 ?? [];
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>
+ ))}
+ </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 className="truncate">{f.value}</dd>
+ <dd>{f.value}</dd>
</div>
))}
</dl>
diff --git a/apps/cua-spaces/src-tauri/tests/installer_commands.rs b/apps/cua-spaces/src-tauri/tests/installer_commands.rs
index ca565915b0..a924c8a8f1 100644
--- a/apps/cua-spaces/src-tauri/tests/installer_commands.rs
+++ b/apps/cua-spaces/src-tauri/tests/installer_commands.rs
@@ -22,6 +22,7 @@ fn installer(dir: &Path, bundled: Option<PathBuf>, path_env: &str, symlink: bool
path_env: path_env.to_string(),
profile: dir.join("home/.zshrc"),
prefer_symlink: symlink,
+ search_dirs: vec![],
}
}
diff --git a/apps/cua-spaces/src/components/InstallerFlow.test.tsx b/apps/cua-spaces/src/components/InstallerFlow.test.tsx
index f656963db4..cef63b3f02 100644
--- a/apps/cua-spaces/src/components/InstallerFlow.test.tsx
+++ b/apps/cua-spaces/src/components/InstallerFlow.test.tsx
@@ -199,9 +199,10 @@ describe("InstallerFlow", () => {
expect(await screen.findByText("How do you want to use this Mac?")).toBeInTheDocument();
click("Continue");
expect(await screen.findByText("You're all set")).toBeInTheDocument();
- expect(screen.getByText("/Users/ada/.local/bin/cua")).toBeInTheDocument();
- expect(screen.getByText("[email protected]")).toBeInTheDocument();
- expect(screen.getByText("Claude Code")).toBeInTheDocument();
+ // The bundled cua installs silently here: Done lists the account and the agents.
+ expect(screen.getByText("Signed in as [email protected].")).toBeInTheDocument();
+ expect(screen.getByText("Claude Code can use Cua.")).toBeInTheDocument();
+ expect(screen.queryByText("Cua CLI")).toBeNull();
expect(screen.getByText("Menu bar only")).toBeInTheDocument();
expect(drive.tools()).toEqual(["volume_mount_status", "volume_storage"]);
// Three static example prompts under a label; each copies on click.
@@ -412,8 +413,11 @@ describe("InstallerFlow", () => {
/>,
);
click("Turn on remote access");
- expect(await screen.findByText("You're all set")).toBeInTheDocument();
- expect(screen.getByText("Reachable from your other devices")).toBeInTheDocument();
+ // Signed in, no agent yet: honest, with the fix.
+ expect(await screen.findByText("Almost done")).toBeInTheDocument();
+ expect(screen.getByText("Your other devices can reach it")).toBeInTheDocument();
+ expect(screen.getByRole("button", { name: "Connect an AI agent" })).toBeInTheDocument();
+ expect(screen.queryByRole("button", { name: "Sign in" })).toBeNull();
expect(screen.queryByText("Grant in System Settings")).toBeNull();
click("Start using Cua Spaces");
expect(onDone).toHaveBeenCalledWith("host");
diff --git a/apps/cua-spaces/src/components/InstallerFlow.tsx b/apps/cua-spaces/src/components/InstallerFlow.tsx
index 743486361c..2af12c3a37 100644
--- a/apps/cua-spaces/src/components/InstallerFlow.tsx
+++ b/apps/cua-spaces/src/components/InstallerFlow.tsx
@@ -152,7 +152,7 @@ export function InstallerFlow({
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [initialIdentity]);
- const view = onboardingView(state);
+ const view = onboardingView(state, true);
// Welcome's usage-data switch starts from the machine's setting (the
// same one as Settings, Privacy and `cua telemetry off`).
useEffect(() => {
@@ -447,11 +447,28 @@ export function InstallerFlow({
</button>
}
>
+ <ul className="onboarding-todos">
+ {(view.todos ?? []).map((t) => (
+ <li key={t.id} data-done={t.done || undefined}>
+ <span aria-hidden>{t.done ? "\u2713" : "\u25cb"}</span>
+ <div>
+ <strong>{t.title}</strong>
+ <p className="st-note">{t.note}</p>
+ </div>
+ {/* Cua Volume opens its page once its experiment is on (Settings, Experiments). */}
+ {t.action && (t.id !== "volume" || state.experiments?.cuaVolume) ? (
+ <button type="button" className="secondary-button" onClick={() => send({ type: "todo-chosen", id: t.id })}>
+ {t.action}
+ </button>
+ ) : null}
+ </li>
+ ))}
+ </ul>
<dl className="this-machine-facts">
{view.summary.map((f) => (
<div key={f.label}>
<dt>{f.label}</dt>
- <dd>{f.label === "cua command" && state.cliTarget ? <code>{f.value}</code> : f.value}</dd>
+ <dd>{f.value}</dd>
</div>
))}
</dl>
diff --git a/apps/cua-spaces/src/model/onboarding.ts b/apps/cua-spaces/src/model/onboarding.ts
index d42aa5212c..9102e3c818 100644
--- a/apps/cua-spaces/src/model/onboarding.ts
+++ b/apps/cua-spaces/src/model/onboarding.ts
@@ -77,8 +77,22 @@ export type OnboardingAction =
| { type: "drive-storage-saved"; check: DriveCheckInput }
| { type: "launch-at-login-toggled"; on: boolean }
| { type: "experiments-loaded"; experiments: import("./experiments").Experiments }
+ | { type: "todo-chosen"; id: OnboardingTodoId }
| { type: "back" };
+/** A line of Done's to-do list. */
+export type OnboardingTodoId = "cli" | "signin" | "agents" | "volume";
+
+/** What is set up on Done, and a one-click fix for what is not. */
+export interface OnboardingTodo {
+ id: OnboardingTodoId;
+ title: string;
+ note: string;
+ done: boolean;
+ optional: boolean;
+ action: string | null;
+}
+
export interface OnboardingView {
step: OnboardingStep;
dots: { step: OnboardingStep; label: string; current: boolean }[];
@@ -104,6 +118,8 @@ export interface OnboardingView {
drive: DriveCard | null;
/** Done's "Launch at login" checkbox. */
launchAtLogin: { label: string; checked: boolean; note: string } | null;
+ /** Done's to-do list. */
+ todos?: OnboardingTodo[];
}
/** The Cua Volume page's card: the miniature over one checkbox line. */
@@ -186,8 +202,10 @@ export function reduceOnboarding(state: OnboardingState, action: OnboardingActio
return core("onboarding.reduce", { state, action });
}
-export function onboardingView(state: OnboardingState): OnboardingView {
- return core("onboarding.view", { state });
+export function onboardingView(state: OnboardingState, withoutCli = false): OnboardingView {
+ // `withoutCli`: this app installs the bundled cua on first launch (no
+ // Command line page), so its Done neither lists the Cua CLI nor waits for it.
+ return core("onboarding.view", withoutCli ? { state, withoutCli } : { state });
}
export function onboardingCopy(): OnboardingCopy {
diff --git a/apps/cua-spaces/src/styles/app.css b/apps/cua-spaces/src/styles/app.css
index 5cb76d7191..c6b44eecf9 100644
--- a/apps/cua-spaces/src/styles/app.css
+++ b/apps/cua-spaces/src/styles/app.css
@@ -5232,3 +5232,27 @@ li.installer-agent {
align-items: center;
gap: 6px;
}
+
+/* Done's to-do list: what is set up, and a one-click fix for what is not. */
+.onboarding-todos {
+ list-style: none;
+ margin: 0 0 12px;
+ padding: 0;
+}
+.onboarding-todos li {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ padding: 8px 0;
+ border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.08));
+}
+.onboarding-todos li > div {
+ flex: 1;
+ min-width: 0;
+}
+.onboarding-todos li .st-note {
+ margin: 2px 0 0;
+}
+.onboarding-todos li[data-done] strong {
+ opacity: 0.6;
+}
diff --git a/docs/content/docs/cua-sdk/reference/index.mdx b/docs/content/docs/cua-sdk/reference/index.mdx
index e4fec207fc..73df655b01 100644
--- a/docs/content/docs/cua-sdk/reference/index.mdx
+++ b/docs/content/docs/cua-sdk/reference/index.mdx
@@ -97,7 +97,8 @@ Pages marked *Cua Spaces app export* document the APIs the Cua Spaces apps are b
| [Notch](/cua-sdk/reference/spaces/app-core/notch) | The notch switcher: state, events, layout on the screen and motion. *Cua Spaces app export.* |
| [Keyvault](/cua-sdk/reference/spaces/app-core/keyvault) | The Keyvault broker client and its overview: items, pending requests, grants, rules and audit. *Cua Spaces app export.* |
| [Keyvault screens](/cua-sdk/reference/spaces/app-core/keyvault-screens) | The Keyvault page, sidebar, the vault list (apps, sites and items with their locks), the unlock prompt and the approval prompt. *Cua Spaces app export.* |
-| [Onboarding and settings](/cua-sdk/reference/spaces/app-core/onboarding-settings) | First-run onboarding, its card miniatures, the settings file and the hotkey label. *Cua Spaces app export.* |
+| [Onboarding and settings](/cua-sdk/reference/spaces/app-core/onboarding-settings) | First-run onboarding, the settings file and the hotkey label. *Cua Spaces app export.* |
+| [Onboarding previews](/cua-sdk/reference/spaces/app-core/onboarding-previews) | The animated miniatures on the onboarding cards: the background computer-use card, the notch and the menu bar. *Cua Spaces app export.* |
| [About, updates and launch](/cua-sdk/reference/spaces/app-core/about) | The About window and its update channel, what the apps do once they launch (the bundled cua install), and the daemon and refresh reports they read. *Cua Spaces app export.* |
| [App core: billing, relay usage and Teams](/cua-sdk/reference/spaces/account-app-core) | The Billing and Relay usage rows in Settings, the out-of-credit and relay allowance notices, and the Teams section. *Cua Spaces app export.* |
| [This machine](/cua-sdk/reference/spaces/app-core/this-machine) | The This machine roster entry, its page and the host setup form. *Cua Spaces app export.* |
@@ -142,4 +143,4 @@ Pages marked *Cua Spaces app export* document the APIs the Cua Spaces apps are b
291 items, 385 methods. The [Types](/cua-sdk/reference/types) page lists them.
-The Cua Spaces app export adds 781 items and 38 methods.
+The Cua Spaces app export adds 783 items and 38 methods.
diff --git a/docs/content/docs/cua-sdk/reference/spaces/app-core/about.mdx b/docs/content/docs/cua-sdk/reference/spaces/app-core/about.mdx
index 6636c62982..eab8ac64e6 100644
--- a/docs/content/docs/cua-sdk/reference/spaces/app-core/about.mdx
+++ b/docs/content/docs/cua-sdk/reference/spaces/app-core/about.mdx
@@ -310,6 +310,7 @@ Returned by [`AppCliInstaller.install`](#appcliinstallerinstall), [`AppCliInstal
| `on_path` / `onPath` | `bool` | | `bin_dir` is already on PATH. |
| `path_profile` / `pathProfile` | `Option<String>` | | Shell profile (or "user PATH" on Windows) the PATH change would edit. |
| `path_line` / `pathLine` | `Option<String>` | | The line that would be added to `path_profile`. |
+| `found` | `Option<String>` | | A working `cua` CLI already on this machine: `target`, else the first in the usual install folders or on PATH (a Finder-launched app's PATH lacks `~/.local/bin`, so the folders are searched too). |
## `AppCliInstallRequest` record
diff --git a/docs/content/docs/cua-sdk/reference/spaces/app-core/index.mdx b/docs/content/docs/cua-sdk/reference/spaces/app-core/index.mdx
index c2b6dab4a0..12b3fc3262 100644
--- a/docs/content/docs/cua-sdk/reference/spaces/app-core/index.mdx
+++ b/docs/content/docs/cua-sdk/reference/spaces/app-core/index.mdx
@@ -140,7 +140,7 @@ pub fn app_account_app_url() -> String
## All items
-628 items, across this page and its subpages, grouped by page (each item's section is on its page). Methods are listed on their object.
+630 items, across this page and its subpages, grouped by page (each item's section is on its page). Methods are listed on their object.
**[About, updates and launch](/cua-sdk/reference/spaces/app-core/about)**: `app_about_after_launch`, `app_about_allowed_channels`, `app_about_input_from_json`, `app_about_refresh_notice`, `app_about_restart_daemon`, `app_about_view`, `app_daemon_check_from_json`, `app_launch_input_from_json`, `app_refresh_report_from_json`, `AppAboutInput`, `AppAboutLink`, `AppAboutLinkId`, `AppAboutUpdates`, `AppAboutView`, `AppCliInstaller`, `AppCliInstallPlan`, `AppCliInstallRequest`, `AppDaemonCheck`, `AppInstallMethod`, `AppLaunchInput`, `AppLaunchPlan`, `AppRefreshReport`, `AppUpdateChannel`
@@ -166,10 +166,12 @@ pub fn app_account_app_url() -> String
**[Window drag trigger](/cua-sdk/reference/spaces/app-core/drag-trigger)**: `app_drag_classify`, `app_drag_displays`, `app_drag_portal_displays`, `app_drag_trigger_apply`, `app_drag_trigger_initial`, `AppDragDisplay`, `AppDragKind`, `AppDragTriggerEvent`, `AppDragTriggerState`, `AppDragTriggerTransition`, `AppStillAnchor`, `AppTriggerPhase`
-**[Onboarding and settings](/cua-sdk/reference/spaces/app-core/onboarding-settings)**: `app_driver_preview`, `app_driver_preview_frame`, `app_driver_preview_still`, `app_format_hotkey`, `app_onboarding_action_from_json`, `app_onboarding_copy`, `app_onboarding_initial`, `app_onboarding_installed_at_text`, `app_onboarding_reduce`, `app_onboarding_replaces_text`, `app_onboarding_sign_in_code_text`, `app_onboarding_signed_in_text`, `app_onboarding_view`, `app_presentation_preview`, `app_presentation_preview_frame`, `app_presentation_preview_still`, `app_settings_load`, `app_settings_save`, `AppDriverFrame`, `AppDriverPreview`, `AppKeyCombo`, `AppMenuPreview`, `AppMenuPreviewRow`, `AppModeChoice`, `AppOnboardingAction`, `AppOnboardingCheckbox`, `AppOnboardingCopy`, `AppOnboardingMode`, `AppOnboardingState`, `AppOnboardingStep`, `AppOnboardingView`, `AppPresentationCard`, `AppPresentationPreview`, `AppPreviewFrame`, `AppPreviewPoint`, `AppPreviewSegment`, `AppPreviewWindow`, `AppSettings`, `AppSwitcherTheme`, `AppUsageToggle`
+**[Onboarding previews](/cua-sdk/reference/spaces/app-core/onboarding-previews)**: `app_driver_preview`, `app_driver_preview_frame`, `app_driver_preview_still`, `app_presentation_preview`, `app_presentation_preview_frame`, `app_presentation_preview_still`, `AppDriverFrame`, `AppDriverPreview`, `AppMenuPreview`, `AppMenuPreviewRow`, `AppPresentationPreview`, `AppPreviewFrame`, `AppPreviewPoint`, `AppPreviewSegment`, `AppPreviewWindow`
**[Experiments](/cua-sdk/reference/spaces/app-core/experiments)**: `app_experiments_choose`, `app_experiments_from_json`, `app_experiments_page`, `app_settings_choose_experiment`, `app_settings_first_launch_channel`, `app_settings_resolve_new_ui`, `app_settings_with_storage`, `app_telemetry_experiments_changed`, `app_telemetry_experiments_on`, `AppExperiments`
+**[Onboarding and settings](/cua-sdk/reference/spaces/app-core/onboarding-settings)**: `app_format_hotkey`, `app_onboarding_action_from_json`, `app_onboarding_copy`, `app_onboarding_initial`, `app_onboarding_installed_at_text`, `app_onboarding_reduce`, `app_onboarding_replaces_text`, `app_onboarding_sign_in_code_text`, `app_onboarding_signed_in_text`, `app_onboarding_view`, `app_settings_load`, `app_settings_save`, `AppKeyCombo`, `AppModeChoice`, `AppOnboardingAction`, `AppOnboardingCheckbox`, `AppOnboardingCopy`, `AppOnboardingMode`, `AppOnboardingState`, `AppOnboardingStep`, `AppOnboardingTodo`, `AppOnboardingTodoId`, `AppOnboardingView`, `AppPresentationCard`, `AppSettings`, `AppSwitcherTheme`, `AppUsageToggle`
+
**[This machine](/cua-sdk/reference/spaces/app-core/this-machine)**: `app_host_account_key`, `app_host_account_step`, `app_host_arch`, `app_host_form_action_from_json`, `app_host_form_initial`, `app_host_form_reduce`, `app_host_form_view`, `app_host_looks_like_listen`, `app_host_panel`, `app_host_parse_allow_list`, `app_host_permission_rows`, `app_host_setting_change`, `app_host_setup`, `app_host_state`, `app_host_state_from_json`, `app_host_summary_input`, `app_host_validate_setup`, `app_with_this_machine`, `AppHostAccess`, `AppHostAccessRow`, `AppHostAccount`, `AppHostAccountStep`, `AppHostAction`, `AppHostActionId`, `AppHostClient`, `AppHostConfirm`, `AppHostFormAction`, `AppHostFormChoice`, `AppHostFormField`, `AppHostFormState`, `AppHostFormView`, `AppHostLimit`, `AppHostPanelView`, `AppHostPermissionInput`, `AppHostProvidedSpace`, `AppHostSettingChange`, `AppHostSetupChoice`, `AppHostSetupRequest`, `AppHostSpacesAudit`, `AppHostState`, `AppHostToggle`, `AppPermissionRow`
**[Notch](/cua-sdk/reference/spaces/app-core/notch)**: `app_notch_estimated_progress`, `app_notch_initial`, `app_notch_layout`, `app_notch_motion`, `app_notch_radii`, `app_notch_reduce`, `app_notch_tile_at`, `app_notch_view`, `app_os_icon_svg`, `app_os_icon_system_symbol`, `app_presence_name`, `app_presence_principal_id`, `AppLogicalRect`, `AppNotchAccess`, `AppNotchActivity`, `AppNotchActivityKind`, `AppNotchButton`, `AppNotchButtonId`, `AppNotchEffect`, `AppNotchEvent`, `AppNotchHeader`, `AppNotchLayout`, `AppNotchMotion`, `AppNotchPermission`, `AppNotchPhase`, `AppNotchPreview`, `AppNotchRadii`, `AppNotchState`, `AppNotchTab`, `AppNotchTile`, `AppNotchTransfer`, `AppNotchTransition`, `AppNotchView`, `AppScreenFacts`
diff --git a/docs/content/docs/cua-sdk/reference/spaces/app-core/meta.json b/docs/content/docs/cua-sdk/reference/spaces/app-core/meta.json
index e2bfdfd18e..8ebd7658db 100644
--- a/docs/content/docs/cua-sdk/reference/spaces/app-core/meta.json
+++ b/docs/content/docs/cua-sdk/reference/spaces/app-core/meta.json
@@ -20,6 +20,7 @@
"keyvault",
"keyvault-screens",
"onboarding-settings",
+ "onboarding-previews",
"about",
"this-machine",
"window",
diff --git a/docs/content/docs/cua-sdk/reference/spaces/app-core/onboarding-previews.mdx b/docs/content/docs/cua-sdk/reference/spaces/app-core/onboarding-previews.mdx
new file mode 100644
index 0000000000..faa23a4001
--- /dev/null
+++ b/docs/content/docs/cua-sdk/reference/spaces/app-core/onboarding-previews.mdx
@@ -0,0 +1,284 @@
+---
+title: "Onboarding previews"
+description: "The animated miniatures on the onboarding cards: the background computer-use card, the notch and the menu bar."
+---
+
+{/*
+ AUTO-GENERATED FILE - DO NOT EDIT DIRECTLY
+ Generated by: pnpm --dir docs docs:generate:cua-sdk
+ Source: cua-bindgen docs --namespace cua_spaces_ffi (UniFFI metadata of libcua_spaces_ffi)
+ Version: 0.4.1
+*/}
+
+import { Callout } from 'fumadocs-ui/components/callout';
+import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
+
+<Callout title="Cua Spaces app export">
+These APIs are part of the Cua Spaces app export for building Spaces UIs. They are source-available under FSL-1.1-MIT and ship for Swift only (`import CuaSpacesFFI`); the Rust tab shows the `cua-spaces-ffi` crate they come from. The open source SDK packages for Python, TypeScript and Kotlin do not include them.
+</Callout>
+
+`app_driver_preview` and `app_presentation_preview` return the miniatures of the AI agents and presentation cards; the `*_frame` functions give one frame of the loop and the `*_still` functions the frame shown with Reduce Motion. The onboarding flow itself is on [Onboarding and settings](/cua-sdk/reference/spaces/app-core/onboarding-settings).
+
+## `AppDriverFrame` record
+
+Returned by [`app_driver_preview_frame`](#app_driver_preview_frame), [`app_driver_preview_still`](#app_driver_preview_still).
+
+| Field | Type | Default | Description |
+| --- | --- | --- | --- |
+| `pointer` | [`AppPreviewPoint`](#apppreviewpoint-record) | | The user's pointer tip. |
+| `pressed` | `bool` | | The user presses (drawn a little smaller). |
+| `selection` | `f64` | | How much of the selected line is highlighted, 0 to 1 from its left. |
+| `agent` | [`AppPreviewPoint`](#apppreviewpoint-record) | | The agent cursor's tip. |
+| `agent_pressed` / `agentPressed` | `bool` | | The agent presses (drawn a little smaller). |
+| `ripple` | `f64` | | The click rays, 0 hidden, else 0 to 1 through their burst (they grow out and fade). |
+| `checked` | `Vec<f64>` | | Each checkbox's tick, 0 to 1. |
+
+## `AppDriverPreview` record
+
+Returned by [`app_driver_preview`](#app_driver_preview).
+
+| Field | Type | Default | Description |
+| --- | --- | --- | --- |
+| `width` | `f64` | | Stage width. |
+| `height` | `f64` | | Stage height. |
+| `loop_ms` / `loopMs` | `u32` | | One loop (ms). |
+| `back` | [`AppPreviewWindow`](#apppreviewwindow-record) | | The window the agent works in (behind). |
+| `front` | [`AppPreviewWindow`](#apppreviewwindow-record) | | The window the user works in (in front). |
+| `checkboxes` | [`Vec<AppLogicalRect>`](/cua-sdk/reference/spaces/app-core/notch#applogicalrect-record) | | The back window's checkboxes, top to bottom. |
+| `labels` | [`Vec<AppLogicalRect>`](/cua-sdk/reference/spaces/app-core/notch#applogicalrect-record) | | The label bar right of each checkbox. |
+| `lines` | [`Vec<AppLogicalRect>`](/cua-sdk/reference/spaces/app-core/notch#applogicalrect-record) | | The front window's text lines (placeholder bars). |
+| `selected_line` / `selectedLine` | `u32` | | The line the user selects (an index into `lines`). |
+| `pointer` | [`Vec<AppPreviewPoint>`](#apppreviewpoint-record) | | The user's pointer outline, tip at the origin (fill black, stroke white). |
+| `agent_pointer` / `agentPointer` | [`Vec<AppPreviewPoint>`](#apppreviewpoint-record) | | The agent cursor's outline, tip at the origin (fill `agent_fill`, stroke white, a soft glow of `agent_fill`). |
+| `agent_fill` / `agentFill` | `String` | | The agent cursor's fill. |
+| `agent_rays` / `agentRays` | [`Vec<AppPreviewSegment>`](#apppreviewsegment-record) | | The click rays, relative to the agent cursor's tip. |
+
+## `AppMenuPreview` record
+
+| Field | Type | Default | Description |
+| --- | --- | --- | --- |
+| `icon` | [`AppLogicalRect`](/cua-sdk/reference/spaces/app-core/notch#applogicalrect-record) | | The Cua Spaces icon (the tray template). |
+| `highlight` | [`AppLogicalRect`](/cua-sdk/reference/spaces/app-core/notch#applogicalrect-record) | | The status item's highlight while pressed or open. |
+| `clock` | `String` | | The clock at the menu bar's right end. |
+| `clock_right` / `clockRight` | `f64` | | Its right edge. |
+| `menu` | [`AppLogicalRect`](/cua-sdk/reference/spaces/app-core/notch#applogicalrect-record) | | The menu. |
+| `radius` | `f64` | | Its corner radius. |
+| `rows` | [`Vec<AppMenuPreviewRow>`](#appmenupreviewrow-record) | | The rows, top to bottom (`window.menu_bar` for `SPACES`). |
+| `inset` | `f64` | | Text and shortcut inset from the menu's edges. |
+| `font_size` / `fontSize` | `f64` | | The rows' font size. |
+
+## `AppMenuPreviewRow` record
+
+| Field | Type | Default | Description |
+| --- | --- | --- | --- |
+| `item` | [`AppMenuItem`](/cua-sdk/reference/spaces/app-core/window#appmenuitem-record) | | The core's item. |
+| `frame` | [`AppLogicalRect`](/cua-sdk/reference/spaces/app-core/notch#applogicalrect-record) | | Its row on the stage. |
+
+## `AppPresentationPreview` record
+
+Returned by [`app_presentation_preview`](#app_presentation_preview).
+
+| Field | Type | Default | Description |
+| --- | --- | --- | --- |
+| `menu_bar` / `menuBar` | `bool` | | The menu bar card (else the notch card). |
+| `width` | `f64` | | Stage width. |
+| `height` | `f64` | | Stage height. |
+| `menu_bar_height` / `menuBarHeight` | `f64` | | The menu bar strip along the top. |
+| `loop_ms` / `loopMs` | `u32` | | One loop (ms). |
+| `pointer` | [`Vec<AppPreviewPoint>`](#apppreviewpoint-record) | | The pointer's outline, tip at the origin (fill black, stroke white). |
+| `notch` | [`Option<AppNotchPreview>`](/cua-sdk/reference/spaces/app-core/notch#appnotchpreview-record) | | The notch card's miniature. |
+| `menu` | [`Option<AppMenuPreview>`](#appmenupreview-record) | | The menu bar card's miniature. |
+
+## `AppPreviewFrame` record
+
+Returned by [`app_presentation_preview_frame`](#app_presentation_preview_frame), [`app_presentation_preview_still`](#app_presentation_preview_still).
+
+| Field | Type | Default | Description |
+| --- | --- | --- | --- |
+| `pointer` | [`AppPreviewPoint`](#apppreviewpoint-record) | | The pointer's tip. |
+| `pressed` | `bool` | | The pointer presses (drawn a little smaller). |
+| `hover` | `f64` | | Notch: the hover cue, 0 to 1 (the closed notch and its tab grow by 1 + (hover_scale - 1) * hover horizontally, about the top centre). |
+| `open` | `f64` | | Notch: the shape, closed 0 to open 1 (a spring: it can pass 1); menu: the menu's opacity. |
+| `content` | `f64` | | Notch: the content's fade, 0 to 1 (it also grows from `content_scale`, anchored at the top); menu: the same as `open`. |
+| `tab` | `f64` | | Notch: the tab, 1 shown to 0 tucked under the notch. |
+| `highlighted` | `Option<u32>` | | Menu: the row under the pointer (an enabled item), highlighted. |
+| `active` | `bool` | | Menu: the status item is highlighted (pressed, or its menu open). |
+
+## `AppPreviewPoint` record
+
+| Field | Type | Default | Description |
+| --- | --- | --- | --- |
+| `x` | `f64` | | Left. |
+| `y` | `f64` | | Down. |
+
+## `AppPreviewSegment` record
+
+| Field | Type | Default | Description |
+| --- | --- | --- | --- |
+| `from` | [`AppPreviewPoint`](#apppreviewpoint-record) | | Start. |
+| `to` | [`AppPreviewPoint`](#apppreviewpoint-record) | | End. |
+
+## `AppPreviewWindow` record
+
+| Field | Type | Default | Description |
+| --- | --- | --- | --- |
+| `frame` | [`AppLogicalRect`](/cua-sdk/reference/spaces/app-core/notch#applogicalrect-record) | | Its frame on the stage. |
+| `title_bar` / `titleBar` | `f64` | | The title bar's height (the three window buttons sit in it). |
+| `radius` | `f64` | | Corner radius. |
+
+## `app_driver_preview`
+
+The AI agents page's background computer-use card: its miniature (an
+agent clicking in a background window while the user works in front).
+
+<Tabs items={['Swift', 'Rust']} groupId="sdk-lang" persist>
+<Tab value="Swift">
+
+```swift
+func appDriverPreview() -> AppDriverPreview
+```
+
+</Tab>
+<Tab value="Rust">
+
+```rust
+pub fn app_driver_preview() -> AppDriverPreview
+```
+
+</Tab>
+</Tabs>
+
+**Returns** [`AppDriverPreview`](#appdriverpreview-record)
+
+## `app_driver_preview_frame`
+
+The card's miniature `t_ms` into its loop (it wraps).
+
+<Tabs items={['Swift', 'Rust']} groupId="sdk-lang" persist>
+<Tab value="Swift">
+
+```swift
+func appDriverPreviewFrame(tMs: UInt32) -> AppDriverFrame
+```
+
+</Tab>
+<Tab value="Rust">
+
+```rust
+pub fn app_driver_preview_frame(t_ms: u32) -> AppDriverFrame
+```
+
+</Tab>
+</Tabs>
+
+| Parameter | Type | Default |
+| --- | --- | --- |
+| `t_ms` | `u32` | required |
+
+**Returns** [`AppDriverFrame`](#appdriverframe-record)
+
+## `app_driver_preview_still`
+
+The card's miniature with Reduce Motion: mid-task, still.
+
+<Tabs items={['Swift', 'Rust']} groupId="sdk-lang" persist>
+<Tab value="Swift">
+
+```swift
+func appDriverPreviewStill() -> AppDriverFrame
+```
+
+</Tab>
+<Tab value="Rust">
+
+```rust
+pub fn app_driver_preview_still() -> AppDriverFrame
+```
+
+</Tab>
+</Tabs>
+
+**Returns** [`AppDriverFrame`](#appdriverframe-record)
+
+## `app_presentation_preview`
+
+A presentation card's animated miniature (the notch card, or with
+`menu_bar` the menu bar card).
+
+<Tabs items={['Swift', 'Rust']} groupId="sdk-lang" persist>
+<Tab value="Swift">
+
+```swift
+func appPresentationPreview(menuBar: Bool) -> AppPresentationPreview
+```
+
+</Tab>
+<Tab value="Rust">
+
+```rust
+pub fn app_presentation_preview(menu_bar: bool) -> AppPresentationPreview
+```
+
+</Tab>
+</Tabs>
+
+| Parameter | Type | Default |
+| --- | --- | --- |
+| `menu_bar` | `bool` | required |
+
+**Returns** [`AppPresentationPreview`](#apppresentationpreview-record)
+
+## `app_presentation_preview_frame`
+
+The miniature `t_ms` into its loop (it wraps).
+
+<Tabs items={['Swift', 'Rust']} groupId="sdk-lang" persist>
+<Tab value="Swift">
+
+```swift
+func appPresentationPreviewFrame(menuBar: Bool, tMs: UInt32) -> AppPreviewFrame
+```
+
+</Tab>
+<Tab value="Rust">
+
+```rust
+pub fn app_presentation_preview_frame(menu_bar: bool, t_ms: u32) -> AppPreviewFrame
+```
+
+</Tab>
+</Tabs>
+
+| Parameter | Type | Default |
+| --- | --- | --- |
+| `menu_bar` | `bool` | required |
+| `t_ms` | `u32` | required |
+
+**Returns** [`AppPreviewFrame`](#apppreviewframe-record)
+
+## `app_presentation_preview_still`
+
+The miniature with Reduce Motion: expanded, still.
+
+<Tabs items={['Swift', 'Rust']} groupId="sdk-lang" persist>
+<Tab value="Swift">
+
+```swift
+func appPresentationPreviewStill(menuBar: Bool) -> AppPreviewFrame
+```
+
+</Tab>
+<Tab value="Rust">
+
+```rust
+pub fn app_presentation_preview_still(menu_bar: bool) -> AppPreviewFrame
+```
+
+</Tab>
+</Tabs>
+
+| Parameter | Type | Default |
+| --- | --- | --- |
+| `menu_bar` | `bool` | required |
+
+**Returns** [`AppPreviewFrame`](#apppreviewframe-record)
diff --git a/docs/content/docs/cua-sdk/reference/spaces/app-core/onboarding-settings.mdx b/docs/content/docs/cua-sdk/reference/spaces/app-core/onboarding-settings.mdx
index 89ed774a1a..711e8c33cf 100644
--- a/docs/content/docs/cua-sdk/reference/spaces/app-core/onboarding-settings.mdx
+++ b/docs/content/docs/cua-sdk/reference/spaces/app-core/onboarding-settings.mdx
@@ -1,6 +1,6 @@
---
title: "Onboarding and settings"
-description: "First-run onboarding, its card miniatures, the settings file and the hotkey label."
+description: "First-run onboarding, the settings file and the hotkey label."
---
{/*
@@ -17,7 +17,7 @@ import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
These APIs are part of the Cua Spaces app export for building Spaces UIs. They are source-available under FSL-1.1-MIT and ship for Swift only (`import CuaSpacesFFI`); the Rust tab shows the `cua-spaces-ffi` crate they come from. The open source SDK packages for Python, TypeScript and Kotlin do not include them.
</Callout>
-`app_onboarding_reduce` steps through first-run onboarding. `app_settings_load` and `app_settings_save` read and write the apps' settings file.
+`app_onboarding_reduce` steps through first-run onboarding. `app_settings_load` and `app_settings_save` read and write the apps' settings file. The animated miniatures on the onboarding cards are on [Onboarding previews](/cua-sdk/reference/spaces/app-core/onboarding-previews).
## `app_format_hotkey`
@@ -99,60 +99,15 @@ AppSwitcherTheme::Glass
| `label` | `String` | | Label. |
| `preselected` | `bool` | | Highlighted (the installer's preselection, else the first). |
-## `AppDriverFrame` record
-
-Returned by [`app_driver_preview_frame`](#app_driver_preview_frame), [`app_driver_preview_still`](#app_driver_preview_still).
-
-| Field | Type | Default | Description |
-| --- | --- | --- | --- |
-| `pointer` | [`AppPreviewPoint`](#apppreviewpoint-record) | | The user's pointer tip. |
-| `pressed` | `bool` | | The user presses (drawn a little smaller). |
-| `selection` | `f64` | | How much of the selected line is highlighted, 0 to 1 from its left. |
-| `agent` | [`AppPreviewPoint`](#apppreviewpoint-record) | | The agent cursor's tip. |
-| `agent_pressed` / `agentPressed` | `bool` | | The agent presses (drawn a little smaller). |
-| `ripple` | `f64` | | The click rays, 0 hidden, else 0 to 1 through their burst (they grow out and fade). |
-| `checked` | `Vec<f64>` | | Each checkbox's tick, 0 to 1. |
-
-## `AppDriverPreview` record
-
-Returned by [`app_driver_preview`](#app_driver_preview).
-
-| Field | Type | Default | Description |
-| --- | --- | --- | --- |
-| `width` | `f64` | | Stage width. |
-| `height` | `f64` | | Stage height. |
-| `loop_ms` / `loopMs` | `u32` | | One loop (ms). |
-| `back` | [`AppPreviewWindow`](#apppreviewwindow-record) | | The window the agent works in (behind). |
-| `front` | [`AppPreviewWindow`](#apppreviewwindow-record) | | The window the user works in (in front). |
-| `checkboxes` | [`Vec<AppLogicalRect>`](/cua-sdk/reference/spaces/app-core/notch#applogicalrect-record) | | The back window's checkboxes, top to bottom. |
-| `labels` | [`Vec<AppLogicalRect>`](/cua-sdk/reference/spaces/app-core/notch#applogicalrect-record) | | The label bar right of each checkbox. |
-| `lines` | [`Vec<AppLogicalRect>`](/cua-sdk/reference/spaces/app-core/notch#applogicalrect-record) | | The front window's text lines (placeholder bars). |
-| `selected_line` / `selectedLine` | `u32` | | The line the user selects (an index into `lines`). |
-| `pointer` | [`Vec<AppPreviewPoint>`](#apppreviewpoint-record) | | The user's pointer outline, tip at the origin (fill black, stroke white). |
-| `agent_pointer` / `agentPointer` | [`Vec<AppPreviewPoint>`](#apppreviewpoint-record) | | The agent cursor's outline, tip at the origin (fill `agent_fill`, stroke white, a soft glow of `agent_fill`). |
-| `agent_fill` / `agentFill` | `String` | | The agent cursor's fill. |
-| `agent_rays` / `agentRays` | [`Vec<AppPreviewSegment>`](#apppreviewsegment-record) | | The click rays, relative to the agent cursor's tip. |
-
-## `AppMenuPreview` record
-
-| Field | Type | Default | Description |
-| --- | --- | --- | --- |
-| `icon` | [`AppLogicalRect`](/cua-sdk/reference/spaces/app-core/notch#applogicalrect-record) | | The Cua Spaces icon (the tray template). |
-| `highlight` | [`AppLogicalRect`](/cua-sdk/reference/spaces/app-core/notch#applogicalrect-record) | | The status item's highlight while pressed or open. |
-| `clock` | `String` | | The clock at the menu bar's right end. |
-| `clock_right` / `clockRight` | `f64` | | Its right edge. |
-| `menu` | [`AppLogicalRect`](/cua-sdk/reference/spaces/app-core/notch#applogicalrect-record) | | The menu. |
-| `radius` | `f64` | | Its corner radius. |
-| `rows` | [`Vec<AppMenuPreviewRow>`](#appmenupreviewrow-record) | | The rows, top to bottom (`window.menu_bar` for `SPACES`). |
-| `inset` | `f64` | | Text and shortcut inset from the menu's edges. |
-| `font_size` / `fontSize` | `f64` | | The rows' font size. |
-
-## `AppMenuPreviewRow` record
+## `AppPresentationCard` record
| Field | Type | Default | Description |
| --- | --- | --- | --- |
-| `item` | [`AppMenuItem`](/cua-sdk/reference/spaces/app-core/window#appmenuitem-record) | | The core's item. |
-| `frame` | [`AppLogicalRect`](/cua-sdk/reference/spaces/app-core/notch#applogicalrect-record) | | Its row on the stage. |
+| `menu_bar` / `menuBar` | `bool` | | Menu bar only. |
+| `title` | `String` | | "Notch and menu bar". |
+| `id` | `String` | | The card's id (`onboarding-notch`, `onboarding-menu-bar`): its accessibility identifier and list key. |
+| `image_label` / `imageLabel` | `String` | | The miniature's spoken description. |
+| `selected` | `bool` | | Picked. |
## `AppOnboardingCheckbox` record
@@ -227,6 +182,18 @@ Returned by [`app_onboarding_initial`](#app_onboarding_initial), [`app_onboardin
| `telemetry` | [`Option<AppTelemetryInput>`](/cua-sdk/reference/spaces/app-core/window#apptelemetryinput-record) | | The usage-data switch on Welcome: the machine's telemetry setting (Settings' "Share anonymous usage data", `cua telemetry off`), none until the shell read it (then it shows on). |
| `experiments` | [`AppExperiments`](/cua-sdk/reference/spaces/app-core/experiments#appexperiments-record) | | Settings, Experiments: the Cua Volume page (and its Done line) only while Cua Volume is on. Off until the shell says otherwise. |
| `run_counted` / `runCounted` | `bool` | | The run's start was counted (`onboarding_shown`, Welcome shown): when Welcome showed on a machine whose usage notice was already shown, else when Welcome was left. Once per run, however often Welcome shows again (Back). |
+| `revisit` | `bool` | | A page opened from Done's to-do list: leaving it (Continue, Skip or Back) comes back to Done. |
+
+## `AppOnboardingTodo` record
+
+| Field | Type | Default | Description |
+| --- | --- | --- | --- |
+| `id` | [`AppOnboardingTodoId`](#apponboardingtodoid-enum) | | Which. |
+| `title` | `String` | | "Cua CLI". |
+| `note` | `String` | | One plain line under it. |
+| `done` | `bool` | | Set up. |
+| `optional` | `bool` | | Nice to have: "You're all set" does not wait for it. |
+| `action` | `Option<String>` | | The fix's button ("Install the Cua CLI"), while not done. |
## `AppOnboardingView` record
@@ -253,68 +220,7 @@ Returned by [`app_onboarding_view`](#app_onboarding_view).
| `usage` | [`Option<AppUsageToggle>`](#appusagetoggle-record) | | Welcome's usage-data switch, next to the notice: nothing is sent before the user leaves Welcome, and nothing at all while it is off. |
| `drive` | [`Option<AppDriveCard>`](/cua-sdk/reference/spaces/volume-app-core#appdrivecard-record) | | The Cua Volume page's card. |
| `launch_at_login` / `launchAtLogin` | [`Option<AppOnboardingCheckbox>`](#apponboardingcheckbox-record) | | Done's "Launch at login" checkbox. |
-
-## `AppPresentationCard` record
-
-| Field | Type | Default | Description |
-| --- | --- | --- | --- |
-| `menu_bar` / `menuBar` | `bool` | | Menu bar only. |
-| `title` | `String` | | "Notch and menu bar". |
-| `id` | `String` | | The card's id (`onboarding-notch`, `onboarding-menu-bar`): its accessibility identifier and list key. |
-| `image_label` / `imageLabel` | `String` | | The miniature's spoken description. |
-| `selected` | `bool` | | Picked. |
-
-## `AppPresentationPreview` record
-
-Returned by [`app_presentation_preview`](#app_presentation_preview).
-
-| Field | Type | Default | Description |
-| --- | --- | --- | --- |
-| `menu_bar` / `menuBar` | `bool` | | The menu bar card (else the notch card). |
-| `width` | `f64` | | Stage width. |
-| `height` | `f64` | | Stage height. |
-| `menu_bar_height` / `menuBarHeight` | `f64` | | The menu bar strip along the top. |
-| `loop_ms` / `loopMs` | `u32` | | One loop (ms). |
-| `pointer` | [`Vec<AppPreviewPoint>`](#apppreviewpoint-record) | | The pointer's outline, tip at the origin (fill black, stroke white). |
-| `notch` | [`Option<AppNotchPreview>`](/cua-sdk/reference/spaces/app-core/notch#appnotchpreview-record) | | The notch card's miniature. |
-| `menu` | [`Option<AppMenuPreview>`](#appmenupreview-record) | | The menu bar card's miniature. |
-
-## `AppPreviewFrame` record
-
-Returned by [`app_presentation_preview_frame`](#app_presentation_preview_frame), [`app_presentation_preview_still`](#app_presentation_preview_still).
-
-| Field | Type | Default | Description |
-| --- | --- | --- | --- |
-| `pointer` | [`AppPreviewPoint`](#apppreviewpoint-record) | | The pointer's tip. |
-| `pressed` | `bool` | | The pointer presses (drawn a little smaller). |
-| `hover` | `f64` | | Notch: the hover cue, 0 to 1 (the closed notch and its tab grow by 1 + (hover_scale - 1) * hover horizontally, about the top centre). |
-| `open` | `f64` | | Notch: the shape, closed 0 to open 1 (a spring: it can pass 1); menu: the menu's opacity. |
-| `content` | `f64` | | Notch: the content's fade, 0 to 1 (it also grows from `content_scale`, anchored at the top); menu: the same as `open`. |
-| `tab` | `f64` | | Notch: the tab, 1 shown to 0 tucked under the notch. |
-| `highlighted` | `Option<u32>` | | Menu: the row under the pointer (an enabled item), highlighted. |
-| `active` | `bool` | | Menu: the status item is highlighted (pressed, or its menu open). |
-
-## `AppPreviewPoint` record
-
-| Field | Type | Default | Description |
-| --- | --- | --- | --- |
-| `x` | `f64` | | Left. |
-| `y` | `f64` | | Down. |
-
-## `AppPreviewSegment` record
-
-| Field | Type | Default | Description |
-| --- | --- | --- | --- |
-| `from` | [`AppPreviewPoint`](#apppreviewpoint-record) | | Start. |
-| `to` | [`AppPreviewPoint`](#apppreviewpoint-record) | | End. |
-
-## `AppPreviewWindow` record
-
-| Field | Type | Default | Description |
-| --- | --- | --- | --- |
-| `frame` | [`AppLogicalRect`](/cua-sdk/reference/spaces/app-core/notch#applogicalrect-record) | | Its frame on the stage. |
-| `title_bar` / `titleBar` | `f64` | | The title bar's height (the three window buttons sit in it). |
-| `radius` | `f64` | | Corner radius. |
+| `todos` | [`Vec<AppOnboardingTodo>`](#apponboardingtodo-record) | | Done's to-do list: the Cua CLI, the account, an AI agent and Cua Volume, each set up or with its fix. The title says "Almost done" until every one that is not optional is. |
## `AppSettings` record
@@ -371,6 +277,8 @@ Returned by [`app_settings_choose_experiment`](/cua-sdk/reference/spaces/app-cor
.welcomeShown
.usageDataToggled(on: Bool)
.experimentsLoaded(experiments: AppExperiments)
+.todoChosen(id: AppOnboardingTodoId)
+.agentsDetected(configured: [String])
```
</Tab>
@@ -403,6 +311,8 @@ AppOnboardingAction::TelemetryLoaded { telemetry: AppTelemetryInput }
AppOnboardingAction::WelcomeShown
AppOnboardingAction::UsageDataToggled { on: bool }
AppOnboardingAction::ExperimentsLoaded { experiments: AppExperiments }
+AppOnboardingAction::TodoChosen { id: AppOnboardingTodoId }
+AppOnboardingAction::AgentsDetected { configured: Vec<String> }
```
</Tab>
@@ -436,6 +346,8 @@ AppOnboardingAction::ExperimentsLoaded { experiments: AppExperiments }
| `WelcomeShown` | Welcome is on screen (each time it shows; after `telemetry-loaded`). On a machine that already showed the usage notice, with usage data on, the run's start counts now rather than when Welcome is left. |
| `UsageDataToggled` | Welcome's "Share anonymous usage data" switch (not while the environment decides). The shell writes the setting. Fields: `on: bool` |
| `ExperimentsLoaded` | Settings, Experiments, as the shell read them (at the start, and whenever a switch changes). Any page; turning Cua Volume off on its page moves on. Fields: `experiments: AppExperiments` |
+| `TodoChosen` | A to-do on Done was clicked: its page opens, and leaving it comes back to Done. Cua Volume needs its experiment on first (the shell turns it on and sends `experiments-loaded`). Fields: `id: AppOnboardingTodoId` |
+| `AgentsDetected` | The coding agents that already use cua (set up earlier, from the CLI or Settings), as the shell read them. Any page. Fields: `configured: Vec<String>` |
## `AppOnboardingMode` enum
@@ -507,79 +419,37 @@ AppOnboardingStep::Done
| `Mode` | Access other machines, or set this one up for unattended access. |
| `Done` | Done. |
-## `app_driver_preview`
-
-The AI agents page's background computer-use card: its miniature (an
-agent clicking in a background window while the user works in front).
-
-<Tabs items={['Swift', 'Rust']} groupId="sdk-lang" persist>
-<Tab value="Swift">
-
-```swift
-func appDriverPreview() -> AppDriverPreview
-```
-
-</Tab>
-<Tab value="Rust">
-
-```rust
-pub fn app_driver_preview() -> AppDriverPreview
-```
-
-</Tab>
-</Tabs>
-
-**Returns** [`AppDriverPreview`](#appdriverpreview-record)
-
-## `app_driver_preview_frame`
-
-The card's miniature `t_ms` into its loop (it wraps).
-
-<Tabs items={['Swift', 'Rust']} groupId="sdk-lang" persist>
-<Tab value="Swift">
-
-```swift
-func appDriverPreviewFrame(tMs: UInt32) -> AppDriverFrame
-```
-
-</Tab>
-<Tab value="Rust">
-
-```rust
-pub fn app_driver_preview_frame(t_ms: u32) -> AppDriverFrame
-```
-
-</Tab>
-</Tabs>
-
-| Parameter | Type | Default |
-| --- | --- | --- |
-| `t_ms` | `u32` | required |
-
-**Returns** [`AppDriverFrame`](#appdriverframe-record)
-
-## `app_driver_preview_still`
-
-The card's miniature with Reduce Motion: mid-task, still.
+## `AppOnboardingTodoId` enum
<Tabs items={['Swift', 'Rust']} groupId="sdk-lang" persist>
<Tab value="Swift">
```swift
-func appDriverPreviewStill() -> AppDriverFrame
+.cli
+.signin
+.agents
+.volume
```
</Tab>
<Tab value="Rust">
```rust
-pub fn app_driver_preview_still() -> AppDriverFrame
+AppOnboardingTodoId::Cli
+AppOnboardingTodoId::Signin
+AppOnboardingTodoId::Agents
+AppOnboardingTodoId::Volume
```
</Tab>
</Tabs>
-**Returns** [`AppDriverFrame`](#appdriverframe-record)
+| Variant | Description |
+| --- | --- |
+| `Cli` | The Cua CLI. |
+| `Signin` | The Cua account. |
+| `Agents` | A coding agent that uses cua. |
+| `Volume` | Cua Volume (optional). |
## `app_onboarding_action_from_json`
@@ -822,89 +692,6 @@ pub fn app_onboarding_view(state: AppOnboardingState) -> AppOnboardingView
**Returns** [`AppOnboardingView`](#apponboardingview-record)
-## `app_presentation_preview`
-
-A presentation card's animated miniature (the notch card, or with
-`menu_bar` the menu bar card).
-
-<Tabs items={['Swift', 'Rust']} groupId="sdk-lang" persist>
-<Tab value="Swift">
-
-```swift
-func appPresentationPreview(menuBar: Bool) -> AppPresentationPreview
-```
-
-</Tab>
-<Tab value="Rust">
-
-```rust
-pub fn app_presentation_preview(menu_bar: bool) -> AppPresentationPreview
-```
-
-</Tab>
-</Tabs>
-
-| Parameter | Type | Default |
-| --- | --- | --- |
-| `menu_bar` | `bool` | required |
-
-**Returns** [`AppPresentationPreview`](#apppresentationpreview-record)
-
-## `app_presentation_preview_frame`
-
-The miniature `t_ms` into its loop (it wraps).
-
-<Tabs items={['Swift', 'Rust']} groupId="sdk-lang" persist>
-<Tab value="Swift">
-
-```swift
-func appPresentationPreviewFrame(menuBar: Bool, tMs: UInt32) -> AppPreviewFrame
-```
-
-</Tab>
-<Tab value="Rust">
-
-```rust
-pub fn app_presentation_preview_frame(menu_bar: bool, t_ms: u32) -> AppPreviewFrame
-```
-
-</Tab>
-</Tabs>
-
-| Parameter | Type | Default |
-| --- | --- | --- |
-| `menu_bar` | `bool` | required |
-| `t_ms` | `u32` | required |
-
-**Returns** [`AppPreviewFrame`](#apppreviewframe-record)
-
-## `app_presentation_preview_still`
-
-The miniature with Reduce Motion: expanded, still.
-
-<Tabs items={['Swift', 'Rust']} groupId="sdk-lang" persist>
-<Tab value="Swift">
-
-```swift
-func appPresentationPreviewStill(menuBar: Bool) -> AppPreviewFrame
-```
-
-</Tab>
-<Tab value="Rust">
-
-```rust
-pub fn app_presentation_preview_still(menu_bar: bool) -> AppPreviewFrame
-```
-
-</Tab>
-</Tabs>
-
-| Parameter | Type | Default |
-| --- | --- | --- |
-| `menu_bar` | `bool` | required |
-
-**Returns** [`AppPreviewFrame`](#apppreviewframe-record)
-
## `app_settings_load`
Reads the settings file (defaults when missing or damaged).
diff --git a/docs/content/docs/cua-sdk/reference/spaces/volume-app-core.mdx b/docs/content/docs/cua-sdk/reference/spaces/volume-app-core.mdx
index d91e4de738..ca7bfdc897 100644
--- a/docs/content/docs/cua-sdk/reference/spaces/volume-app-core.mdx
+++ b/docs/content/docs/cua-sdk/reference/spaces/volume-app-core.mdx
@@ -98,7 +98,7 @@ Returned by [`app_drive_mount_preview_frame`](#app_drive_mount_preview_frame), [
| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `volume` | `f64` | | The volume in the sidebar, 0 absent to 1 shown (and selected). |
-| `flight` | [`Option<AppPreviewPoint>`](/cua-sdk/reference/spaces/app-core/onboarding-settings#apppreviewpoint-record) | | The file in flight: its icon's top left (drawn above both windows). |
+| `flight` | [`Option<AppPreviewPoint>`](/cua-sdk/reference/spaces/app-core/onboarding-previews#apppreviewpoint-record) | | The file in flight: its icon's top left (drawn above both windows). |
| `arrived` | `Vec<f64>` | | Each file in the volume, 0 absent to 1 shown. |
## `AppDriveMountInput` record
@@ -124,8 +124,8 @@ Returned by [`app_drive_mount_preview`](#app_drive_mount_preview).
| `width` | `f64` | | Stage width. |
| `height` | `f64` | | Stage height. |
| `loop_ms` / `loopMs` | `u32` | | One loop (ms). |
-| `space` | [`AppPreviewWindow`](/cua-sdk/reference/spaces/app-core/onboarding-settings#apppreviewwindow-record) | | The Space (left). |
-| `finder` | [`AppPreviewWindow`](/cua-sdk/reference/spaces/app-core/onboarding-settings#apppreviewwindow-record) | | The Finder window (right). |
+| `space` | [`AppPreviewWindow`](/cua-sdk/reference/spaces/app-core/onboarding-previews#apppreviewwindow-record) | | The Space (left). |
+| `finder` | [`AppPreviewWindow`](/cua-sdk/reference/spaces/app-core/onboarding-previews#apppreviewwindow-record) | | The Finder window (right). |
| `sidebar` | [`AppLogicalRect`](/cua-sdk/reference/spaces/app-core/notch#applogicalrect-record) | | The Finder window's sidebar (a shade darker than its content). |
| `places` | [`Vec<AppLogicalRect>`](/cua-sdk/reference/spaces/app-core/notch#applogicalrect-record) | | The sidebar's other places (placeholder bars). |
| `volume` | [`AppLogicalRect`](/cua-sdk/reference/spaces/app-core/notch#applogicalrect-record) | | The volume's row in the sidebar (the selection highlight). |
diff --git a/docs/content/docs/cua-sdk/reference/types.mdx b/docs/content/docs/cua-sdk/reference/types.mdx
index be94884936..39bf79d9ce 100644
--- a/docs/content/docs/cua-sdk/reference/types.mdx
+++ b/docs/content/docs/cua-sdk/reference/types.mdx
@@ -50,7 +50,7 @@ Renamed members: in Kotlin, objects implement `AutoCloseable`, whose `close()` f
292 items. Methods are listed on their object.
-The 781 items of the Cua Spaces app export (source-available, FSL-1.1-MIT, Swift only) are listed on their pages: [Decoded media](/cua-sdk/reference/spaces/decoded-media), [Host teleport](/cua-sdk/reference/spaces/teleport-host), [Teleport an app](/cua-sdk/reference/spaces/teleport-apps), [Spaces app core](/cua-sdk/reference/spaces/app-core#all-items), [App core: Cua Volume storage, mount and sync](/cua-sdk/reference/spaces/volume-app-core#all-items), [App core: agents, drive, notifications](/cua-sdk/reference/spaces/agents-app-core#all-items), [App core: billing, relay usage and Teams](/cua-sdk/reference/spaces/account-app-core#all-items), [Machines page](/cua-sdk/reference/spaces/machines-app-core), [Getting started and the command palette](/cua-sdk/reference/spaces/app-checklist-palette).
+The 783 items of the Cua Spaces app export (source-available, FSL-1.1-MIT, Swift only) are listed on their pages: [Decoded media](/cua-sdk/reference/spaces/decoded-media), [Host teleport](/cua-sdk/reference/spaces/teleport-host), [Teleport an app](/cua-sdk/reference/spaces/teleport-apps), [Spaces app core](/cua-sdk/reference/spaces/app-core#all-items), [App core: Cua Volume storage, mount and sync](/cua-sdk/reference/spaces/volume-app-core#all-items), [App core: agents, drive, notifications](/cua-sdk/reference/spaces/agents-app-core#all-items), [App core: billing, relay usage and Teams](/cua-sdk/reference/spaces/account-app-core#all-items), [Machines page](/cua-sdk/reference/spaces/machines-app-core), [Getting started and the command palette](/cua-sdk/reference/spaces/app-checklist-palette).
| Item | Kind | Summary |
| --- | --- | --- |
diff --git a/libs/cua/crates/cua-spaces-app-core/parity/golden/drive-onboarding.json b/libs/cua/crates/cua-spaces-app-core/parity/golden/drive-onboarding.json
index 2797a5bc78..6f99885097 100644
--- a/libs/cua/crates/cua-spaces-app-core/parity/golden/drive-onboarding.json
+++ b/libs/cua/crates/cua-spaces-app-core/parity/golden/drive-onboarding.json
@@ -38,6 +38,7 @@
"step": "drive",
"summary": [],
"title": "Cua Volume",
+ "todos": [],
"usage": null
},
"request": null,
@@ -67,6 +68,7 @@
"step": "drive",
"summary": [],
"title": "Cua Volume",
+ "todos": [],
"usage": null
},
"request": null,
@@ -96,6 +98,7 @@
"step": "drive",
"summary": [],
"title": "Cua Volume",
+ "todos": [],
"usage": null
},
"request": null,
@@ -125,6 +128,7 @@
"step": "drive",
"summary": [],
"title": "Cua Volume",
+ "todos": [],
"usage": null
},
"request": "mount",
@@ -154,6 +158,7 @@
"step": "drive",
"summary": [],
"title": "Cua Volume",
+ "todos": [],
"usage": null
},
"request": null,
@@ -182,6 +187,7 @@
"step": "mode",
"summary": [],
"title": "How do you want to use this Mac?",
+ "todos": [],
"usage": null
},
"request": null,
@@ -198,7 +204,7 @@
"drive": null,
"driveStorage": null,
"launchAtLogin": "[x] Launch at login ~Keeps your Spaces, agents and Cua Volume available after a restart.",
- "lede": "Cua Spaces is in your menu bar.",
+ "lede": "3 things are left. You can finish them now, or later from the menu bar.",
"notice": null,
"noticeLink": null,
"presentations": [],
@@ -211,14 +217,16 @@
"showMark": false,
"step": "done",
"summary": [
- "cua command: not installed",
- "Account: not signed in",
- "AI agents: none",
"Shows in: Notch and menu bar",
- "Cua Volume: Waiting for approval",
- "This machine: Only used to open other computers"
+ "This machine: Opens your other computers"
+ ],
+ "title": "Almost done",
+ "todos": [
+ "[ ] Cua CLI ~Command-line tools for you and your agents. -> Install the Cua CLI",
+ "[ ] Account ~Reach your computers from any device. -> Sign in",
+ "[ ] AI agents ~Let Claude Code, Codex and others use Cua. -> Connect an AI agent",
+ "[ ] Cua Volume ~Shared folder: files your agents can share across your computers. Waiting for approval. -> Turn on (optional)"
],
- "title": "You're all set",
"usage": null
},
"request": null,
@@ -244,6 +252,7 @@
"step": "drive",
"summary": [],
"title": "Cua Volume",
+ "todos": [],
"usage": null
},
"request": null,
@@ -269,6 +278,7 @@
"step": "drive",
"summary": [],
"title": "Cua Volume",
+ "todos": [],
"usage": null
},
"request": null,
@@ -294,6 +304,7 @@
"step": "drive",
"summary": [],
"title": "Cua Volume",
+ "todos": [],
"usage": null
},
"request": "mount",
@@ -322,6 +333,7 @@
"step": "mode",
"summary": [],
"title": "How do you want to use this Mac?",
+ "todos": [],
"usage": null
},
"request": null,
@@ -338,7 +350,7 @@
"drive": null,
"driveStorage": null,
"launchAtLogin": "[x] Launch at login ~Keeps your Spaces, agents and Cua Volume available after a restart.",
- "lede": "Cua Spaces is in your menu bar.",
+ "lede": "3 things are left. You can finish them now, or later from the menu bar.",
"notice": null,
"noticeLink": null,
"presentations": [],
@@ -351,14 +363,16 @@
"showMark": false,
"step": "done",
"summary": [
- "cua command: not installed",
- "Account: not signed in",
- "AI agents: none",
"Shows in: Notch and menu bar",
- "Cua Volume: /home/maya/Cua Volume",
- "This machine: Only used to open other computers"
+ "This machine: Opens your other computers"
+ ],
+ "title": "Almost done",
+ "todos": [
+ "[ ] Cua CLI ~Command-line tools for you and your agents. -> Install the Cua CLI",
+ "[ ] Account ~Reach your computers from any device. -> Sign in",
+ "[ ] AI agents ~Let Claude Code, Codex and others use Cua. -> Connect an AI agent",
+ "[x] Cua Volume ~Shared folder: files your agents can share across your computers. /home/maya/Cua Volume. (optional)"
],
- "title": "You're all set",
"usage": null
},
"request": null,
@@ -384,6 +398,7 @@
"step": "drive",
"summary": [],
"title": "Cua Volume",
+ "todos": [],
"usage": null
},
"request": null,
@@ -409,6 +424,7 @@
"step": "drive",
"summary": [],
"title": "Cua Volume",
+ "todos": [],
"usage": null
},
"request": null,
@@ -437,6 +453,7 @@
"step": "mode",
"summary": [],
"title": "How do you want to use this Mac?",
+ "todos": [],
"usage": null
},
"request": null,
@@ -465,6 +482,7 @@
"step": "presentation",
"summary": [],
"title": "Where should Cua Spaces show up?",
+ "todos": [],
"usage": null
},
"request": null,
@@ -493,6 +511,7 @@
"step": "mode",
"summary": [],
"title": "How do you want to use this Mac?",
+ "todos": [],
"usage": null
},
"request": null,
@@ -521,6 +540,7 @@
"step": "presentation",
"summary": [],
"title": "Where should Cua Spaces show up?",
+ "todos": [],
"usage": null
},
"request": null,
@@ -537,7 +557,7 @@
"drive": null,
"driveStorage": null,
"launchAtLogin": "[x] Launch at login ~Keeps your Spaces, agents and Cua Volume available after a restart.",
- "lede": "Cua Spaces is in your menu bar.",
+ "lede": "3 things are left. You can finish them now, or later from the menu bar.",
"notice": null,
"noticeLink": null,
"presentations": [],
@@ -550,13 +570,15 @@
"showMark": false,
"step": "done",
"summary": [
- "cua command: not installed",
- "Account: not signed in",
- "AI agents: none",
"Shows in: Notch and menu bar",
- "This machine: Only used to open other computers"
+ "This machine: Opens your other computers"
+ ],
+ "title": "Almost done",
+ "todos": [
+ "[ ] Cua CLI ~Command-line tools for you and your agents. -> Install the Cua CLI",
+ "[ ] Account ~Reach your computers from any device. -> Sign in",
+ "[ ] AI agents ~Let Claude Code, Codex and others use Cua. -> Connect an AI agent"
],
- "title": "You're all set",
"usage": null
},
"request": null,
@@ -587,6 +609,7 @@
"step": "drive",
"summary": [],
"title": "Cua Volume",
+ "todos": [],
"usage": null
},
"request": null,
@@ -615,6 +638,7 @@
"step": "mode",
"summary": [],
"title": "How do you want to use this Mac?",
+ "todos": [],
"usage": null
},
"request": null,
@@ -645,6 +669,7 @@
"step": "drive",
"summary": [],
"title": "Cua Volume",
+ "todos": [],
"usage": null
},
"request": null,
@@ -681,6 +706,7 @@
"step": "drive",
"summary": [],
"title": "Cua Volume",
+ "todos": [],
"usage": null
},
"request": null,
@@ -717,6 +743,7 @@
"step": "drive",
"summary": [],
"title": "Cua Volume",
+ "todos": [],
"usage": null
},
"request": null,
@@ -753,6 +780,7 @@
"step": "drive",
"summary": [],
"title": "Cua Volume",
+ "todos": [],
"usage": null
},
"request": null,
@@ -790,6 +818,7 @@
"step": "drive",
"summary": [],
"title": "Cua Volume",
+ "todos": [],
"usage": null
},
"request": null,
@@ -826,6 +855,7 @@
"step": "drive",
"summary": [],
"title": "Cua Volume",
+ "todos": [],
"usage": null
},
"request": null,
@@ -862,6 +892,7 @@
"step": "drive",
"summary": [],
"title": "Cua Volume",
+ "todos": [],
"usage": null
},
"request": null,
@@ -898,6 +929,7 @@
"step": "drive",
"summary": [],
"title": "Cua Volume",
+ "todos": [],
"usage": null
},
"request": null,
@@ -933,6 +965,7 @@
"step": "drive",
"summary": [],
"title": "Cua Volume",
+ "todos": [],
"usage": null
},
"request": "mount",
@@ -961,6 +994,7 @@
"step": "mode",
"summary": [],
"title": "How do you want to use this Mac?",
+ "todos": [],
"usage": null
},
"request": null,
@@ -991,6 +1025,7 @@
"step": "drive",
"summary": [],
"title": "Cua Volume",
+ "todos": [],
"usage": null
},
"request": null,
@@ -1021,6 +1056,7 @@
"step": "drive",
"summary": [],
"title": "Cua Volume",
+ "todos": [],
"usage": null
},
"request": null,
@@ -1052,6 +1088,7 @@
"step": "drive",
"summary": [],
"title": "Cua Volume",
+ "todos": [],
"usage": null
},
"request": null,
@@ -1087,6 +1124,7 @@
"step": "drive",
"summary": [],
"title": "Cua Volume",
+ "todos": [],
"usage": null
},
"request": null,
@@ -1115,6 +1153,7 @@
"step": "mode",
"summary": [],
"title": "How do you want to use this Mac?",
+ "todos": [],
"usage": null
},
"request": null,
@@ -1144,6 +1183,7 @@
"step": "drive",
"summary": [],
"title": "Cua Volume",
+ "todos": [],
"usage": null
},
"request": null,
@@ -1172,6 +1212,7 @@
"step": "mode",
"summary": [],
"title": "How do you want to use this Mac?",
+ "todos": [],
"usage": null
},
"request": null,
diff --git a/libs/cua/crates/cua-spaces-app-core/parity/golden/experiments.json b/libs/cua/crates/cua-spaces-app-core/parity/golden/experiments.json
index b40091a1c0..1c6246bc58 100644
--- a/libs/cua/crates/cua-spaces-app-core/parity/golden/experiments.json
+++ b/libs/cua/crates/cua-spaces-app-core/parity/golden/experiments.json
@@ -27,7 +27,7 @@
"drive": null,
"driveStorage": null,
"launchAtLogin": "[x] Launch at login ~Keeps your Spaces and agents available after a restart.",
- "lede": "Cua Spaces is in your menu bar.",
+ "lede": "3 things are left. You can finish them now, or later from the menu bar.",
"notice": null,
"noticeLink": null,
"presentations": [],
@@ -40,13 +40,16 @@
"showMark": false,
"step": "done",
"summary": [
- "cua command: not installed",
- "Account: not signed in",
- "AI agents: none",
"Shows in: Notch and menu bar",
- "This machine: Only used to open other computers"
+ "This machine: Opens your other computers"
+ ],
+ "title": "Almost done",
+ "todos": [
+ "[ ] Cua CLI ~Command-line tools for you and your agents. -> Install the Cua CLI",
+ "[ ] Account ~Reach your computers from any device. -> Sign in",
+ "[ ] AI agents ~Let Claude Code, Codex and others use Cua. -> Connect an AI agent",
+ "[ ] Cua Volume ~Shared folder: files your agents can share across your computers. -> Turn on (optional)"
],
- "title": "You're all set",
"usage": null
},
"pages": [
@@ -134,7 +137,7 @@
"drive": null,
"driveStorage": null,
"launchAtLogin": "[x] Launch at login ~Keeps your Spaces, agents and Cua Volume available after a restart.",
- "lede": "Cua Spaces is in your menu bar.",
+ "lede": "3 things are left. You can finish them now, or later from the menu bar.",
"notice": null,
"noticeLink": null,
"presentations": [],
@@ -147,14 +150,16 @@
"showMark": false,
"step": "done",
"summary": [
- "cua command: not installed",
- "Account: not signed in",
- "AI agents: none",
"Shows in: Notch and menu bar",
- "Cua Volume: In Finder",
- "This machine: Only used to open other computers"
+ "This machine: Opens your other computers"
+ ],
+ "title": "Almost done",
+ "todos": [
+ "[ ] Cua CLI ~Command-line tools for you and your agents. -> Install the Cua CLI",
+ "[ ] Account ~Reach your computers from any device. -> Sign in",
+ "[ ] AI agents ~Let Claude Code, Codex and others use Cua. -> Connect an AI agent",
+ "[x] Cua Volume ~Shared folder: files your agents can share across your computers. In Finder. (optional)"
],
- "title": "You're all set",
"usage": null
},
"pages": [
@@ -261,7 +266,7 @@
"drive": null,
"driveStorage": null,
"launchAtLogin": "[x] Launch at login ~Keeps your Spaces, agents and Cua Volume available after a restart.",
- "lede": "Cua Spaces is in your menu bar.",
+ "lede": "3 things are left. You can finish them now, or later from the menu bar.",
"notice": null,
"noticeLink": null,
"presentations": [],
@@ -274,14 +279,16 @@
"showMark": false,
"step": "done",
"summary": [
- "cua command: not installed",
- "Account: not signed in",
- "AI agents: none",
"Shows in: Notch and menu bar",
- "Cua Volume: In Finder",
- "This machine: Only used to open other computers"
+ "This machine: Opens your other computers"
+ ],
+ "title": "Almost done",
+ "todos": [
+ "[ ] Cua CLI ~Command-line tools for you and your agents. -> Install the Cua CLI",
+ "[ ] Account ~Reach your computers from any device. -> Sign in",
+ "[ ] AI agents ~Let Claude Code, Codex and others use Cua. -> Connect an AI agent",
+ "[x] Cua Volume ~Shared folder: files your agents can share across your computers. In Finder. (optional)"
],
- "title": "You're all set",
"usage": null
},
"pages": [
@@ -392,7 +399,7 @@
"drive": null,
"driveStorage": null,
"launchAtLogin": "[x] Launch at login ~Keeps your Spaces, agents and Cua Volume available after a restart.",
- "lede": "Cua Spaces is in your menu bar.",
+ "lede": "3 things are left. You can finish them now, or later from the menu bar.",
"notice": null,
"noticeLink": null,
"presentations": [],
@@ -405,14 +412,16 @@
"showMark": false,
"step": "done",
"summary": [
- "cua command: not installed",
- "Account: not signed in",
- "AI agents: none",
"Shows in: Notch and menu bar",
- "Cua Volume: In Finder",
- "This machine: Only used to open other computers"
+ "This machine: Opens your other computers"
+ ],
+ "title": "Almost done",
+ "todos": [
+ "[ ] Cua CLI ~Command-line tools for you and your agents. -> Install the Cua CLI",
+ "[ ] Account ~Reach your computers from any device. -> Sign in",
+ "[ ] AI agents ~Let Claude Code, Codex and others use Cua. -> Connect an AI agent",
+ "[x] Cua Volume ~Shared folder: files your agents can share across your computers. In Finder. (optional)"
],
- "title": "You're all set",
"usage": null
},
"pages": [
@@ -509,7 +518,7 @@
"drive": null,
"driveStorage": null,
"launchAtLogin": "[x] Launch at login ~Keeps your Spaces, agents and Cua Volume available after a restart.",
- "lede": "Cua Spaces is in your menu bar.",
+ "lede": "3 things are left. You can finish them now, or later from the menu bar.",
"notice": null,
"noticeLink": null,
"presentations": [],
@@ -522,14 +531,16 @@
"showMark": false,
"step": "done",
"summary": [
- "cua command: not installed",
- "Account: not signed in",
- "AI agents: none",
"Shows in: Notch and menu bar",
- "Cua Volume: In Finder",
- "This machine: Only used to open other computers"
+ "This machine: Opens your other computers"
+ ],
+ "title": "Almost done",
+ "todos": [
+ "[ ] Cua CLI ~Command-line tools for you and your agents. -> Install the Cua CLI",
+ "[ ] Account ~Reach your computers from any device. -> Sign in",
+ "[ ] AI agents ~Let Claude Code, Codex and others use Cua. -> Connect an AI agent",
+ "[x] Cua Volume ~Shared folder: files your agents can share across your computers. In Finder. (optional)"
],
- "title": "You're all set",
"usage": null
},
"pages": [
@@ -626,7 +637,7 @@
"drive": null,
"driveStorage": null,
"launchAtLogin": "[x] Launch at login ~Keeps your Spaces, agents and Cua Volume available after a restart.",
- "lede": "Cua Spaces is in your menu bar.",
+ "lede": "3 things are left. You can finish them now, or later from the menu bar.",
"notice": null,
"noticeLink": null,
"presentations": [],
@@ -639,14 +650,16 @@
"showMark": false,
"step": "done",
"summary": [
- "cua command: not installed",
- "Account: not signed in",
- "AI agents: none",
"Shows in: Notch and menu bar",
- "Cua Volume: In Finder",
- "This machine: Only used to open other computers"
+ "This machine: Opens your other computers"
+ ],
+ "title": "Almost done",
+ "todos": [
+ "[ ] Cua CLI ~Command-line tools for you and your agents. -> Install the Cua CLI",
+ "[ ] Account ~Reach your computers from any device. -> Sign in",
+ "[ ] AI agents ~Let Claude Code, Codex and others use Cua. -> Connect an AI agent",
+ "[x] Cua Volume ~Shared folder: files your agents can share across your computers. In Finder. (optional)"
],
- "title": "You're all set",
"usage": null
},
"pages": [
@@ -742,7 +755,7 @@
"drive": null,
"driveStorage": null,
"launchAtLogin": "[x] Launch at login ~Keeps your Spaces and agents available after a restart.",
- "lede": "Cua Spaces is in your menu bar.",
+ "lede": "3 things are left. You can finish them now, or later from the menu bar.",
"notice": null,
"noticeLink": null,
"presentations": [],
@@ -755,13 +768,16 @@
"showMark": false,
"step": "done",
"summary": [
- "cua command: not installed",
- "Account: not signed in",
- "AI agents: none",
"Shows in: Notch and menu bar",
- "This machine: Only used to open other computers"
+ "This machine: Opens your other computers"
+ ],
+ "title": "Almost done",
+ "todos": [
+ "[ ] Cua CLI ~Command-line tools for you and your agents. -> Install the Cua CLI",
+ "[ ] Account ~Reach your computers from any device. -> Sign in",
+ "[ ] AI agents ~Let Claude Code, Codex and others use Cua. -> Connect an AI agent",
+ "[ ] Cua Volume ~Shared folder: files your agents can share across your computers. -> Turn on (optional)"
],
- "title": "You're all set",
"usage": null
},
"pages": [
@@ -864,7 +880,7 @@
"drive": null,
"driveStorage": null,
"launchAtLogin": "[x] Launch at login ~Keeps your Spaces and agents available after a restart.",
- "lede": "Cua Spaces is in your menu bar.",
+ "lede": "3 things are left. You can finish them now, or later from the menu bar.",
"notice": null,
"noticeLink": null,
"presentations": [],
@@ -877,13 +893,16 @@
"showMark": false,
"step": "done",
"summary": [
- "cua command: not installed",
- "Account: not signed in",
- "AI agents: none",
"Shows in: Notch and menu bar",
- "This machine: Only used to open other computers"
+ "This machine: Opens your other computers"
+ ],
+ "title": "Almost done",
+ "todos": [
+ "[ ] Cua CLI ~Command-line tools for you and your agents. -> Install the Cua CLI",
+ "[ ] Account ~Reach your computers from any device. -> Sign in",
+ "[ ] AI agents ~Let Claude Code, Codex and others use Cua. -> Connect an AI agent",
+ "[ ] Cua Volume ~Shared folder: files your agents can share across your computers. -> Turn on (optional)"
],
- "title": "You're all set",
"usage": null
},
"pages": [
@@ -981,7 +1000,7 @@
"drive": null,
"driveStorage": null,
"launchAtLogin": "[x] Launch at login ~Keeps your Spaces and agents available after a restart.",
- "lede": "Cua Spaces is in your menu bar.",
+ "lede": "3 things are left. You can finish them now, or later from the menu bar.",
"notice": null,
"noticeLink": null,
"presentations": [],
@@ -994,13 +1013,16 @@
"showMark": false,
"step": "done",
"summary": [
- "cua command: not installed",
- "Account: not signed in",
- "AI agents: none",
"Shows in: Notch and menu bar",
- "This machine: Only used to open other computers"
+ "This machine: Opens your other computers"
+ ],
+ "title": "Almost done",
+ "todos": [
+ "[ ] Cua CLI ~Command-line tools for you and your agents. -> Install the Cua CLI",
+ "[ ] Account ~Reach your computers from any device. -> Sign in",
+ "[ ] AI agents ~Let Claude Code, Codex and others use Cua. -> Connect an AI agent",
+ "[ ] Cua Volume ~Shared folder: files your agents can share across your computers. -> Turn on (optional)"
],
- "title": "You're all set",
"usage": null
},
"pages": [
@@ -1096,7 +1118,7 @@
"drive": null,
"driveStorage": null,
"launchAtLogin": "[x] Launch at login ~Keeps your Spaces and agents available after a restart.",
- "lede": "Cua Spaces is in your menu bar.",
+ "lede": "3 things are left. You can finish them now, or later from the menu bar.",
"notice": null,
"noticeLink": null,
"presentations": [],
@@ -1109,13 +1131,16 @@
"showMark": false,
"step": "done",
"summary": [
- "cua command: not installed",
- "Account: not signed in",
- "AI agents: none",
"Shows in: Notch and menu bar",
- "This machine: Only used to open other computers"
+ "This machine: Opens your other computers"
+ ],
+ "title": "Almost done",
+ "todos": [
+ "[ ] Cua CLI ~Command-line tools for you and your agents. -> Install the Cua CLI",
+ "[ ] Account ~Reach your computers from any device. -> Sign in",
+ "[ ] AI agents ~Let Claude Code, Codex and others use Cua. -> Connect an AI agent",
+ "[ ] Cua Volume ~Shared folder: files your agents can share across your computers. -> Turn on (optional)"
],
- "title": "You're all set",
"usage": null
},
"pages": [
@@ -1213,7 +1238,7 @@
"drive": null,
"driveStorage": null,
"launchAtLogin": "[x] Launch at login ~Keeps your Spaces and agents available after a restart.",
- "lede": "Cua Spaces is in your menu bar.",
+ "lede": "3 things are left. You can finish them now, or later from the menu bar.",
"notice": null,
"noticeLink": null,
"presentations": [],
@@ -1226,13 +1251,16 @@
"showMark": false,
"step": "done",
"summary": [
- "cua command: not installed",
- "Account: not signed in",
- "AI agents: none",
"Shows in: Notch and menu bar",
- "This machine: Only used to open other computers"
+ "This machine: Opens your other computers"
+ ],
+ "title": "Almost done",
+ "todos": [
+ "[ ] Cua CLI ~Command-line tools for you and your agents. -> Install the Cua CLI",
+ "[ ] Account ~Reach your computers from any device. -> Sign in",
+ "[ ] AI agents ~Let Claude Code, Codex and others use Cua. -> Connect an AI agent",
+ "[ ] Cua Volume ~Shared folder: files your agents can share across your computers. -> Turn on (optional)"
],
- "title": "You're all set",
"usage": null
},
"pages": [
diff --git a/libs/cua/crates/cua-spaces-app-core/parity/golden/launch-at-login.json b/libs/cua/crates/cua-spaces-app-core/parity/golden/launch-at-login.json
index 60fb3084b1..023f715855 100644
--- a/libs/cua/crates/cua-spaces-app-core/parity/golden/launch-at-login.json
+++ b/libs/cua/crates/cua-spaces-app-core/parity/golden/launch-at-login.json
@@ -10,7 +10,7 @@
"drive": null,
"driveStorage": null,
"launchAtLogin": "[x] Launch at login ~Keeps your Spaces and agents available after a restart.",
- "lede": "Cua Spaces is in your menu bar.",
+ "lede": "3 things are left. You can finish them now, or later from the menu bar.",
"notice": null,
"noticeLink": null,
"presentations": [],
@@ -23,13 +23,16 @@
"showMark": false,
"step": "done",
"summary": [
- "cua command: not installed",
- "Account: not signed in",
- "AI agents: none",
"Shows in: Notch and menu bar",
- "This machine: Only used to open other computers"
+ "This machine: Opens your other computers"
+ ],
+ "title": "Almost done",
+ "todos": [
+ "[ ] Cua CLI ~Command-line tools for you and your agents. -> Install the Cua CLI",
+ "[ ] Account ~Reach your computers from any device. -> Sign in",
+ "[ ] AI agents ~Let Claude Code, Codex and others use Cua. -> Connect an AI agent",
+ "[ ] Cua Volume ~Shared folder: files your agents can share across your computers. -> Turn on (optional)"
],
- "title": "You're all set",
"usage": null
},
"launchAtLogin": true,
@@ -44,7 +47,7 @@
"drive": null,
"driveStorage": null,
"launchAtLogin": "[ ] Launch at login ~Keeps your Spaces and agents available after a restart.",
- "lede": "Cua Spaces is in your menu bar.",
+ "lede": "3 things are left. You can finish them now, or later from the menu bar.",
"notice": null,
"noticeLink": null,
"presentations": [],
@@ -57,13 +60,16 @@
"showMark": false,
"step": "done",
"summary": [
- "cua command: not installed",
- "Account: not signed in",
- "AI agents: none",
"Shows in: Notch and menu bar",
- "This machine: Only used to open other computers"
+ "This machine: Opens your other computers"
+ ],
+ "title": "Almost done",
+ "todos": [
+ "[ ] Cua CLI ~Command-line tools for you and your agents. -> Install the Cua CLI",
+ "[ ] Account ~Reach your computers from any device. -> Sign in",
+ "[ ] AI agents ~Let Claude Code, Codex and others use Cua. -> Connect an AI agent",
+ "[ ] Cua Volume ~Shared folder: files your agents can share across your computers. -> Turn on (optional)"
],
- "title": "You're all set",
"usage": null
},
"launchAtLogin": false,
@@ -78,7 +84,7 @@
"drive": null,
"driveStorage": null,
"launchAtLogin": "[x] Launch at login ~Keeps your Spaces and agents available after a restart.",
- "lede": "Cua Spaces is in your menu bar.",
+ "lede": "3 things are left. You can finish them now, or later from the menu bar.",
"notice": null,
"noticeLink": null,
"presentations": [],
@@ -91,13 +97,16 @@
"showMark": false,
"step": "done",
"summary": [
- "cua command: not installed",
- "Account: not signed in",
- "AI agents: none",
"Shows in: Notch and menu bar",
- "This machine: Only used to open other computers"
+ "This machine: Opens your other computers"
+ ],
+ "title": "Almost done",
+ "todos": [
+ "[ ] Cua CLI ~Command-line tools for you and your agents. -> Install the Cua CLI",
+ "[ ] Account ~Reach your computers from any device. -> Sign in",
+ "[ ] AI agents ~Let Claude Code, Codex and others use Cua. -> Connect an AI agent",
+ "[ ] Cua Volume ~Shared folder: files your agents can share across your computers. -> Turn on (optional)"
],
- "title": "You're all set",
"usage": null
},
"launchAtLogin": true,
@@ -112,7 +121,7 @@
"drive": null,
"driveStorage": null,
"launchAtLogin": "[x] Launch at login ~Keeps your Spaces and agents available after a restart.",
- "lede": "Cua Spaces is in your menu bar.",
+ "lede": "3 things are left. You can finish them now, or later from the menu bar.",
"notice": null,
"noticeLink": null,
"presentations": [],
@@ -125,13 +134,16 @@
"showMark": false,
"step": "done",
"summary": [
- "cua command: not installed",
- "Account: not signed in",
- "AI agents: none",
"Shows in: Notch and menu bar",
- "This machine: Reachable from your other devices"
+ "This machine: Your other devices can reach it"
+ ],
+ "title": "Almost done",
+ "todos": [
+ "[ ] Cua CLI ~Command-line tools for you and your agents. -> Install the Cua CLI",
+ "[ ] Account ~Reach your computers from any device. -> Sign in",
+ "[ ] AI agents ~Let Claude Code, Codex and others use Cua. -> Connect an AI agent",
+ "[ ] Cua Volume ~Shared folder: files your agents can share across your computers. -> Turn on (optional)"
],
- "title": "You're all set",
"usage": null
},
"launchAtLogin": true,
@@ -146,7 +158,7 @@
"drive": null,
"driveStorage": null,
"launchAtLogin": "[ ] Launch at login ~Keeps your Spaces and agents available after a restart.",
- "lede": "Cua Spaces is in your menu bar.",
+ "lede": "3 things are left. You can finish them now, or later from the menu bar.",
"notice": null,
"noticeLink": null,
"presentations": [],
@@ -159,13 +171,16 @@
"showMark": false,
"step": "done",
"summary": [
- "cua command: not installed",
- "Account: not signed in",
- "AI agents: none",
"Shows in: Notch and menu bar",
- "This machine: Reachable from your other devices"
+ "This machine: Your other devices can reach it"
+ ],
+ "title": "Almost done",
+ "todos": [
+ "[ ] Cua CLI ~Command-line tools for you and your agents. -> Install the Cua CLI",
+ "[ ] Account ~Reach your computers from any device. -> Sign in",
+ "[ ] AI agents ~Let Claude Code, Codex and others use Cua. -> Connect an AI agent",
+ "[ ] Cua Volume ~Shared folder: files your agents can share across your computers. -> Turn on (optional)"
],
- "title": "You're all set",
"usage": null
},
"launchAtLogin": false,
diff --git a/libs/cua/crates/cua-spaces-app-core/parity/golden/main-window.json b/libs/cua/crates/cua-spaces-app-core/parity/golden/main-window.json
index b1086be818..8c56634d0b 100644
--- a/libs/cua/crates/cua-spaces-app-core/parity/golden/main-window.json
+++ b/libs/cua/crates/cua-spaces-app-core/parity/golden/main-window.json
@@ -765,6 +765,7 @@
"step": "welcome",
"summary": [],
"title": "Welcome to Cua Spaces",
+ "todos": [],
"usage": "Share anonymous usage data [x]"
},
"onboarding": "initial"
@@ -787,6 +788,7 @@
"step": "welcome",
"summary": [],
"title": "Welcome to Cua Spaces",
+ "todos": [],
"usage": "Share anonymous usage data [x]"
},
"onboarding": "cli-installed"
@@ -809,6 +811,7 @@
"step": "signin",
"summary": [],
"title": "Sign in",
+ "todos": [],
"usage": null
},
"onboarding": "start"
@@ -831,6 +834,7 @@
"step": "signin",
"summary": [],
"title": "Sign in",
+ "todos": [],
"usage": null
},
"onboarding": "signed-in"
@@ -853,6 +857,7 @@
"step": "agents",
"summary": [],
"title": "AI agents",
+ "todos": [],
"usage": null
},
"onboarding": "signin-done"
@@ -878,6 +883,7 @@
"step": "presentation",
"summary": [],
"title": "Where should Cua Spaces show up?",
+ "todos": [],
"usage": null
},
"onboarding": "agents-done"
@@ -900,6 +906,7 @@
"step": "agents",
"summary": [],
"title": "AI agents",
+ "todos": [],
"usage": null
},
"onboarding": "back"
@@ -925,6 +932,7 @@
"step": "presentation",
"summary": [],
"title": "Where should Cua Spaces show up?",
+ "todos": [],
"usage": null
},
"onboarding": "agents-done"
@@ -950,6 +958,7 @@
"step": "presentation",
"summary": [],
"title": "Where should Cua Spaces show up?",
+ "todos": [],
"usage": null
},
"onboarding": "presentation-picked"
@@ -975,6 +984,7 @@
"step": "presentation",
"summary": [],
"title": "Where should Cua Spaces show up?",
+ "todos": [],
"usage": null
},
"onboarding": "presentation-picked"
@@ -1000,6 +1010,7 @@
"step": "presentation",
"summary": [],
"title": "Where should Cua Spaces show up?",
+ "todos": [],
"usage": null
},
"onboarding": "presentation-picked"
@@ -1025,6 +1036,7 @@
"step": "mode",
"summary": [],
"title": "How do you want to use this Mac?",
+ "todos": [],
"usage": null
},
"onboarding": "presentation-done"
@@ -1050,6 +1062,7 @@
"step": "presentation",
"summary": [],
"title": "Where should Cua Spaces show up?",
+ "todos": [],
"usage": null
},
"onboarding": "back"
@@ -1075,6 +1088,7 @@
"step": "mode",
"summary": [],
"title": "How do you want to use this Mac?",
+ "todos": [],
"usage": null
},
"onboarding": "presentation-done"
@@ -1100,6 +1114,7 @@
"step": "mode",
"summary": [],
"title": "How do you want to use this Mac?",
+ "todos": [],
"usage": null
},
"onboarding": "drive-continue"
@@ -1126,13 +1141,16 @@
"showMark": false,
"step": "done",
"summary": [
- "cua command: /Users/me/.local/bin/cua",
- "Account: [email protected]",
- "AI agents: Codex",
"Shows in: Menu bar only",
- "This machine: Reachable from your other devices"
+ "This machine: Your other devices can reach it"
],
"title": "You're all set",
+ "todos": [
+ "[x] Cua CLI ~Command-line tools for you and your agents.",
+ "[x] Account ~Signed in as [email protected].",
+ "[x] AI agents ~Codex, Pi can use Cua.",
+ "[ ] Cua Volume ~Shared folder: files your agents can share across your computers. -> Turn on (optional)"
+ ],
"usage": null
},
"onboarding": "mode-chosen"
diff --git a/libs/cua/crates/cua-spaces-app-core/src/dispatch.rs b/libs/cua/crates/cua-spaces-app-core/src/dispatch.rs
index 9ee67ba0da..81ec04f16d 100644
--- a/libs/cua/crates/cua-spaces-app-core/src/dispatch.rs
+++ b/libs/cua/crates/cua-spaces-app-core/src/dispatch.rs
@@ -711,10 +711,13 @@ pub fn call_value(method: &str, args: Value) -> Result<Value, CoreError> {
)),
"onboarding.reduce" => out(onboarding::reduce(&a.get("state")?, &a.get("action")?)),
// `hostOs`: the shell's system, for its words (macOS when absent).
- "onboarding.view" => out(onboarding::view_on(
+ // `withoutCli`: a shell with no Command line page (the web UI):
+ // Done neither lists the Cua CLI nor waits for it.
+ "onboarding.view" => out(onboarding::view_for(
&a.get("state")?,
a.get::<Option<SpaceOs>>("hostOs")?
.unwrap_or(SpaceOs::Macos),
+ !a.get::<Option<bool>>("withoutCli")?.unwrap_or(false),
)),
"onboarding.copy" => out(onboarding::copy()),
"onboarding.signedInText" => out(onboarding::signed_in_text(
@@ -1257,6 +1260,9 @@ mod tests {
.unwrap();
let mut done = state.clone();
done["step"] = json!("done");
+ done["identity"] = json!("[email protected]");
+ done["cliTarget"] = json!("/h/.local/bin/cua");
+ done["agents"] = json!(["Claude Code"]);
let lede = |os: Value| {
call_value("onboarding.view", json!({ "state": done, "hostOs": os })).unwrap()["lede"]
.as_str()
diff --git a/libs/cua/crates/cua-spaces-app-core/src/installer.rs b/libs/cua/crates/cua-spaces-app-core/src/installer.rs
index 7074275867..c1083f3805 100644
--- a/libs/cua/crates/cua-spaces-app-core/src/installer.rs
+++ b/libs/cua/crates/cua-spaces-app-core/src/installer.rs
@@ -120,6 +120,11 @@ pub struct CliInstallPlan {
pub path_profile: Option<String>,
/// The line that would be added to `path_profile`.
pub path_line: Option<String>,
+ /// A working `cua` CLI already on this machine: `target`, else the
+ /// first in the usual install folders or on PATH (a Finder-launched
+ /// app's PATH lacks `~/.local/bin`, so the folders are searched too).
+ #[serde(default)]
+ pub found: Option<String>,
}
/// What the user agreed to in the CLI step.
@@ -143,6 +148,9 @@ pub struct CliInstaller {
pub profile: PathBuf,
/// Symlink rather than copy (stable app location on macOS).
pub prefer_symlink: bool,
+ /// Other folders a `cua` is usually installed in (Homebrew, a root
+ /// install.sh), searched with PATH for one already there.
+ pub search_dirs: Vec<PathBuf>,
}
#[cfg(feature = "installer")]
@@ -163,7 +171,38 @@ impl CliInstaller {
bin_dir: default_bin_dir(&home, local.as_deref()),
path_env: std::env::var("PATH").unwrap_or_default(),
profile: profile_for_shell(&home, shell.as_deref(), xdg.as_deref()),
+ search_dirs: known_bin_dirs(&home),
+ }
+ }
+
+ /// A working `cua` CLI already here: `target` when it runs as one (its
+ /// `--version` is `installed_version`), else the first in
+ /// [`Self::search_dirs`] or on PATH.
+ async fn find_installed(
+ &self,
+ target: &Path,
+ installed_version: Option<&str>,
+ ) -> Option<String> {
+ if installed_version.is_some_and(is_cua_cli) {
+ return Some(target.display().to_string());
+ }
+ let mut seen = vec![target.to_path_buf()];
+ let dirs = self
+ .search_dirs
+ .iter()
+ .cloned()
+ .chain(std::env::split_paths(&self.path_env));
+ for dir in dirs {
+ let cli = dir.join(cli_file_name());
+ if seen.contains(&cli) || !cli.is_file() {
+ continue;
+ }
+ seen.push(cli.clone());
+ if cli_version(&cli).await.as_deref().is_some_and(is_cua_cli) {
+ return Some(cli.display().to_string());
+ }
}
+ None
}
/// The file the CLI is written to.
@@ -216,7 +255,11 @@ impl CliInstaller {
Some(path_line(&self.bin_dir, &self.profile)),
)
};
+ let found = self
+ .find_installed(&target, installed_version.as_deref())
+ .await;
CliInstallPlan {
+ found,
source: self.bundled.as_ref().map(|p| p.display().to_string()),
target: target.display().to_string(),
bin_dir: self.bin_dir.display().to_string(),
@@ -378,6 +421,19 @@ fn same_file(a: &Path, b: &Path) -> bool {
}
}
+/// Where a `cua` is usually installed besides the GUI's own target:
+/// Homebrew and a root install.sh's `/usr/local/bin` (not on Windows).
+pub fn known_bin_dirs(home: &Path) -> Vec<PathBuf> {
+ if cfg!(windows) {
+ return vec![];
+ }
+ vec![
+ home.join(".local").join("bin"),
+ PathBuf::from("/opt/homebrew/bin"),
+ PathBuf::from("/usr/local/bin"),
+ ]
+}
+
/// The first `name` on a PATH-style string.
pub fn first_on_path(path_env: &str, name: &str) -> Option<PathBuf> {
std::env::split_paths(path_env)
@@ -534,6 +590,7 @@ mod tests {
path_env: "/usr/bin:/bin".into(),
profile: profile_for_shell(&home, Some("/bin/zsh"), None),
prefer_symlink: false,
+ search_dirs: vec![],
};
let plan = cli.plan().await;
assert_eq!(
@@ -568,6 +625,28 @@ mod tests {
.unwrap();
let plan = cli.plan().await;
assert!(plan.installed && !plan.up_to_date, "{plan:?}");
+ assert_eq!(plan.found, None, "an old Python cua-cli is not the cua CLI");
+ // install.sh's own copy (the cua CLI, not the app's): found, so the
+ // app says it is installed even though it would still offer its own.
+ let elsewhere = tmp.path().join("brew/bin");
+ std::fs::create_dir_all(&elsewhere).unwrap();
+ std::fs::write(elsewhere.join("cua"), "#!/bin/sh\necho 'cua 0.4.4'\n").unwrap();
+ std::fs::set_permissions(
+ elsewhere.join("cua"),
+ std::fs::Permissions::from_mode(0o755),
+ )
+ .unwrap();
+ let searching = CliInstaller {
+ search_dirs: vec![elsewhere.clone()],
+ ..cli.clone()
+ };
+ let plan = searching.plan().await;
+ assert_eq!(
+ plan.found,
+ Some(elsewhere.join("cua").display().to_string()),
+ "{plan:?}"
+ );
+ assert!(!plan.up_to_date);
let done = cli.install(&CliInstallRequest::default()).await.unwrap();
assert!(done.up_to_date, "{done:?}");
assert_eq!(done.installed_version.as_deref(), Some("cua 1.2.3"));
diff --git a/libs/cua/crates/cua-spaces-app-core/src/onboarding.rs b/libs/cua/crates/cua-spaces-app-core/src/onboarding.rs
index b3e9eafdc6..986dc70999 100644
--- a/libs/cua/crates/cua-spaces-app-core/src/onboarding.rs
+++ b/libs/cua/crates/cua-spaces-app-core/src/onboarding.rs
@@ -220,6 +220,10 @@ pub struct OnboardingState {
/// Welcome shows again (Back).
#[serde(default)]
pub run_counted: bool,
+ /// A page opened from Done's to-do list: leaving it (Continue, Skip or
+ /// Back) comes back to Done.
+ #[serde(default)]
+ pub revisit: bool,
}
fn ticked() -> bool {
@@ -364,6 +368,19 @@ pub enum OnboardingAction {
/// The switches.
experiments: Experiments,
},
+ /// A to-do on Done was clicked: its page opens, and leaving it comes
+ /// back to Done. Cua Volume needs its experiment on first (the shell
+ /// turns it on and sends `experiments-loaded`).
+ TodoChosen {
+ /// Which.
+ id: OnboardingTodoId,
+ },
+ /// The coding agents that already use cua (set up earlier, from the
+ /// CLI or Settings), as the shell read them. Any page.
+ AgentsDetected {
+ /// Their names.
+ configured: Vec<String>,
+ },
}
/// The first state.
@@ -397,6 +414,7 @@ pub fn initial(
telemetry: None,
experiments: Experiments::default(),
run_counted: false,
+ revisit: false,
}
}
@@ -456,6 +474,18 @@ fn drive_usable(s: &OnboardingState) -> bool {
/// Advances the flow. Out-of-order actions are ignored.
pub fn reduce(s: &OnboardingState, a: &OnboardingAction) -> OnboardingState {
+ let mut n = reduce_page(s, a);
+ // A page opened from Done: whatever leaves it (Back too, even from a
+ // page this run otherwise skips) lands on Done again.
+ let back = matches!(a, OnboardingAction::Back) && !s.cli_installing;
+ if s.revisit && s.step != OnboardingStep::Done && (n.step != s.step || back) {
+ n.step = OnboardingStep::Done;
+ n.revisit = false;
+ }
+ n
+}
+
+fn reduce_page(s: &OnboardingState, a: &OnboardingAction) -> OnboardingState {
use OnboardingStep::*;
let mut n = s.clone();
match (s.step, a) {
@@ -471,14 +501,18 @@ pub fn reduce(s: &OnboardingState, a: &OnboardingAction) -> OnboardingState {
(_, OnboardingAction::CliInstalled { target }) => n.cli_target = target.clone(),
(_, OnboardingAction::CliPlanned { plan }) => {
n.cli_plan = Some(plan.clone());
- if plan.up_to_date {
+ // A working `cua` anywhere it is usually installed (install.sh's
+ // copy included), not only the app's own.
+ if let Some(found) = plan.found.clone() {
+ n.cli_target = Some(found);
+ } else if plan.up_to_date {
n.cli_target = Some(plan.target.clone());
}
if s.step == Cli && !cli_shown(&n) {
n.cli_installing = false;
n.step = next(s, Cli);
}
- if s.step != Welcome && !cli_shown(s) && cli_shown(&n) {
+ if !matches!(s.step, Welcome | Done) && !cli_shown(s) && cli_shown(&n) {
n.step = Cli;
}
}
@@ -499,7 +533,12 @@ pub fn reduce(s: &OnboardingState, a: &OnboardingAction) -> OnboardingState {
(_, OnboardingAction::SignedIn { identity }) => n.identity = Some(identity.clone()),
(Signin, OnboardingAction::SigninDone) => n.step = Agents,
(Agents, OnboardingAction::AgentsDone { configured }) => {
- n.agents = configured.clone();
+ // Added to the agents already found (a Skip keeps them).
+ for name in configured {
+ if !n.agents.contains(name) {
+ n.agents.push(name.clone());
+ }
+ }
n.step = Presentation;
}
(Mode, OnboardingAction::ModeChosen { mode }) => {
@@ -614,6 +653,26 @@ pub fn reduce(s: &OnboardingState, a: &OnboardingAction) -> OnboardingState {
n.drive_error = Some(error.clone());
}
(Done, OnboardingAction::LaunchAtLoginToggled { on }) => n.launch_at_login = *on,
+ (Done, OnboardingAction::TodoChosen { id }) => {
+ let page = match id {
+ OnboardingTodoId::Cli => Some(Cli),
+ OnboardingTodoId::Signin => Some(Signin),
+ OnboardingTodoId::Agents => Some(Agents),
+ OnboardingTodoId::Volume => drive_shown(s).then_some(Drive),
+ };
+ if let Some(page) = page {
+ n.step = page;
+ n.revisit = true;
+ n.cli_error = None;
+ }
+ }
+ (_, OnboardingAction::AgentsDetected { configured }) => {
+ for name in configured {
+ if !n.agents.contains(name) {
+ n.agents.push(name.clone());
+ }
+ }
+ }
(_, OnboardingAction::TelemetryLoaded { telemetry }) => {
n.telemetry = Some(telemetry.clone())
}
@@ -706,6 +765,11 @@ pub struct OnboardingView {
pub drive: Option<DriveCard>,
/// Done's "Launch at login" checkbox.
pub launch_at_login: Option<OnboardingCheckbox>,
+ /// Done's to-do list: the Cua CLI, the account, an AI agent and Cua
+ /// Volume, each set up or with its fix. The title says "Almost done"
+ /// until every one that is not optional is.
+ #[serde(default)]
+ pub todos: Vec<OnboardingTodo>,
}
/// A checkbox with one muted line under it.
@@ -720,6 +784,39 @@ pub struct OnboardingCheckbox {
pub note: String,
}
+/// A line of Done's to-do list.
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
+#[serde(rename_all = "lowercase")]
+pub enum OnboardingTodoId {
+ /// The Cua CLI.
+ Cli,
+ /// The Cua account.
+ Signin,
+ /// A coding agent that uses cua.
+ Agents,
+ /// Cua Volume (optional).
+ Volume,
+}
+
+/// One line of Done's to-do list: what is set up, and a one-click fix for
+/// what is not.
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase")]
+pub struct OnboardingTodo {
+ /// Which.
+ pub id: OnboardingTodoId,
+ /// "Cua CLI".
+ pub title: String,
+ /// One plain line under it.
+ pub note: String,
+ /// Set up.
+ pub done: bool,
+ /// Nice to have: "You're all set" does not wait for it.
+ pub optional: bool,
+ /// The fix's button ("Install the Cua CLI"), while not done.
+ pub action: Option<String>,
+}
+
/// The Cua Volume page's card: an animated miniature
/// ([`crate::drive_mount_preview`]) over one checkbox line.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
@@ -1160,6 +1257,12 @@ pub fn done_lede(os: SpaceOs) -> &'static str {
/// [`view`] in the words of the system the app runs on (`os`).
pub fn view_on(s: &OnboardingState, os: SpaceOs) -> OnboardingView {
+ view_for(s, os, true)
+}
+
+/// [`view_on`] for a shell with (`cli_page`) or without a Command line
+/// page: without one, Done neither lists the Cua CLI nor waits for it.
+pub fn view_for(s: &OnboardingState, os: SpaceOs, cli_page: bool) -> OnboardingView {
use crate::spaces::sidebar::Fact;
use OnboardingStep::*;
let cli = s.cli_plan.as_ref().map(cli_lede).unwrap_or_default();
@@ -1173,9 +1276,9 @@ pub fn view_on(s: &OnboardingState, os: SpaceOs) -> OnboardingView {
),
Cli => (
if s.cli_plan.as_ref().is_some_and(|p| p.on_path) {
- "Install the cua command"
+ "Install the Cua CLI"
} else {
- "Install the cua command and add it to your PATH"
+ "Install the Cua CLI and add it to your PATH"
},
cli.as_str(),
if s.cli_installing {
@@ -1215,38 +1318,24 @@ pub fn view_on(s: &OnboardingState, os: SpaceOs) -> OnboardingView {
"Use it only to open your other computers, or let your other devices reach it too. You can change this later.",
"Continue",
),
- Done => ("You're all set", done_lede(os), "Start using Cua Spaces"),
+ Done => ("", "", "Start using Cua Spaces"),
+ };
+ let todos = if s.step == Done {
+ done_todos(s)
+ .into_iter()
+ .filter(|t| cli_page || t.id != OnboardingTodoId::Cli)
+ .collect()
+ } else {
+ vec![]
+ };
+ let left = todos.iter().filter(|t| !t.done && !t.optional).count();
+ let done_words = (s.step == Done).then(|| done_heading(left, os));
+ let (title, lede) = match &done_words {
+ Some((t, l)) => (t.as_str(), l.as_str()),
+ None => (title, lede),
};
let summary = if s.step == Done {
- let mut facts = vec![
- Fact {
- label: "cua command".into(),
- value: s
- .cli_target
- .clone()
- .unwrap_or_else(|| "not installed".into()),
- copy: None,
- help: None,
- warning: None,
- },
- Fact {
- label: "Account".into(),
- value: s.identity.clone().unwrap_or_else(|| "not signed in".into()),
- copy: None,
- help: None,
- warning: None,
- },
- Fact {
- label: "AI agents".into(),
- value: if s.agents.is_empty() {
- "none".into()
- } else {
- s.agents.join(", ")
- },
- copy: None,
- help: None,
- warning: None,
- },
+ vec![
Fact {
label: "Shows in".into(),
value: if s.menu_bar {
@@ -1262,29 +1351,16 @@ pub fn view_on(s: &OnboardingState, os: SpaceOs) -> OnboardingView {
Fact {
label: "This machine".into(),
value: if s.mode == Some(OnboardingMode::Host) {
- "Reachable from your other devices"
+ "Your other devices can reach it"
} else {
- "Only used to open other computers"
+ "Opens your other computers"
}
.into(),
copy: None,
help: None,
warning: None,
},
- ];
- if drive_shown(s) {
- facts.insert(
- 4,
- Fact {
- label: "Cua Volume".into(),
- value: drive_fact(s),
- copy: None,
- help: None,
- warning: None,
- },
- );
- }
- facts
+ ]
} else {
vec![]
};
@@ -1365,9 +1441,105 @@ pub fn view_on(s: &OnboardingState, os: SpaceOs) -> OnboardingView {
checked: s.launch_at_login,
note: crate::login_item::note(s.experiments.cua_volume).into(),
}),
+ todos,
}
}
+/// Done's heading and the line under it: "You're all set" only when it is
+/// true, else "Almost done" and how many things are left.
+pub fn done_heading(left: usize, os: SpaceOs) -> (String, String) {
+ let place = match os {
+ SpaceOs::Macos => "the menu bar",
+ _ => "the system tray",
+ };
+ match left {
+ 0 => ("You're all set".into(), done_lede(os).into()),
+ 1 => (
+ "Almost done".into(),
+ format!("One thing is left. You can finish it now, or later from {place}."),
+ ),
+ n => (
+ "Almost done".into(),
+ format!("{n} things are left. You can finish them now, or later from {place}."),
+ ),
+ }
+}
+
+/// The Cua CLI's one plain line (next to its name everywhere it shows).
+pub const CLI_HINT: &str = "Command-line tools for you and your agents.";
+/// Cua Volume's one plain line.
+pub const VOLUME_HINT: &str = "Shared folder: files your agents can share across your computers.";
+
+/// Done's to-do list, in page order. Cua Volume shows wherever it can
+/// mount (its experiment need not be on: "Turn on" turns it on).
+fn done_todos(s: &OnboardingState) -> Vec<OnboardingTodo> {
+ let todo = |id, title: &str, note: String, done: bool, optional, action: &str| OnboardingTodo {
+ id,
+ title: title.into(),
+ note,
+ done,
+ optional,
+ action: (!done).then(|| action.to_string()),
+ };
+ let signed_in = s.identity.as_deref().filter(|i| !i.is_empty());
+ let mut out = vec![
+ todo(
+ OnboardingTodoId::Cli,
+ "Cua CLI",
+ CLI_HINT.into(),
+ s.cli_target.is_some(),
+ false,
+ "Install the Cua CLI",
+ ),
+ todo(
+ OnboardingTodoId::Signin,
+ "Account",
+ match signed_in {
+ Some(id) => format!("Signed in as {id}."),
+ None => "Reach your computers from any device.".into(),
+ },
+ signed_in.is_some(),
+ false,
+ "Sign in",
+ ),
+ todo(
+ OnboardingTodoId::Agents,
+ "AI agents",
+ if s.agents.is_empty() {
+ "Let Claude Code, Codex and others use Cua.".into()
+ } else {
+ format!("{} can use Cua.", s.agents.join(", "))
+ },
+ !s.agents.is_empty(),
+ false,
+ "Connect an AI agent",
+ ),
+ ];
+ let can_mount = s.drive_os != Some(SpaceOs::Windows)
+ || s.drive_status.as_ref().is_some_and(|m| m.supported());
+ if can_mount {
+ let on = drive_fact(s);
+ let mounted = s.experiments.cua_volume
+ && s.drive_mount
+ && s.drive_status
+ .as_ref()
+ .is_some_and(|m| m.enabled && m.state == "mounted");
+ out.push(todo(
+ OnboardingTodoId::Volume,
+ "Cua Volume",
+ if s.experiments.cua_volume && on != "Off" {
+ format!("{VOLUME_HINT} {on}.")
+ } else {
+ VOLUME_HINT.into()
+ },
+ mounted,
+ true,
+ "Turn on",
+ ));
+ }
+ out
+}
+
#[cfg(test)]
mod tests {
/// A Windows machine whose drive check answers while its Volume page
@@ -1385,14 +1557,111 @@ mod tests {
)
}
+ /// Done is honest: "Almost done" while the CLI, the account or an
+ /// agent is missing, with a fix for each; a fix opens its page and
+ /// leaving it comes back to Done.
+ #[test]
+ fn done_lists_what_is_missing_and_each_fix_comes_back() {
+ let done = OnboardingState {
+ step: OnboardingStep::Done,
+ mode: Some(OnboardingMode::Client),
+ ..initial(None, None)
+ };
+ let v = view(&done);
+ assert_eq!(v.title, "Almost done");
+ assert_eq!(
+ v.lede,
+ "3 things are left. You can finish them now, or later from the menu bar."
+ );
+ let fixes: Vec<_> = v.todos.iter().filter_map(|t| t.action.clone()).collect();
+ assert_eq!(
+ fixes,
+ [
+ "Install the Cua CLI",
+ "Sign in",
+ "Connect an AI agent",
+ "Turn on"
+ ]
+ );
+ assert!(
+ v.summary
+ .iter()
+ .any(|f| f.label == "This machine" && f.value == "Opens your other computers")
+ );
+ // Sign in from Done, then back to Done.
+ let at = reduce(
+ &done,
+ &OnboardingAction::TodoChosen {
+ id: OnboardingTodoId::Signin,
+ },
+ );
+ assert_eq!(at.step, OnboardingStep::Signin);
+ let signed = reduce(
+ &at,
+ &OnboardingAction::SignedIn {
+ identity: "[email protected]".into(),
+ },
+ );
+ let back = reduce(&signed, &OnboardingAction::SigninDone);
+ assert_eq!(back.step, OnboardingStep::Done);
+ assert!(!back.revisit);
+ assert_eq!(
+ view(&back).lede.split('.').next(),
+ Some("2 things are left")
+ );
+ // Back from a page this run skipped (no Command line page) too.
+ let cli = reduce(
+ &back,
+ &OnboardingAction::TodoChosen {
+ id: OnboardingTodoId::Cli,
+ },
+ );
+ assert_eq!(cli.step, OnboardingStep::Cli);
+ assert_eq!(
+ reduce(&cli, &OnboardingAction::Back).step,
+ OnboardingStep::Done
+ );
+ // Cua Volume needs its experiment first: nothing until it is on.
+ let vol = OnboardingTodoId::Volume;
+ assert_eq!(
+ reduce(&back, &OnboardingAction::TodoChosen { id: vol }).step,
+ OnboardingStep::Done
+ );
+ // The CLI from install.sh and agents set up earlier count.
+ let found = reduce(
+ &back,
+ &OnboardingAction::CliPlanned {
+ plan: CliInstallPlan {
+ found: Some("/h/.local/bin/cua".into()),
+ ..plan(false, false)
+ },
+ },
+ );
+ assert_eq!(
+ found.step,
+ OnboardingStep::Done,
+ "a late plan never leaves Done"
+ );
+ let all = reduce(
+ &found,
+ &OnboardingAction::AgentsDetected {
+ configured: vec!["Codex".into()],
+ },
+ );
+ assert_eq!(view(&all).title, "You're all set");
+ }
+
/// The last page says where the app stays: the menu bar on a Mac, the
/// tray on Windows and Linux.
#[test]
fn done_names_the_menu_bar_only_on_a_mac() {
let done = OnboardingState {
step: OnboardingStep::Done,
- ..initial(None, None)
+ cli_target: Some("/h/.local/bin/cua".into()),
+ agents: vec!["Claude Code".into()],
+ ..initial(None, Some("[email protected]".into()))
};
+ assert_eq!(view(&done).title, "You're all set");
assert_eq!(view(&done).lede, "Cua Spaces is in your menu bar.");
assert_eq!(view_on(&done, SpaceOs::Macos), view(&done));
for os in [SpaceOs::Windows, SpaceOs::Linux] {
@@ -1401,6 +1670,14 @@ mod tests {
"Cua Spaces is in your system tray."
);
}
+ let one_left = OnboardingState {
+ agents: vec![],
+ ..done.clone()
+ };
+ assert_eq!(
+ view_on(&one_left, SpaceOs::Linux).lede,
+ "One thing is left. You can finish it now, or later from the system tray."
+ );
}
#[test]
@@ -1477,7 +1754,14 @@ mod tests {
},
);
let done = view(&s);
- assert!(done.summary.iter().all(|f| f.label != "Cua Volume"));
+ let volume = done
+ .todos
+ .iter()
+ .find(|t| t.id == OnboardingTodoId::Volume)
+ .unwrap();
+ assert!(volume.optional && !volume.done, "offered, off");
+ assert_eq!(volume.action.as_deref(), Some("Turn on"));
+ assert_eq!(volume.note, VOLUME_HINT);
assert_eq!(
done.launch_at_login.unwrap().note,
crate::login_item::NOTE_WITHOUT_VOLUME
@@ -1494,7 +1778,7 @@ mod tests {
);
let v = view(&on);
assert!(v.dots.iter().any(|d| d.label == "Cua Volume"));
- assert!(v.summary.iter().any(|f| f.label == "Cua Volume"));
+ assert!(v.todos.iter().any(|t| t.title == "Cua Volume"));
assert_eq!(v.launch_at_login.unwrap().note, crate::login_item::NOTE);
// Turned off while its page shows: on to the next page.
let at = OnboardingState {
@@ -1536,6 +1820,7 @@ mod tests {
fn plan(up_to_date: bool, on_path: bool) -> CliInstallPlan {
CliInstallPlan {
+ found: up_to_date.then(|| "/h/.local/bin/cua".into()),
source: Some("/Applications/Cua Spaces.app/Contents/MacOS/cua".into()),
target: "/h/.local/bin/cua".into(),
bin_dir: "/h/.local/bin".into(),
@@ -1558,7 +1843,7 @@ mod tests {
let s = reduce(&planned, &OnboardingAction::Start);
assert_eq!(s.step, OnboardingStep::Cli);
let v = view(&s);
- assert_eq!(v.title, "Install the cua command and add it to your PATH");
+ assert_eq!(v.title, "Install the Cua CLI and add it to your PATH");
assert_eq!(
v.lede,
"Copies cua to /h/.local/bin/cua and adds /h/.local/bin to PATH in /h/.zshrc."
@@ -1597,10 +1882,11 @@ mod tests {
plan: plan(false, true),
},
);
- assert_eq!(view(&on_path).title, "Install the cua command");
+ assert_eq!(view(&on_path).title, "Install the Cua CLI");
for p in [
plan(true, true),
CliInstallPlan {
+ found: None,
source: None,
..plan(false, false)
},
@@ -1625,6 +1911,7 @@ mod tests {
&s,
&OnboardingAction::CliPlanned {
plan: CliInstallPlan {
+ found: None,
method: Some(InstallMethod::Symlink),
..plan(false, true)
},
@@ -1783,11 +2070,14 @@ mod tests {
.iter()
.any(|f| f.label == "Shows in" && f.value == "Menu bar only")
);
- assert!(
- facts
- .iter()
- .any(|f| f.label == "cua command" && f.value == "/h/.local/bin/cua")
- );
+ let cli = view(&s)
+ .todos
+ .into_iter()
+ .find(|t| t.id == OnboardingTodoId::Cli)
+ .unwrap();
+ assert!(cli.done && cli.action.is_none(), "{cli:?}");
+ assert_eq!(cli.title, "Cua CLI");
+ assert_eq!(cli.note, CLI_HINT);
}
fn mount(state: &str, enabled: bool) -> DriveMountInput {
@@ -1915,12 +2205,13 @@ mod tests {
mode: OnboardingMode::Client,
},
);
- let fact = view(&s)
- .summary
+ let volume = view(&s)
+ .todos
.into_iter()
- .find(|f| f.label == "Cua Volume")
+ .find(|t| t.id == OnboardingTodoId::Volume)
.unwrap();
- assert_eq!(fact.value, "Waiting for approval");
+ assert!(!volume.done);
+ assert!(volume.note.ends_with("Waiting for approval."), "{volume:?}");
}
#[test]
diff --git a/libs/cua/crates/cua-spaces-app-core/src/parity.rs b/libs/cua/crates/cua-spaces-app-core/src/parity.rs
index 83318a3446..9ff8b7837b 100644
--- a/libs/cua/crates/cua-spaces-app-core/src/parity.rs
+++ b/libs/cua/crates/cua-spaces-app-core/src/parity.rs
@@ -1038,6 +1038,11 @@ pub mod frame {
"showMark": v["showMark"],
"dots": v["dots"].as_array().map(|a| a.iter().map(|d| format!("{}{}", if d["current"] == true { "*" } else { "" }, str_of(&d["label"]))).collect::<Vec<_>>().join(",")).unwrap_or_default(),
"summary": facts(&v["summary"]),
+ // Done's to-do list: `[x] title ~note -> fix (optional)`.
+ "todos": v["todos"].as_array().map(|a| a.iter().map(|t| Value::String(format!("[{}] {} ~{}{}{}",
+ if t["done"] == true { "x" } else { " " }, str_of(&t["title"]), str_of(&t["note"]),
+ t["action"].as_str().map(|x| format!(" -> {x}")).unwrap_or_default(),
+ if t["optional"] == true { " (optional)" } else { "" }))).collect::<Vec<_>>()).unwrap_or_default(),
"choices": v["choices"].as_array().map(|a| a.iter().map(|c| Value::String(format!("{}: {}{}", str_of(&c["mode"]), str_of(&c["label"]),
if c["preselected"] == true { " (preselected)" } else { "" }))).collect::<Vec<_>>()).unwrap_or_default(),
"presentations": v["presentations"].as_array().map(|a| a.iter().map(|c| Value::String(format!("{} [{}]{}", str_of(&c["title"]), str_of(&c["id"]),
diff --git a/libs/cua/crates/cua-spaces-app-core/src/telemetry.rs b/libs/cua/crates/cua-spaces-app-core/src/telemetry.rs
index 287ffa41c8..6f1dc6d7b2 100644
--- a/libs/cua/crates/cua-spaces-app-core/src/telemetry.rs
+++ b/libs/cua/crates/cua-spaces-app-core/src/telemetry.rs
@@ -1129,6 +1129,7 @@ mod tests {
&initial(None, None),
&OnboardingAction::CliPlanned {
plan: crate::installer::CliInstallPlan {
+ found: None,
source: Some("/Applications/Cua Spaces.app/Contents/MacOS/cua".into()),
target: "/Users/alice/.local/bin/cua".into(),
..Default::default()
@@ -1144,6 +1145,7 @@ mod tests {
assert!(onboarding(&s, &OnboardingAction::CliDone { install: true }).is_empty());
let installed = OnboardingAction::CliPlanned {
plan: crate::installer::CliInstallPlan {
+ found: None,
source: Some("/Applications/Cua Spaces.app/Contents/MacOS/cua".into()),
target: "/Users/alice/.local/bin/cua".into(),
up_to_date: true,
diff --git a/libs/cua/crates/cua-spaces-ffi/src/app_core.rs b/libs/cua/crates/cua-spaces-ffi/src/app_core.rs
index 5bac9bfaef..7aec1abc77 100644
--- a/libs/cua/crates/cua-spaces-ffi/src/app_core.rs
+++ b/libs/cua/crates/cua-spaces-ffi/src/app_core.rs
@@ -2396,6 +2396,7 @@ impl AppCliInstaller {
path_env,
profile: profile.into(),
prefer_symlink: false,
+ search_dirs: vec![],
},
})
}
diff --git a/libs/cua/crates/cua-spaces-ffi/src/app_core_types.rs b/libs/cua/crates/cua-spaces-ffi/src/app_core_types.rs
index b2418e69d9..de6926ff89 100644
--- a/libs/cua/crates/cua-spaces-ffi/src/app_core_types.rs
+++ b/libs/cua/crates/cua-spaces-ffi/src/app_core_types.rs
@@ -5598,6 +5598,9 @@ pub struct AppOnboardingState {
/// shown, else when Welcome was left. Once per run, however often
/// Welcome shows again (Back).
pub run_counted: bool,
+ /// A page opened from Done's to-do list: leaving it (Continue, Skip or
+ /// Back) comes back to Done.
+ pub revisit: bool,
}
/// An input.
@@ -5728,6 +5731,52 @@ pub enum AppOnboardingAction {
/// The switches.
experiments: AppExperiments,
},
+ /// A to-do on Done was clicked: its page opens, and leaving it comes
+ /// back to Done. Cua Volume needs its experiment on first (the shell
+ /// turns it on and sends `experiments-loaded`).
+ TodoChosen {
+ /// Which.
+ id: AppOnboardingTodoId,
+ },
+ /// The coding agents that already use cua (set up earlier, from the
+ /// CLI or Settings), as the shell read them. Any page.
+ AgentsDetected {
+ /// Their names.
+ configured: Vec<String>,
+ },
+}
+
+/// A line of Done's to-do list.
+pub type AppOnboardingTodoId = core::onboarding::OnboardingTodoId;
+#[uniffi::remote(Enum)]
+pub enum AppOnboardingTodoId {
+ /// The Cua CLI.
+ Cli,
+ /// The Cua account.
+ Signin,
+ /// A coding agent that uses cua.
+ Agents,
+ /// Cua Volume (optional).
+ Volume,
+}
+
+/// One line of Done's to-do list: what is set up, and a one-click fix for
+/// what is not.
+pub type AppOnboardingTodo = core::onboarding::OnboardingTodo;
+#[uniffi::remote(Record)]
+pub struct AppOnboardingTodo {
+ /// Which.
+ pub id: AppOnboardingTodoId,
+ /// "Cua CLI".
+ pub title: String,
+ /// One plain line under it.
+ pub note: String,
+ /// Set up.
+ pub done: bool,
+ /// Nice to have: "You're all set" does not wait for it.
+ pub optional: bool,
+ /// The fix's button ("Install the Cua CLI"), while not done.
+ pub action: Option<String>,
}
/// A page dot.
@@ -5817,6 +5866,10 @@ pub struct AppOnboardingView {
pub drive: Option<AppDriveCard>,
/// Done's "Launch at login" checkbox.
pub launch_at_login: Option<AppOnboardingCheckbox>,
+ /// Done's to-do list: the Cua CLI, the account, an AI agent and Cua
+ /// Volume, each set up or with its fix. The title says "Almost done"
+ /// until every one that is not optional is.
+ pub todos: Vec<AppOnboardingTodo>,
}
/// The Cua Volume page's card: an animated miniature
@@ -7495,6 +7548,10 @@ pub struct AppCliInstallPlan {
pub path_profile: Option<String>,
/// The line that would be added to `path_profile`.
pub path_line: Option<String>,
+ /// A working `cua` CLI already on this machine: `target`, else the
+ /// first in the usual install folders or on PATH (a Finder-launched
+ /// app's PATH lacks `~/.local/bin`, so the folders are searched too).
+ pub found: Option<String>,
}
/// What the user agreed to in the CLI step.
diff --git a/libs/cua/scripts/generate-app-core-ffi.py b/libs/cua/scripts/generate-app-core-ffi.py
index 38c5e48213..b8ed166ba9 100644
--- a/libs/cua/scripts/generate-app-core-ffi.py
+++ b/libs/cua/scripts/generate-app-core-ffi.py
@@ -45,7 +45,7 @@ TYPES = [
("keyvault/client.rs", "keyvault::client", ["KvOutcome"]),
("billing.rs", "billing", ["BillingCard", "BillingCredit", "BillingStatus", "CreditNotice"]),
("drive_settings.rs", "drive_settings", ["DriveMountInput", "DriveS3Input", "DriveStorageInput", "DriveCheckInput", "DriveCacheInput", "StorageInput", "DriveStorageUpdate", "StorageForm", "StorageField", "StorageRequest", "StorageState", "StorageAction"]),
- ("onboarding.rs", "onboarding", ["OnboardingStep", "DriveStepRequest", "StorageChoice", "OnboardingMode", "OnboardingState", "OnboardingAction", "StepDot", "UsageToggle", "ModeChoice", "OnboardingView", "DriveCard", "PresentationCard", "OnboardingCopy", "OnboardingCheckbox"]),
+ ("onboarding.rs", "onboarding", ["OnboardingStep", "DriveStepRequest", "StorageChoice", "OnboardingMode", "OnboardingState", "OnboardingAction", "OnboardingTodoId", "OnboardingTodo", "StepDot", "UsageToggle", "ModeChoice", "OnboardingView", "DriveCard", "PresentationCard", "OnboardingCopy", "OnboardingCheckbox"]),
("onboarding_preview.rs", "onboarding_preview", ["PreviewPoint", "NotchPreview", "MenuPreviewRow", "MenuPreview", "PresentationPreview", "PreviewFrame"]),
("driver_preview.rs", "driver_preview", ["PreviewSegment", "PreviewWindow", "DriverPreview", "DriverFrame"]),
("drive_mount_preview.rs", "drive_mount_preview", ["DriveMountPreview", "DriveMountFrame"]),
diff --git a/libs/spaces-app-swift/Sources/CuaSpacesFFI/CuaSpacesFFI.swift b/libs/spaces-app-swift/Sources/CuaSpacesFFI/CuaSpacesFFI.swift
index dbcd565cd6..2e2398f92a 100644
--- a/libs/spaces-app-swift/Sources/CuaSpacesFFI/CuaSpacesFFI.swift
+++ b/libs/spaces-app-swift/Sources/CuaSpacesFFI/CuaSpacesFFI.swift
@@ -7133,6 +7133,12 @@ public struct AppCliInstallPlan: Equatable, Hashable {
* The line that would be added to `path_profile`.
*/
public var pathLine: String?
+ /**
+ * A working `cua` CLI already on this machine: `target`, else the
+ * first in the usual install folders or on PATH (a Finder-launched
+ * app's PATH lacks `~/.local/bin`, so the folders are searched too).
+ */
+ public var found: String?
// Default memberwise initializers are never public by default, so we
// declare one manually.
@@ -7172,7 +7178,12 @@ public struct AppCliInstallPlan: Equatable, Hashable {
*/pathProfile: String?,
/**
* The line that would be added to `path_profile`.
- */pathLine: String?) {
+ */pathLine: String?,
+ /**
+ * A working `cua` CLI already on this machine: `target`, else the
+ * first in the usual install folders or on PATH (a Finder-launched
+ * app's PATH lacks `~/.local/bin`, so the folders are searched too).
+ */found: String?) {
self.source = source
self.target = target
self.binDir = binDir
@@ -7185,6 +7196,7 @@ public struct AppCliInstallPlan: Equatable, Hashable {
self.onPath = onPath
self.pathProfile = pathProfile
self.pathLine = pathLine
+ self.found = found
}
@@ -7214,7 +7226,8 @@ public struct FfiConverterTypeAppCliInstallPlan: FfiConverterRustBuffer {
shadowedBy: FfiConverterOptionString.read(from: &buf),
onPath: FfiConverterBool.read(from: &buf),
pathProfile: FfiConverterOptionString.read(from: &buf),
- pathLine: FfiConverterOptionString.read(from: &buf)
+ pathLine: FfiConverterOptionString.read(from: &buf),
+ found: FfiConverterOptionString.read(from: &buf)
)
}
@@ -7231,6 +7244,7 @@ public struct FfiConverterTypeAppCliInstallPlan: FfiConverterRustBuffer {
FfiConverterBool.write(value.onPath, into: &buf)
FfiConverterOptionString.write(value.pathProfile, into: &buf)
FfiConverterOptionString.write(value.pathLine, into: &buf)
+ FfiConverterOptionString.write(value.found, into: &buf)
}
}
@@ -22368,6 +22382,11 @@ public struct AppOnboardingState: Equatable, Hashable {
* Welcome shows again (Back).
*/
public var runCounted: Bool
+ /**
+ * A page opened from Done's to-do list: leaving it (Continue, Skip or
+ * Back) comes back to Done.
+ */
+ public var revisit: Bool
// Default memberwise initializers are never public by default, so we
// declare one manually.
@@ -22455,7 +22474,11 @@ public struct AppOnboardingState: Equatable, Hashable {
* when Welcome showed on a machine whose usage notice was already
* shown, else when Welcome was left. Once per run, however often
* Welcome shows again (Back).
- */runCounted: Bool) {
+ */runCounted: Bool,
+ /**
+ * A page opened from Done's to-do list: leaving it (Continue, Skip or
+ * Back) comes back to Done.
+ */revisit: Bool) {
self.step = step
self.cliTarget = cliTarget
self.cliPlan = cliPlan
@@ -22481,6 +22504,7 @@ public struct AppOnboardingState: Equatable, Hashable {
self.telemetry = telemetry
self.experiments = experiments
self.runCounted = runCounted
+ self.revisit = revisit
}
@@ -22523,7 +22547,8 @@ public struct FfiConverterTypeAppOnboardingState: FfiConverterRustBuffer {
launchAtLogin: FfiConverterBool.read(from: &buf),
telemetry: FfiConverterOptionTypeAppTelemetryInput.read(from: &buf),
experiments: FfiConverterTypeAppExperiments.read(from: &buf),
- runCounted: FfiConverterBool.read(from: &buf)
+ runCounted: FfiConverterBool.read(from: &buf),
+ revisit: FfiConverterBool.read(from: &buf)
)
}
@@ -22553,6 +22578,7 @@ public struct FfiConverterTypeAppOnboardingState: FfiConverterRustBuffer {
FfiConverterOptionTypeAppTelemetryInput.write(value.telemetry, into: &buf)
FfiConverterTypeAppExperiments.write(value.experiments, into: &buf)
FfiConverterBool.write(value.runCounted, into: &buf)
+ FfiConverterBool.write(value.revisit, into: &buf)
}
}
@@ -22572,6 +22598,112 @@ public func FfiConverterTypeAppOnboardingState_lower(_ value: AppOnboardingState
}
+public struct AppOnboardingTodo: Equatable, Hashable {
+ /**
+ * Which.
+ */
+ public var id: AppOnboardingTodoId
+ /**
+ * "Cua CLI".
+ */
+ public var title: String
+ /**
+ * One plain line under it.
+ */
+ public var note: String
+ /**
+ * Set up.
+ */
+ public var done: Bool
+ /**
+ * Nice to have: "You're all set" does not wait for it.
+ */
+ public var optional: Bool
+ /**
+ * The fix's button ("Install the Cua CLI"), while not done.
+ */
+ public var action: String?
+
+ // Default memberwise initializers are never public by default, so we
+ // declare one manually.
+ public init(
+ /**
+ * Which.
+ */id: AppOnboardingTodoId,
+ /**
+ * "Cua CLI".
+ */title: String,
+ /**
+ * One plain line under it.
+ */note: String,
+ /**
+ * Set up.
+ */done: Bool,
+ /**
+ * Nice to have: "You're all set" does not wait for it.
+ */optional: Bool,
+ /**
+ * The fix's button ("Install the Cua CLI"), while not done.
+ */action: String?) {
+ self.id = id
+ self.title = title
+ self.note = note
+ self.done = done
+ self.optional = optional
+ self.action = action
+ }
+
+
+
+
+}
+
+#if compiler(>=6)
+extension AppOnboardingTodo: Sendable {}
+#endif
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public struct FfiConverterTypeAppOnboardingTodo: FfiConverterRustBuffer {
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AppOnboardingTodo {
+ return
+ try AppOnboardingTodo(
+ id: FfiConverterTypeAppOnboardingTodoId.read(from: &buf),
+ title: FfiConverterString.read(from: &buf),
+ note: FfiConverterString.read(from: &buf),
+ done: FfiConverterBool.read(from: &buf),
+ optional: FfiConverterBool.read(from: &buf),
+ action: FfiConverterOptionString.read(from: &buf)
+ )
+ }
+
+ public static func write(_ value: AppOnboardingTodo, into buf: inout [UInt8]) {
+ FfiConverterTypeAppOnboardingTodoId.write(value.id, into: &buf)
+ FfiConverterString.write(value.title, into: &buf)
+ FfiConverterString.write(value.note, into: &buf)
+ FfiConverterBool.write(value.done, into: &buf)
+ FfiConverterBool.write(value.optional, into: &buf)
+ FfiConverterOptionString.write(value.action, into: &buf)
+ }
+}
+
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeAppOnboardingTodo_lift(_ buf: RustBuffer) throws -> AppOnboardingTodo {
+ return try FfiConverterTypeAppOnboardingTodo.lift(buf)
+}
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeAppOnboardingTodo_lower(_ value: AppOnboardingTodo) -> RustBuffer {
+ return FfiConverterTypeAppOnboardingTodo.lower(value)
+}
+
+
public struct AppOnboardingView: Equatable, Hashable {
/**
* Page.
@@ -22655,6 +22787,12 @@ public struct AppOnboardingView: Equatable, Hashable {
* Done's "Launch at login" checkbox.
*/
public var launchAtLogin: AppOnboardingCheckbox?
+ /**
+ * Done's to-do list: the Cua CLI, the account, an AI agent and Cua
+ * Volume, each set up or with its fix. The title says "Almost done"
+ * until every one that is not optional is.
+ */
+ public var todos: [AppOnboardingTodo]
// Default memberwise initializers are never public by default, so we
// declare one manually.
@@ -22721,7 +22859,12 @@ public struct AppOnboardingView: Equatable, Hashable {
*/drive: AppDriveCard?,
/**
* Done's "Launch at login" checkbox.
- */launchAtLogin: AppOnboardingCheckbox?) {
+ */launchAtLogin: AppOnboardingCheckbox?,
+ /**
+ * Done's to-do list: the Cua CLI, the account, an AI agent and Cua
+ * Volume, each set up or with its fix. The title says "Almost done"
+ * until every one that is not optional is.
+ */todos: [AppOnboardingTodo]) {
self.step = step
self.dots = dots
self.title = title
@@ -22741,6 +22884,7 @@ public struct AppOnboardingView: Equatable, Hashable {
self.usage = usage
self.drive = drive
self.launchAtLogin = launchAtLogin
+ self.todos = todos
}
@@ -22777,7 +22921,8 @@ public struct FfiConverterTypeAppOnboardingView: FfiConverterRustBuffer {
noticeLinkUrl: FfiConverterOptionString.read(from: &buf),
usage: FfiConverterOptionTypeAppUsageToggle.read(from: &buf),
drive: FfiConverterOptionTypeAppDriveCard.read(from: &buf),
- launchAtLogin: FfiConverterOptionTypeAppOnboardingCheckbox.read(from: &buf)
+ launchAtLogin: FfiConverterOptionTypeAppOnboardingCheckbox.read(from: &buf),
+ todos: FfiConverterSequenceTypeAppOnboardingTodo.read(from: &buf)
)
}
@@ -22801,6 +22946,7 @@ public struct FfiConverterTypeAppOnboardingView: FfiConverterRustBuffer {
FfiConverterOptionTypeAppUsageToggle.write(value.usage, into: &buf)
FfiConverterOptionTypeAppDriveCard.write(value.drive, into: &buf)
FfiConverterOptionTypeAppOnboardingCheckbox.write(value.launchAtLogin, into: &buf)
+ FfiConverterSequenceTypeAppOnboardingTodo.write(value.todos, into: &buf)
}
}
@@ -48902,6 +49048,25 @@ public enum AppOnboardingAction: Equatable, Hashable {
* The switches.
*/experiments: AppExperiments
)
+ /**
+ * A to-do on Done was clicked: its page opens, and leaving it comes
+ * back to Done. Cua Volume needs its experiment on first (the shell
+ * turns it on and sends `experiments-loaded`).
+ */
+ case todoChosen(
+ /**
+ * Which.
+ */id: AppOnboardingTodoId
+ )
+ /**
+ * The coding agents that already use cua (set up earlier, from the
+ * CLI or Settings), as the shell read them. Any page.
+ */
+ case agentsDetected(
+ /**
+ * Their names.
+ */configured: [String]
+ )
@@ -48995,6 +49160,12 @@ public struct FfiConverterTypeAppOnboardingAction: FfiConverterRustBuffer {
case 26: return .experimentsLoaded(experiments: try FfiConverterTypeAppExperiments.read(from: &buf)
)
+ case 27: return .todoChosen(id: try FfiConverterTypeAppOnboardingTodoId.read(from: &buf)
+ )
+
+ case 28: return .agentsDetected(configured: try FfiConverterSequenceString.read(from: &buf)
+ )
+
default: throw UniffiInternalError.unexpectedEnumCase
}
}
@@ -49128,6 +49299,16 @@ public struct FfiConverterTypeAppOnboardingAction: FfiConverterRustBuffer {
writeInt(&buf, Int32(26))
FfiConverterTypeAppExperiments.write(experiments, into: &buf)
+
+ case let .todoChosen(id):
+ writeInt(&buf, Int32(27))
+ FfiConverterTypeAppOnboardingTodoId.write(id, into: &buf)
+
+
+ case let .agentsDetected(configured):
+ writeInt(&buf, Int32(28))
+ FfiConverterSequenceString.write(configured, into: &buf)
+
}
}
}
@@ -49356,6 +49537,99 @@ public func FfiConverterTypeAppOnboardingStep_lower(_ value: AppOnboardingStep)
}
+// Note that we don't yet support `indirect` for enums.
+// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
+
+public enum AppOnboardingTodoId: Equatable, Hashable {
+
+ /**
+ * The Cua CLI.
+ */
+ case cli
+ /**
+ * The Cua account.
+ */
+ case signin
+ /**
+ * A coding agent that uses cua.
+ */
+ case agents
+ /**
+ * Cua Volume (optional).
+ */
+ case volume
+
+
+
+
+
+}
+
+#if compiler(>=6)
+extension AppOnboardingTodoId: Sendable {}
+#endif
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public struct FfiConverterTypeAppOnboardingTodoId: FfiConverterRustBuffer {
+ typealias SwiftType = AppOnboardingTodoId
+
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AppOnboardingTodoId {
+ let variant: Int32 = try readInt(&buf)
+ switch variant {
+
+ case 1: return .cli
+
+ case 2: return .signin
+
+ case 3: return .agents
+
+ case 4: return .volume
+
+ default: throw UniffiInternalError.unexpectedEnumCase
+ }
+ }
+
+ public static func write(_ value: AppOnboardingTodoId, into buf: inout [UInt8]) {
+ switch value {
+
+
+ case .cli:
+ writeInt(&buf, Int32(1))
+
+
+ case .signin:
+ writeInt(&buf, Int32(2))
+
+
+ case .agents:
+ writeInt(&buf, Int32(3))
+
+
+ case .volume:
+ writeInt(&buf, Int32(4))
+
+ }
+ }
+}
+
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeAppOnboardingTodoId_lift(_ buf: RustBuffer) throws -> AppOnboardingTodoId {
+ return try FfiConverterTypeAppOnboardingTodoId.lift(buf)
+}
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeAppOnboardingTodoId_lower(_ value: AppOnboardingTodoId) -> RustBuffer {
+ return FfiConverterTypeAppOnboardingTodoId.lower(value)
+}
+
+
// Note that we don't yet support `indirect` for enums.
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
@@ -62199,6 +62473,31 @@ fileprivate struct FfiConverterSequenceTypeAppNotificationInput: FfiConverterRus
}
}
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+fileprivate struct FfiConverterSequenceTypeAppOnboardingTodo: FfiConverterRustBuffer {
+ typealias SwiftType = [AppOnboardingTodo]
+
+ public static func write(_ value: [AppOnboardingTodo], into buf: inout [UInt8]) {
+ let len = Int32(value.count)
+ writeInt(&buf, len)
+ for item in value {
+ FfiConverterTypeAppOnboardingTodo.write(item, into: &buf)
+ }
+ }
+
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [AppOnboardingTodo] {
+ let len: Int32 = try readInt(&buf)
+ var seq = [AppOnboardingTodo]()
+ seq.reserveCapacity(Int(len))
+ for _ in 0 ..< len {
+ seq.append(try FfiConverterTypeAppOnboardingTodo.read(from: &buf))
+ }
+ return seq
+ }
+}
+
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
diff --git a/scripts/docs-generators/cua-sdk.ts b/scripts/docs-generators/cua-sdk.ts
index 10e48b6391..b7120e35e5 100644
--- a/scripts/docs-generators/cua-sdk.ts
+++ b/scripts/docs-generators/cua-sdk.ts
@@ -981,10 +981,19 @@ export const PAGES: PageSpec[] = [
{
slug: 'spaces/app-core/onboarding-settings',
title: 'Onboarding and settings',
- description: 'First-run onboarding, its card miniatures, the settings file and the hotkey label.',
- intro: '`app_onboarding_reduce` steps through first-run onboarding. `app_settings_load` and `app_settings_save` read and write the apps\' settings file.',
- items: ['app_format_hotkey', 'AppKeyCombo', 'AppSwitcherTheme', 'AppUsageToggle', 'AppModeChoice'],
- prefixes: ['AppOnboarding', 'app_onboarding_', 'AppSettings', 'app_settings_', 'AppPresentation', 'app_presentation_', 'AppMenuPreview', 'AppPreview', 'AppDriver', 'app_driver_'],
+ description: 'First-run onboarding, the settings file and the hotkey label.',
+ intro: '`app_onboarding_reduce` steps through first-run onboarding. `app_settings_load` and `app_settings_save` read and write the apps\' settings file. The animated miniatures on the onboarding cards are on [Onboarding previews](/cua-sdk/reference/spaces/app-core/onboarding-previews).',
+ items: ['app_format_hotkey', 'AppKeyCombo', 'AppSwitcherTheme', 'AppUsageToggle', 'AppModeChoice', 'AppPresentationCard'],
+ prefixes: ['AppOnboarding', 'app_onboarding_', 'AppSettings', 'app_settings_'],
+ spaces: true,
+ },
+ {
+ slug: 'spaces/app-core/onboarding-previews',
+ title: 'Onboarding previews',
+ description: 'The animated miniatures on the onboarding cards: the background computer-use card, the notch and the menu bar.',
+ intro: '`app_driver_preview` and `app_presentation_preview` return the miniatures of the AI agents and presentation cards; the `*_frame` functions give one frame of the loop and the `*_still` functions the frame shown with Reduce Motion. The onboarding flow itself is on [Onboarding and settings](/cua-sdk/reference/spaces/app-core/onboarding-settings).',
+ items: [],
+ prefixes: ['AppPresentation', 'app_presentation_', 'AppMenuPreview', 'AppPreview', 'AppDriver', 'app_driver_'],
spaces: true,
},
{