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(cua-spaces): typed resource values, the generated Space name, and picking saved passwords (#5205)

dduponta14eadd3b8a5
diff --git a/apps/cua-spaces-desktop/src/model/teleport.ts b/apps/cua-spaces-desktop/src/model/teleport.ts
index 6f08c602e6..e243fc12fd 100644
--- a/apps/cua-spaces-desktop/src/model/teleport.ts
+++ b/apps/cua-spaces-desktop/src/model/teleport.ts
@@ -135,6 +135,7 @@ export function teleportConsent(c: Record<string, unknown>): TeleportConsent {
exclude: strings(c.exclude) ?? [],
fromVault: strings(c.fromVault),
includePasswords: c.includePasswords === true,
+ passwordDomains: strings(c.passwordDomains),
};
}
diff --git a/apps/cua-spaces-desktop/src/native/generated/cua_spaces_ffi-ffi.ts b/apps/cua-spaces-desktop/src/native/generated/cua_spaces_ffi-ffi.ts
index 024a6821d1..c203192b34 100644
--- a/apps/cua-spaces-desktop/src/native/generated/cua_spaces_ffi-ffi.ts
+++ b/apps/cua-spaces-desktop/src/native/generated/cua_spaces_ffi-ffi.ts
@@ -1147,6 +1147,11 @@ const DEFINITIONS = {
ret: FfiType.RustBuffer,
hasRustCallStatus: true,
},
+ "uniffi_cua_spaces_ffi_fn_func_app_picker_event_from_json": {
+ args: [FfiType.RustBuffer],
+ ret: FfiType.RustBuffer,
+ hasRustCallStatus: true,
+ },
"uniffi_cua_spaces_ffi_fn_func_app_picker_grid_primary": {
args: [FfiType.RustBuffer, FfiType.RustBuffer, FfiType.RustBuffer],
ret: FfiType.RustBuffer,
@@ -2837,6 +2842,11 @@ const DEFINITIONS = {
ret: FfiType.UInt16,
hasRustCallStatus: false,
},
+ "uniffi_cua_spaces_ffi_checksum_func_app_picker_event_from_json": {
+ args: [],
+ ret: FfiType.UInt16,
+ hasRustCallStatus: false,
+ },
"uniffi_cua_spaces_ffi_checksum_func_app_picker_grid_primary": {
args: [],
ret: FfiType.UInt16,
@@ -4115,6 +4125,7 @@ interface NativeModuleInterface {
uniffi_cua_spaces_ffi_fn_func_app_picker_app_grid(state: Uint8Array, windows: Uint8Array, uniffi_out_err: UniffiRustCallStatus): Uint8Array;
uniffi_cua_spaces_ffi_fn_func_app_picker_can_plan(state: Uint8Array, uniffi_out_err: UniffiRustCallStatus): number;
uniffi_cua_spaces_ffi_fn_func_app_picker_consent(state: Uint8Array, uniffi_out_err: UniffiRustCallStatus): Uint8Array;
+ uniffi_cua_spaces_ffi_fn_func_app_picker_event_from_json(json: Uint8Array, uniffi_out_err: UniffiRustCallStatus): Uint8Array;
uniffi_cua_spaces_ffi_fn_func_app_picker_grid_primary(tab: Uint8Array, spaceName: Uint8Array, grid: Uint8Array, uniffi_out_err: UniffiRustCallStatus): Uint8Array;
uniffi_cua_spaces_ffi_fn_func_app_picker_grid_step(grid: Uint8Array, selected: Uint8Array, delta: number, uniffi_out_err: UniffiRustCallStatus): Uint8Array;
uniffi_cua_spaces_ffi_fn_func_app_picker_grid_tabs(spaceName: Uint8Array, uniffi_out_err: UniffiRustCallStatus): Uint8Array;
@@ -4453,6 +4464,7 @@ interface NativeModuleInterface {
uniffi_cua_spaces_ffi_checksum_func_app_picker_app_grid(): number;
uniffi_cua_spaces_ffi_checksum_func_app_picker_can_plan(): number;
uniffi_cua_spaces_ffi_checksum_func_app_picker_consent(): number;
+ uniffi_cua_spaces_ffi_checksum_func_app_picker_event_from_json(): number;
uniffi_cua_spaces_ffi_checksum_func_app_picker_grid_primary(): number;
uniffi_cua_spaces_ffi_checksum_func_app_picker_grid_step(): number;
uniffi_cua_spaces_ffi_checksum_func_app_picker_grid_tabs(): number;
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 678e507064..309e45ac9a 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
@@ -3172,6 +3172,27 @@ export function appPickerConsent(state: AppPickerState): AppTeleportConsent {
));
}
+/**
+ * A teleport picker event from JSON (fixtures, parity).
+ */
+export function appPickerEventFromJson(json: string): AppPickerEvent /*throws*/ {
+ return ((__rb: Uint8Array) => {
+ try {
+ return FfiConverterTypeAppPickerEvent.lift(__rb);
+ } finally {
+ nativeModule().rustbuffer_free(__rb);
+ }
+ })(uniffiCaller.rustCallWithError(
+ /*liftError:*/ FfiConverterTypeCuaError.lift.bind(FfiConverterTypeCuaError),
+ /*caller:*/ (callStatus) => {
+ return nativeModule().uniffi_cua_spaces_ffi_fn_func_app_picker_event_from_json(
+ FfiConverterString.lower(json, nativeModule().rustbuffer_alloc),
+ callStatus);
+ },
+ /*liftString:*/ FfiConverterString.lift.bind(FfiConverterString),
+ ));
+ }
+
/**
* The picker grid's primary button for a tab ("Continue", "Teleport to
* <Space>", "Stream to This Mac"), live with a choosable tile selected.
@@ -29988,6 +30009,62 @@ const FfiConverterTypeKvDomainCount = (() => {
return new FFIConverter();
})();
+export type AppVaultPassword = {
+ /**
+ * The item's id.
+ */
+ id: string,
+ /**
+ * Its site (`github.com`); empty when not known.
+ */
+ site: string,
+ /**
+ * Its username; empty when not known or hidden.
+ */
+ username: string
+}
+
+/**
+ * Generated factory for {@link AppVaultPassword} record objects.
+ */
+export const AppVaultPassword = (() => {
+ const defaults = () => ({
+ });
+ const create = (() => {
+ return uniffiCreateRecord<AppVaultPassword, ReturnType<typeof defaults>>(defaults);
+ })();
+ return Object.freeze({
+ create,
+ new: create,
+ defaults: () => Object.freeze(defaults()) as Partial<AppVaultPassword>,
+ });
+})();
+
+const FfiConverterTypeAppVaultPassword = (() => {
+ type TypeName = AppVaultPassword;
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
+ read(from: RustBuffer): TypeName {
+ return {
+ id: FfiConverterString.read(from),
+ site: FfiConverterString.read(from),
+ username: FfiConverterString.read(from)
+ };
+ }
+ write(value: TypeName, into: RustBuffer): void {
+ FfiConverterString.write(value.id, into);
+ FfiConverterString.write(value.site, into);
+ FfiConverterString.write(value.username, into);
+ }
+ allocationSize(value: TypeName): number {
+ return FfiConverterString.allocationSize(value.id) +
+ FfiConverterString.allocationSize(value.site) +
+ FfiConverterString.allocationSize(value.username);
+
+ }
+ };
+ return new FFIConverter();
+})();
+
export type AppVaultSource = {
/**
* The app has saved items that can be sent (passwords never are).
@@ -30008,7 +30085,20 @@ export type AppVaultSource = {
/**
* The app's saved passwords (ids), sent only when ticked.
*/
- passwordIds: Array<string>
+ passwordIds: Array<string>,
+ /**
+ * The same passwords with their site and username (never a value), for
+ * the review to list.
+ */
+ passwords: Array<AppVaultPassword>,
+ /**
+ * The Keyvault daemon enforces a choice of passwords by site
+ * (`password_domains` in its status). Without it the review offers
+ * the passwords as before (those of the chosen sites, or every saved
+ * one) and lists none to pick: it never shows a choice the daemon
+ * would not keep.
+ */
+ passwordPicks: boolean
}
/**
@@ -30036,7 +30126,9 @@ const FfiConverterTypeAppVaultSource = (() => {
items: FfiConverterUInt32.read(from),
saved: FfiConverterString.read(from),
selected: FfiConverterSequenceString.read(from),
- passwordIds: FfiConverterSequenceString.read(from)
+ passwordIds: FfiConverterSequenceString.read(from),
+ passwords: FfiConverterSequenceTypeAppVaultPassword.read(from),
+ passwordPicks: FfiConverterBool.read(from)
};
}
write(value: TypeName, into: RustBuffer): void {
@@ -30045,13 +30137,17 @@ const FfiConverterTypeAppVaultSource = (() => {
FfiConverterString.write(value.saved, into);
FfiConverterSequenceString.write(value.selected, into);
FfiConverterSequenceString.write(value.passwordIds, into);
+ FfiConverterSequenceTypeAppVaultPassword.write(value.passwords, into);
+ FfiConverterBool.write(value.passwordPicks, into);
}
allocationSize(value: TypeName): number {
return FfiConverterBool.allocationSize(value.available) +
FfiConverterUInt32.allocationSize(value.items) +
FfiConverterString.allocationSize(value.saved) +
FfiConverterSequenceString.allocationSize(value.selected) +
- FfiConverterSequenceString.allocationSize(value.passwordIds);
+ FfiConverterSequenceString.allocationSize(value.passwordIds) +
+ FfiConverterSequenceTypeAppVaultPassword.allocationSize(value.passwords) +
+ FfiConverterBool.allocationSize(value.passwordPicks);
}
};
@@ -30093,7 +30189,24 @@ export type AppReviewChoice = {
* The saved passwords are ticked to send (off unless the user ticks
* them; never remembered).
*/
- includePasswords: boolean
+ includePasswords: boolean,
+ /**
+ * The sites whose saved passwords to send (reading the app).
+ */
+ passwordDomains: Array<string>,
+ /**
+ * The saved passwords to send (ids, from the Keyvault).
+ */
+ passwordItems: Array<string>,
+ /**
+ * The passwords list's search text.
+ */
+ passwordQuery: string,
+ /**
+ * The password choice was made (the default is picked the first time
+ * the box is ticked).
+ */
+ passwordsPicked: boolean
}
/**
@@ -30124,7 +30237,11 @@ const FfiConverterTypeAppReviewChoice = (() => {
excluded: FfiConverterSequenceString.read(from),
vault: FfiConverterTypeAppVaultSource.read(from),
loaded: FfiConverterBool.read(from),
- includePasswords: FfiConverterBool.read(from)
+ includePasswords: FfiConverterBool.read(from),
+ passwordDomains: FfiConverterSequenceString.read(from),
+ passwordItems: FfiConverterSequenceString.read(from),
+ passwordQuery: FfiConverterString.read(from),
+ passwordsPicked: FfiConverterBool.read(from)
};
}
write(value: TypeName, into: RustBuffer): void {
@@ -30136,6 +30253,10 @@ const FfiConverterTypeAppReviewChoice = (() => {
FfiConverterTypeAppVaultSource.write(value.vault, into);
FfiConverterBool.write(value.loaded, into);
FfiConverterBool.write(value.includePasswords, into);
+ FfiConverterSequenceString.write(value.passwordDomains, into);
+ FfiConverterSequenceString.write(value.passwordItems, into);
+ FfiConverterString.write(value.passwordQuery, into);
+ FfiConverterBool.write(value.passwordsPicked, into);
}
allocationSize(value: TypeName): number {
return FfiConverterTypeAppSendSource.allocationSize(value.source) +
@@ -30145,7 +30266,11 @@ const FfiConverterTypeAppReviewChoice = (() => {
FfiConverterSequenceString.allocationSize(value.excluded) +
FfiConverterTypeAppVaultSource.allocationSize(value.vault) +
FfiConverterBool.allocationSize(value.loaded) +
- FfiConverterBool.allocationSize(value.includePasswords);
+ FfiConverterBool.allocationSize(value.includePasswords) +
+ FfiConverterSequenceString.allocationSize(value.passwordDomains) +
+ FfiConverterSequenceString.allocationSize(value.passwordItems) +
+ FfiConverterString.allocationSize(value.passwordQuery) +
+ FfiConverterBool.allocationSize(value.passwordsPicked);
}
};
@@ -31430,6 +31555,152 @@ const FfiConverterTypeAppRemoteWindowGroup = (() => {
return new FFIConverter();
})();
+export enum AppResourceField {
+ /**
+ * CPU cores.
+ */
+ Cpus = "cpus",
+ /**
+ * Memory, GB.
+ */
+ Memory = "memory",
+ /**
+ * Disk, GB.
+ */
+ Disk = "disk"
+}
+
+const FfiConverterTypeAppResourceField = (() => {
+ const ordinalConverter = FfiConverterInt32;
+ type TypeName = AppResourceField;
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
+ read(from: RustBuffer): TypeName {
+ switch (ordinalConverter.read(from)) {
+ case 1: return AppResourceField.Cpus;
+ case 2: return AppResourceField.Memory;
+ case 3: return AppResourceField.Disk;
+ default: throw new UniffiInternalError.UnexpectedEnumCase();
+ }
+ }
+ write(value: TypeName, into: RustBuffer): void {
+ switch (value) {
+ case AppResourceField.Cpus: return ordinalConverter.write(1, into);
+ case AppResourceField.Memory: return ordinalConverter.write(2, into);
+ case AppResourceField.Disk: return ordinalConverter.write(3, into);
+ }
+ }
+ allocationSize(value: TypeName): number {
+ return ordinalConverter.allocationSize(0);
+ }
+ }
+ return new FFIConverter();
+})();
+
+export type AppResourceEdit = {
+ /**
+ * Which slider.
+ */
+ field: AppResourceField,
+ /**
+ * The text as typed.
+ */
+ text: string
+}
+
+/**
+ * Generated factory for {@link AppResourceEdit} record objects.
+ */
+export const AppResourceEdit = (() => {
+ const defaults = () => ({
+ });
+ const create = (() => {
+ return uniffiCreateRecord<AppResourceEdit, ReturnType<typeof defaults>>(defaults);
+ })();
+ return Object.freeze({
+ create,
+ new: create,
+ defaults: () => Object.freeze(defaults()) as Partial<AppResourceEdit>,
+ });
+})();
+
+const FfiConverterTypeAppResourceEdit = (() => {
+ type TypeName = AppResourceEdit;
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
+ read(from: RustBuffer): TypeName {
+ return {
+ field: FfiConverterTypeAppResourceField.read(from),
+ text: FfiConverterString.read(from)
+ };
+ }
+ write(value: TypeName, into: RustBuffer): void {
+ FfiConverterTypeAppResourceField.write(value.field, into);
+ FfiConverterString.write(value.text, into);
+ }
+ allocationSize(value: TypeName): number {
+ return FfiConverterTypeAppResourceField.allocationSize(value.field) +
+ FfiConverterString.allocationSize(value.text);
+
+ }
+ };
+ return new FFIConverter();
+})();
+
+export type AppResourceEditView = {
+ /**
+ * Which slider.
+ */
+ field: AppResourceField,
+ /**
+ * The text as typed.
+ */
+ text: string,
+ /**
+ * Why it cannot be used, in one line (the slider's limits).
+ */
+ error?: string
+}
+
+/**
+ * Generated factory for {@link AppResourceEditView} record objects.
+ */
+export const AppResourceEditView = (() => {
+ const defaults = () => ({
+ });
+ const create = (() => {
+ return uniffiCreateRecord<AppResourceEditView, ReturnType<typeof defaults>>(defaults);
+ })();
+ return Object.freeze({
+ create,
+ new: create,
+ defaults: () => Object.freeze(defaults()) as Partial<AppResourceEditView>,
+ });
+})();
+
+const FfiConverterTypeAppResourceEditView = (() => {
+ type TypeName = AppResourceEditView;
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
+ read(from: RustBuffer): TypeName {
+ return {
+ field: FfiConverterTypeAppResourceField.read(from),
+ text: FfiConverterString.read(from),
+ error: FfiConverterOptionalString.read(from)
+ };
+ }
+ write(value: TypeName, into: RustBuffer): void {
+ FfiConverterTypeAppResourceField.write(value.field, into);
+ FfiConverterString.write(value.text, into);
+ FfiConverterOptionalString.write(value.error, into);
+ }
+ allocationSize(value: TypeName): number {
+ return FfiConverterTypeAppResourceField.allocationSize(value.field) +
+ FfiConverterString.allocationSize(value.text) +
+ FfiConverterOptionalString.allocationSize(value.error);
+
+ }
+ };
+ return new FFIConverter();
+})();
+
export type AppReviewDomain = {
/**
* The site (`github.com`).
@@ -31529,6 +31800,77 @@ const FfiConverterTypeAppReviewDomain = (() => {
return new FFIConverter();
})();
+export type AppReviewPassword = {
+ /**
+ * What picking it toggles: the site (reading the app) or the item id
+ * (from the Keyvault).
+ */
+ key: string,
+ /**
+ * The site (`github.com`), or "Saved password" when not known.
+ */
+ site: string,
+ /**
+ * The username, when known (a saved item).
+ */
+ username: string,
+ /**
+ * "2 passwords" (a site of the browser); empty for one saved item.
+ */
+ counts: string,
+ /**
+ * Chosen to send.
+ */
+ selected: boolean
+}
+
+/**
+ * Generated factory for {@link AppReviewPassword} record objects.
+ */
+export const AppReviewPassword = (() => {
+ const defaults = () => ({
+ });
+ const create = (() => {
+ return uniffiCreateRecord<AppReviewPassword, ReturnType<typeof defaults>>(defaults);
+ })();
+ return Object.freeze({
+ create,
+ new: create,
+ defaults: () => Object.freeze(defaults()) as Partial<AppReviewPassword>,
+ });
+})();
+
+const FfiConverterTypeAppReviewPassword = (() => {
+ type TypeName = AppReviewPassword;
+ class FFIConverter extends AbstractFfiConverterByteArray<TypeName> {
+ read(from: RustBuffer): TypeName {
+ return {
+ key: FfiConverterString.read(from),
+ site: FfiConverterString.read(from),
+ username: FfiConverterString.read(from),
+ counts: FfiConverterString.read(from),
+ selected: FfiConverterBool.read(from)
+ };
+ }
+ write(value: TypeName, into: RustBuffer): void {
+ FfiConverterString.write(value.key, into);
+ FfiConverterString.write(value.site, into);
+ FfiConverterString.write(value.username, into);
+ FfiConverterString.write(value.counts, into);
+ FfiConverterBool.write(value.selected, into);
+ }
+ allocationSize(value: TypeName): number {
+ return FfiConverterString.allocationSize(value.key) +
+ FfiConverterString.allocationSize(value.site) +
+ FfiConverterString.allocationSize(value.username) +
+ FfiConverterString.allocationSize(value.counts) +
+ FfiConverterBool.allocationSize(value.selected);
+
+ }
+ };
+ return new FFIConverter();
+})();
+
export type AppReviewToggle = {
/**
* The consent item's key.
@@ -31725,6 +32067,20 @@ export type AppReviewView = {
* "Also send 14 saved passwords".
*/
passwordsLabel: string,
+ /**
+ * Ticked: the saved passwords to pick from (sites with counts when
+ * reading the app, each saved password's site and username from the
+ * Keyvault; never a value), filtered by the search.
+ */
+ passwords: Array<AppReviewPassword>,
+ /**
+ * "2 of 5 sites", "2 of 5 passwords".
+ */
+ passwordSummary: string,
+ /**
+ * The passwords search text.
+ */
+ passwordQuery: string,
/**
* What the Keychain will do for this source, in a line.
*/
@@ -31779,6 +32135,9 @@ const FfiConverterTypeAppReviewView = (() => {
offersPasswords: FfiConverterBool.read(from),
includePasswords: FfiConverterBool.read(from),
passwordsLabel: FfiConverterString.read(from),
+ passwords: FfiConverterSequenceTypeAppReviewPassword.read(from),
+ passwordSummary: FfiConverterString.read(from),
+ passwordQuery: FfiConverterString.read(from),
sourceNote: FfiConverterString.read(from)
};
}
@@ -31810,6 +32169,9 @@ const FfiConverterTypeAppReviewView = (() => {
FfiConverterBool.write(value.offersPasswords, into);
FfiConverterBool.write(value.includePasswords, into);
FfiConverterString.write(value.passwordsLabel, into);
+ FfiConverterSequenceTypeAppReviewPassword.write(value.passwords, into);
+ FfiConverterString.write(value.passwordSummary, into);
+ FfiConverterString.write(value.passwordQuery, into);
FfiConverterString.write(value.sourceNote, into);
}
allocationSize(value: TypeName): number {
@@ -31840,6 +32202,9 @@ const FfiConverterTypeAppReviewView = (() => {
FfiConverterBool.allocationSize(value.offersPasswords) +
FfiConverterBool.allocationSize(value.includePasswords) +
FfiConverterString.allocationSize(value.passwordsLabel) +
+ FfiConverterSequenceTypeAppReviewPassword.allocationSize(value.passwords) +
+ FfiConverterString.allocationSize(value.passwordSummary) +
+ FfiConverterString.allocationSize(value.passwordQuery) +
FfiConverterString.allocationSize(value.sourceNote);
}
@@ -35638,7 +36003,12 @@ export type AppTeleportConsent = {
/**
* Also send the saved passwords (ticked in the review).
*/
- includePasswords: boolean
+ includePasswords: boolean,
+ /**
+ * Reading the app: the sites whose saved passwords to send (the
+ * review's per-site choice); `None` when no password is sent this way.
+ */
+ passwordDomains?: Array<string>
}
/**
@@ -35669,7 +36039,8 @@ const FfiConverterTypeAppTeleportConsent = (() => {
cookieDomains: FfiConverterOptionalSequenceString.read(from),
exclude: FfiConverterSequenceString.read(from),
fromVault: FfiConverterOptionalSequenceString.read(from),
- includePasswords: FfiConverterBool.read(from)
+ includePasswords: FfiConverterBool.read(from),
+ passwordDomains: FfiConverterOptionalSequenceString.read(from)
};
}
write(value: TypeName, into: RustBuffer): void {
@@ -35681,6 +36052,7 @@ const FfiConverterTypeAppTeleportConsent = (() => {
FfiConverterSequenceString.write(value.exclude, into);
FfiConverterOptionalSequenceString.write(value.fromVault, into);
FfiConverterBool.write(value.includePasswords, into);
+ FfiConverterOptionalSequenceString.write(value.passwordDomains, into);
}
allocationSize(value: TypeName): number {
return FfiConverterBool.allocationSize(value.approved) +
@@ -35690,7 +36062,8 @@ const FfiConverterTypeAppTeleportConsent = (() => {
FfiConverterOptionalSequenceString.allocationSize(value.cookieDomains) +
FfiConverterSequenceString.allocationSize(value.exclude) +
FfiConverterOptionalSequenceString.allocationSize(value.fromVault) +
- FfiConverterBool.allocationSize(value.includePasswords);
+ FfiConverterBool.allocationSize(value.includePasswords) +
+ FfiConverterOptionalSequenceString.allocationSize(value.passwordDomains);
}
};
@@ -36125,7 +36498,13 @@ export type AppWizardEnv = {
* `gpu_support`), when known. A runtime not listed has none: the
* Resources step shows no GPU row for it.
*/
- gpus?: Array<AppGpuChoice>
+ gpus?: Array<AppGpuChoice>,
+ /**
+ * Picks the name an unnamed Space gets ([`generated_space_name`]);
+ * `None`: this process's own randomness. A core without randomness
+ * (the wasm build) is given one; tests give a fixed one.
+ */
+ nameSeed?: bigint
}
/**
@@ -36164,7 +36543,8 @@ const FfiConverterTypeAppWizardEnv = (() => {
clouds: FfiConverterSequenceTypeAppConnectedCloud.read(from),
hosts: FfiConverterSequenceTypeAppSpaceHost.read(from),
experiments: FfiConverterTypeAppExperiments.read(from),
- gpus: FfiConverterOptionalSequenceTypeAppGpuChoice.read(from)
+ gpus: FfiConverterOptionalSequenceTypeAppGpuChoice.read(from),
+ nameSeed: FfiConverterOptionalUInt64.read(from)
};
}
write(value: TypeName, into: RustBuffer): void {
@@ -36184,6 +36564,7 @@ const FfiConverterTypeAppWizardEnv = (() => {
FfiConverterSequenceTypeAppSpaceHost.write(value.hosts, into);
FfiConverterTypeAppExperiments.write(value.experiments, into);
FfiConverterOptionalSequenceTypeAppGpuChoice.write(value.gpus, into);
+ FfiConverterOptionalUInt64.write(value.nameSeed, into);
}
allocationSize(value: TypeName): number {
return FfiConverterTypeAppLocation.allocationSize(value.defaultLocation) +
@@ -36201,7 +36582,8 @@ const FfiConverterTypeAppWizardEnv = (() => {
FfiConverterSequenceTypeAppConnectedCloud.allocationSize(value.clouds) +
FfiConverterSequenceTypeAppSpaceHost.allocationSize(value.hosts) +
FfiConverterTypeAppExperiments.allocationSize(value.experiments) +
- FfiConverterOptionalSequenceTypeAppGpuChoice.allocationSize(value.gpus);
+ FfiConverterOptionalSequenceTypeAppGpuChoice.allocationSize(value.gpus) +
+ FfiConverterOptionalUInt64.allocationSize(value.nameSeed);
}
};
@@ -36524,7 +36906,16 @@ export type AppWizardState = {
/**
* The address form.
*/
- address: AppAddressForm
+ address: AppAddressForm,
+ /**
+ * The name the Space gets when Name is left empty
+ * ([`generated_space_name`], chosen when the wizard opens).
+ */
+ generatedName: string,
+ /**
+ * A slider's value being typed (its number was clicked).
+ */
+ resourceEdit?: AppResourceEdit
}
/**
@@ -36567,7 +36958,9 @@ const FfiConverterTypeAppWizardState = (() => {
cloud: FfiConverterOptionalString.read(from),
host: FfiConverterOptionalString.read(from),
gpu: FfiConverterBool.read(from),
- address: FfiConverterTypeAppAddressForm.read(from)
+ address: FfiConverterTypeAppAddressForm.read(from),
+ generatedName: FfiConverterString.read(from),
+ resourceEdit: FfiConverterOptionalTypeAppResourceEdit.read(from)
};
}
write(value: TypeName, into: RustBuffer): void {
@@ -36591,6 +36984,8 @@ const FfiConverterTypeAppWizardState = (() => {
FfiConverterOptionalString.write(value.host, into);
FfiConverterBool.write(value.gpu, into);
FfiConverterTypeAppAddressForm.write(value.address, into);
+ FfiConverterString.write(value.generatedName, into);
+ FfiConverterOptionalTypeAppResourceEdit.write(value.resourceEdit, into);
}
allocationSize(value: TypeName): number {
return FfiConverterTypeAppWizardMode.allocationSize(value.mode) +
@@ -36612,7 +37007,9 @@ const FfiConverterTypeAppWizardState = (() => {
FfiConverterOptionalString.allocationSize(value.cloud) +
FfiConverterOptionalString.allocationSize(value.host) +
FfiConverterBool.allocationSize(value.gpu) +
- FfiConverterTypeAppAddressForm.allocationSize(value.address);
+ FfiConverterTypeAppAddressForm.allocationSize(value.address) +
+ FfiConverterString.allocationSize(value.generatedName) +
+ FfiConverterOptionalTypeAppResourceEdit.allocationSize(value.resourceEdit);
}
};
@@ -36785,10 +37182,20 @@ export type AppWizardView = {
* The GPU row (Resources), where the runtime offers a GPU.
*/
gpu?: AppGpuRow,
+ /**
+ * A slider's value being typed: the field shows instead of its number
+ * (its error is also the field's [`WizardField::error`]).
+ */
+ resourceEdit?: AppResourceEditView,
/**
* Name as typed.
*/
name: string,
+ /**
+ * The name the Space gets: the one typed, else the generated one
+ * (the Name field's placeholder).
+ */
+ spaceName: string,
/**
* The name breaks the DNS-label rule.
*/
@@ -36899,7 +37306,9 @@ const FfiConverterTypeAppWizardView = (() => {
resourceFacts: FfiConverterSequenceTypeAppWizardFact.read(from),
resourcesError: FfiConverterOptionalString.read(from),
gpu: FfiConverterOptionalTypeAppGpuRow.read(from),
+ resourceEdit: FfiConverterOptionalTypeAppResourceEditView.read(from),
name: FfiConverterString.read(from),
+ spaceName: FfiConverterString.read(from),
nameInvalid: FfiConverterBool.read(from),
nameError: FfiConverterOptionalString.read(from),
openWhenReady: FfiConverterBool.read(from),
@@ -36954,7 +37363,9 @@ const FfiConverterTypeAppWizardView = (() => {
FfiConverterSequenceTypeAppWizardFact.write(value.resourceFacts, into);
FfiConverterOptionalString.write(value.resourcesError, into);
FfiConverterOptionalTypeAppGpuRow.write(value.gpu, into);
+ FfiConverterOptionalTypeAppResourceEditView.write(value.resourceEdit, into);
FfiConverterString.write(value.name, into);
+ FfiConverterString.write(value.spaceName, into);
FfiConverterBool.write(value.nameInvalid, into);
FfiConverterOptionalString.write(value.nameError, into);
FfiConverterBool.write(value.openWhenReady, into);
@@ -37008,7 +37419,9 @@ const FfiConverterTypeAppWizardView = (() => {
FfiConverterSequenceTypeAppWizardFact.allocationSize(value.resourceFacts) +
FfiConverterOptionalString.allocationSize(value.resourcesError) +
FfiConverterOptionalTypeAppGpuRow.allocationSize(value.gpu) +
+ FfiConverterOptionalTypeAppResourceEditView.allocationSize(value.resourceEdit) +
FfiConverterString.allocationSize(value.name) +
+ FfiConverterString.allocationSize(value.spaceName) +
FfiConverterBool.allocationSize(value.nameInvalid) +
FfiConverterOptionalString.allocationSize(value.nameError) +
FfiConverterBool.allocationSize(value.openWhenReady) +
@@ -37221,6 +37634,12 @@ export type KvStatus = {
* "Never ask again" on the unlock prompt is on.
*/
skipUnlockPrompt?: boolean,
+ /**
+ * What the daemon supports beyond the original protocol
+ * (`password_domains`: it reads only the saved passwords of the sites
+ * picked for them); empty from a daemon that predates the list.
+ */
+ features: Array<string>,
/**
* An earlier preview's vault was found and set aside.
*/
@@ -37263,6 +37682,7 @@ const FfiConverterTypeKvStatus = (() => {
unlockProtectors: FfiConverterSequenceString.read(from),
browseUntilMs: FfiConverterOptionalUInt64.read(from),
skipUnlockPrompt: FfiConverterOptionalBoolean.read(from),
+ features: FfiConverterSequenceString.read(from),
resetNotice: FfiConverterOptionalString.read(from)
};
}
@@ -37282,6 +37702,7 @@ const FfiConverterTypeKvStatus = (() => {
FfiConverterSequenceString.write(value.unlockProtectors, into);
FfiConverterOptionalUInt64.write(value.browseUntilMs, into);
FfiConverterOptionalBoolean.write(value.skipUnlockPrompt, into);
+ FfiConverterSequenceString.write(value.features, into);
FfiConverterOptionalString.write(value.resetNotice, into);
}
allocationSize(value: TypeName): number {
@@ -37300,6 +37721,7 @@ const FfiConverterTypeKvStatus = (() => {
FfiConverterSequenceString.allocationSize(value.unlockProtectors) +
FfiConverterOptionalUInt64.allocationSize(value.browseUntilMs) +
FfiConverterOptionalBoolean.allocationSize(value.skipUnlockPrompt) +
+ FfiConverterSequenceString.allocationSize(value.features) +
FfiConverterOptionalString.allocationSize(value.resetNotice);
}
@@ -42148,7 +42570,17 @@ export type KvVaultSource = {
* The app's saved passwords (ids), never part of `ids`: they are sent
* only when ticked in the review.
*/
- passwordIds: Array<string>
+ passwordIds: Array<string>,
+ /**
+ * The same passwords with their site and username (never a value),
+ * for the review to list and pick from.
+ */
+ passwords: Array<AppVaultPassword>,
+ /**
+ * The daemon enforces a choice of passwords by site
+ * (`password_domains` in its status): the review may offer one.
+ */
+ passwordPicks: boolean
}
/**
@@ -42175,7 +42607,9 @@ const FfiConverterTypeKvVaultSource = (() => {
count: FfiConverterUInt32.read(from),
newestMs: FfiConverterInt64.read(from),
ids: FfiConverterSequenceString.read(from),
- passwordIds: FfiConverterSequenceString.read(from)
+ passwordIds: FfiConverterSequenceString.read(from),
+ passwords: FfiConverterSequenceTypeAppVaultPassword.read(from),
+ passwordPicks: FfiConverterBool.read(from)
};
}
write(value: TypeName, into: RustBuffer): void {
@@ -42183,12 +42617,16 @@ const FfiConverterTypeKvVaultSource = (() => {
FfiConverterInt64.write(value.newestMs, into);
FfiConverterSequenceString.write(value.ids, into);
FfiConverterSequenceString.write(value.passwordIds, into);
+ FfiConverterSequenceTypeAppVaultPassword.write(value.passwords, into);
+ FfiConverterBool.write(value.passwordPicks, into);
}
allocationSize(value: TypeName): number {
return FfiConverterUInt32.allocationSize(value.count) +
FfiConverterInt64.allocationSize(value.newestMs) +
FfiConverterSequenceString.allocationSize(value.ids) +
- FfiConverterSequenceString.allocationSize(value.passwordIds);
+ FfiConverterSequenceString.allocationSize(value.passwordIds) +
+ FfiConverterSequenceTypeAppVaultPassword.allocationSize(value.passwords) +
+ FfiConverterBool.allocationSize(value.passwordPicks);
}
};
@@ -42939,7 +43377,12 @@ export type TeleportConsent = {
/**
* Also send the saved passwords: only when ticked in the review.
*/
- includePasswords: boolean
+ includePasswords: boolean,
+ /**
+ * The sites whose saved passwords to send (the review's own
+ * choice; `None`: those of `cookie_domains`).
+ */
+ passwordDomains?: Array<string>
}
/**
@@ -42953,7 +43396,8 @@ export const TeleportConsent = (() => {
cookieDomains: undefined,
exclude: [],
fromVault: undefined,
- includePasswords: false
+ includePasswords: false,
+ passwordDomains: undefined
});
const create = (() => {
return uniffiCreateRecord<TeleportConsent, ReturnType<typeof defaults>>(defaults);
@@ -42977,7 +43421,8 @@ const FfiConverterTypeTeleportConsent = (() => {
cookieDomains: FfiConverterOptionalSequenceString.read(from),
exclude: FfiConverterSequenceString.read(from),
fromVault: FfiConverterOptionalSequenceString.read(from),
- includePasswords: FfiConverterBool.read(from)
+ includePasswords: FfiConverterBool.read(from),
+ passwordDomains: FfiConverterOptionalSequenceString.read(from)
};
}
write(value: TypeName, into: RustBuffer): void {
@@ -42989,6 +43434,7 @@ const FfiConverterTypeTeleportConsent = (() => {
FfiConverterSequenceString.write(value.exclude, into);
FfiConverterOptionalSequenceString.write(value.fromVault, into);
FfiConverterBool.write(value.includePasswords, into);
+ FfiConverterOptionalSequenceString.write(value.passwordDomains, into);
}
allocationSize(value: TypeName): number {
return FfiConverterBool.allocationSize(value.approved) +
@@ -42998,7 +43444,8 @@ const FfiConverterTypeTeleportConsent = (() => {
FfiConverterOptionalSequenceString.allocationSize(value.cookieDomains) +
FfiConverterSequenceString.allocationSize(value.exclude) +
FfiConverterOptionalSequenceString.allocationSize(value.fromVault) +
- FfiConverterBool.allocationSize(value.includePasswords);
+ FfiConverterBool.allocationSize(value.includePasswords) +
+ FfiConverterOptionalSequenceString.allocationSize(value.passwordDomains);
}
};
@@ -51095,6 +51542,9 @@ export enum AppPickerEvent_Tags {
SendFrom = "SendFrom",
VaultItems = "VaultItems",
TogglePasswords = "TogglePasswords",
+ TogglePassword = "TogglePassword",
+ SelectShownPasswords = "SelectShownPasswords",
+ PasswordQuery = "PasswordQuery",
VaultSelection = "VaultSelection",
Confirm = "Confirm",
Progress = "Progress",
@@ -51842,7 +52292,7 @@ inner: {source: AppSendSource }): SendFrom_ {
type VaultItems__interface = {
tag: AppPickerEvent_Tags.VaultItems;
inner:
-Readonly<{count: number; newestMs: bigint; nowMs: bigint; selected: Array<string>; passwordIds: Array<string>}>
+Readonly<{count: number; newestMs: bigint; nowMs: bigint; selected: Array<string>; passwordIds: Array<string>; passwords: Array<AppVaultPassword>; passwordPicks: boolean}>
};
/**
* The app's saved Keyvault items (what the Keyvault holds for it).
@@ -51855,15 +52305,15 @@ Readonly<{count: number; newestMs: bigint; nowMs: bigint; selected: Array<string
readonly [uniffiTypeNameSymbol] = "AppPickerEvent";
readonly tag = AppPickerEvent_Tags.VaultItems;
readonly inner:
-Readonly<{count: number; newestMs: bigint; nowMs: bigint; selected: Array<string>; passwordIds: Array<string>}>;
+Readonly<{count: number; newestMs: bigint; nowMs: bigint; selected: Array<string>; passwordIds: Array<string>; passwords: Array<AppVaultPassword>; passwordPicks: boolean}>;
constructor(
-inner: {count: number; newestMs: bigint; nowMs: bigint; selected: Array<string>; passwordIds: Array<string> }) {
+inner: {count: number; newestMs: bigint; nowMs: bigint; selected: Array<string>; passwordIds: Array<string>; passwords: Array<AppVaultPassword>; passwordPicks: boolean }) {
super("AppPickerEvent", "VaultItems");
this.inner = Object.freeze(inner);
}
static new(
-inner: {count: number; newestMs: bigint; nowMs: bigint; selected: Array<string>; passwordIds: Array<string> }): VaultItems_ {
+inner: {count: number; newestMs: bigint; nowMs: bigint; selected: Array<string>; passwordIds: Array<string>; passwords: Array<AppVaultPassword>; passwordPicks: boolean }): VaultItems_ {
return new VaultItems_(inner);
}
@@ -51907,6 +52357,109 @@ inner: {value: boolean }): TogglePasswords_ {
}
+ type TogglePassword__interface = {
+ tag: AppPickerEvent_Tags.TogglePassword;
+ inner:
+Readonly<{key: string}>
+ };
+ /**
+ * Pick or drop one saved password choice (a site, or a saved item's
+ * id: [`ReviewPassword::key`]).
+ */
+ class TogglePassword_ extends UniffiEnum implements TogglePassword__interface {
+ /**
+ * @private
+ * This field is private and should not be used, use `tag` instead.
+ */
+ readonly [uniffiTypeNameSymbol] = "AppPickerEvent";
+ readonly tag = AppPickerEvent_Tags.TogglePassword;
+ readonly inner:
+Readonly<{key: string}>;
+ constructor(
+inner: {key: string }) {
+ super("AppPickerEvent", "TogglePassword");
+
+ this.inner = Object.freeze(inner);
+ }
+ static new(
+inner: {key: string }): TogglePassword_ {
+ return new TogglePassword_(inner);
+ }
+
+ static instanceOf(obj: any): obj is TogglePassword_ {
+ return obj.tag === AppPickerEvent_Tags.TogglePassword;
+ }
+
+ }
+
+ type SelectShownPasswords__interface = {
+ tag: AppPickerEvent_Tags.SelectShownPasswords;
+ inner:
+Readonly<{value: boolean}>
+ };
+ /**
+ * Pick or drop every saved password choice the search shows.
+ */
+ class SelectShownPasswords_ extends UniffiEnum implements SelectShownPasswords__interface {
+ /**
+ * @private
+ * This field is private and should not be used, use `tag` instead.
+ */
+ readonly [uniffiTypeNameSymbol] = "AppPickerEvent";
+ readonly tag = AppPickerEvent_Tags.SelectShownPasswords;
+ readonly inner:
+Readonly<{value: boolean}>;
+ constructor(
+inner: {value: boolean }) {
+ super("AppPickerEvent", "SelectShownPasswords");
+
+ this.inner = Object.freeze(inner);
+ }
+ static new(
+inner: {value: boolean }): SelectShownPasswords_ {
+ return new SelectShownPasswords_(inner);
+ }
+
+ static instanceOf(obj: any): obj is SelectShownPasswords_ {
+ return obj.tag === AppPickerEvent_Tags.SelectShownPasswords;
+ }
+
+ }
+
+ type PasswordQuery__interface = {
+ tag: AppPickerEvent_Tags.PasswordQuery;
+ inner:
+Readonly<{text: string}>
+ };
+ /**
+ * The passwords list's search text.
+ */
+ class PasswordQuery_ extends UniffiEnum implements PasswordQuery__interface {
+ /**
+ * @private
+ * This field is private and should not be used, use `tag` instead.
+ */
+ readonly [uniffiTypeNameSymbol] = "AppPickerEvent";
+ readonly tag = AppPickerEvent_Tags.PasswordQuery;
+ readonly inner:
+Readonly<{text: string}>;
+ constructor(
+inner: {text: string }) {
+ super("AppPickerEvent", "PasswordQuery");
+
+ this.inner = Object.freeze(inner);
+ }
+ static new(
+inner: {text: string }): PasswordQuery_ {
+ return new PasswordQuery_(inner);
+ }
+
+ static instanceOf(obj: any): obj is PasswordQuery_ {
+ return obj.tag === AppPickerEvent_Tags.PasswordQuery;
+ }
+
+ }
+
type VaultSelection__interface = {
tag: AppPickerEvent_Tags.VaultSelection;
inner:
@@ -52093,6 +52646,9 @@ inner: {report: AppTeleportRunReport }): Finished_ {
SendFrom: SendFrom_,
VaultItems: VaultItems_,
TogglePasswords: TogglePasswords_,
+ TogglePassword: TogglePassword_,
+ SelectShownPasswords: SelectShownPasswords_,
+ PasswordQuery: PasswordQuery_,
VaultSelection: VaultSelection_,
Confirm: Confirm_,
Progress: Progress_,
@@ -52102,7 +52658,7 @@ inner: {report: AppTeleportRunReport }): Finished_ {
})();
export type AppPickerEvent = InstanceType<
- typeof AppPickerEvent['Loaded' | 'Failed' | 'Query' | 'Select' | 'Choose' | 'Preselect' | 'Move' | 'Files' | 'RemoveFile' | 'Sensitive' | 'Plan' | 'Planned' | 'Acknowledge' | 'SaveToKeyvault' | 'AcknowledgeRelayPlaintext' | 'DomainsLoaded' | 'DomainsFailed' | 'ToggleDomain' | 'SelectShownDomains' | 'DomainQuery' | 'ToggleItem' | 'SendFrom' | 'VaultItems' | 'TogglePasswords' | 'VaultSelection' | 'Confirm' | 'Progress' | 'Finished' | 'Back']
+ typeof AppPickerEvent['Loaded' | 'Failed' | 'Query' | 'Select' | 'Choose' | 'Preselect' | 'Move' | 'Files' | 'RemoveFile' | 'Sensitive' | 'Plan' | 'Planned' | 'Acknowledge' | 'SaveToKeyvault' | 'AcknowledgeRelayPlaintext' | 'DomainsLoaded' | 'DomainsFailed' | 'ToggleDomain' | 'SelectShownDomains' | 'DomainQuery' | 'ToggleItem' | 'SendFrom' | 'VaultItems' | 'TogglePasswords' | 'TogglePassword' | 'SelectShownPasswords' | 'PasswordQuery' | 'VaultSelection' | 'Confirm' | 'Progress' | 'Finished' | 'Back']
>;
// FfiConverter for enum AppPickerEvent
@@ -52134,13 +52690,16 @@ const FfiConverterTypeAppPickerEvent = (() => {
case 20: return new AppPickerEvent.DomainQuery({text: FfiConverterString.read(from) });
case 21: return new AppPickerEvent.ToggleItem({key: FfiConverterString.read(from) });
case 22: return new AppPickerEvent.SendFrom({source: FfiConverterTypeAppSendSource.read(from) });
- case 23: return new AppPickerEvent.VaultItems({count: FfiConverterUInt32.read(from), newestMs: FfiConverterInt64.read(from), nowMs: FfiConverterInt64.read(from), selected: FfiConverterSequenceString.read(from), passwordIds: FfiConverterSequenceString.read(from) });
+ case 23: return new AppPickerEvent.VaultItems({count: FfiConverterUInt32.read(from), newestMs: FfiConverterInt64.read(from), nowMs: FfiConverterInt64.read(from), selected: FfiConverterSequenceString.read(from), passwordIds: FfiConverterSequenceString.read(from), passwords: FfiConverterSequenceTypeAppVaultPassword.read(from), passwordPicks: FfiConverterBool.read(from) });
case 24: return new AppPickerEvent.TogglePasswords({value: FfiConverterBool.read(from) });
- case 25: return new AppPickerEvent.VaultSelection({selected: FfiConverterSequenceString.read(from) });
- case 26: return new AppPickerEvent.Confirm();
- case 27: return new AppPickerEvent.Progress({event: FfiConverterTypeAppTeleportRunEvent.read(from) });
- case 28: return new AppPickerEvent.Finished({report: FfiConverterTypeAppTeleportRunReport.read(from) });
- case 29: return new AppPickerEvent.Back();
+ case 25: return new AppPickerEvent.TogglePassword({key: FfiConverterString.read(from) });
+ case 26: return new AppPickerEvent.SelectShownPasswords({value: FfiConverterBool.read(from) });
+ case 27: return new AppPickerEvent.PasswordQuery({text: FfiConverterString.read(from) });
+ case 28: return new AppPickerEvent.VaultSelection({selected: FfiConverterSequenceString.read(from) });
+ case 29: return new AppPickerEvent.Confirm();
+ case 30: return new AppPickerEvent.Progress({event: FfiConverterTypeAppTeleportRunEvent.read(from) });
+ case 31: return new AppPickerEvent.Finished({report: FfiConverterTypeAppTeleportRunReport.read(from) });
+ case 32: return new AppPickerEvent.Back();
default: throw new UniffiInternalError.UnexpectedEnumCase();
}
}
@@ -52287,6 +52846,8 @@ const FfiConverterTypeAppPickerEvent = (() => {
FfiConverterInt64.write(inner.nowMs, into);
FfiConverterSequenceString.write(inner.selected, into);
FfiConverterSequenceString.write(inner.passwordIds, into);
+ FfiConverterSequenceTypeAppVaultPassword.write(inner.passwords, into);
+ FfiConverterBool.write(inner.passwordPicks, into);
return;
}
case AppPickerEvent_Tags.TogglePasswords: {
@@ -52295,30 +52856,48 @@ const FfiConverterTypeAppPickerEvent = (() => {
FfiConverterBool.write(inner.value, into);
return;
}
- case AppPickerEvent_Tags.VaultSelection: {
+ case AppPickerEvent_Tags.TogglePassword: {
ordinalConverter.write(25, into);
const inner = value.inner;
+ FfiConverterString.write(inner.key, into);
+ return;
+ }
+ case AppPickerEvent_Tags.SelectShownPasswords: {
+ ordinalConverter.write(26, into);
+ const inner = value.inner;
+ FfiConverterBool.write(inner.value, into);
+ return;
+ }
+ case AppPickerEvent_Tags.PasswordQuery: {
+ ordinalConverter.write(27, into);
+ const inner = value.inner;
+ FfiConverterString.write(inner.text, into);
+ return;
+ }
+ case AppPickerEvent_Tags.VaultSelection: {
+ ordinalConverter.write(28, into);
+ const inner = value.inner;
FfiConverterSequenceString.write(inner.selected, into);
return;
}
case AppPickerEvent_Tags.Confirm: {
- ordinalConverter.write(26, into);
+ ordinalConverter.write(29, into);
return;
}
case AppPickerEvent_Tags.Progress: {
- ordinalConverter.write(27, into);
+ ordinalConverter.write(30, into);
const inner = value.inner;
FfiConverterTypeAppTeleportRunEvent.write(inner.event, into);
return;
}
case AppPickerEvent_Tags.Finished: {
- ordinalConverter.write(28, into);
+ ordinalConverter.write(31, into);
const inner = value.inner;
FfiConverterTypeAppTeleportRunReport.write(inner.report, into);
return;
}
case AppPickerEvent_Tags.Back: {
- ordinalConverter.write(29, into);
+ ordinalConverter.write(32, into);
return;
}
default:
@@ -52467,6 +53046,8 @@ const FfiConverterTypeAppPickerEvent = (() => {
size += FfiConverterInt64.allocationSize(inner.nowMs);
size += FfiConverterSequenceString.allocationSize(inner.selected);
size += FfiConverterSequenceString.allocationSize(inner.passwordIds);
+ size += FfiConverterSequenceTypeAppVaultPassword.allocationSize(inner.passwords);
+ size += FfiConverterBool.allocationSize(inner.passwordPicks);
return size;
}
case AppPickerEvent_Tags.TogglePasswords: {
@@ -52475,29 +53056,47 @@ const FfiConverterTypeAppPickerEvent = (() => {
size += FfiConverterBool.allocationSize(inner.value);
return size;
}
- case AppPickerEvent_Tags.VaultSelection: {
+ case AppPickerEvent_Tags.TogglePassword: {
const inner = value.inner;
let size = ordinalConverter.allocationSize(25);
+ size += FfiConverterString.allocationSize(inner.key);
+ return size;
+ }
+ case AppPickerEvent_Tags.SelectShownPasswords: {
+ const inner = value.inner;
+ let size = ordinalConverter.allocationSize(26);
+ size += FfiConverterBool.allocationSize(inner.value);
+ return size;
+ }
+ case AppPickerEvent_Tags.PasswordQuery: {
+ const inner = value.inner;
+ let size = ordinalConverter.allocationSize(27);
+ size += FfiConverterString.allocationSize(inner.text);
+ return size;
+ }
+ case AppPickerEvent_Tags.VaultSelection: {
+ const inner = value.inner;
+ let size = ordinalConverter.allocationSize(28);
size += FfiConverterSequenceString.allocationSize(inner.selected);
return size;
}
case AppPickerEvent_Tags.Confirm: {
- return ordinalConverter.allocationSize(26);
+ return ordinalConverter.allocationSize(29);
}
case AppPickerEvent_Tags.Progress: {
const inner = value.inner;
- let size = ordinalConverter.allocationSize(27);
+ let size = ordinalConverter.allocationSize(30);
size += FfiConverterTypeAppTeleportRunEvent.allocationSize(inner.event);
return size;
}
case AppPickerEvent_Tags.Finished: {
const inner = value.inner;
- let size = ordinalConverter.allocationSize(28);
+ let size = ordinalConverter.allocationSize(31);
size += FfiConverterTypeAppTeleportRunReport.allocationSize(inner.report);
return size;
}
case AppPickerEvent_Tags.Back: {
- return ordinalConverter.allocationSize(29);
+ return ordinalConverter.allocationSize(32);
}
default: throw new UniffiInternalError.UnexpectedEnumCase();
}
@@ -53754,6 +54353,10 @@ export enum AppWizardAction_Tags {
SetMemory = "SetMemory",
SetDisk = "SetDisk",
ResetDisk = "ResetDisk",
+ EditResource = "EditResource",
+ SetResourceText = "SetResourceText",
+ CommitResource = "CommitResource",
+ CancelResource = "CancelResource",
SetGpu = "SetGpu",
SetName = "SetName",
SetOpenWhenReady = "SetOpenWhenReady",
@@ -54349,6 +54952,129 @@ inner: {diskGb: number }): SetDisk_ {
}
+ type EditResource__interface = {
+ tag: AppWizardAction_Tags.EditResource;
+ inner:
+Readonly<{field: AppResourceField}>
+ };
+ /**
+ * A slider's number clicked: its value can be typed.
+ */
+ class EditResource_ extends UniffiEnum implements EditResource__interface {
+ /**
+ * @private
+ * This field is private and should not be used, use `tag` instead.
+ */
+ readonly [uniffiTypeNameSymbol] = "AppWizardAction";
+ readonly tag = AppWizardAction_Tags.EditResource;
+ readonly inner:
+Readonly<{field: AppResourceField}>;
+ constructor(
+inner: {field: AppResourceField }) {
+ super("AppWizardAction", "EditResource");
+
+ this.inner = Object.freeze(inner);
+ }
+ static new(
+inner: {field: AppResourceField }): EditResource_ {
+ return new EditResource_(inner);
+ }
+
+ static instanceOf(obj: any): obj is EditResource_ {
+ return obj.tag === AppWizardAction_Tags.EditResource;
+ }
+
+ }
+
+ type SetResourceText__interface = {
+ tag: AppWizardAction_Tags.SetResourceText;
+ inner:
+Readonly<{text: string}>
+ };
+ /**
+ * The typed value's text.
+ */
+ class SetResourceText_ extends UniffiEnum implements SetResourceText__interface {
+ /**
+ * @private
+ * This field is private and should not be used, use `tag` instead.
+ */
+ readonly [uniffiTypeNameSymbol] = "AppWizardAction";
+ readonly tag = AppWizardAction_Tags.SetResourceText;
+ readonly inner:
+Readonly<{text: string}>;
+ constructor(
+inner: {text: string }) {
+ super("AppWizardAction", "SetResourceText");
+
+ this.inner = Object.freeze(inner);
+ }
+ static new(
+inner: {text: string }): SetResourceText_ {
+ return new SetResourceText_(inner);
+ }
+
+ static instanceOf(obj: any): obj is SetResourceText_ {
+ return obj.tag === AppWizardAction_Tags.SetResourceText;
+ }
+
+ }
+
+ type CommitResource__interface = {
+ tag: AppWizardAction_Tags.CommitResource
+ };
+ /**
+ * Return (or leaving the field): the typed value is used when it is
+ * within the slider's limits; otherwise the field stays with why.
+ */
+ class CommitResource_ extends UniffiEnum implements CommitResource__interface {
+ /**
+ * @private
+ * This field is private and should not be used, use `tag` instead.
+ */
+ readonly [uniffiTypeNameSymbol] = "AppWizardAction";
+ readonly tag = AppWizardAction_Tags.CommitResource;
+ constructor() {
+ super("AppWizardAction", "CommitResource");
+ }
+
+ static new(): CommitResource_ {
+ return new CommitResource_();
+ }
+
+ static instanceOf(obj: any): obj is CommitResource_ {
+ return obj.tag === AppWizardAction_Tags.CommitResource;
+ }
+
+ }
+
+ type CancelResource__interface = {
+ tag: AppWizardAction_Tags.CancelResource
+ };
+ /**
+ * Escape: the slider's value stays.
+ */
+ class CancelResource_ extends UniffiEnum implements CancelResource__interface {
+ /**
+ * @private
+ * This field is private and should not be used, use `tag` instead.
+ */
+ readonly [uniffiTypeNameSymbol] = "AppWizardAction";
+ readonly tag = AppWizardAction_Tags.CancelResource;
+ constructor() {
+ super("AppWizardAction", "CancelResource");
+ }
+
+ static new(): CancelResource_ {
+ return new CancelResource_();
+ }
+
+ static instanceOf(obj: any): obj is CancelResource_ {
+ return obj.tag === AppWizardAction_Tags.CancelResource;
+ }
+
+ }
+
type SetGpu__interface = {
tag: AppWizardAction_Tags.SetGpu;
inner:
@@ -54747,6 +55473,10 @@ inner: {error: string }): AddressFailed_ {
SetMemory: SetMemory_,
SetDisk: SetDisk_,
ResetDisk: ResetDisk_,
+ EditResource: EditResource_,
+ SetResourceText: SetResourceText_,
+ CommitResource: CommitResource_,
+ CancelResource: CancelResource_,
SetGpu: SetGpu_,
SetName: SetName_,
SetOpenWhenReady: SetOpenWhenReady_,
@@ -54763,7 +55493,7 @@ inner: {error: string }): AddressFailed_ {
})();
export type AppWizardAction = InstanceType<
- typeof AppWizardAction['SyncDefault' | 'ChooseOs' | 'ChooseImage' | 'SetImageText' | 'OpenImageSuggestions' | 'MoveImageSuggestion' | 'PickImageSuggestion' | 'DismissImageSuggestions' | 'SetPlacement' | 'ChooseCloud' | 'ChoosePlacement' | 'ToggleAdvanced' | 'ChooseKind' | 'SetRuntime' | 'SetCpus' | 'SetMemory' | 'SetDisk' | 'ResetDisk' | 'SetGpu' | 'SetName' | 'SetOpenWhenReady' | 'Next' | 'Back' | 'ShowAddress' | 'HideAddress' | 'SetAddress' | 'SetToken' | 'SetAddressName' | 'SubmitAddress' | 'AddressFailed']
+ typeof AppWizardAction['SyncDefault' | 'ChooseOs' | 'ChooseImage' | 'SetImageText' | 'OpenImageSuggestions' | 'MoveImageSuggestion' | 'PickImageSuggestion' | 'DismissImageSuggestions' | 'SetPlacement' | 'ChooseCloud' | 'ChoosePlacement' | 'ToggleAdvanced' | 'ChooseKind' | 'SetRuntime' | 'SetCpus' | 'SetMemory' | 'SetDisk' | 'ResetDisk' | 'EditResource' | 'SetResourceText' | 'CommitResource' | 'CancelResource' | 'SetGpu' | 'SetName' | 'SetOpenWhenReady' | 'Next' | 'Back' | 'ShowAddress' | 'HideAddress' | 'SetAddress' | 'SetToken' | 'SetAddressName' | 'SubmitAddress' | 'AddressFailed']
>;
// FfiConverter for enum AppWizardAction
@@ -54791,18 +55521,22 @@ const FfiConverterTypeAppWizardAction = (() => {
case 16: return new AppWizardAction.SetMemory({memoryGb: FfiConverterUInt32.read(from) });
case 17: return new AppWizardAction.SetDisk({diskGb: FfiConverterUInt32.read(from) });
case 18: return new AppWizardAction.ResetDisk();
- case 19: return new AppWizardAction.SetGpu({on: FfiConverterBool.read(from) });
- case 20: return new AppWizardAction.SetName({name: FfiConverterString.read(from) });
- case 21: return new AppWizardAction.SetOpenWhenReady({on: FfiConverterBool.read(from) });
- case 22: return new AppWizardAction.Next();
- case 23: return new AppWizardAction.Back();
- case 24: return new AppWizardAction.ShowAddress();
- case 25: return new AppWizardAction.HideAddress();
- case 26: return new AppWizardAction.SetAddress({url: FfiConverterString.read(from) });
- case 27: return new AppWizardAction.SetToken({token: FfiConverterString.read(from) });
- case 28: return new AppWizardAction.SetAddressName({name: FfiConverterString.read(from) });
- case 29: return new AppWizardAction.SubmitAddress();
- case 30: return new AppWizardAction.AddressFailed({error: FfiConverterString.read(from) });
+ case 19: return new AppWizardAction.EditResource({field: FfiConverterTypeAppResourceField.read(from) });
+ case 20: return new AppWizardAction.SetResourceText({text: FfiConverterString.read(from) });
+ case 21: return new AppWizardAction.CommitResource();
+ case 22: return new AppWizardAction.CancelResource();
+ case 23: return new AppWizardAction.SetGpu({on: FfiConverterBool.read(from) });
+ case 24: return new AppWizardAction.SetName({name: FfiConverterString.read(from) });
+ case 25: return new AppWizardAction.SetOpenWhenReady({on: FfiConverterBool.read(from) });
+ case 26: return new AppWizardAction.Next();
+ case 27: return new AppWizardAction.Back();
+ case 28: return new AppWizardAction.ShowAddress();
+ case 29: return new AppWizardAction.HideAddress();
+ case 30: return new AppWizardAction.SetAddress({url: FfiConverterString.read(from) });
+ case 31: return new AppWizardAction.SetToken({token: FfiConverterString.read(from) });
+ case 32: return new AppWizardAction.SetAddressName({name: FfiConverterString.read(from) });
+ case 33: return new AppWizardAction.SubmitAddress();
+ case 34: return new AppWizardAction.AddressFailed({error: FfiConverterString.read(from) });
default: throw new UniffiInternalError.UnexpectedEnumCase();
}
}
@@ -54906,64 +55640,84 @@ const FfiConverterTypeAppWizardAction = (() => {
ordinalConverter.write(18, into);
return;
}
- case AppWizardAction_Tags.SetGpu: {
+ case AppWizardAction_Tags.EditResource: {
ordinalConverter.write(19, into);
const inner = value.inner;
+ FfiConverterTypeAppResourceField.write(inner.field, into);
+ return;
+ }
+ case AppWizardAction_Tags.SetResourceText: {
+ ordinalConverter.write(20, into);
+ const inner = value.inner;
+ FfiConverterString.write(inner.text, into);
+ return;
+ }
+ case AppWizardAction_Tags.CommitResource: {
+ ordinalConverter.write(21, into);
+ return;
+ }
+ case AppWizardAction_Tags.CancelResource: {
+ ordinalConverter.write(22, into);
+ return;
+ }
+ case AppWizardAction_Tags.SetGpu: {
+ ordinalConverter.write(23, into);
+ const inner = value.inner;
FfiConverterBool.write(inner.on, into);
return;
}
case AppWizardAction_Tags.SetName: {
- ordinalConverter.write(20, into);
+ ordinalConverter.write(24, into);
const inner = value.inner;
FfiConverterString.write(inner.name, into);
return;
}
case AppWizardAction_Tags.SetOpenWhenReady: {
- ordinalConverter.write(21, into);
+ ordinalConverter.write(25, into);
const inner = value.inner;
FfiConverterBool.write(inner.on, into);
return;
}
case AppWizardAction_Tags.Next: {
- ordinalConverter.write(22, into);
+ ordinalConverter.write(26, into);
return;
}
case AppWizardAction_Tags.Back: {
- ordinalConverter.write(23, into);
+ ordinalConverter.write(27, into);
return;
}
case AppWizardAction_Tags.ShowAddress: {
- ordinalConverter.write(24, into);
+ ordinalConverter.write(28, into);
return;
}
case AppWizardAction_Tags.HideAddress: {
- ordinalConverter.write(25, into);
+ ordinalConverter.write(29, into);
return;
}
case AppWizardAction_Tags.SetAddress: {
- ordinalConverter.write(26, into);
+ ordinalConverter.write(30, into);
const inner = value.inner;
FfiConverterString.write(inner.url, into);
return;
}
case AppWizardAction_Tags.SetToken: {
- ordinalConverter.write(27, into);
+ ordinalConverter.write(31, into);
const inner = value.inner;
FfiConverterString.write(inner.token, into);
return;
}
case AppWizardAction_Tags.SetAddressName: {
- ordinalConverter.write(28, into);
+ ordinalConverter.write(32, into);
const inner = value.inner;
FfiConverterString.write(inner.name, into);
return;
}
case AppWizardAction_Tags.SubmitAddress: {
- ordinalConverter.write(29, into);
+ ordinalConverter.write(33, into);
return;
}
case AppWizardAction_Tags.AddressFailed: {
- ordinalConverter.write(30, into);
+ ordinalConverter.write(34, into);
const inner = value.inner;
FfiConverterString.write(inner.error, into);
return;
@@ -55068,60 +55822,78 @@ const FfiConverterTypeAppWizardAction = (() => {
case AppWizardAction_Tags.ResetDisk: {
return ordinalConverter.allocationSize(18);
}
- case AppWizardAction_Tags.SetGpu: {
+ case AppWizardAction_Tags.EditResource: {
const inner = value.inner;
let size = ordinalConverter.allocationSize(19);
+ size += FfiConverterTypeAppResourceField.allocationSize(inner.field);
+ return size;
+ }
+ case AppWizardAction_Tags.SetResourceText: {
+ const inner = value.inner;
+ let size = ordinalConverter.allocationSize(20);
+ size += FfiConverterString.allocationSize(inner.text);
+ return size;
+ }
+ case AppWizardAction_Tags.CommitResource: {
+ return ordinalConverter.allocationSize(21);
+ }
+ case AppWizardAction_Tags.CancelResource: {
+ return ordinalConverter.allocationSize(22);
+ }
+ case AppWizardAction_Tags.SetGpu: {
+ const inner = value.inner;
+ let size = ordinalConverter.allocationSize(23);
size += FfiConverterBool.allocationSize(inner.on);
return size;
}
case AppWizardAction_Tags.SetName: {
const inner = value.inner;
- let size = ordinalConverter.allocationSize(20);
+ let size = ordinalConverter.allocationSize(24);
size += FfiConverterString.allocationSize(inner.name);
return size;
}
case AppWizardAction_Tags.SetOpenWhenReady: {
const inner = value.inner;
- let size = ordinalConverter.allocationSize(21);
+ let size = ordinalConverter.allocationSize(25);
size += FfiConverterBool.allocationSize(inner.on);
return size;
}
case AppWizardAction_Tags.Next: {
- return ordinalConverter.allocationSize(22);
+ return ordinalConverter.allocationSize(26);
}
case AppWizardAction_Tags.Back: {
- return ordinalConverter.allocationSize(23);
+ return ordinalConverter.allocationSize(27);
}
case AppWizardAction_Tags.ShowAddress: {
- return ordinalConverter.allocationSize(24);
+ return ordinalConverter.allocationSize(28);
}
case AppWizardAction_Tags.HideAddress: {
- return ordinalConverter.allocationSize(25);
+ return ordinalConverter.allocationSize(29);
}
case AppWizardAction_Tags.SetAddress: {
const inner = value.inner;
- let size = ordinalConverter.allocationSize(26);
+ let size = ordinalConverter.allocationSize(30);
size += FfiConverterString.allocationSize(inner.url);
return size;
}
case AppWizardAction_Tags.SetToken: {
const inner = value.inner;
- let size = ordinalConverter.allocationSize(27);
+ let size = ordinalConverter.allocationSize(31);
size += FfiConverterString.allocationSize(inner.token);
return size;
}
case AppWizardAction_Tags.SetAddressName: {
const inner = value.inner;
- let size = ordinalConverter.allocationSize(28);
+ let size = ordinalConverter.allocationSize(32);
size += FfiConverterString.allocationSize(inner.name);
return size;
}
case AppWizardAction_Tags.SubmitAddress: {
- return ordinalConverter.allocationSize(29);
+ return ordinalConverter.allocationSize(33);
}
case AppWizardAction_Tags.AddressFailed: {
const inner = value.inner;
- let size = ordinalConverter.allocationSize(30);
+ let size = ordinalConverter.allocationSize(34);
size += FfiConverterString.allocationSize(inner.error);
return size;
}
@@ -59151,6 +59923,9 @@ const FfiConverterOptionalTypeAppTeleportPlan = new FfiConverterOptional(FfiConv
// FfiConverter for Array<KvDomainCount>
const FfiConverterSequenceTypeKvDomainCount = new FfiConverterArray(FfiConverterTypeKvDomainCount);
+// FfiConverter for Array<AppVaultPassword>
+const FfiConverterSequenceTypeAppVaultPassword = new FfiConverterArray(FfiConverterTypeAppVaultPassword);
+
// FfiConverter for Array<AppTeleportRunEvent>
const FfiConverterSequenceTypeAppTeleportRunEvent = new FfiConverterArray(FfiConverterTypeAppTeleportRunEvent);
@@ -59181,6 +59956,9 @@ const FfiConverterSequenceTypeAppReviewToggle = new FfiConverterArray(FfiConvert
// FfiConverter for Array<AppReviewDomain>
const FfiConverterSequenceTypeAppReviewDomain = new FfiConverterArray(FfiConverterTypeAppReviewDomain);
+// FfiConverter for Array<AppReviewPassword>
+const FfiConverterSequenceTypeAppReviewPassword = new FfiConverterArray(FfiConverterTypeAppReviewPassword);
+
// FfiConverter for AppNotice | undefined
const FfiConverterOptionalTypeAppNotice = new FfiConverterOptional(FfiConverterTypeAppNotice);
@@ -59283,6 +60061,9 @@ const FfiConverterSequenceTypeAppGpuChoice = new FfiConverterArray(FfiConverterT
// FfiConverter for Array<AppGpuChoice> | undefined
const FfiConverterOptionalSequenceTypeAppGpuChoice = new FfiConverterOptional(FfiConverterSequenceTypeAppGpuChoice);
+// FfiConverter for AppResourceEdit | undefined
+const FfiConverterOptionalTypeAppResourceEdit = new FfiConverterOptional(FfiConverterTypeAppResourceEdit);
+
// FfiConverter for Array<AppStepView>
const FfiConverterSequenceTypeAppStepView = new FfiConverterArray(FfiConverterTypeAppStepView);
@@ -59304,6 +60085,9 @@ const FfiConverterSequenceTypeAppWizardFact = new FfiConverterArray(FfiConverter
// FfiConverter for AppGpuRow | undefined
const FfiConverterOptionalTypeAppGpuRow = new FfiConverterOptional(FfiConverterTypeAppGpuRow);
+// FfiConverter for AppResourceEditView | undefined
+const FfiConverterOptionalTypeAppResourceEditView = new FfiConverterOptional(FfiConverterTypeAppResourceEditView);
+
// FfiConverter for Array<AppWizardField>
const FfiConverterSequenceTypeAppWizardField = new FfiConverterArray(FfiConverterTypeAppWizardField);
@@ -60001,6 +60785,9 @@ function uniffiEnsureInitialized() {
if (nativeModule().uniffi_cua_spaces_ffi_checksum_func_app_picker_consent() !== 47226) {
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_spaces_ffi_checksum_func_app_picker_consent");
}
+ if (nativeModule().uniffi_cua_spaces_ffi_checksum_func_app_picker_event_from_json() !== 64995) {
+ throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_spaces_ffi_checksum_func_app_picker_event_from_json");
+ }
if (nativeModule().uniffi_cua_spaces_ffi_checksum_func_app_picker_grid_primary() !== 24894) {
throw new UniffiInternalError.ApiChecksumMismatch("uniffi_cua_spaces_ffi_checksum_func_app_picker_grid_primary");
}
@@ -60842,8 +61629,12 @@ export default Object.freeze({
FfiConverterTypeAppRememberedChoice,
FfiConverterTypeAppRemoteWindow,
FfiConverterTypeAppRemoteWindowGroup,
+ FfiConverterTypeAppResourceEdit,
+ FfiConverterTypeAppResourceEditView,
+ FfiConverterTypeAppResourceField,
FfiConverterTypeAppReviewChoice,
FfiConverterTypeAppReviewDomain,
+ FfiConverterTypeAppReviewPassword,
FfiConverterTypeAppReviewToggle,
FfiConverterTypeAppReviewView,
FfiConverterTypeAppRoleOption,
@@ -60941,6 +61732,7 @@ export default Object.freeze({
FfiConverterTypeAppUnconfirmedMachine,
FfiConverterTypeAppUpdateChannel,
FfiConverterTypeAppUsageToggle,
+ FfiConverterTypeAppVaultPassword,
FfiConverterTypeAppVaultSource,
FfiConverterTypeAppWindowMode,
FfiConverterTypeAppWizardAction,
diff --git a/apps/cua-spaces-desktop/test/teleport-model.test.ts b/apps/cua-spaces-desktop/test/teleport-model.test.ts
index 3efd6dcd39..837504aa29 100644
--- a/apps/cua-spaces-desktop/test/teleport-model.test.ts
+++ b/apps/cua-spaces-desktop/test/teleport-model.test.ts
@@ -91,6 +91,14 @@ describe("the consent", () => {
expect(off.fromVault).toBeUndefined();
});
+ it("carries the sites picked for saved passwords apart from the cookie sites", () => {
+ const c = teleportConsent({ approved: true, acknowledgeSensitive: true, includePasswords: true, cookieDomains: ["github.com"], passwordDomains: ["bank.example", "github.com"] });
+ expect(c.cookieDomains).toEqual(["github.com"]);
+ expect(c.passwordDomains).toEqual(["bank.example", "github.com"]);
+ expect(c.includePasswords).toBe(true);
+ expect(teleportConsent({ approved: true, passwordDomains: ["a", 2] }).passwordDomains).toBeUndefined();
+ });
+
it("takes only true as yes, and only lists of strings as lists", () => {
const c = teleportConsent({ approved: "yes", saveToKeyvault: 1, cookieDomains: ["a", 2], exclude: "x", fromVault: null });
expect(c).toEqual({ approved: false, acknowledgeSensitive: false, saveToKeyvault: false, acknowledgeRelayPlaintext: false, cookieDomains: undefined, exclude: [], fromVault: undefined, includePasswords: false });
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppModel.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppModel.swift
index c483df6d4b..616d4dc9cd 100644
--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppModel.swift
+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/AppModel.swift
@@ -197,7 +197,7 @@ public final class AppModel {
localAvailable: true, localReason: nil, localBackends: nil, localDetails: nil,
maxCpus: UInt32(max(2, min(16, ProcessInfo.processInfo.activeProcessorCount))),
hostArch: Self.hostArch, lumeSource: nil, linuxSource: nil, storage: nil, cloudPricing: nil, clouds: [], hosts: [],
- experiments: settings.experiments, gpus: nil))
+ experiments: settings.experiments, gpus: nil, nameSeed: nil))
self.notch = NotchModel()
// The notch tiles and the preview cover read one thumbnail store,
// filled from the SDK's shared cache.
@@ -876,7 +876,7 @@ public final class AppModel {
hostArch: Self.hostArch, lumeSource: lumeSource, linuxSource: linuxSource,
storage: storage.map(Self.wizardStorage),
cloudPricing: available ? pricing : nil, clouds: [], hosts: [],
- experiments: settings.experiments, gpus: gpus))
+ experiments: settings.experiments, gpus: gpus, nameSeed: nil))
}
/// The New Space panel's Cancel.
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/TeleportModel.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/TeleportModel.swift
index 4628f18847..ea0ed550fd 100644
--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/TeleportModel.swift
+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Models/TeleportModel.swift
@@ -396,7 +396,8 @@ public final class TeleportModel {
reviewVault = KvVaultState(query: "", selected: source.ids, expanded: [provider], app: provider)
send(.vaultItems(count: source.count, newestMs: source.newestMs,
nowMs: Int64(keyvault.clock().timeIntervalSince1970 * 1000), selected: source.ids,
- passwordIds: source.passwordIds))
+ passwordIds: source.passwordIds, passwords: source.passwords,
+ passwordPicks: source.passwordPicks))
}
guard review.needsDomains else { return }
guard let client = keyvault?.client else { send(.domainsFailed); return }
@@ -515,5 +516,6 @@ func sdkConsent(_ consent: AppTeleportConsent) -> TeleportConsent {
cookieDomains: consent.cookieDomains,
exclude: consent.exclude,
fromVault: consent.fromVault,
- includePasswords: consent.includePasswords)
+ includePasswords: consent.includePasswords,
+ passwordDomains: consent.passwordDomains)
}
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/NewSpaceWizardView.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/NewSpaceWizardView.swift
index 962a265a0d..3252ed04d0 100644
--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/NewSpaceWizardView.swift
+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/NewSpaceWizardView.swift
@@ -18,6 +18,8 @@ public struct NewSpaceWizardView: View {
/// "Use built-in Lume" (the core's `runtimeSwitch`).
let onRuntimeSwitch: ((AppRuntimeSwitch) async -> Void)?
@State private var switchingRuntime = false
+ /// A slider's typed value has the keyboard.
+ @FocusState private var typingValue: Bool
public init(wizard: WizardModel, onCreate: @escaping (AppCreatePlan) -> Void,
onAdd: @escaping (String, String?, String?) async throws -> Void,
@@ -260,17 +262,19 @@ public struct NewSpaceWizardView: View {
Slider(value: Binding(get: { Double(v.cpus) },
set: { wizard.send(.setCpus(cpus: UInt32($0.rounded()))) }),
in: Double(v.minCpus)...Double(max(v.maxCpus, v.minCpus + 1)), step: 1)
- Text(v.cpusText).monospacedDigit().frame(width: 64, alignment: .trailing)
+ sliderValue(v, .cpus, v.cpusText, id: "cpus")
}
}
+ typedError(v, "cpus")
LabeledContent(label(v, "memory")) {
HStack {
Slider(value: Binding(get: { Double(v.memoryGb) },
set: { wizard.send(.setMemory(memoryGb: UInt32($0.rounded()))) }),
in: Double(v.minMemoryGb)...Double(v.maxMemoryGb), step: 1)
- Text(v.memoryText).monospacedDigit().frame(width: 64, alignment: .trailing)
+ sliderValue(v, .memory, v.memoryText, id: "memory")
}
}
+ typedError(v, "memory")
}
if v.diskEditable {
LabeledContent(label(v, "disk")) {
@@ -280,9 +284,10 @@ public struct NewSpaceWizardView: View {
// Continuous: a GB step over hundreds of GB draws a solid tick rail.
in: Double(v.minDiskGb)...Double(max(v.maxDiskGb, v.minDiskGb + 1)))
.help(v.diskHelp ?? "")
- Text(v.diskText).monospacedDigit().frame(width: 64, alignment: .trailing)
+ sliderValue(v, .disk, v.diskText, id: "disk")
}
}
+ typedError(v, "disk")
if v.diskNote != nil || v.diskResetLabel != nil {
HStack(alignment: .firstTextBaseline, spacing: 8) {
if let note = v.diskNote {
@@ -305,6 +310,44 @@ public struct NewSpaceWizardView: View {
}
}
+ /// A slider's number: click it to type a value. The core checks it
+ /// against the slider's own limits; Return or leaving the field uses
+ /// it, Escape keeps the slider's value.
+ @ViewBuilder private func sliderValue(_ v: AppWizardView, _ f: AppResourceField, _ text: String, id: String) -> some View {
+ if let edit = v.resourceEdit, edit.field == f {
+ TextField(label(v, id), text: Binding(get: { edit.text }, set: { wizard.send(.setResourceText(text: $0)) }))
+ .labelsHidden()
+ .multilineTextAlignment(.trailing)
+ .monospacedDigit()
+ .frame(width: 64)
+ .focused($typingValue)
+ .onAppear { typingValue = true }
+ .onSubmit { wizard.send(.commitResource) }
+ .onExitCommand { wizard.send(.cancelResource) }
+ .onChange(of: typingValue) { _, focused in
+ if !focused { wizard.send(.commitResource) }
+ }
+ .accessibilityIdentifier("wizard-\(id)-value-field")
+ } else {
+ Button { wizard.send(.editResource(field: f)) } label: {
+ Text(text).monospacedDigit().frame(width: 64, alignment: .trailing)
+ .contentShape(Rectangle())
+ }
+ .buttonStyle(.plain)
+ .help("Click to type a value")
+ .accessibilityIdentifier("wizard-\(id)-value")
+ }
+ }
+
+ /// Why a typed value cannot be used (the slider's limits), under it.
+ @ViewBuilder private func typedError(_ v: AppWizardView, _ id: String) -> some View {
+ if let error = field(v, id)?.error {
+ Text(error).foregroundStyle(.red).font(.callout)
+ .frame(maxWidth: .infinity, alignment: .trailing)
+ .accessibilityIdentifier("wizard-\(id)-error")
+ }
+ }
+
/// The GPU checkbox with a small "Learn more"; where this machine
/// cannot, disabled with the reason (tooltip and one quiet line).
@ViewBuilder private func gpuRow(_ gpu: AppGpuRow) -> some View {
@@ -376,8 +419,9 @@ public struct NewSpaceWizardView: View {
@ViewBuilder private func footer(_ v: AppWizardView) -> some View {
HStack {
- // While the image suggestions are open, Escape and Return are theirs.
- let menuOpen = v.mode == .create && v.imageField.open
+ // While the image suggestions are open, or a slider's value is
+ // typed, Escape and Return are theirs.
+ let menuOpen = v.mode == .create && (v.imageField.open || v.resourceEdit != nil)
Button(v.labels.cancel, action: onCancel).keyboardShortcut(menuOpen ? nil : .cancelAction)
Spacer()
if v.mode == .address {
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/TeleportReviewViews.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/TeleportReviewViews.swift
index f9a7b3c710..1202542b99 100644
--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/TeleportReviewViews.swift
+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/Views/TeleportReviewViews.swift
@@ -32,6 +32,8 @@ struct TeleportReview: View {
Text("Off by default. Passwords are re-encrypted for the browser in the Space and need " +
"that browser to have been opened once.")
.font(.caption).foregroundStyle(.secondary)
+ // The picker only where the Keyvault keeps the choice.
+ if review.includePasswords && !review.passwordSummary.isEmpty { passwords }
}
}
// What happens, when there is nothing to choose (the core's).
@@ -149,6 +151,52 @@ struct TeleportReview: View {
}
}
+ /// The saved passwords to pick, as the sites are: a site with how many
+ /// it holds (reading the app), or each saved password's site and
+ /// username (from the Keyvault). Never a value.
+ @ViewBuilder private var passwords: some View {
+ HStack(spacing: 8) {
+ Image(systemName: "magnifyingglass").foregroundStyle(.secondary)
+ TextField("Search saved passwords", text: Binding(get: { review.passwordQuery },
+ set: { teleport.send(.passwordQuery(text: $0)) }))
+ .textFieldStyle(.plain)
+ Text(review.passwordSummary).font(.caption).foregroundStyle(.secondary)
+ Button("All") { teleport.send(.selectShownPasswords(value: true)) }.buttonStyle(.link)
+ Button("None") { teleport.send(.selectShownPasswords(value: false)) }.buttonStyle(.link)
+ }
+ .accessibilityIdentifier("review-passwords-search")
+ if review.passwords.isEmpty {
+ Text("No saved passwords match.").font(.callout).foregroundStyle(.secondary)
+ } else {
+ List {
+ ForEach(review.passwords, id: \.key) { p in
+ HStack(spacing: 8) {
+ TriCheckbox(state: p.selected ? .on : .off,
+ label: "Send \([p.site, p.username].filter { !$0.isEmpty }.joined(separator: " "))") {
+ teleport.send(.togglePassword(key: p.key))
+ }
+ Image(systemName: "key").foregroundStyle(.secondary).frame(width: 18)
+ Text(p.site).lineLimit(1)
+ if !p.username.isEmpty {
+ Text(p.username).font(.callout).foregroundStyle(.secondary).lineLimit(1)
+ }
+ Spacer(minLength: 8)
+ if !p.counts.isEmpty {
+ Text(p.counts).font(.caption).foregroundStyle(.secondary)
+ }
+ }
+ .contentShape(Rectangle())
+ .onTapGesture { teleport.send(.togglePassword(key: p.key)) }
+ .accessibilityElement(children: .contain)
+ .accessibilityIdentifier("review-password-\(p.key)")
+ }
+ }
+ .listStyle(.inset)
+ .frame(height: min(CGFloat(max(review.passwords.count, 1)) * 26 + 8, 190))
+ .accessibilityIdentifier("review-passwords-list")
+ }
+ }
+
/// The other lines the user can turn off.
private var items: some View {
ForEach(review.toggles, id: \.key) { t in
diff --git a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIBridge+Pages.swift b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIBridge+Pages.swift
index f45272a7df..2b3646fe79 100644
--- a/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIBridge+Pages.swift
+++ b/apps/cua-spaces-macos/Sources/CuaSpacesMacKit/WebHost/WebUIBridge+Pages.swift
@@ -667,7 +667,8 @@ extension WebUIBridge {
cookieDomains: c["cookieDomains"] as? [String],
exclude: c["exclude"] as? [String] ?? [],
fromVault: c["fromVault"] as? [String],
- includePasswords: c["includePasswords"] as? Bool ?? false))
+ includePasswords: c["includePasswords"] as? Bool ?? false,
+ passwordDomains: c["passwordDomains"] as? [String]))
}
/// A run's report, as the page reads it (`RunReport`).
diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/KeyvaultFixtures.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/KeyvaultFixtures.swift
index e3b383156f..b8e75185d1 100644
--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/KeyvaultFixtures.swift
+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/KeyvaultFixtures.swift
@@ -70,7 +70,7 @@ enum KeyvaultFixtures {
KvStatus(version: "0.1.0", initialized: true, unlocked: true, disabled: false, callerFirstParty: true,
callerDisplay: "Cua Spaces", items: 27, pending: 0, unlockPolicy: "auto", autoWipe: false,
osProtectorAvailable: true, passphraseAvailable: true, unlockProtectors: ["macos-keychain"],
- browseUntilMs: nil, skipUnlockPrompt: skipPrompt, resetNotice: nil)
+ browseUntilMs: nil, skipUnlockPrompt: skipPrompt, features: [], resetNotice: nil)
}
/// The vault as the broker serves it (`namesVisible`: the user opened
diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/KeyvaultReviewTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/KeyvaultReviewTests.swift
index 2c2804ba8f..0255e466af 100644
--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/KeyvaultReviewTests.swift
+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/KeyvaultReviewTests.swift
@@ -44,8 +44,11 @@ struct KeyvaultReviewTests {
/// A review of Chrome's state on its way to Aurora, as the picker reaches
/// it: planned, with the sites and the saved items asked for.
- func reviewModel(vault: Bool = false) async throws -> (TeleportModel, FakeKeyvault) {
+ /// `features`: what the fake Keyvault daemon says it supports (none:
+ /// one that predates the list).
+ func reviewModel(vault: Bool = false, features: [String] = []) async throws -> (TeleportModel, FakeKeyvault) {
let (m, fake) = await model(icons: useRealIcons)
+ fake.current.status?.features = features
let t = TeleportModel(spaceName: "aurora", teleport: nil, space: nil)
t.keyvault = m.keyvault
let entry = try #require(try appCatalogEntriesFromJson(json: """
@@ -105,6 +108,10 @@ struct KeyvaultReviewTests {
t.send(.togglePasswords(value: true))
#expect(appPickerConsent(state: t.state).includePasswords)
#expect(sdkConsent(appPickerConsent(state: t.state)).includePasswords, "carried over to the SDK consent")
+ // This daemon predates the per-site choice: nothing to pick, and no
+ // narrower choice is sent for it to ignore.
+ #expect(t.review?.passwords.isEmpty == true && t.review?.passwordSummary == "")
+ #expect(appPickerConsent(state: t.state).passwordDomains == nil)
// Dropping the only site that has passwords takes the offer away.
t.send(.toggleDomain(domain: "github.com"))
#expect(t.review?.offersPasswords == false)
@@ -117,6 +124,29 @@ struct KeyvaultReviewTests {
#expect(appPickerConsent(state: v.state).fromVault?.count == 18)
}
+ /// A daemon that advertises `password_domains`: ticked, the passwords
+ /// are listed by site to pick (CUA-1641), starting from the sites kept
+ /// signed in; never a value.
+ @Test func savedPasswordsCanBePickedWhereTheKeyvaultKeepsTheChoice() async throws {
+ let (t, _) = try await reviewModel(features: ["password_domains"])
+ t.send(.togglePasswords(value: true))
+ #expect(t.review?.passwords.map(\.site) == ["github.com"])
+ #expect(appPickerConsent(state: t.state).passwordDomains == ["github.com"])
+ #expect(sdkConsent(appPickerConsent(state: t.state)).passwordDomains == ["github.com"])
+ // The password choice is its own: dropping the site's cookies keeps it.
+ t.send(.toggleDomain(domain: "github.com"))
+ #expect(appPickerConsent(state: t.state).passwordDomains == ["github.com"])
+ // Dropping it from the passwords sends none.
+ t.send(.togglePassword(key: "github.com"))
+ #expect(!appPickerConsent(state: t.state).includePasswords)
+ // From the Keyvault: its saved passwords, only when ticked.
+ let (v, _) = try await reviewModel(vault: true)
+ #expect(v.review?.passwordsLabel == "Also send 2 saved passwords")
+ #expect(appPickerConsent(state: v.state).fromVault?.count == 16)
+ v.send(.togglePasswords(value: true))
+ #expect(appPickerConsent(state: v.state).fromVault?.count == 18)
+ }
+
@Test func reviewCanSendFromTheSavedItemsWithoutReadingTheApp() async throws {
let (t, _) = try await reviewModel(vault: true)
let review = try #require(t.review)
diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ParityTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ParityTests.swift
index f5fe79c68a..c43804653d 100644
--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ParityTests.swift
+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/ParityTests.swift
@@ -140,6 +140,9 @@ struct ParityTests {
case "set-address": return .setAddress(url: a["url"] as! String)
case "set-token": return .setToken(token: a["token"] as! String)
case "set-address-name": return .setAddressName(name: a["name"] as! String)
+ // Typed slider values, decoded as the core does.
+ case "edit-resource", "set-resource-text", "commit-resource", "cancel-resource":
+ return try! appWizardActionFromJson(json: text(a))
case let other: fatalError("unmapped wizard action \(other)")
}
}
@@ -154,7 +157,7 @@ struct ParityTests {
}
func wizardFrame(_ v: AppWizardView) -> [String: Any] {
- [
+ var out: [String: Any] = [
"step": Int(v.step),
"canContinue": v.canContinue,
"primaryLabel": v.primaryLabel,
@@ -200,6 +203,16 @@ struct ParityTests {
"submit": v.address.submit.map { "\($0.url) token=\($0.token ?? "") name=\($0.name ?? "")" } ?? NSNull(),
] as [String: Any],
]
+ // A slider's value being typed, only while one is.
+ if let e = v.resourceEdit {
+ let field = switch e.field {
+ case .cpus: "cpus"
+ case .memory: "memory"
+ case .disk: "disk"
+ }
+ out["resourceEdit"] = "\(field): \(e.text)" + (e.error.map { " !\($0)" } ?? "")
+ }
+ return out
}
func storage(_ s: [String: Any]) -> AppLocalStorage {
@@ -486,7 +499,8 @@ struct ParityTests {
// MARK: - teleport-review
func pickerFrame(_ s: AppPickerState) -> [String: Any] {
- let review: Any = appPickerReview(state: s).map { r -> [String: Any] in
+ let r0 = appPickerReview(state: s)
+ let review: Any = r0.map { r -> [String: Any] in
[
"title": r.title,
"items": r.items.map { "\(word($0.kind)):\($0.label)\($0.sensitive ? " (secret)" : "")" },
@@ -497,7 +511,7 @@ struct ParityTests {
"warnings": r.warnings,
]
} ?? NSNull()
- return [
+ var out: [String: Any] = [
"step": word(s.step),
"selectedId": opt(s.selectedId),
"entry": opt(s.entry?.id),
@@ -513,6 +527,16 @@ struct ParityTests {
},
"planSensitive": appPickerPlanSensitive(state: s).map(word),
]
+ // Saved passwords, while the review offers them.
+ if let r = r0, r.offersPasswords {
+ out["passwords"] = [
+ "label": r.passwordsLabel,
+ "on": r.includePasswords,
+ "summary": r.passwordSummary,
+ "rows": r.passwords.map { "\($0.site) \($0.username) (\($0.counts)) [\($0.selected ? "x" : " ")]" },
+ ] as [String: Any]
+ }
+ return out
}
func word(_ g: AppSensitiveGroup) -> String {
@@ -553,6 +577,10 @@ struct ParityTests {
case "acknowledge-relay-plaintext": event = .acknowledgeRelayPlaintext(value: e["value"] as! Bool)
case "sensitive": event = .sensitive(group: group(e["group"] as! String), value: e["value"] as! Bool)
case "back": event = .back
+ // The review's sites, saved items and passwords, decoded as the core does.
+ case "domains-loaded", "toggle-passwords", "toggle-password", "password-query",
+ "select-shown-passwords", "vault-items", "send-from":
+ event = try appPickerEventFromJson(json: text(e))
case "progress":
let p = e["event"] as! [String: Any]
event = .progress(event: AppTeleportRunEvent(
@@ -570,7 +598,14 @@ struct ParityTests {
frames.append(["picker": e["type"]!, "frame": pickerFrame(s)])
}
let consent = appPickerConsent(state: s)
- frames.append(["consent": ["approved": consent.approved, "acknowledgeSensitive": consent.acknowledgeSensitive, "acknowledgeRelayPlaintext": consent.acknowledgeRelayPlaintext, "saveToKeyvault": consent.saveToKeyvault]])
+ var consentFrame: [String: Any] = ["approved": consent.approved, "acknowledgeSensitive": consent.acknowledgeSensitive, "acknowledgeRelayPlaintext": consent.acknowledgeRelayPlaintext, "saveToKeyvault": consent.saveToKeyvault]
+ // The fields the core leaves out at their defaults.
+ if let d = consent.cookieDomains { consentFrame["cookieDomains"] = d }
+ if !consent.exclude.isEmpty { consentFrame["exclude"] = consent.exclude }
+ if let v = consent.fromVault { consentFrame["fromVault"] = v }
+ if consent.includePasswords { consentFrame["includePasswords"] = true }
+ if let d = consent.passwordDomains { consentFrame["passwordDomains"] = d }
+ frames.append(["consent": consentFrame])
let spaces = try appSpacesFromJson(json: text(f["spaces"]))
frames += notchFrames(f["notch"] as! [[String: Any]], spaces: spaces)
diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/TeleportBridgeTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/TeleportBridgeTests.swift
index 781dbf8292..8fd7423026 100644
--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/TeleportBridgeTests.swift
+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/TeleportBridgeTests.swift
@@ -55,7 +55,7 @@ struct TeleportBridgeTests {
])
#expect(on == sdkConsent(AppTeleportConsent(
approved: true, acknowledgeSensitive: true, saveToKeyvault: true, acknowledgeRelayPlaintext: true,
- cookieDomains: ["github.com"], exclude: ["Default/Bookmarks"], fromVault: ["a", "b"], includePasswords: true)))
+ cookieDomains: ["github.com"], exclude: ["Default/Bookmarks"], fromVault: ["a", "b"], includePasswords: true, passwordDomains: nil)))
#expect(on.saveToKeyvault)
let off = WebUIBridge.teleportConsent(["approved": true, "acknowledgeSensitive": true])
#expect(!off.saveToKeyvault && off.exclude.isEmpty && off.cookieDomains == nil)
diff --git a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/TeleportConsentTests.swift b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/TeleportConsentTests.swift
index 33e1cfcae1..662c5ea46f 100644
--- a/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/TeleportConsentTests.swift
+++ b/apps/cua-spaces-macos/Tests/CuaSpacesMacTests/TeleportConsentTests.swift
@@ -15,13 +15,13 @@ struct TeleportConsentTests {
let c = sdkConsent(AppTeleportConsent(
approved: true, acknowledgeSensitive: true,
saveToKeyvault: true, acknowledgeRelayPlaintext: true,
- cookieDomains: nil, exclude: [], fromVault: nil, includePasswords: false))
+ cookieDomains: nil, exclude: [], fromVault: nil, includePasswords: false, passwordDomains: nil))
#expect(c == TeleportConsent(approved: true, acknowledgeSensitive: true,
saveToKeyvault: true, acknowledgeRelayPlaintext: true))
let off = sdkConsent(AppTeleportConsent(
approved: true, acknowledgeSensitive: true,
saveToKeyvault: false, acknowledgeRelayPlaintext: false,
- cookieDomains: nil, exclude: [], fromVault: nil, includePasswords: false))
+ cookieDomains: nil, exclude: [], fromVault: nil, includePasswords: false, passwordDomains: nil))
#expect(!off.saveToKeyvault)
}
@@ -31,13 +31,30 @@ struct TeleportConsentTests {
@Test func theReviewsChoicesReachTheSdkConsent() {
let c = sdkConsent(AppTeleportConsent(
approved: true, acknowledgeSensitive: true, saveToKeyvault: false, acknowledgeRelayPlaintext: false,
- cookieDomains: ["github.com", "notion.so"], exclude: ["Default/Bookmarks"], fromVault: nil, includePasswords: false))
+ cookieDomains: ["github.com", "notion.so"], exclude: ["Default/Bookmarks"], fromVault: nil, includePasswords: false, passwordDomains: nil))
#expect(c.cookieDomains == ["github.com", "notion.so"])
#expect(c.exclude == ["Default/Bookmarks"])
#expect(c.fromVault == nil)
let v = sdkConsent(AppTeleportConsent(
approved: true, acknowledgeSensitive: true, saveToKeyvault: false, acknowledgeRelayPlaintext: false,
- cookieDomains: nil, exclude: [], fromVault: ["a", "b"], includePasswords: true))
+ cookieDomains: nil, exclude: [], fromVault: ["a", "b"], includePasswords: true, passwordDomains: nil))
#expect(v.fromVault == ["a", "b"] && v.cookieDomains == nil && v.includePasswords)
}
+
+ /// The sites picked for saved passwords reach the SDK, apart from the
+ /// sites whose cookies go (CUA-1641), from the native review and from
+ /// the page's consent alike.
+ @MainActor @Test func thePasswordSitesReachTheSdkConsent() {
+ let c = sdkConsent(AppTeleportConsent(
+ approved: true, acknowledgeSensitive: true, saveToKeyvault: false, acknowledgeRelayPlaintext: false,
+ cookieDomains: ["github.com"], exclude: [], fromVault: nil, includePasswords: true,
+ passwordDomains: ["bank.example", "github.com"]))
+ #expect(c.cookieDomains == ["github.com"])
+ #expect(c.passwordDomains == ["bank.example", "github.com"] && c.includePasswords)
+ let page = WebUIBridge.teleportConsent([
+ "approved": true, "acknowledgeSensitive": true, "includePasswords": true,
+ "cookieDomains": ["github.com"], "passwordDomains": ["bank.example"],
+ ])
+ #expect(page.passwordDomains == ["bank.example"] && page.includePasswords)
+ }
}
diff --git a/apps/cua-spaces-web/e2e/new-space.ts b/apps/cua-spaces-web/e2e/new-space.ts
index 7c3a93b1a1..c4ebd0c40c 100644
--- a/apps/cua-spaces-web/e2e/new-space.ts
+++ b/apps/cua-spaces-web/e2e/new-space.ts
@@ -136,16 +136,28 @@ async function checkWizard(page: Page, state: WizardState, v: WizardView, menuCh
}
if (v.placementHint) await expect(root.locator("[data-placement-hint]")).toHaveText(v.placementHint);
} else if (v.step === 1) {
- const value = (id: string) => root.locator(`[data-value-text="${id}"]`);
- if (field("cpus")) await expect(value("cpus")).toHaveText(v.cpusText);
- else await expect(value("cpus")).toHaveCount(0);
- if (field("memory")) await expect(value("memory")).toHaveText(v.memoryText);
- else await expect(value("memory")).toHaveCount(0);
+ // A slider's number, or the field it is typed in (with why it can't be used).
+ const edit = v.resourceEdit ?? null;
+ const value = async (id: "cpus" | "memory" | "disk", text: string) => {
+ if (edit?.field === id) {
+ await expect(root.locator(`[data-value-input="${id}"]`)).toHaveValue(edit.text);
+ await expect(root.locator(`[data-value-text="${id}"]`)).toHaveCount(0);
+ if (edit.error) await expect(root.locator(`[data-field-error="${id}"]`)).toHaveText(edit.error);
+ else await expect(root.locator(`[data-field-error="${id}"]`)).toHaveCount(0);
+ } else await expect(root.locator(`[data-value-text="${id}"]`)).toHaveText(text);
+ };
+ const none = (id: string) => expect(root.locator(`[data-value-text="${id}"]`)).toHaveCount(0);
+ if (field("cpus")) await value("cpus", v.cpusText);
+ else await none("cpus");
+ if (field("memory")) await value("memory", v.memoryText);
+ else await none("memory");
if (v.diskEditable) {
- await expect(value("disk")).toHaveText(v.diskText);
- if (v.diskNote) await expect(root.locator("[data-disk-note]")).toHaveText(v.diskNote);
- await expect(root.locator("[data-disk-reset]")).toHaveCount(v.diskResetLabel ? 1 : 0);
- } else await expect(value("disk")).toHaveCount(0);
+ await value("disk", v.diskText);
+ // A typed disk value's error takes the note's place.
+ const typingDisk = edit?.field === "disk" && Boolean(edit.error);
+ if (v.diskNote && !typingDisk) await expect(root.locator("[data-disk-note]")).toHaveText(v.diskNote);
+ await expect(root.locator("[data-disk-reset]")).toHaveCount(v.diskResetLabel && !typingDisk ? 1 : 0);
+ } else await none("disk");
if (v.gpu) {
await expect(root.locator("[data-gpu-label]")).toHaveText(v.gpu.label);
await expectCheckbox(root.locator("[data-gpu]"), v.gpu.on, v.gpu.enabled);
@@ -165,6 +177,9 @@ async function checkWizard(page: Page, state: WizardState, v: WizardView, menuCh
else await expect(root.locator("[data-resources-error]")).toHaveCount(0);
} else if (v.step === 2) {
await expect(root.locator("[data-name-input]")).toHaveValue(v.name);
+ // Left empty, the name it gets is the placeholder.
+ const placeholder = v.fields.find((f) => f.id === "name")?.placeholder;
+ if (placeholder) await expect(root.locator("[data-name-input]")).toHaveAttribute("placeholder", placeholder);
await expect(root.locator("[data-name-input]")).toHaveAttribute("aria-invalid", String(v.nameInvalid));
if (v.nameError) await expect(root.locator('[data-field-error="name"]')).toHaveText(v.nameError);
else await expect(root.locator('[data-field-error="name"]')).toHaveCount(0);
diff --git a/apps/cua-spaces-web/e2e/teleport.ts b/apps/cua-spaces-web/e2e/teleport.ts
index d267f90965..616a3d4418 100644
--- a/apps/cua-spaces-web/e2e/teleport.ts
+++ b/apps/cua-spaces-web/e2e/teleport.ts
@@ -123,7 +123,8 @@ async function checkPicker(page: Page, cp: Cp<"picker">): Promise<void> {
await expect(page.locator("[data-teleport-title]")).toHaveText(r.title);
// Every install and every line the user can turn off, with secrets marked.
const kind = (i: { kind: string; sensitive: boolean }) => (i.kind === "install" ? "install" : i.sensitive ? "secret" : "state");
- const shown = r.items.filter((i) => i.kind === "install" || r.toggles.some((t) => t.key === i.key));
+ // Sending from the Keyvault, the saved items are the list: no "Also sent".
+ const shown = r.items.filter((i) => i.kind === "install" || (r.source !== "vault" && r.toggles.some((t) => t.key === i.key)));
await expect
.poll(() =>
root.locator("[data-review-item]").evaluateAll((els) =>
@@ -134,6 +135,11 @@ async function checkPicker(page: Page, cp: Cp<"picker">): Promise<void> {
if (r.leavesText) await expect(page.locator("[data-review-leaves]")).toHaveText(r.leavesText);
else await expect(page.locator("[data-review-leaves]")).toHaveCount(0);
await expect.poll(() => root.locator("[data-review-warning]").allTextContents()).toEqual(r.warnings);
+ // Saved passwords: the picker only where the Keyvault keeps the choice.
+ const picking = r.offersPasswords && r.includePasswords && Boolean(r.passwordSummary);
+ await expect
+ .poll(() => root.locator("[data-review-password]").evaluateAll((els) => els.map((e) => `${e.getAttribute("data-review-password")}${e.hasAttribute("data-selected") ? " x" : ""}`)))
+ .toEqual(picking ? (r.passwords ?? []).map((p) => `${p.key}${p.selected ? " x" : ""}`) : []);
for (const [gate, needed, checked] of [
["ack", r.needsAcknowledgement, r.acknowledged],
["ack-relay", r.needsRelayPlaintextAcknowledgement, r.acknowledgedRelayPlaintext],
diff --git a/apps/cua-spaces-web/src/__tests__/new-space-nits.test.tsx b/apps/cua-spaces-web/src/__tests__/new-space-nits.test.tsx
new file mode 100644
index 0000000000..8fa1e5eedf
--- /dev/null
+++ b/apps/cua-spaces-web/src/__tests__/new-space-nits.test.tsx
@@ -0,0 +1,106 @@
+// SPDX-License-Identifier: FSL-1.1-MIT
+// Copyright (c) 2026 Cua AI, Inc.
+
+// New Space (CUA-1641): a slider's number can be clicked and typed, within
+// the slider's own limits and with its words when outside them; and a Space
+// left unnamed shows the name it will get (the Name placeholder, the
+// Summary, the row while it is created), the one the create uses.
+
+import { act, cleanup, fireEvent, screen, waitFor } from "@testing-library/react";
+import { afterEach, beforeEach, describe, expect, it } from "vitest";
+import { wasmBuilt } from "@/bridge/__tests__/testCore";
+import { resetNewSpaceSession } from "@/bridge/new-space";
+import { mountApp, stubBrowserApis } from "./app-harness";
+
+beforeEach(resetNewSpaceSession);
+afterEach(cleanup);
+stubBrowserApis();
+
+async function openWizard(): Promise<HTMLElement> {
+ fireEvent.click(await screen.findByRole("button", { name: /New Space/ }));
+ return waitFor(
+ () => {
+ const d = document.querySelector<HTMLElement>("[data-new-space]");
+ expect(d).not.toBeNull();
+ return d!;
+ },
+ { timeout: 4000 },
+ );
+}
+
+async function next(dialog: HTMLElement) {
+ const b = await waitFor(() => {
+ const b = dialog.querySelector<HTMLButtonElement>("[data-wizard-primary]")!;
+ expect(b.disabled).toBe(false);
+ return b;
+ });
+ fireEvent.click(b);
+}
+
+const input = (dialog: HTMLElement, id: string) => dialog.querySelector<HTMLInputElement>(`[data-value-input="${id}"]`);
+
+describe.skipIf(!wasmBuilt)("New Space nits", () => {
+ it("types a slider's value within its limits, and says why outside them", { timeout: 20_000 }, async () => {
+ await mountApp("/spaces", { failsCreates: false, listsGhost: false });
+ const dialog = await openWizard();
+ await next(dialog);
+ await waitFor(() => expect(dialog.getAttribute("data-step")).toBe("1"));
+
+ // Clicking the number opens a field with the value.
+ fireEvent.click(dialog.querySelector('[data-value-text="cpus"]')!);
+ const cpus = await waitFor(() => {
+ const f = input(dialog, "cpus");
+ expect(f).not.toBeNull();
+ return f!;
+ });
+ const max = Number(dialog.querySelector<HTMLInputElement>("#ns-cpus")!.max);
+ // Outside the limits: the slider's words, Continue waits.
+ fireEvent.change(cpus, { target: { value: String(max + 1) } });
+ await waitFor(() => expect(dialog.querySelector('[data-field-error="cpus"]')?.textContent).toBe(`Choose 1 to ${max} cores.`));
+ expect(cpus.getAttribute("aria-invalid")).toBe("true");
+ expect(dialog.querySelector<HTMLButtonElement>("[data-wizard-primary]")!.disabled).toBe(true);
+ fireEvent.keyDown(cpus, { key: "Enter" });
+ expect(input(dialog, "cpus")).not.toBeNull();
+ // Escape keeps the slider's value and the sheet.
+ fireEvent.keyDown(input(dialog, "cpus")!, { key: "Escape" });
+ await waitFor(() => expect(input(dialog, "cpus")).toBeNull());
+ expect(document.querySelector("[data-new-space]")).not.toBeNull();
+
+ // Within them: Return uses it.
+ fireEvent.click(dialog.querySelector('[data-value-text="memory"]')!);
+ const memory = await waitFor(() => input(dialog, "memory")!);
+ fireEvent.change(memory, { target: { value: "6 GB" } });
+ fireEvent.keyDown(memory, { key: "Enter" });
+ await waitFor(() => expect(dialog.querySelector('[data-value-text="memory"]')?.textContent).toBe("6 GB"));
+ expect(dialog.querySelector<HTMLInputElement>("#ns-memory")!.value).toBe("6");
+ });
+
+ it("shows the generated name as the placeholder, in the Summary and on the new row", { timeout: 20_000 }, async () => {
+ let release = () => {};
+ const hold = new Promise<void>((r) => (release = r));
+ await mountApp("/spaces", { failsCreates: false, listsGhost: false, hold });
+ const dialog = await openWizard();
+ await next(dialog);
+ await next(dialog);
+ const name = await waitFor(() => dialog.querySelector<HTMLInputElement>("[data-name-input]")!);
+ const generated = name.placeholder;
+ expect(generated).toMatch(/^space-[0-9a-f]{10}$/);
+ await next(dialog);
+ await waitFor(() => expect(dialog.textContent).toContain(`Name${generated}`));
+ // The create uses it: the row while it is created carries the name.
+ const create = await waitFor(() => {
+ const b = dialog.querySelector<HTMLButtonElement>("[data-wizard-primary]")!;
+ expect(b.textContent).toMatch(/Create Space/);
+ return b;
+ });
+ await act(async () => {
+ create.click();
+ await new Promise((r) => setTimeout(r, 50));
+ });
+ await waitFor(() => expect(screen.getAllByText(generated).length).toBeGreaterThan(0), { timeout: 8000 });
+ await act(async () => {
+ release();
+ await new Promise((r) => setTimeout(r, 50));
+ });
+ });
+});
diff --git a/apps/cua-spaces-web/src/__tests__/teleport-passwords.test.tsx b/apps/cua-spaces-web/src/__tests__/teleport-passwords.test.tsx
new file mode 100644
index 0000000000..7ed5a01cb9
--- /dev/null
+++ b/apps/cua-spaces-web/src/__tests__/teleport-passwords.test.tsx
@@ -0,0 +1,131 @@
+// SPDX-License-Identifier: FSL-1.1-MIT
+// Copyright (c) 2026 Cua AI, Inc.
+
+// Teleport a browser (CUA-1641): ticking "Saved passwords" in the review
+// lists them to pick, as "Keep me signed in" lists its sites: by site with
+// counts when reading the browser, by site and username from the Keyvault.
+// No password value is ever on the page; only the picked ones are sent.
+
+import { readFileSync } from "node:fs";
+import { join } from "node:path";
+import { cleanup, fireEvent, render, screen } from "@testing-library/react";
+import { useState } from "react";
+import { afterEach, describe, expect, it } from "vitest";
+import type { PickerEvent, PickerState, TeleportStore } from "@/bridge";
+import { testCore, wasmBuilt } from "@/bridge/__tests__/testCore";
+import { pickerConsent, pickerReduce, pickerReview } from "@/bridge/teleport";
+import type { CoreClient } from "@/bridge/core";
+import { TeleportReview } from "@/components/teleport/review";
+
+afterEach(cleanup);
+
+const flow = JSON.parse(
+ readFileSync(join(import.meta.dirname, "../../../../libs/cua/crates/cua-spaces-app-core/parity/teleport-sign-ins.json"), "utf8"),
+) as { spaceName: string; entries: unknown; plan: unknown; picker: Record<string, unknown>[] };
+
+/** What the Keyvault daemon says: `picks` is its `password_domains` feature. */
+const daemon = (picks: boolean): PickerEvent => ({ type: "vault-items", count: 0, newestMs: 0, nowMs: 0, selected: [], passwordIds: [], passwords: [], passwordPicks: picks });
+
+/** The review of Chrome with its sites read (the flow up to the first
+ * `domains-loaded`), on a daemon with or without the per-site choice. */
+function reviewState(core: CoreClient, picks = true): PickerState {
+ return pickerReduce(core, sitesRead(core), daemon(picks));
+}
+
+function sitesRead(core: CoreClient): PickerState {
+ let s = core.call<PickerState>("flow.initial", { spaceName: flow.spaceName });
+ for (const e of flow.picker) {
+ const ev = { ...e } as Record<string, unknown>;
+ if (e.type === "loaded") ev.entries = flow.entries;
+ if (e.type === "planned") ev.plan = flow.plan;
+ s = pickerReduce(core, s, ev as unknown as PickerEvent);
+ if (e.type === "domains-loaded") return s;
+ }
+ throw new Error("no domains-loaded in the flow");
+}
+
+function Review({ core, start, sent }: { core: CoreClient; start: PickerState; sent: PickerEvent[] }) {
+ const [state, setState] = useState(start);
+ const teleport = {
+ send: (e: PickerEvent) => {
+ sent.push(e);
+ setState((s) => pickerReduce(core, s, e));
+ },
+ sendFrom: async (source: "live" | "vault") => setState((s) => pickerReduce(core, s, { type: "send-from", source })),
+ bytes: (n: number) => `${n} B`,
+ } as unknown as TeleportStore;
+ return (
+ <div data-consent={JSON.stringify(pickerConsent(core, state))}>
+ <TeleportReview review={pickerReview(core, state)!} readingSites={false} vault={null} teleport={teleport} />
+ </div>
+ );
+}
+
+/** A saved password choice's checkbox, by its key. */
+const box = (key: string) => document.querySelector<HTMLElement>(`[data-review-password="${key}"] [role="checkbox"]`)!;
+
+const consentOf = () => JSON.parse(document.querySelector<HTMLElement>("[data-consent]")!.dataset.consent!) as Record<string, unknown>;
+
+describe.skipIf(!wasmBuilt)("Teleport review, saved passwords", () => {
+ it("lists the sites with saved passwords once ticked, and sends only the picked ones", async () => {
+ const core = await testCore();
+ const sent: PickerEvent[] = [];
+ render(<Review core={core} start={reviewState(core)} sent={sent} />);
+ expect(document.querySelector("[data-review-password]")).toBeNull();
+ fireEvent.click(document.querySelector("[data-review-passwords]")!);
+ const rows = () => [...document.querySelectorAll<HTMLElement>("[data-review-password]")].map((r) => `${r.dataset.reviewPassword}${r.dataset.selected ? " x" : ""}`);
+ // Starts from the sites kept signed in.
+ expect(rows()).toEqual(["bank.example", "github.com x", "google.com"]);
+ expect(document.querySelector("[data-review-passwords-summary]")?.textContent).toBe("1 of 3 sites");
+ fireEvent.click(box("bank.example"));
+ expect(rows()).toEqual(["bank.example x", "github.com x", "google.com"]);
+ expect(consentOf()).toMatchObject({ includePasswords: true, passwordDomains: ["bank.example", "github.com"] });
+ // The search filters; None drops what it shows.
+ fireEvent.change(screen.getByRole("textbox", { name: "Search saved passwords" }), { target: { value: "bank" } });
+ expect(rows()).toEqual(["bank.example x"]);
+ fireEvent.click(screen.getAllByRole("button", { name: "None" }).at(-1)!);
+ expect(consentOf()).toMatchObject({ passwordDomains: ["github.com"] });
+ expect(sent.map((e) => e.type)).toEqual(["toggle-passwords", "toggle-password", "password-query", "select-shown-passwords"]);
+ });
+
+ it("lists each saved password of the Keyvault by site and username, never a value", async () => {
+ const core = await testCore();
+ let s = reviewState(core);
+ s = pickerReduce(core, s, {
+ type: "vault-items",
+ count: 1,
+ newestMs: 1,
+ nowMs: 1,
+ selected: ["c1"],
+ passwordIds: ["p1", "p2"],
+ passwords: [
+ { id: "p1", site: "github.com", username: "octocat" },
+ { id: "p2", site: "google.com", username: "[email protected]" },
+ ],
+ passwordPicks: true,
+ });
+ s = pickerReduce(core, s, { type: "send-from", source: "vault" });
+ s = pickerReduce(core, s, { type: "toggle-passwords", value: true });
+ render(<Review core={core} start={s} sent={[]} />);
+ expect(screen.getByText("octocat")).toBeTruthy();
+ expect(screen.getByText("[email protected]")).toBeTruthy();
+ fireEvent.click(box("p2"));
+ expect(consentOf()).toMatchObject({ includePasswords: true, fromVault: ["c1", "p1"] });
+ expect(screen.getByText("Also send 1 saved password")).toBeTruthy();
+ });
+
+ it("offers no picker on a Keyvault daemon that would not keep the choice", async () => {
+ const core = await testCore();
+ const sent: PickerEvent[] = [];
+ render(<Review core={core} start={reviewState(core, false)} sent={sent} />);
+ fireEvent.click(document.querySelector("[data-review-passwords]")!);
+ // The box as before: the passwords of the sites kept signed in, nothing to pick.
+ expect(screen.getByText("Also send 2 saved passwords")).toBeTruthy();
+ expect(document.querySelector("[data-review-password]")).toBeNull();
+ expect(document.querySelector("[data-review-passwords-summary]")).toBeNull();
+ expect(screen.queryByRole("textbox", { name: "Search saved passwords" })).toBeNull();
+ const c = consentOf();
+ expect(c.includePasswords).toBe(true);
+ expect(c.passwordDomains).toBeUndefined();
+ });
+});
diff --git a/apps/cua-spaces-web/src/bridge/contracts/bridge-shapes.json b/apps/cua-spaces-web/src/bridge/contracts/bridge-shapes.json
index 678741e06d..35170159a0 100644
--- a/apps/cua-spaces-web/src/bridge/contracts/bridge-shapes.json
+++ b/apps/cua-spaces-web/src/bridge/contracts/bridge-shapes.json
@@ -2895,6 +2895,12 @@
"items": {
"$ref": "#/$defs/GpuChoice"
}
+ },
+ "nameSeed": {
+ "type": [
+ "number",
+ "null"
+ ]
}
},
"required": [
diff --git a/apps/cua-spaces-web/src/bridge/contracts/keyvault.ts b/apps/cua-spaces-web/src/bridge/contracts/keyvault.ts
index f013d9a637..abb66ab947 100644
--- a/apps/cua-spaces-web/src/bridge/contracts/keyvault.ts
+++ b/apps/cua-spaces-web/src/bridge/contracts/keyvault.ts
@@ -168,6 +168,8 @@ export interface KvStatus {
browse_until_ms?: number;
skip_unlock_prompt?: boolean;
reset_notice?: string;
+ /** What the daemon supports beyond the original protocol (`password_domains`). */
+ features?: string[];
}
export interface KvVerification {
@@ -431,6 +433,11 @@ export interface VaultSource {
newestMs: number;
ids: string[];
passwordIds: string[];
+ /** The same passwords with their site and username, never a value. */
+ passwords?: { id: string; site: string; username: string }[];
+ /** The Keyvault daemon enforces a choice of passwords by site
+ * (`password_domains`); without it the review offers none to pick. */
+ passwordPicks?: boolean;
}
/* ---- The approval sheet (approval.rs) ------------------------------------- */
diff --git a/apps/cua-spaces-web/src/bridge/contracts/new-space.ts b/apps/cua-spaces-web/src/bridge/contracts/new-space.ts
index 736b7032bd..c8c3f57415 100644
--- a/apps/cua-spaces-web/src/bridge/contracts/new-space.ts
+++ b/apps/cua-spaces-web/src/bridge/contracts/new-space.ts
@@ -115,6 +115,9 @@ export interface WizardEnv {
hosts?: WizardHost[];
experiments?: Experiments;
gpus?: GpuChoice[] | null;
+ /** Picks the name an unnamed Space gets (`wizard::generated_space_name`):
+ * the wasm core has no randomness of its own, so the page gives one. */
+ nameSeed?: number | null;
}
/** `spaces.createOptions`: what New Space needs from the host beyond Spaces,
@@ -152,6 +155,16 @@ export type WizardState = Record<string, unknown> & {
export type WizardAction = { type: string } & Record<string, unknown>;
+/** A Resources slider whose value can be typed (`wizard::ResourceField`). */
+export type ResourceField = "cpus" | "memory" | "disk";
+
+/** A slider's value being typed (`wizard::ResourceEditView`). */
+export interface ResourceEdit {
+ field: ResourceField;
+ text: string;
+ error: string | null;
+}
+
export interface WizardTile {
id: string;
title: string;
@@ -294,7 +307,12 @@ export interface WizardView {
resourceFacts: WizardFact[];
resourcesError: string | null;
gpu: GpuRow | null;
+ /** A slider's value being typed (its number was clicked), with why it
+ * cannot be used (the slider's limits). */
+ resourceEdit?: ResourceEdit | null;
name: string;
+ /** The name the Space gets: the one typed, else the generated one. */
+ spaceName?: string;
nameInvalid: boolean;
nameError: string | null;
openWhenReady: boolean;
diff --git a/apps/cua-spaces-web/src/bridge/contracts/shapes.ts b/apps/cua-spaces-web/src/bridge/contracts/shapes.ts
index fbfc7ec076..f8f738f104 100644
--- a/apps/cua-spaces-web/src/bridge/contracts/shapes.ts
+++ b/apps/cua-spaces-web/src/bridge/contracts/shapes.ts
@@ -448,6 +448,7 @@ const WizardEnvShape = ref(
hosts: opt(list(object({ id: str, name: str, via: str, online: bool, os: str, limits }))),
experiments: opt(ExperimentsShape),
gpus: optNull(list(GpuShape)),
+ nameSeed: optNull(num),
}),
);
const createOptions = (strict: boolean) =>
diff --git a/apps/cua-spaces-web/src/bridge/contracts/teleport.ts b/apps/cua-spaces-web/src/bridge/contracts/teleport.ts
index 178c4f2dfb..384747454b 100644
--- a/apps/cua-spaces-web/src/bridge/contracts/teleport.ts
+++ b/apps/cua-spaces-web/src/bridge/contracts/teleport.ts
@@ -95,6 +95,9 @@ export interface TeleportConsent {
exclude?: string[];
fromVault?: string[] | null;
includePasswords?: boolean;
+ /** Reading the app: the sites whose saved passwords to send (the review's
+ * own choice of passwords). */
+ passwordDomains?: string[] | null;
}
export type PickerStep = "loading" | "pick" | "options" | "planning" | "consent" | "running" | "done" | "error";
@@ -167,8 +170,11 @@ export type PickerEvent =
| { type: "domain-query"; text: string }
| { type: "toggle-item"; key: string }
| { type: "toggle-passwords"; value: boolean }
+ | { type: "toggle-password"; key: string }
+ | { type: "select-shown-passwords"; value: boolean }
+ | { type: "password-query"; text: string }
| { type: "send-from"; source: "live" | "vault" }
- | { type: "vault-items"; count: number; newestMs: number; nowMs: number; selected: string[]; passwordIds: string[] }
+ | { type: "vault-items"; count: number; newestMs: number; nowMs: number; selected: string[]; passwordIds: string[]; passwords?: VaultPassword[]; passwordPicks?: boolean }
| { type: "vault-selection"; selected: string[] }
| { type: "confirm" }
| { type: "progress"; event: RunEvent }
@@ -202,6 +208,25 @@ export interface ReviewDomain {
unavailableNote: string;
}
+/** One saved password of the Keyvault (`review::VaultPassword`): its site and
+ * username, never its value. */
+export interface VaultPassword {
+ id: string;
+ site: string;
+ username: string;
+}
+
+/** One saved password choice of the review (`review::ReviewPassword`): a site
+ * of the browser (reading it now) or one saved password (from the Keyvault).
+ * Sites and usernames only, never a value. */
+export interface ReviewPassword {
+ key: string;
+ site: string;
+ username: string;
+ counts: string;
+ selected: boolean;
+}
+
/** A consent line the user can turn off (`review::ReviewToggle`). */
export interface ReviewToggle {
key: string;
@@ -240,6 +265,11 @@ export interface ReviewView {
offersPasswords: boolean;
includePasswords: boolean;
passwordsLabel: string;
+ /** Ticked: the saved passwords to pick from, filtered by the search. */
+ passwords?: ReviewPassword[];
+ /** "2 of 5 sites", "2 of 5 passwords". */
+ passwordSummary?: string;
+ passwordQuery?: string;
sourceNote: string;
}
diff --git a/apps/cua-spaces-web/src/bridge/new-space.ts b/apps/cua-spaces-web/src/bridge/new-space.ts
index 95bf52f5d9..742c7f88c0 100644
--- a/apps/cua-spaces-web/src/bridge/new-space.ts
+++ b/apps/cua-spaces-web/src/bridge/new-space.ts
@@ -45,7 +45,15 @@ import type { BridgeStore } from "./store";
type Args = Record<string, any>; // eslint-disable-line @typescript-eslint/no-explicit-any
-export const wizardInitial = (core: CoreClient, env: WizardEnv) => core.call<WizardState>("wizard.initial", { env });
+/** A seed for the name an unnamed Space gets (40 random bits): the wasm core
+ * has no randomness of its own. The core picks the name from it when the
+ * wizard opens, shows it, and creates the Space with it. */
+export function nameSeed(): number {
+ const [high = 0, low = 0] = globalThis.crypto.getRandomValues(new Uint32Array(2));
+ return (high & 0xff) * 2 ** 32 + low;
+}
+export const wizardInitial = (core: CoreClient, env: WizardEnv) =>
+ core.call<WizardState>("wizard.initial", { env: env.nameSeed == null ? { ...env, nameSeed: nameSeed() } : env });
export const wizardReduce = (core: CoreClient, state: WizardState, action: WizardAction, env: WizardEnv) =>
core.call<WizardState>("wizard.reduce", { state, action, env });
/** The wizard as drawn, in the words of the system the app runs on (`hostOs`). */
diff --git a/apps/cua-spaces-web/src/bridge/ops/teleport.ts b/apps/cua-spaces-web/src/bridge/ops/teleport.ts
index 32c1149600..278760a6e4 100644
--- a/apps/cua-spaces-web/src/bridge/ops/teleport.ts
+++ b/apps/cua-spaces-web/src/bridge/ops/teleport.ts
@@ -244,6 +244,7 @@ export function consentToSdk(c: TeleportConsent): Json {
exclude: c.exclude ?? [],
from_vault: c.fromVault ?? null,
include_passwords: Boolean(c.includePasswords),
+ password_domains: c.passwordDomains ?? null,
};
}
diff --git a/apps/cua-spaces-web/src/bridge/teleport.ts b/apps/cua-spaces-web/src/bridge/teleport.ts
index e7faa58c46..85d22f8f0c 100644
--- a/apps/cua-spaces-web/src/bridge/teleport.ts
+++ b/apps/cua-spaces-web/src/bridge/teleport.ts
@@ -420,6 +420,8 @@ export class TeleportStore {
nowMs: Date.now(),
selected: source.ids,
passwordIds: source.passwordIds,
+ passwords: source.passwords ?? [],
+ passwordPicks: source.passwordPicks ?? false,
});
} catch {
/* no Keyvault: nothing saved to send from */
diff --git a/apps/cua-spaces-web/src/components/new-space/new-space-dialog.tsx b/apps/cua-spaces-web/src/components/new-space/new-space-dialog.tsx
index a6b8da8875..a7210f0d3d 100644
--- a/apps/cua-spaces-web/src/components/new-space/new-space-dialog.tsx
+++ b/apps/cua-spaces-web/src/components/new-space/new-space-dialog.tsx
@@ -43,8 +43,9 @@ export function NewSpaceDialog() {
open={wizard.open && view !== null}
onOpenChange={(open) => {
if (open) return;
- // Escape closes the image suggestions first.
+ // Escape closes the image suggestions, or a typed value, first.
if (view?.imageField.open) return send({ type: "dismiss-image-suggestions" });
+ if (view?.resourceEdit) return send({ type: "cancel-resource" });
wizard.close();
}}
>
@@ -396,7 +397,77 @@ function SystemRow({ field: f, v }: { field: WizardField; v: WizardView }) {
/* ---- Resources ------------------------------------------------------------- */
-function Slider({ id, label, value, min, max, text, title, onChange }: { id: string; label: string; value: number; min: number; max: number; text: string; title?: string; onChange: (n: number) => void }) {
+/** The slider's number: click it to type a value. The core checks it against
+ * the slider's own limits (`edit-resource` / `set-resource-text` /
+ * `commit-resource`); Return or leaving the field uses it, Escape keeps the
+ * slider's value. */
+function SliderValue({ id, label, text, edit }: { id: "cpus" | "memory" | "disk"; label: string; text: string; edit: WizardView["resourceEdit"] }) {
+ const { send } = useNewSpaceWizard();
+ if (edit?.field === id) {
+ return (
+ <input
+ id={`ns-${id}-value`}
+ data-value-input={id}
+ autoFocus
+ inputMode="numeric"
+ spellCheck={false}
+ autoComplete="off"
+ aria-label={label}
+ aria-invalid={Boolean(edit.error)}
+ aria-describedby={edit.error ? `ns-${id}-error` : undefined}
+ value={edit.text}
+ onFocus={(e) => e.currentTarget.select()}
+ onChange={(e) => send({ type: "set-resource-text", text: e.target.value })}
+ onKeyDown={(e) => {
+ if (e.key === "Enter") {
+ e.preventDefault();
+ send({ type: "commit-resource" });
+ } else if (e.key === "Escape") {
+ // Keeps the sheet open: only the typed value is dropped.
+ e.preventDefault();
+ e.stopPropagation();
+ send({ type: "cancel-resource" });
+ }
+ }}
+ onBlur={() => send({ type: "commit-resource" })}
+ className="h-6 w-16 rounded-md border border-input bg-transparent px-1.5 text-right text-[13px] tabular-nums outline-none focus-visible:ring-2 focus-visible:ring-ring/60 aria-invalid:border-destructive"
+ />
+ );
+ }
+ return (
+ <button
+ type="button"
+ data-value-text={id}
+ title={`Type a value for ${label.toLowerCase()}`}
+ onClick={() => send({ type: "edit-resource", field: id })}
+ className="w-16 cursor-text rounded-md px-1.5 text-right text-[13px] tabular-nums hover:bg-muted/60 focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:outline-none"
+ >
+ {text}
+ </button>
+ );
+}
+
+function Slider({
+ id,
+ label,
+ value,
+ min,
+ max,
+ text,
+ title,
+ edit,
+ onChange,
+}: {
+ id: "cpus" | "memory" | "disk";
+ label: string;
+ value: number;
+ min: number;
+ max: number;
+ text: string;
+ title?: string;
+ edit: WizardView["resourceEdit"];
+ onChange: (n: number) => void;
+}) {
return (
<div className="flex w-72 items-center gap-3" title={title}>
<input
@@ -411,13 +482,21 @@ function Slider({ id, label, value, min, max, text, title, onChange }: { id: str
onChange={(e) => onChange(Number(e.target.value))}
className="h-1 flex-1 accent-brand"
/>
- <output htmlFor={`ns-${id}`} data-value-text={id} className="w-16 text-right text-[13px] tabular-nums">
- {text}
- </output>
+ <SliderValue id={id} label={label} text={text} edit={edit} />
</div>
);
}
+/** Why a typed value cannot be used, under its slider (the field's error). */
+function typedError(v: WizardView, id: string): ReactNode {
+ const error = v.resourceEdit?.field === id ? v.resourceEdit.error : null;
+ return error ? (
+ <p role="alert" id={`ns-${id}-error`} data-field-error={id} className="mt-1.5 text-right text-xs text-destructive">
+ {error}
+ </p>
+ ) : null;
+}
+
function ResourcesStep({ v }: { v: WizardView }) {
const { send } = useNewSpaceWizard();
const { data } = useBridge();
@@ -429,12 +508,21 @@ function ResourcesStep({ v }: { v: WizardView }) {
{sized ? (
<Group>
{fieldOf(v, "cpus") ? (
- <Row id="cpus" label={labelOf(v, "cpus")} htmlFor="ns-cpus">
- <Slider id="cpus" label={labelOf(v, "cpus")} value={v.cpus} min={v.minCpus} max={v.maxCpus} text={v.cpusText} onChange={(cpus) => send({ type: "set-cpus", cpus })} />
+ <Row id="cpus" label={labelOf(v, "cpus")} htmlFor="ns-cpus" below={typedError(v, "cpus")}>
+ <Slider
+ id="cpus"
+ label={labelOf(v, "cpus")}
+ value={v.cpus}
+ min={v.minCpus}
+ max={v.maxCpus}
+ text={v.cpusText}
+ edit={v.resourceEdit}
+ onChange={(cpus) => send({ type: "set-cpus", cpus })}
+ />
</Row>
) : null}
{fieldOf(v, "memory") ? (
- <Row id="memory" label={labelOf(v, "memory")} htmlFor="ns-memory">
+ <Row id="memory" label={labelOf(v, "memory")} htmlFor="ns-memory" below={typedError(v, "memory")}>
<Slider
id="memory"
label={labelOf(v, "memory")}
@@ -442,6 +530,7 @@ function ResourcesStep({ v }: { v: WizardView }) {
min={v.minMemoryGb}
max={v.maxMemoryGb}
text={v.memoryText}
+ edit={v.resourceEdit}
onChange={(memoryGb) => send({ type: "set-memory", memoryGb })}
/>
</Row>
@@ -452,7 +541,9 @@ function ResourcesStep({ v }: { v: WizardView }) {
label={labelOf(v, "disk")}
htmlFor="ns-disk"
below={
- v.diskNote || v.diskResetLabel ? (
+ v.resourceEdit?.field === "disk" && v.resourceEdit.error ? (
+ typedError(v, "disk")
+ ) : v.diskNote || v.diskResetLabel ? (
<div className="mt-1.5 flex items-baseline justify-between gap-4">
{v.diskNote ? (
<p data-disk-note="" className="text-xs text-muted-foreground">
@@ -478,6 +569,7 @@ function ResourcesStep({ v }: { v: WizardView }) {
max={v.maxDiskGb}
text={v.diskText}
title={v.diskHelp ?? undefined}
+ edit={v.resourceEdit}
onChange={(diskGb) => send({ type: "set-disk", diskGb })}
/>
</Row>
diff --git a/apps/cua-spaces-web/src/components/teleport/review.tsx b/apps/cua-spaces-web/src/components/teleport/review.tsx
index 924025de5e..fcf92c0f7f 100644
--- a/apps/cua-spaces-web/src/components/teleport/review.tsx
+++ b/apps/cua-spaces-web/src/components/teleport/review.tsx
@@ -3,7 +3,7 @@
import { Radio } from "@base-ui/react/radio";
import { RadioGroup } from "@base-ui/react/radio-group";
-import { GlobeIcon, LoaderCircleIcon, SearchIcon } from "lucide-react";
+import { GlobeIcon, KeyRoundIcon, LoaderCircleIcon, SearchIcon } from "lucide-react";
import type { ReactNode } from "react";
import type { ReviewView, TeleportSession, TeleportStore } from "@/bridge";
@@ -77,14 +77,26 @@ export function TeleportReview({
{r.offersPasswords ? (
<Group>
<label className="flex cursor-default items-start gap-3 px-4 py-2.5">
- <Checkbox className="mt-0.5" checked={r.includePasswords} onCheckedChange={(value) => teleport.send({ type: "toggle-passwords", value })} />
- <span>
+ <Checkbox
+ className="mt-0.5"
+ data-review-passwords=""
+ checked={r.includePasswords}
+ onCheckedChange={(value) => teleport.send({ type: "toggle-passwords", value })}
+ />
+ <span className="min-w-0 flex-1">
<span className="block text-[13px]">{r.passwordsLabel}</span>
<span className="block text-xs text-muted-foreground">
Off by default. Passwords are re-encrypted for the browser in the Space and need that browser to have been opened once.
</span>
</span>
+ {r.includePasswords && r.passwordSummary ? (
+ <span className="shrink-0 text-xs text-muted-foreground tabular-nums" data-review-passwords-summary>
+ {r.passwordSummary}
+ </span>
+ ) : null}
</label>
+ {/* The picker only where the Keyvault keeps the choice (the core lists rows then). */}
+ {r.includePasswords && r.passwordSummary ? <Passwords review={r} teleport={teleport} /> : null}
</Group>
) : null}
@@ -216,6 +228,55 @@ function Gate({ data, checked, onChange, note, children }: { data: string; check
);
}
+/** The saved passwords to pick, as the sites are: a site with how many it
+ * holds (reading the app), or each saved password's site and username (from
+ * the Keyvault). Never a value. */
+function Passwords({ review: r, teleport }: { review: ReviewView; teleport: TeleportStore }) {
+ const rows = r.passwords ?? [];
+ return (
+ <div className="border-t">
+ <div className="flex items-center gap-2 border-b px-4 py-1.5">
+ <SearchIcon className="size-3.5 shrink-0 text-muted-foreground" />
+ <input
+ aria-label="Search saved passwords"
+ placeholder="Search saved passwords"
+ value={r.passwordQuery ?? ""}
+ onChange={(e) => teleport.send({ type: "password-query", text: e.target.value })}
+ className="h-7 min-w-0 flex-1 bg-transparent text-[13px] outline-none placeholder:text-muted-foreground"
+ />
+ <button type="button" className="text-xs text-brand hover:underline" onClick={() => teleport.send({ type: "select-shown-passwords", value: true })}>
+ All
+ </button>
+ <button type="button" className="text-xs text-brand hover:underline" onClick={() => teleport.send({ type: "select-shown-passwords", value: false })}>
+ None
+ </button>
+ </div>
+ {rows.length ? (
+ <ul className="max-h-52 divide-y overflow-y-auto">
+ {rows.map((p) => (
+ <li key={p.key} data-review-password={p.key} data-selected={p.selected || undefined}>
+ <label className="flex cursor-default items-center gap-2.5 px-4 py-2">
+ <Checkbox
+ aria-label={`Send ${[p.site, p.username].filter(Boolean).join(" ")}`}
+ checked={p.selected}
+ onCheckedChange={() => teleport.send({ type: "toggle-password", key: p.key })}
+ />
+ <KeyRoundIcon className="size-3.5 shrink-0 text-muted-foreground" />
+ <span className="truncate text-[13px]">{p.site}</span>
+ {p.username ? <span className="truncate text-xs text-muted-foreground">{p.username}</span> : null}
+ <span className="flex-1" />
+ {p.counts ? <span className="shrink-0 text-xs text-muted-foreground">{p.counts}</span> : null}
+ </label>
+ </li>
+ ))}
+ </ul>
+ ) : (
+ <p className="px-4 py-3 text-[13px] text-muted-foreground">No saved passwords match.</p>
+ )}
+ </div>
+ );
+}
+
/** The browser's sites, with counts and a search. */
function Sites({ review: r, reading, teleport }: { review: ReviewView; reading: boolean; teleport: TeleportStore }) {
if (reading) {
diff --git a/apps/cua-spaces/src/components/desktop/MainWindow.test.tsx b/apps/cua-spaces/src/components/desktop/MainWindow.test.tsx
index 7645609795..55d5bd566a 100644
--- a/apps/cua-spaces/src/components/desktop/MainWindow.test.tsx
+++ b/apps/cua-spaces/src/components/desktop/MainWindow.test.tsx
@@ -14,6 +14,9 @@ import { fakeFleetBridge } from "../../test/fakeFleet";
import { MainWindow } from "./MainWindow";
import { createFakeCloudBridge, type CloudBridge } from '../../native/cloud';
+/** A Space created unnamed: the name the wizard generated and showed. */
+const GENERATED = /space-[0-9a-f]{10}/;
+
const ROWS: SpaceRow[] = [
{ id: "cloud:aurora", name: "aurora", provider: "cloud", spacesdVersion: "0.4.0", features: [], os: "linux", reachable: true },
{ id: "local:cua-e2e-vm", name: "cua-e2e-vm", provider: "local", spacesdVersion: "0.4.0", features: [], os: "linux", reachable: true },
@@ -106,7 +109,7 @@ describe("MainWindow", () => {
on: "local",
kind: "vm",
runtime: "auto",
- name: undefined,
+ name: expect.stringMatching(/^space-[0-9a-f]{10}$/),
cpus: 2,
memoryMb: 4096,
spacesd: true,
@@ -230,17 +233,17 @@ describe("MainWindow", () => {
for (let i = 0; i < 3; i++) fireEvent.click(within(dialog).getByRole("button", { name: "Continue" }));
fireEvent.click(within(dialog).getByRole("button", { name: "Create Space" }));
// Before the create resolves: the row, selected, at 2%, and its detail.
- const row = await screen.findByRole("option", { name: /New Space/ });
+ const row = await screen.findByRole("option", { name: GENERATED });
expect(row).toHaveAttribute("aria-selected", "true");
expect(row).toHaveTextContent("1%");
- expect(await screen.findByRole("heading", { level: 1, name: "New Space" })).toBeInTheDocument();
+ expect(await screen.findByRole("heading", { level: 1, name: GENERATED })).toBeInTheDocument();
expect(pendingId).toMatch(/^pending:/);
// The SDK's pull moves it.
act(() => progress.forEach((h) => h({ pendingId, phase: "pulling", fraction: 0.5, detail: "" })));
- await waitFor(() => expect(screen.getByRole("option", { name: /New Space/ })).toHaveTextContent("42%"));
+ await waitFor(() => expect(screen.getByRole("option", { name: GENERATED })).toHaveTextContent("42%"));
// Ready: it gives way to the registry's row.
act(() => finish(ROWS[1]!));
- await waitFor(() => expect(screen.queryByRole("option", { name: /New Space/ })).toBeNull());
+ await waitFor(() => expect(screen.queryByRole("option", { name: GENERATED })).toBeNull());
});
/** Starts a local create from the wizard; resolves with its pending id and
@@ -266,7 +269,7 @@ describe("MainWindow", () => {
fireEvent.change(within(dialog).getByRole("combobox", { name: "Run on" }), { target: { value: "local" } });
for (let i = 0; i < 3; i++) fireEvent.click(within(dialog).getByRole("button", { name: "Continue" }));
fireEvent.click(within(dialog).getByRole("button", { name: "Create Space" }));
- await screen.findByRole("option", { name: /New Space/ });
+ await screen.findByRole("option", { name: GENERATED });
const emit = (p: Omit<CreateProgress, "pendingId" | "detail">) =>
act(() => progress.forEach((h) => h({ pendingId, detail: "", ...p })));
return { ...ctx, pendingId: () => pendingId, emit, settle: () => settle! };
@@ -302,11 +305,11 @@ describe("MainWindow", () => {
// The button keeps its label, disabled; the preview says Cancelling.
await waitFor(() => expect(screen.getByRole("button", { name: "Cancel" })).toBeDisabled());
expect(screen.getByText("Cancelling\u2026")).toBeInTheDocument();
- expect(screen.getByRole("option", { name: /New Space/ })).toBeInTheDocument();
+ expect(screen.getByRole("option", { name: GENERATED })).toBeInTheDocument();
// The SDK cleans up; the create ends with its Cancelled error.
act(() => settle().reject(new Error("cancelled: Cancelled local:space-1; removed its VM or container.")));
await act(async () => done());
- await waitFor(() => expect(screen.queryByRole("option", { name: /New Space/ })).toBeNull());
+ await waitFor(() => expect(screen.queryByRole("option", { name: GENERATED })).toBeNull());
expect(screen.queryByText(/Failed/)).toBeNull();
expect(screen.queryByRole("option", { name: /cancelled/i })).toBeNull();
});
@@ -314,7 +317,7 @@ describe("MainWindow", () => {
it("a cancelled create's error never shows as a failure, even from another client", async () => {
const { settle } = await startPendingCreate({});
act(() => settle().reject(new Error("cancelled: Cancelled local:space-1.")));
- await waitFor(() => expect(screen.queryByRole("option", { name: /New Space/ })).toBeNull());
+ await waitFor(() => expect(screen.queryByRole("option", { name: GENERATED })).toBeNull());
});
it("a cancel that fails says so on the row", async () => {
@@ -366,7 +369,7 @@ describe("MainWindow", () => {
for (let i = 0; i < 3; i++) fireEvent.click(within(dialog).getByRole("button", { name: "Continue" }));
fireEvent.click(within(dialog).getByRole("button", { name: "Create Space" }));
const row = await screen.findByRole("option", { name: /docker is not running/ });
- expect(row).toHaveTextContent("New Space");
+ expect(row).toHaveTextContent(GENERATED);
expect(screen.queryByRole("alert")).toBeNull();
});
diff --git a/apps/cua-spaces/src/components/desktop/NewSpaceWizard.test.tsx b/apps/cua-spaces/src/components/desktop/NewSpaceWizard.test.tsx
index 652a7a8ab7..14fbe6255a 100644
--- a/apps/cua-spaces/src/components/desktop/NewSpaceWizard.test.tsx
+++ b/apps/cua-spaces/src/components/desktop/NewSpaceWizard.test.tsx
@@ -166,7 +166,7 @@ describe("New Space wizard", () => {
fireEvent.change(screen.getByRole("slider", { name: "CPU cores" }), { target: { value: "3" } });
fireEvent.change(screen.getByRole("slider", { name: "Memory" }), { target: { value: "6" } });
next();
- fireEvent.change(screen.getByPlaceholderText("Optional"), {
+ fireEvent.change(screen.getByPlaceholderText(/^space-[0-9a-f]{10}$/), {
target: { value: "cua-e2e-vm" },
});
next();
@@ -268,7 +268,7 @@ describe("New Space wizard", () => {
renderWizard();
next();
next();
- fireEvent.change(screen.getByPlaceholderText("Optional"), { target: { value: "Bad Name" } });
+ fireEvent.change(screen.getByPlaceholderText(/^space-[0-9a-f]{10}$/), { target: { value: "Bad Name" } });
expect(screen.getByRole("button", { name: "Continue" })).toBeDisabled();
});
diff --git a/apps/cua-spaces/src/components/desktop/NewSpaceWizard.tsx b/apps/cua-spaces/src/components/desktop/NewSpaceWizard.tsx
index 21298a8601..976395ad7d 100644
--- a/apps/cua-spaces/src/components/desktop/NewSpaceWizard.tsx
+++ b/apps/cua-spaces/src/components/desktop/NewSpaceWizard.tsx
@@ -305,7 +305,9 @@ export function NewSpaceWizard({
const [state, setState] = useState<WizardState>(() =>
(quick ? [{ type: "choose-os", os: quick }] : (startActions ?? [])).reduce<WizardState>(
(s, action) => core<WizardState>("wizard.reduce", { state: s, action, env }),
- core<WizardState>("wizard.initial", { env }),
+ // The wasm core has no randomness: a seed for the name an unnamed
+ // Space gets (the core shows it and creates the Space with it).
+ core<WizardState>("wizard.initial", { env: { ...env, nameSeed: nameSeed() } }),
),
);
// The panel opened, was cancelled, or created a Space (the SwiftUI app
@@ -849,3 +851,9 @@ function AddByAddress({
</div>
);
}
+
+/** 40 random bits for the generated Space name (`wizard::generated_space_name`). */
+function nameSeed(): number {
+ const [high = 0, low = 0] = globalThis.crypto.getRandomValues(new Uint32Array(2));
+ return (high & 0xff) * 2 ** 32 + low;
+}
diff --git a/docs/content/docs/cua-sdk/reference/index.mdx b/docs/content/docs/cua-sdk/reference/index.mdx
index 08acbc8579..2c7a05211e 100644
--- a/docs/content/docs/cua-sdk/reference/index.mdx
+++ b/docs/content/docs/cua-sdk/reference/index.mdx
@@ -142,4 +142,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 773 items and 38 methods.
+The Cua Spaces app export adds 779 items and 38 methods.
diff --git a/docs/content/docs/cua-sdk/reference/rust/cua-spaces.mdx b/docs/content/docs/cua-sdk/reference/rust/cua-spaces.mdx
index c37d6f3b16..eb3f89852e 100644
--- a/docs/content/docs/cua-sdk/reference/rust/cua-spaces.mdx
+++ b/docs/content/docs/cua-sdk/reference/rust/cua-spaces.mdx
@@ -2117,6 +2117,8 @@ pub struct WalkEntry {
```rust
/// Whether `image` is expected to run ...
pub fn expects_spacesd(image: Option<&str>, explicit: Option<bool>) -> bool
+/// A name in the form `SpaceCreate::name` ...
+pub fn is_generated_name(name: &str) -> bool
/// The key a Fleet pool is named after ...
pub fn pool_key(image: &str, command: Option<&[String]>, env: &BTreeMap<String, String>, services: &BTreeMap<String, u16>) -> String
/// Lowercase DNS label: `[a-z0-9-]` ...
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 8bdea7b54e..e1812a0bd3 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
@@ -43,6 +43,58 @@ pub fn cua_spaces_register()
</Tab>
</Tabs>
+## `AppResourceEdit` record
+
+| Field | Type | Default | Description |
+| --- | --- | --- | --- |
+| `field` | [`AppResourceField`](#appresourcefield-enum) | | Which slider. |
+| `text` | `String` | | The text as typed. |
+
+## `AppResourceEditView` record
+
+| Field | Type | Default | Description |
+| --- | --- | --- | --- |
+| `field` | [`AppResourceField`](#appresourcefield-enum) | | Which slider. |
+| `text` | `String` | | The text as typed. |
+| `error` | `Option<String>` | | Why it cannot be used, in one line (the slider's limits). |
+
+## `AppVaultPassword` record
+
+| Field | Type | Default | Description |
+| --- | --- | --- | --- |
+| `id` | `String` | | The item's id. |
+| `site` | `String` | | Its site (`github.com`); empty when not known. |
+| `username` | `String` | | Its username; empty when not known or hidden. |
+
+## `AppResourceField` enum
+
+<Tabs items={['Swift', 'Rust']} groupId="sdk-lang" persist>
+<Tab value="Swift">
+
+```swift
+.cpus
+.memory
+.disk
+```
+
+</Tab>
+<Tab value="Rust">
+
+```rust
+AppResourceField::Cpus
+AppResourceField::Memory
+AppResourceField::Disk
+```
+
+</Tab>
+</Tabs>
+
+| Variant | Description |
+| --- | --- |
+| `Cpus` | CPU cores. |
+| `Memory` | Memory, GB. |
+| `Disk` | Disk, GB. |
+
## `app_account_app_url`
The account app for this environment (`CUA_ACCOUNT_APP_URL`, else
@@ -71,11 +123,11 @@ pub fn app_account_app_url() -> String
## All items
-620 items, across this page and its subpages, grouped by page (each item's section is on its page). Methods are listed on their object.
+626 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`
-**Spaces app core**: [`app_account_app_url`](#app_account_app_url), [`cua_spaces_register`](#cua_spaces_register)
+**Spaces app core**: [`app_account_app_url`](#app_account_app_url), [`AppResourceEdit`](#appresourceedit-record), [`AppResourceEditView`](#appresourceeditview-record), [`AppResourceField`](#appresourcefield-enum), [`AppVaultPassword`](#appvaultpassword-record), [`cua_spaces_register`](#cua_spaces_register)
**[Settings, Agents](/cua-sdk/reference/spaces/app-core/agent-keys)**: `app_agent_key_form`, `app_agent_key_form_input_from_json`, `app_agent_key_name_problem`, `app_agent_key_remove_confirm`, `app_agent_keys_input_from_json`, `app_agent_keys_view`, `app_agent_settings_rows`, `app_agent_setup_outcome`, `app_agent_setup_outcomes_from_json`, `app_agent_setup_status`, `app_agent_setup_statuses_from_json`, `app_agent_setup_summary`, `AppAgentKeyConfirm`, `AppAgentKeyFormInput`, `AppAgentKeyFormView`, `AppAgentKeyInput`, `AppAgentKeyRow`, `AppAgentKeysInput`, `AppAgentKeysView`, `AppAgentSettingsRow`, `AppAgentSetupOutcomeInput`, `AppAgentSetupStatus`, `AppAgentSetupSummary`
@@ -83,7 +135,7 @@ pub fn app_account_app_url() -> String
**[Devices](/cua-sdk/reference/spaces/app-core/devices)**: `app_approve_open`, `app_approve_reduce`, `app_approve_sheet_action_from_json`, `app_approve_view`, `app_confirm_presence`, `app_devices_clean_name`, `app_devices_input`, `app_devices_input_from_json`, `app_devices_view`, `app_enroll_action_from_json`, `app_enroll_initial`, `app_enroll_reduce`, `app_enroll_state_from_json`, `app_enroll_view`, `app_machine_access_notice`, `AppActivityRow`, `AppApprovalPrompt`, `AppApproveRequest`, `AppApproveSheetAction`, `AppApproveSheetState`, `AppApproveSheetView`, `AppAuditInput`, `AppBannerTone`, `AppDeviceAction`, `AppDeviceBanner`, `AppDeviceConfirm`, `AppDeviceInput`, `AppDeviceRow`, `AppDevicesInput`, `AppDevicesLabels`, `AppDevicesView`, `AppEnrollAction`, `AppEnrollmentKind`, `AppEnrollMethod`, `AppEnrollOption`, `AppEnrollPhase`, `AppEnrollState`, `AppEnrollView`, `AppMachineAccessNotice`, `AppMachineInput`, `AppThisDevice`, `AppUnconfirmedMachine`
-**[Teleport picker](/cua-sdk/reference/spaces/app-core/teleport)**: `app_catalog_entries_from_json`, `app_catalog_entry`, `app_picker_can_plan`, `app_picker_consent`, `app_picker_initial`, `app_picker_plan_sensitive`, `app_picker_primary`, `app_picker_progress`, `app_picker_reduce`, `app_picker_review`, `app_picker_sections`, `app_picker_sensitive_options`, `app_picker_status`, `AppCatalogEntry`, `AppEntrySection`, `AppPickerAction`, `AppPickerEvent`, `AppPickerPrimary`, `AppPickerState`, `AppPickerStep`, `AppPickerTab`
+**[Teleport picker](/cua-sdk/reference/spaces/app-core/teleport)**: `app_catalog_entries_from_json`, `app_catalog_entry`, `app_picker_can_plan`, `app_picker_consent`, `app_picker_event_from_json`, `app_picker_initial`, `app_picker_plan_sensitive`, `app_picker_primary`, `app_picker_progress`, `app_picker_reduce`, `app_picker_review`, `app_picker_sections`, `app_picker_sensitive_options`, `app_picker_status`, `AppCatalogEntry`, `AppEntrySection`, `AppPickerAction`, `AppPickerEvent`, `AppPickerPrimary`, `AppPickerState`, `AppPickerStep`, `AppPickerTab`
**[Window, menu bar and Settings](/cua-sdk/reference/spaces/app-core/window)**: `app_chrome_input_from_json`, `app_delete_failed_text`, `app_display_name`, `app_display_path`, `app_drop_sending_text`, `app_drop_sent_text`, `app_format_bytes`, `app_login_item_launch_plan`, `app_main_chrome`, `app_menu`, `app_menu_bar`, `app_menu_bar_with_keyvault`, `app_menu_input_from_json`, `app_openable_count`, `app_sent_file`, `app_sent_files_from_json`, `app_settings_input_from_json`, `app_settings_page`, `app_space_detail_copy`, `AppChromeInput`, `AppDeleteConfirm`, `AppDetailAction`, `AppDetailActionId`, `AppDetailCopy`, `AppFact`, `AppFactCopy`, `AppLoginItemInput`, `AppLoginItemPlan`, `AppLoginItemStatus`, `AppMainChrome`, `AppMenuInput`, `AppMenuItem`, `AppMenuItemId`, `AppSentFileInfo`, `AppSettingsInput`, `AppSettingsOption`, `AppSettingsPage`, `AppSettingsRow`, `AppSettingsRowKind`, `AppSettingsSection`, `AppSignInPhase`, `AppTelemetryInput`
@@ -107,7 +159,7 @@ pub fn app_account_app_url() -> String
**[Teleport picker grid](/cua-sdk/reference/spaces/app-core/teleport-grid)**: `app_picker_app_grid`, `app_picker_grid_primary`, `app_picker_grid_step`, `app_picker_grid_tabs`, `app_picker_remote_grid`, `app_picker_window_grid`, `AppPickerGrid`, `AppPickerGridPrimary`, `AppPickerGridTab`, `AppPickerGridTabItem`, `AppPickerTile`, `AppPickerTileIcon`, `AppPickerTileSection`, `AppPickerTileThumbnail`
-**[Teleport review](/cua-sdk/reference/spaces/app-core/teleport-review)**: `app_review_remember`, `app_review_remember_key`, `app_review_remembered`, `AppConsentItem`, `AppConsentKind`, `AppInstallCuaPrompt`, `AppPlanStepView`, `AppRememberedChoice`, `AppReviewChoice`, `AppReviewDomain`, `AppReviewToggle`, `AppReviewView`, `AppSendSource`, `AppVaultSource`
+**[Teleport review](/cua-sdk/reference/spaces/app-core/teleport-review)**: `app_review_remember`, `app_review_remember_key`, `app_review_remembered`, `AppConsentItem`, `AppConsentKind`, `AppInstallCuaPrompt`, `AppPlanStepView`, `AppRememberedChoice`, `AppReviewChoice`, `AppReviewDomain`, `AppReviewPassword`, `AppReviewToggle`, `AppReviewView`, `AppSendSource`, `AppVaultSource`
**[Keyvault](/cua-sdk/reference/spaces/app-core/keyvault)**: `app_sensitive_group_sdk`, `AppSensitiveGroup`, `AppSensitiveOption`, `KeyvaultClient`, `KeyvaultOverview`, `kv_credential_form`, `kv_duration`, `kv_labels`, `kv_overview_from_json`, `kv_passphrase_check`, `kv_prune_dismissed`, `kv_recovery_key_text`, `kv_sharing_label`, `kv_signed_in_spaces`, `kv_space_access_key`, `kv_visible_sharing_label`, `KvAccessRequest`, `KvAuditEntry`, `KvCaller`, `KvCommand`, `KvCredentialForm`, `KvDelivery`, `KvDomainCount`, `KvFavicon`, `KvFormMode`, `KvGrant`, `KvInventory`, `KvItem`, `KvItemPolicy`, `KvLabels`, `KvMethod`, `KvOutcome`, `KvPassphraseCheck`, `KvPending`, `KvRule`, `KvRuleCaller`, `KvSelector`, `KvSigning`, `KvStatus`, `KvStrength`, `KvVerification`
diff --git a/docs/content/docs/cua-sdk/reference/spaces/app-core/keyvault-screens.mdx b/docs/content/docs/cua-sdk/reference/spaces/app-core/keyvault-screens.mdx
index cdf51f50b6..2c3a72deeb 100644
--- a/docs/content/docs/cua-sdk/reference/spaces/app-core/keyvault-screens.mdx
+++ b/docs/content/docs/cua-sdk/reference/spaces/app-core/keyvault-screens.mdx
@@ -430,6 +430,8 @@ Returned by [`kv_vault_source`](#kv_vault_source).
| `newest_ms` / `newestMs` | `i64` | | When the newest was saved, Unix ms (0: none). |
| `ids` | `Vec<String>` | | Their ids, in list order. |
| `password_ids` / `passwordIds` | `Vec<String>` | | The app's saved passwords (ids), never part of `ids`: they are sent only when ticked in the review. |
+| `passwords` | [`Vec<AppVaultPassword>`](/cua-sdk/reference/spaces/app-core#appvaultpassword-record) | | The same passwords with their site and username (never a value), for the review to list and pick from. |
+| `password_picks` / `passwordPicks` | `bool` | | The daemon enforces a choice of passwords by site (`password_domains` in its status): the review may offer one. |
## `KvVaultState` record
diff --git a/docs/content/docs/cua-sdk/reference/spaces/app-core/keyvault.mdx b/docs/content/docs/cua-sdk/reference/spaces/app-core/keyvault.mdx
index 5317d687ac..c4cd9f4fb5 100644
--- a/docs/content/docs/cua-sdk/reference/spaces/app-core/keyvault.mdx
+++ b/docs/content/docs/cua-sdk/reference/spaces/app-core/keyvault.mdx
@@ -560,6 +560,7 @@ Returned by [`kv_passphrase_check`](#kv_passphrase_check).
| `unlock_protectors` / `unlockProtectors` | `Vec<String>` | | Protector kinds that can unlock this vault now (`macos-keychain`, `windows-credential`, `linux-secret-service`, `passphrase`, `recovery`). |
| `browse_until_ms` / `browseUntilMs` | `Option<u64>` | | The browse window is open until this time, Unix ms: item names are visible until then. |
| `skip_unlock_prompt` / `skipUnlockPrompt` | `Option<bool>` | | "Never ask again" on the unlock prompt is on. |
+| `features` | `Vec<String>` | | What the daemon supports beyond the original protocol (`password_domains`: it reads only the saved passwords of the sites picked for them); empty from a daemon that predates the list. |
| `reset_notice` / `resetNotice` | `Option<String>` | | An earlier preview's vault was found and set aside. |
## `KvVerification` record
diff --git a/docs/content/docs/cua-sdk/reference/spaces/app-core/new-space.mdx b/docs/content/docs/cua-sdk/reference/spaces/app-core/new-space.mdx
index 290f26d6c2..f9bc8dead4 100644
--- a/docs/content/docs/cua-sdk/reference/spaces/app-core/new-space.mdx
+++ b/docs/content/docs/cua-sdk/reference/spaces/app-core/new-space.mdx
@@ -326,6 +326,7 @@ Returned by [`app_wizard_env_from_json`](#app_wizard_env_from_json).
| `hosts` | [`Vec<AppSpaceHost>`](/cua-sdk/reference/spaces/app-core/run-on#appspacehost-record) | | The user's machines that provide Spaces (`Spaces.hosts()`). |
| `experiments` | [`AppExperiments`](/cua-sdk/reference/spaces/app-core/experiments#appexperiments-record) | | Settings, Experiments ("Your cloud" decides whether clouds show). |
| `gpus` | [`Option<Vec<AppGpuChoice>>`](#appgpuchoice-record) | | The GPU option of each runtime that has one (the SDK's `gpu_support`), when known. A runtime not listed has none: the Resources step shows no GPU row for it. |
+| `name_seed` / `nameSeed` | `Option<u64>` | | Picks the name an unnamed Space gets (`generated_space_name`); `None`: this process's own randomness. A core without randomness (the wasm build) is given one; tests give a fixed one. |
## `AppWizardFact` record
@@ -381,6 +382,8 @@ Returned by [`app_wizard_initial`](#app_wizard_initial), [`app_wizard_reduce`](#
| `host` | `Option<String>` | | The machine chosen for `Location::Host` (`SpaceHost.id`). |
| `gpu` | `bool` | | The GPU box is checked (it applies where the effective runtime offers a GPU). |
| `address` | [`AppAddressForm`](#appaddressform-record) | | The address form. |
+| `generated_name` / `generatedName` | `String` | | The name the Space gets when Name is left empty (`generated_space_name`, chosen when the wizard opens). |
+| `resource_edit` / `resourceEdit` | [`Option<AppResourceEdit>`](/cua-sdk/reference/spaces/app-core#appresourceedit-record) | | A slider's value being typed (its number was clicked). |
## `AppWizardView` record
@@ -427,7 +430,9 @@ Returned by [`app_wizard_view`](#app_wizard_view).
| `resource_facts` / `resourceFacts` | [`Vec<AppWizardFact>`](#appwizardfact-record) | | The Resources step's lines under the sliders: kind, architecture, disk (or download), available. |
| `resources_error` / `resourcesError` | `Option<String>` | | One line when the Space does not fit where it is written (blocks Continue). |
| `gpu` | [`Option<AppGpuRow>`](#appgpurow-record) | | The GPU row (Resources), where the runtime offers a GPU. |
+| `resource_edit` / `resourceEdit` | [`Option<AppResourceEditView>`](/cua-sdk/reference/spaces/app-core#appresourceeditview-record) | | A slider's value being typed: the field shows instead of its number (its error is also the field's `WizardField.error`). |
| `name` | `String` | | Name as typed. |
+| `space_name` / `spaceName` | `String` | | The name the Space gets: the one typed, else the generated one (the Name field's placeholder). |
| `name_invalid` / `nameInvalid` | `bool` | | The name breaks the DNS-label rule. |
| `name_error` / `nameError` | `Option<String>` | | Why, in one line. |
| `open_when_ready` / `openWhenReady` | `bool` | | Open when ready. |
@@ -494,6 +499,10 @@ AppStepState::Todo
.setMemory(memoryGb: UInt32)
.setDisk(diskGb: UInt32)
.resetDisk
+.editResource(field: AppResourceField)
+.setResourceText(text: String)
+.commitResource
+.cancelResource
.setGpu(on: Bool)
.setName(name: String)
.setOpenWhenReady(on: Bool)
@@ -530,6 +539,10 @@ AppWizardAction::SetCpus { cpus: u32 }
AppWizardAction::SetMemory { memory_gb: u32 }
AppWizardAction::SetDisk { disk_gb: u32 }
AppWizardAction::ResetDisk
+AppWizardAction::EditResource { field: AppResourceField }
+AppWizardAction::SetResourceText { text: String }
+AppWizardAction::CommitResource
+AppWizardAction::CancelResource
AppWizardAction::SetGpu { on: bool }
AppWizardAction::SetName { name: String }
AppWizardAction::SetOpenWhenReady { on: bool }
@@ -567,6 +580,10 @@ AppWizardAction::AddressFailed { error: String }
| `SetMemory` | Memory slider. Fields: `memory_gb: u32` |
| `SetDisk` | Disk slider (VMs whose disk can grow). Fields: `disk_gb: u32` |
| `ResetDisk` | The disk slider's Reset: back to the image's own disk. |
+| `EditResource` | A slider's number clicked: its value can be typed. Fields: `field: AppResourceField` |
+| `SetResourceText` | The typed value's text. Fields: `text: String` |
+| `CommitResource` | Return (or leaving the field): the typed value is used when it is within the slider's limits; otherwise the field stays with why. |
+| `CancelResource` | Escape: the slider's value stays. |
| `SetGpu` | The GPU checkbox. Fields: `on: bool` |
| `SetName` | Name field. Fields: `name: String` |
| `SetOpenWhenReady` | "Open when ready". Fields: `on: bool` |
diff --git a/docs/content/docs/cua-sdk/reference/spaces/app-core/teleport-review.mdx b/docs/content/docs/cua-sdk/reference/spaces/app-core/teleport-review.mdx
index 8af00de325..0e5f9db2fd 100644
--- a/docs/content/docs/cua-sdk/reference/spaces/app-core/teleport-review.mdx
+++ b/docs/content/docs/cua-sdk/reference/spaces/app-core/teleport-review.mdx
@@ -52,6 +52,9 @@ Returned by [`app_picker_review`](/cua-sdk/reference/spaces/app-core/teleport#ap
| `offers_passwords` / `offersPasswords` | `bool` | | "Also send saved passwords" shows (there are some to send). |
| `include_passwords` / `includePasswords` | `bool` | | Ticked. |
| `passwords_label` / `passwordsLabel` | `String` | | "Also send 14 saved passwords". |
+| `passwords` | [`Vec<AppReviewPassword>`](#appreviewpassword-record) | | Ticked: the saved passwords to pick from (sites with counts when reading the app, each saved password's site and username from the Keyvault; never a value), filtered by the search. |
+| `password_summary` / `passwordSummary` | `String` | | "2 of 5 sites", "2 of 5 passwords". |
+| `password_query` / `passwordQuery` | `String` | | The passwords search text. |
| `source_note` / `sourceNote` | `String` | | What the Keychain will do for this source, in a line. |
## `AppSendSource` enum
@@ -89,6 +92,8 @@ AppSendSource::Vault
| `saved` | `String` | | "saved 2 days ago". |
| `selected` | `Vec<String>` | | The items chosen to send (ids). |
| `password_ids` / `passwordIds` | `Vec<String>` | | The app's saved passwords (ids), sent only when ticked. |
+| `passwords` | [`Vec<AppVaultPassword>`](/cua-sdk/reference/spaces/app-core#appvaultpassword-record) | | The same passwords with their site and username (never a value), for the review to list. |
+| `password_picks` / `passwordPicks` | `bool` | | The Keyvault daemon enforces a choice of passwords by site (`password_domains` in its status). Without it the review offers the passwords as before (those of the chosen sites, or every saved one) and lists none to pick: it never shows a choice the daemon would not keep. |
## `AppRememberedChoice` record
@@ -139,6 +144,10 @@ Returned by [`app_review_remember`](#app_review_remember).
| `vault` | [`AppVaultSource`](#appvaultsource-record) | | The saved items. |
| `loaded` | `bool` | | The sites were asked for (a failure counts: the review then sends what the plan lists). |
| `include_passwords` / `includePasswords` | `bool` | | The saved passwords are ticked to send (off unless the user ticks them; never remembered). |
+| `password_domains` / `passwordDomains` | `Vec<String>` | | The sites whose saved passwords to send (reading the app). |
+| `password_items` / `passwordItems` | `Vec<String>` | | The saved passwords to send (ids, from the Keyvault). |
+| `password_query` / `passwordQuery` | `String` | | The passwords list's search text. |
+| `passwords_picked` / `passwordsPicked` | `bool` | | The password choice was made (the default is picked the first time the box is ticked). |
## `AppReviewDomain` record
@@ -154,6 +163,16 @@ Returned by [`app_review_remember`](#app_review_remember).
| `unavailable` | `u32` | | Cookies that cannot be read, shown greyed with `unavailable_note`. |
| `unavailable_note` / `unavailableNote` | `String` | | "3 cookies cannot be sent: Chrome protects them with ...", or empty. |
+## `AppReviewPassword` record
+
+| Field | Type | Default | Description |
+| --- | --- | --- | --- |
+| `key` | `String` | | What picking it toggles: the site (reading the app) or the item id (from the Keyvault). |
+| `site` | `String` | | The site (`github.com`), or "Saved password" when not known. |
+| `username` | `String` | | The username, when known (a saved item). |
+| `counts` | `String` | | "2 passwords" (a site of the browser); empty for one saved item. |
+| `selected` | `bool` | | Chosen to send. |
+
## `AppReviewToggle` record
| Field | Type | Default | Description |
diff --git a/docs/content/docs/cua-sdk/reference/spaces/app-core/teleport-run.mdx b/docs/content/docs/cua-sdk/reference/spaces/app-core/teleport-run.mdx
index 690fe5da87..71d989af82 100644
--- a/docs/content/docs/cua-sdk/reference/spaces/app-core/teleport-run.mdx
+++ b/docs/content/docs/cua-sdk/reference/spaces/app-core/teleport-run.mdx
@@ -33,6 +33,7 @@ Returned by [`app_picker_consent`](/cua-sdk/reference/spaces/app-core/teleport#a
| `exclude` | `Vec<String>` | | Consent items (keys) the user turned off. |
| `from_vault` / `fromVault` | `Option<Vec<String>>` | | Send these saved Keyvault items instead of reading the live app. |
| `include_passwords` / `includePasswords` | `bool` | | Also send the saved passwords (ticked in the review). |
+| `password_domains` / `passwordDomains` | `Option<Vec<String>>` | | Reading the app: the sites whose saved passwords to send (the review's per-site choice); `None` when no password is sent this way. |
## `AppTeleportPlan` record
diff --git a/docs/content/docs/cua-sdk/reference/spaces/app-core/teleport.mdx b/docs/content/docs/cua-sdk/reference/spaces/app-core/teleport.mdx
index 4fdaac0a42..cb18e5c5f0 100644
--- a/docs/content/docs/cua-sdk/reference/spaces/app-core/teleport.mdx
+++ b/docs/content/docs/cua-sdk/reference/spaces/app-core/teleport.mdx
@@ -144,8 +144,11 @@ AppPickerAction::StreamLocalSoon
.domainQuery(text: String)
.toggleItem(key: String)
.sendFrom(source: AppSendSource)
-.vaultItems(count: UInt32, newestMs: Int64, nowMs: Int64, selected: [String], passwordIds: [String])
+.vaultItems(count: UInt32, newestMs: Int64, nowMs: Int64, selected: [String], passwordIds: [String], passwords: [AppVaultPassword], passwordPicks: Bool)
.togglePasswords(value: Bool)
+.togglePassword(key: String)
+.selectShownPasswords(value: Bool)
+.passwordQuery(text: String)
.vaultSelection(selected: [String])
.confirm
.progress(event: AppTeleportRunEvent)
@@ -179,8 +182,11 @@ AppPickerEvent::SelectShownDomains { value: bool }
AppPickerEvent::DomainQuery { text: String }
AppPickerEvent::ToggleItem { key: String }
AppPickerEvent::SendFrom { source: AppSendSource }
-AppPickerEvent::VaultItems { count: u32, newest_ms: i64, now_ms: i64, selected: Vec<String>, password_ids: Vec<String> }
+AppPickerEvent::VaultItems { count: u32, newest_ms: i64, now_ms: i64, selected: Vec<String>, password_ids: Vec<String>, passwords: Vec<AppVaultPassword>, password_picks: bool }
AppPickerEvent::TogglePasswords { value: bool }
+AppPickerEvent::TogglePassword { key: String }
+AppPickerEvent::SelectShownPasswords { value: bool }
+AppPickerEvent::PasswordQuery { text: String }
AppPickerEvent::VaultSelection { selected: Vec<String> }
AppPickerEvent::Confirm
AppPickerEvent::Progress { event: AppTeleportRunEvent }
@@ -215,8 +221,11 @@ AppPickerEvent::Back
| `DomainQuery` | The sites list's search text. Fields: `text: String` |
| `ToggleItem` | Turn a consent line on or off. Fields: `key: String` |
| `SendFrom` | Where to send from. Fields: `source: AppSendSource` |
-| `VaultItems` | The app's saved Keyvault items (what the Keyvault holds for it). Fields: `count: u32`, `newest_ms: i64`, `now_ms: i64`, `selected: Vec<String>`, `password_ids: Vec<String>` |
+| `VaultItems` | The app's saved Keyvault items (what the Keyvault holds for it). Fields: `count: u32`, `newest_ms: i64`, `now_ms: i64`, `selected: Vec<String>`, `password_ids: Vec<String>`, `passwords: Vec<AppVaultPassword>`, `password_picks: bool` |
| `TogglePasswords` | Tick or untick "Also send saved passwords". Fields: `value: bool` |
+| `TogglePassword` | Pick or drop one saved password choice (a site, or a saved item's id: `ReviewPassword.key`). Fields: `key: String` |
+| `SelectShownPasswords` | Pick or drop every saved password choice the search shows. Fields: `value: bool` |
+| `PasswordQuery` | The passwords list's search text. Fields: `text: String` |
| `VaultSelection` | The chosen saved items changed. Fields: `selected: Vec<String>` |
| `Confirm` | Confirm the review. |
| `Progress` | A run event. Fields: `event: AppTeleportRunEvent` |
@@ -401,6 +410,33 @@ pub fn app_picker_consent(state: AppPickerState) -> AppTeleportConsent
**Returns** [`AppTeleportConsent`](/cua-sdk/reference/spaces/app-core/teleport-run#appteleportconsent-record)
+## `app_picker_event_from_json`
+
+A teleport picker event from JSON (fixtures, parity).
+
+<Tabs items={['Swift', 'Rust']} groupId="sdk-lang" persist>
+<Tab value="Swift">
+
+```swift
+func appPickerEventFromJson(json: String) throws -> AppPickerEvent
+```
+
+</Tab>
+<Tab value="Rust">
+
+```rust
+pub fn app_picker_event_from_json(json: String) -> Result<AppPickerEvent, CuaError>
+```
+
+</Tab>
+</Tabs>
+
+| Parameter | Type | Default |
+| --- | --- | --- |
+| `json` | `String` | required |
+
+**Returns** [`AppPickerEvent`](#apppickerevent-enum) · **Raises** [`CuaError`](/cua-sdk/reference/errors)
+
## `app_picker_initial`
"Teleport an app..." first state.
diff --git a/docs/content/docs/cua-sdk/reference/spaces/teleport-apps.mdx b/docs/content/docs/cua-sdk/reference/spaces/teleport-apps.mdx
index 1dac7b55c4..00f5008c06 100644
--- a/docs/content/docs/cua-sdk/reference/spaces/teleport-apps.mdx
+++ b/docs/content/docs/cua-sdk/reference/spaces/teleport-apps.mdx
@@ -179,6 +179,7 @@ The user's answer to the consent screen.
| `exclude` | `Vec<String>` | `[]` | Consent items (their keys) the user turned off. |
| `from_vault` / `fromVault` | `Option<Vec<String>>` | `None` | Send these saved Keyvault items (ids) instead of reading the live app: nothing is captured from the host. |
| `include_passwords` / `includePasswords` | `bool` | `false` | Also send the saved passwords: only when ticked in the review. |
+| `password_domains` / `passwordDomains` | `Option<Vec<String>>` | `None` | The sites whose saved passwords to send (the review's own choice; `None`: those of `cookie_domains`). |
## `TeleportConsentItem` record
diff --git a/docs/content/docs/cua-sdk/reference/types.mdx b/docs/content/docs/cua-sdk/reference/types.mdx
index 53358efa3f..f2c0990184 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 773 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 779 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-keyvault/src/broker.rs b/libs/cua/crates/cua-keyvault/src/broker.rs
index 727778d378..399becc700 100644
--- a/libs/cua/crates/cua-keyvault/src/broker.rs
+++ b/libs/cua/crates/cua-keyvault/src/broker.rs
@@ -240,6 +240,10 @@ pub struct ImportSpec {
/// the destination browser's own key.
#[serde(default)]
pub passwords: bool,
+ /// The registrable domains whose saved passwords to read (the review's
+ /// own per-site choice of passwords); `None`: those of `domains`.
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub password_domains: Option<Vec<String>>,
}
/// One domain a browser holds secrets for, as the inventory shows it:
@@ -760,6 +764,16 @@ pub struct TeleportOutcome {
pub expires_ms: u64,
}
+/// The [`ImportSpec::password_domains`] filter is honored: a capture
+/// reads only the saved passwords of those sites. A daemon that does not
+/// list it ignores the field and reads the passwords of `domains`, so a
+/// caller must not send a narrower choice of passwords to one.
+pub const FEATURE_PASSWORD_DOMAINS: &str = "password_domains";
+
+/// What this daemon supports beyond the original protocol
+/// ([`Status::features`]).
+pub const FEATURES: &[&str] = &[FEATURE_PASSWORD_DOMAINS];
+
/// Vault status (safe for any caller).
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct Status {
@@ -812,6 +826,10 @@ pub struct Status {
/// new one is created (one line for the UI).
#[serde(default, skip_serializing_if = "Option::is_none")]
pub reset_notice: Option<String>,
+ /// What this daemon supports beyond the original protocol
+ /// ([`FEATURES`]); empty from a daemon that predates the list.
+ #[serde(default)]
+ pub features: Vec<String>,
}
/// Creating a vault. Its `Debug` never prints the passphrase, and the
@@ -1320,6 +1338,7 @@ impl Broker {
}
_ => Vec::new(),
},
+ features: FEATURES.iter().map(|f| f.to_string()).collect(),
}
}
diff --git a/libs/cua/crates/cua-spaces-app-core/parity/create-gpu.json b/libs/cua/crates/cua-spaces-app-core/parity/create-gpu.json
index fcefdc0328..6abc6a1610 100644
--- a/libs/cua/crates/cua-spaces-app-core/parity/create-gpu.json
+++ b/libs/cua/crates/cua-spaces-app-core/parity/create-gpu.json
@@ -11,6 +11,7 @@
"docker",
"lume"
],
+ "nameSeed": 42,
"maxCpus": 8,
"hostArch": "arm64",
"gpus": [
diff --git a/libs/cua/crates/cua-spaces-app-core/parity/create-resources.json b/libs/cua/crates/cua-spaces-app-core/parity/create-resources.json
index efe73c14e9..b75a827454 100644
--- a/libs/cua/crates/cua-spaces-app-core/parity/create-resources.json
+++ b/libs/cua/crates/cua-spaces-app-core/parity/create-resources.json
@@ -1,12 +1,13 @@
{
"name": "create-resources",
- "about": "The Resources step: kind, architecture (emulated off this Mac's platform), the disk (a slider where the guest grows it) with the download and the room left where it is written, a Space that does not fit blocking Continue, the cloud tile refusing a pick while it is coming soon (its lines, sliders and price are unit-tested), the local sliders (local is free), and a grown macOS disk in the plan.",
+ "about": "The Resources step: kind, architecture (emulated off this Mac's platform), the disk (a slider where the guest grows it) with the download and the room left where it is written, a Space that does not fit blocking Continue, the cloud tile refusing a pick while it is coming soon (its lines, sliders and price are unit-tested), the local sliders (local is free), and a grown macOS disk in the plan, and a value typed into a slider's number (used within the slider's limits, refused with the slider's words outside them).",
"env": {
"defaultLocation": "local",
"cloudAvailable": true,
"localAvailable": true,
"localReason": null,
"localBackends": null,
+ "nameSeed": 42,
"maxCpus": 8,
"hostArch": "arm64",
"storage": {
@@ -68,6 +69,53 @@
"type": "set-disk",
"diskGb": 2
},
+ {
+ "type": "edit-resource",
+ "field": "disk"
+ },
+ {
+ "type": "set-resource-text",
+ "text": "9999"
+ },
+ {
+ "type": "commit-resource"
+ },
+ {
+ "type": "set-resource-text",
+ "text": "80 GB"
+ },
+ {
+ "type": "commit-resource"
+ },
+ {
+ "type": "edit-resource",
+ "field": "cpus"
+ },
+ {
+ "type": "set-resource-text",
+ "text": "99"
+ },
+ {
+ "type": "next"
+ },
+ {
+ "type": "cancel-resource"
+ },
+ {
+ "type": "edit-resource",
+ "field": "memory"
+ },
+ {
+ "type": "set-resource-text",
+ "text": "six"
+ },
+ {
+ "type": "set-resource-text",
+ "text": "6"
+ },
+ {
+ "type": "commit-resource"
+ },
{
"type": "back"
},
diff --git a/libs/cua/crates/cua-spaces-app-core/parity/create-space.json b/libs/cua/crates/cua-spaces-app-core/parity/create-space.json
index a65f93b33f..b7bc857b9b 100644
--- a/libs/cua/crates/cua-spaces-app-core/parity/create-space.json
+++ b/libs/cua/crates/cua-spaces-app-core/parity/create-space.json
@@ -9,6 +9,7 @@
"localBackends": [
"docker"
],
+ "nameSeed": 42,
"maxCpus": 8
},
"wizard": [
diff --git a/libs/cua/crates/cua-spaces-app-core/parity/experiments.json b/libs/cua/crates/cua-spaces-app-core/parity/experiments.json
index 966827691d..b69a9b4cb8 100644
--- a/libs/cua/crates/cua-spaces-app-core/parity/experiments.json
+++ b/libs/cua/crates/cua-spaces-app-core/parity/experiments.json
@@ -61,6 +61,7 @@
"localAvailable": true,
"localReason": null,
"localBackends": ["docker"],
+ "nameSeed": 42,
"maxCpus": 8,
"hostArch": "arm64",
"storage": null,
diff --git a/libs/cua/crates/cua-spaces-app-core/parity/golden/create-gpu.json b/libs/cua/crates/cua-spaces-app-core/parity/golden/create-gpu.json
index bfd7a274c6..7202783368 100644
--- a/libs/cua/crates/cua-spaces-app-core/parity/golden/create-gpu.json
+++ b/libs/cua/crates/cua-spaces-app-core/parity/golden/create-gpu.json
@@ -342,7 +342,7 @@
"cpusText": "4 cores",
"disk": "150 GB (150-1024) ~Uses about 32 GB on this Mac at first, up to 150 GB as the Space fills it. ?A VM disk cannot shrink below the image's 150 GB.",
"fields": [
- "name: Name [Optional]",
+ "name: Name [space-000000002a]",
"open-when-ready: Open when ready"
],
"gpu": "GPU acceleration (Experimental) [x] Learn more -> https://cua.ai/docs/lume/guides/gpu-passthrough",
@@ -439,11 +439,12 @@
"image": "ghcr.io/trycua/macos:26",
"kind": "vm",
"memoryMb": 8192,
+ "name": "space-000000002a",
"on": "local",
"runtime": "auto",
"spacesd": true
},
- "creating": "Creating macOS Tahoe 26. It appears in the list when it is ready.",
+ "creating": "Creating space-000000002a. It appears in the list when it is ready.",
"failed": "Could not create the Space: no macOS image is configured",
"openDesktop": true,
"summary": [
@@ -455,7 +456,7 @@
"Runtime: Lume virtual machine (Apple silicon)",
"Resources: 4 cores, 8 GB memory, 150 GB disk",
"GPU: GPU acceleration (Experimental)",
- "Name: Chosen automatically",
+ "Name: space-000000002a",
"When ready: Open the desktop"
]
}
diff --git a/libs/cua/crates/cua-spaces-app-core/parity/golden/create-resources.json b/libs/cua/crates/cua-spaces-app-core/parity/golden/create-resources.json
index b4fe799a12..ffa971becc 100644
--- a/libs/cua/crates/cua-spaces-app-core/parity/golden/create-resources.json
+++ b/libs/cua/crates/cua-spaces-app-core/parity/golden/create-resources.json
@@ -591,6 +591,744 @@
"canContinue": true,
"cpusText": "2 cores",
"disk": "20 GB (20-500) ~Uses about 1.2 GB on this Mac at first, up to 20 GB as the Space fills it. ?A VM disk cannot shrink below the image's 20 GB.",
+ "fields": [
+ "cpus: CPU cores",
+ "memory: Memory",
+ "disk: Disk"
+ ],
+ "gpu": null,
+ "image": "ghcr.io/trycua/linux:24.04-disk",
+ "imageField": {
+ "custom": false,
+ "error": null,
+ "open": false,
+ "rows": [],
+ "text": "ghcr.io/trycua/linux:24.04-disk"
+ },
+ "kinds": [
+ "container",
+ "vm"
+ ],
+ "labels": "Cancel | Back | Advanced",
+ "memoryText": "4 GB",
+ "nameInvalid": false,
+ "placement": "local",
+ "placementError": null,
+ "placements": [
+ "local"
+ ],
+ "price": null,
+ "primaryLabel": "Continue",
+ "ranges": "cpus 1-8, memory 2-16",
+ "resourceEdit": "disk: 20",
+ "resourceFacts": [
+ "Kind: Virtual machine",
+ "Architecture: ARM",
+ "Download: 1.1 GB",
+ "Available: 212 GB on Macintosh HD"
+ ],
+ "resourcesError": null,
+ "runtime": "auto",
+ "runtimes": [
+ "auto",
+ "qemu"
+ ],
+ "step": 1
+ },
+ "wizard": "edit-resource"
+ },
+ {
+ "frame": {
+ "address": {
+ "canSubmit": false,
+ "error": null,
+ "submit": null,
+ "submitLabel": "Add Space"
+ },
+ "canContinue": false,
+ "cpusText": "2 cores",
+ "disk": "20 GB (20-500) ~Uses about 1.2 GB on this Mac at first, up to 20 GB as the Space fills it. ?A VM disk cannot shrink below the image's 20 GB.",
+ "fields": [
+ "cpus: CPU cores",
+ "memory: Memory",
+ "disk: Disk !Macintosh HD has room for up to 500 GB."
+ ],
+ "gpu": null,
+ "image": "ghcr.io/trycua/linux:24.04-disk",
+ "imageField": {
+ "custom": false,
+ "error": null,
+ "open": false,
+ "rows": [],
+ "text": "ghcr.io/trycua/linux:24.04-disk"
+ },
+ "kinds": [
+ "container",
+ "vm"
+ ],
+ "labels": "Cancel | Back | Advanced",
+ "memoryText": "4 GB",
+ "nameInvalid": false,
+ "placement": "local",
+ "placementError": null,
+ "placements": [
+ "local"
+ ],
+ "price": null,
+ "primaryLabel": "Continue",
+ "ranges": "cpus 1-8, memory 2-16",
+ "resourceEdit": "disk: 9999 !Macintosh HD has room for up to 500 GB.",
+ "resourceFacts": [
+ "Kind: Virtual machine",
+ "Architecture: ARM",
+ "Download: 1.1 GB",
+ "Available: 212 GB on Macintosh HD"
+ ],
+ "resourcesError": null,
+ "runtime": "auto",
+ "runtimes": [
+ "auto",
+ "qemu"
+ ],
+ "step": 1
+ },
+ "wizard": "set-resource-text"
+ },
+ {
+ "frame": {
+ "address": {
+ "canSubmit": false,
+ "error": null,
+ "submit": null,
+ "submitLabel": "Add Space"
+ },
+ "canContinue": false,
+ "cpusText": "2 cores",
+ "disk": "20 GB (20-500) ~Uses about 1.2 GB on this Mac at first, up to 20 GB as the Space fills it. ?A VM disk cannot shrink below the image's 20 GB.",
+ "fields": [
+ "cpus: CPU cores",
+ "memory: Memory",
+ "disk: Disk !Macintosh HD has room for up to 500 GB."
+ ],
+ "gpu": null,
+ "image": "ghcr.io/trycua/linux:24.04-disk",
+ "imageField": {
+ "custom": false,
+ "error": null,
+ "open": false,
+ "rows": [],
+ "text": "ghcr.io/trycua/linux:24.04-disk"
+ },
+ "kinds": [
+ "container",
+ "vm"
+ ],
+ "labels": "Cancel | Back | Advanced",
+ "memoryText": "4 GB",
+ "nameInvalid": false,
+ "placement": "local",
+ "placementError": null,
+ "placements": [
+ "local"
+ ],
+ "price": null,
+ "primaryLabel": "Continue",
+ "ranges": "cpus 1-8, memory 2-16",
+ "resourceEdit": "disk: 9999 !Macintosh HD has room for up to 500 GB.",
+ "resourceFacts": [
+ "Kind: Virtual machine",
+ "Architecture: ARM",
+ "Download: 1.1 GB",
+ "Available: 212 GB on Macintosh HD"
+ ],
+ "resourcesError": null,
+ "runtime": "auto",
+ "runtimes": [
+ "auto",
+ "qemu"
+ ],
+ "step": 1
+ },
+ "wizard": "commit-resource"
+ },
+ {
+ "frame": {
+ "address": {
+ "canSubmit": false,
+ "error": null,
+ "submit": null,
+ "submitLabel": "Add Space"
+ },
+ "canContinue": true,
+ "cpusText": "2 cores",
+ "disk": "20 GB (20-500) ~Uses about 1.2 GB on this Mac at first, up to 20 GB as the Space fills it. ?A VM disk cannot shrink below the image's 20 GB.",
+ "fields": [
+ "cpus: CPU cores",
+ "memory: Memory",
+ "disk: Disk"
+ ],
+ "gpu": null,
+ "image": "ghcr.io/trycua/linux:24.04-disk",
+ "imageField": {
+ "custom": false,
+ "error": null,
+ "open": false,
+ "rows": [],
+ "text": "ghcr.io/trycua/linux:24.04-disk"
+ },
+ "kinds": [
+ "container",
+ "vm"
+ ],
+ "labels": "Cancel | Back | Advanced",
+ "memoryText": "4 GB",
+ "nameInvalid": false,
+ "placement": "local",
+ "placementError": null,
+ "placements": [
+ "local"
+ ],
+ "price": null,
+ "primaryLabel": "Continue",
+ "ranges": "cpus 1-8, memory 2-16",
+ "resourceEdit": "disk: 80 GB",
+ "resourceFacts": [
+ "Kind: Virtual machine",
+ "Architecture: ARM",
+ "Download: 1.1 GB",
+ "Available: 212 GB on Macintosh HD"
+ ],
+ "resourcesError": null,
+ "runtime": "auto",
+ "runtimes": [
+ "auto",
+ "qemu"
+ ],
+ "step": 1
+ },
+ "wizard": "set-resource-text"
+ },
+ {
+ "frame": {
+ "address": {
+ "canSubmit": false,
+ "error": null,
+ "submit": null,
+ "submitLabel": "Add Space"
+ },
+ "canContinue": true,
+ "cpusText": "2 cores",
+ "disk": "80 GB (20-500) [Reset] ~The disk will be resized to 80 GB after downloading. Uses about 1.2 GB on this Mac at first, up to 80 GB as the Space fills it. ?A VM disk cannot shrink below the image's 20 GB.",
+ "fields": [
+ "cpus: CPU cores",
+ "memory: Memory",
+ "disk: Disk"
+ ],
+ "gpu": null,
+ "image": "ghcr.io/trycua/linux:24.04-disk",
+ "imageField": {
+ "custom": false,
+ "error": null,
+ "open": false,
+ "rows": [],
+ "text": "ghcr.io/trycua/linux:24.04-disk"
+ },
+ "kinds": [
+ "container",
+ "vm"
+ ],
+ "labels": "Cancel | Back | Advanced",
+ "memoryText": "4 GB",
+ "nameInvalid": false,
+ "placement": "local",
+ "placementError": null,
+ "placements": [
+ "local"
+ ],
+ "price": null,
+ "primaryLabel": "Continue",
+ "ranges": "cpus 1-8, memory 2-16",
+ "resourceFacts": [
+ "Kind: Virtual machine",
+ "Architecture: ARM",
+ "Download: 1.1 GB",
+ "Available: 212 GB on Macintosh HD"
+ ],
+ "resourcesError": null,
+ "runtime": "auto",
+ "runtimes": [
+ "auto",
+ "qemu"
+ ],
+ "step": 1
+ },
+ "wizard": "commit-resource"
+ },
+ {
+ "frame": {
+ "address": {
+ "canSubmit": false,
+ "error": null,
+ "submit": null,
+ "submitLabel": "Add Space"
+ },
+ "canContinue": true,
+ "cpusText": "2 cores",
+ "disk": "80 GB (20-500) [Reset] ~The disk will be resized to 80 GB after downloading. Uses about 1.2 GB on this Mac at first, up to 80 GB as the Space fills it. ?A VM disk cannot shrink below the image's 20 GB.",
+ "fields": [
+ "cpus: CPU cores",
+ "memory: Memory",
+ "disk: Disk"
+ ],
+ "gpu": null,
+ "image": "ghcr.io/trycua/linux:24.04-disk",
+ "imageField": {
+ "custom": false,
+ "error": null,
+ "open": false,
+ "rows": [],
+ "text": "ghcr.io/trycua/linux:24.04-disk"
+ },
+ "kinds": [
+ "container",
+ "vm"
+ ],
+ "labels": "Cancel | Back | Advanced",
+ "memoryText": "4 GB",
+ "nameInvalid": false,
+ "placement": "local",
+ "placementError": null,
+ "placements": [
+ "local"
+ ],
+ "price": null,
+ "primaryLabel": "Continue",
+ "ranges": "cpus 1-8, memory 2-16",
+ "resourceEdit": "cpus: 2",
+ "resourceFacts": [
+ "Kind: Virtual machine",
+ "Architecture: ARM",
+ "Download: 1.1 GB",
+ "Available: 212 GB on Macintosh HD"
+ ],
+ "resourcesError": null,
+ "runtime": "auto",
+ "runtimes": [
+ "auto",
+ "qemu"
+ ],
+ "step": 1
+ },
+ "wizard": "edit-resource"
+ },
+ {
+ "frame": {
+ "address": {
+ "canSubmit": false,
+ "error": null,
+ "submit": null,
+ "submitLabel": "Add Space"
+ },
+ "canContinue": false,
+ "cpusText": "2 cores",
+ "disk": "80 GB (20-500) [Reset] ~The disk will be resized to 80 GB after downloading. Uses about 1.2 GB on this Mac at first, up to 80 GB as the Space fills it. ?A VM disk cannot shrink below the image's 20 GB.",
+ "fields": [
+ "cpus: CPU cores !Choose 1 to 8 cores.",
+ "memory: Memory",
+ "disk: Disk"
+ ],
+ "gpu": null,
+ "image": "ghcr.io/trycua/linux:24.04-disk",
+ "imageField": {
+ "custom": false,
+ "error": null,
+ "open": false,
+ "rows": [],
+ "text": "ghcr.io/trycua/linux:24.04-disk"
+ },
+ "kinds": [
+ "container",
+ "vm"
+ ],
+ "labels": "Cancel | Back | Advanced",
+ "memoryText": "4 GB",
+ "nameInvalid": false,
+ "placement": "local",
+ "placementError": null,
+ "placements": [
+ "local"
+ ],
+ "price": null,
+ "primaryLabel": "Continue",
+ "ranges": "cpus 1-8, memory 2-16",
+ "resourceEdit": "cpus: 99 !Choose 1 to 8 cores.",
+ "resourceFacts": [
+ "Kind: Virtual machine",
+ "Architecture: ARM",
+ "Download: 1.1 GB",
+ "Available: 212 GB on Macintosh HD"
+ ],
+ "resourcesError": null,
+ "runtime": "auto",
+ "runtimes": [
+ "auto",
+ "qemu"
+ ],
+ "step": 1
+ },
+ "wizard": "set-resource-text"
+ },
+ {
+ "frame": {
+ "address": {
+ "canSubmit": false,
+ "error": null,
+ "submit": null,
+ "submitLabel": "Add Space"
+ },
+ "canContinue": false,
+ "cpusText": "2 cores",
+ "disk": "80 GB (20-500) [Reset] ~The disk will be resized to 80 GB after downloading. Uses about 1.2 GB on this Mac at first, up to 80 GB as the Space fills it. ?A VM disk cannot shrink below the image's 20 GB.",
+ "fields": [
+ "cpus: CPU cores !Choose 1 to 8 cores.",
+ "memory: Memory",
+ "disk: Disk"
+ ],
+ "gpu": null,
+ "image": "ghcr.io/trycua/linux:24.04-disk",
+ "imageField": {
+ "custom": false,
+ "error": null,
+ "open": false,
+ "rows": [],
+ "text": "ghcr.io/trycua/linux:24.04-disk"
+ },
+ "kinds": [
+ "container",
+ "vm"
+ ],
+ "labels": "Cancel | Back | Advanced",
+ "memoryText": "4 GB",
+ "nameInvalid": false,
+ "placement": "local",
+ "placementError": null,
+ "placements": [
+ "local"
+ ],
+ "price": null,
+ "primaryLabel": "Continue",
+ "ranges": "cpus 1-8, memory 2-16",
+ "resourceEdit": "cpus: 99 !Choose 1 to 8 cores.",
+ "resourceFacts": [
+ "Kind: Virtual machine",
+ "Architecture: ARM",
+ "Download: 1.1 GB",
+ "Available: 212 GB on Macintosh HD"
+ ],
+ "resourcesError": null,
+ "runtime": "auto",
+ "runtimes": [
+ "auto",
+ "qemu"
+ ],
+ "step": 1
+ },
+ "wizard": "next"
+ },
+ {
+ "frame": {
+ "address": {
+ "canSubmit": false,
+ "error": null,
+ "submit": null,
+ "submitLabel": "Add Space"
+ },
+ "canContinue": true,
+ "cpusText": "2 cores",
+ "disk": "80 GB (20-500) [Reset] ~The disk will be resized to 80 GB after downloading. Uses about 1.2 GB on this Mac at first, up to 80 GB as the Space fills it. ?A VM disk cannot shrink below the image's 20 GB.",
+ "fields": [
+ "cpus: CPU cores",
+ "memory: Memory",
+ "disk: Disk"
+ ],
+ "gpu": null,
+ "image": "ghcr.io/trycua/linux:24.04-disk",
+ "imageField": {
+ "custom": false,
+ "error": null,
+ "open": false,
+ "rows": [],
+ "text": "ghcr.io/trycua/linux:24.04-disk"
+ },
+ "kinds": [
+ "container",
+ "vm"
+ ],
+ "labels": "Cancel | Back | Advanced",
+ "memoryText": "4 GB",
+ "nameInvalid": false,
+ "placement": "local",
+ "placementError": null,
+ "placements": [
+ "local"
+ ],
+ "price": null,
+ "primaryLabel": "Continue",
+ "ranges": "cpus 1-8, memory 2-16",
+ "resourceFacts": [
+ "Kind: Virtual machine",
+ "Architecture: ARM",
+ "Download: 1.1 GB",
+ "Available: 212 GB on Macintosh HD"
+ ],
+ "resourcesError": null,
+ "runtime": "auto",
+ "runtimes": [
+ "auto",
+ "qemu"
+ ],
+ "step": 1
+ },
+ "wizard": "cancel-resource"
+ },
+ {
+ "frame": {
+ "address": {
+ "canSubmit": false,
+ "error": null,
+ "submit": null,
+ "submitLabel": "Add Space"
+ },
+ "canContinue": true,
+ "cpusText": "2 cores",
+ "disk": "80 GB (20-500) [Reset] ~The disk will be resized to 80 GB after downloading. Uses about 1.2 GB on this Mac at first, up to 80 GB as the Space fills it. ?A VM disk cannot shrink below the image's 20 GB.",
+ "fields": [
+ "cpus: CPU cores",
+ "memory: Memory",
+ "disk: Disk"
+ ],
+ "gpu": null,
+ "image": "ghcr.io/trycua/linux:24.04-disk",
+ "imageField": {
+ "custom": false,
+ "error": null,
+ "open": false,
+ "rows": [],
+ "text": "ghcr.io/trycua/linux:24.04-disk"
+ },
+ "kinds": [
+ "container",
+ "vm"
+ ],
+ "labels": "Cancel | Back | Advanced",
+ "memoryText": "4 GB",
+ "nameInvalid": false,
+ "placement": "local",
+ "placementError": null,
+ "placements": [
+ "local"
+ ],
+ "price": null,
+ "primaryLabel": "Continue",
+ "ranges": "cpus 1-8, memory 2-16",
+ "resourceEdit": "memory: 4",
+ "resourceFacts": [
+ "Kind: Virtual machine",
+ "Architecture: ARM",
+ "Download: 1.1 GB",
+ "Available: 212 GB on Macintosh HD"
+ ],
+ "resourcesError": null,
+ "runtime": "auto",
+ "runtimes": [
+ "auto",
+ "qemu"
+ ],
+ "step": 1
+ },
+ "wizard": "edit-resource"
+ },
+ {
+ "frame": {
+ "address": {
+ "canSubmit": false,
+ "error": null,
+ "submit": null,
+ "submitLabel": "Add Space"
+ },
+ "canContinue": false,
+ "cpusText": "2 cores",
+ "disk": "80 GB (20-500) [Reset] ~The disk will be resized to 80 GB after downloading. Uses about 1.2 GB on this Mac at first, up to 80 GB as the Space fills it. ?A VM disk cannot shrink below the image's 20 GB.",
+ "fields": [
+ "cpus: CPU cores",
+ "memory: Memory !Enter a whole number.",
+ "disk: Disk"
+ ],
+ "gpu": null,
+ "image": "ghcr.io/trycua/linux:24.04-disk",
+ "imageField": {
+ "custom": false,
+ "error": null,
+ "open": false,
+ "rows": [],
+ "text": "ghcr.io/trycua/linux:24.04-disk"
+ },
+ "kinds": [
+ "container",
+ "vm"
+ ],
+ "labels": "Cancel | Back | Advanced",
+ "memoryText": "4 GB",
+ "nameInvalid": false,
+ "placement": "local",
+ "placementError": null,
+ "placements": [
+ "local"
+ ],
+ "price": null,
+ "primaryLabel": "Continue",
+ "ranges": "cpus 1-8, memory 2-16",
+ "resourceEdit": "memory: six !Enter a whole number.",
+ "resourceFacts": [
+ "Kind: Virtual machine",
+ "Architecture: ARM",
+ "Download: 1.1 GB",
+ "Available: 212 GB on Macintosh HD"
+ ],
+ "resourcesError": null,
+ "runtime": "auto",
+ "runtimes": [
+ "auto",
+ "qemu"
+ ],
+ "step": 1
+ },
+ "wizard": "set-resource-text"
+ },
+ {
+ "frame": {
+ "address": {
+ "canSubmit": false,
+ "error": null,
+ "submit": null,
+ "submitLabel": "Add Space"
+ },
+ "canContinue": true,
+ "cpusText": "2 cores",
+ "disk": "80 GB (20-500) [Reset] ~The disk will be resized to 80 GB after downloading. Uses about 1.2 GB on this Mac at first, up to 80 GB as the Space fills it. ?A VM disk cannot shrink below the image's 20 GB.",
+ "fields": [
+ "cpus: CPU cores",
+ "memory: Memory",
+ "disk: Disk"
+ ],
+ "gpu": null,
+ "image": "ghcr.io/trycua/linux:24.04-disk",
+ "imageField": {
+ "custom": false,
+ "error": null,
+ "open": false,
+ "rows": [],
+ "text": "ghcr.io/trycua/linux:24.04-disk"
+ },
+ "kinds": [
+ "container",
+ "vm"
+ ],
+ "labels": "Cancel | Back | Advanced",
+ "memoryText": "4 GB",
+ "nameInvalid": false,
+ "placement": "local",
+ "placementError": null,
+ "placements": [
+ "local"
+ ],
+ "price": null,
+ "primaryLabel": "Continue",
+ "ranges": "cpus 1-8, memory 2-16",
+ "resourceEdit": "memory: 6",
+ "resourceFacts": [
+ "Kind: Virtual machine",
+ "Architecture: ARM",
+ "Download: 1.1 GB",
+ "Available: 212 GB on Macintosh HD"
+ ],
+ "resourcesError": null,
+ "runtime": "auto",
+ "runtimes": [
+ "auto",
+ "qemu"
+ ],
+ "step": 1
+ },
+ "wizard": "set-resource-text"
+ },
+ {
+ "frame": {
+ "address": {
+ "canSubmit": false,
+ "error": null,
+ "submit": null,
+ "submitLabel": "Add Space"
+ },
+ "canContinue": true,
+ "cpusText": "2 cores",
+ "disk": "80 GB (20-500) [Reset] ~The disk will be resized to 80 GB after downloading. Uses about 1.2 GB on this Mac at first, up to 80 GB as the Space fills it. ?A VM disk cannot shrink below the image's 20 GB.",
+ "fields": [
+ "cpus: CPU cores",
+ "memory: Memory",
+ "disk: Disk"
+ ],
+ "gpu": null,
+ "image": "ghcr.io/trycua/linux:24.04-disk",
+ "imageField": {
+ "custom": false,
+ "error": null,
+ "open": false,
+ "rows": [],
+ "text": "ghcr.io/trycua/linux:24.04-disk"
+ },
+ "kinds": [
+ "container",
+ "vm"
+ ],
+ "labels": "Cancel | Back | Advanced",
+ "memoryText": "6 GB",
+ "nameInvalid": false,
+ "placement": "local",
+ "placementError": null,
+ "placements": [
+ "local"
+ ],
+ "price": null,
+ "primaryLabel": "Continue",
+ "ranges": "cpus 1-8, memory 2-16",
+ "resourceFacts": [
+ "Kind: Virtual machine",
+ "Architecture: ARM",
+ "Download: 1.1 GB",
+ "Available: 212 GB on Macintosh HD"
+ ],
+ "resourcesError": null,
+ "runtime": "auto",
+ "runtimes": [
+ "auto",
+ "qemu"
+ ],
+ "step": 1
+ },
+ "wizard": "commit-resource"
+ },
+ {
+ "frame": {
+ "address": {
+ "canSubmit": false,
+ "error": null,
+ "submit": null,
+ "submitLabel": "Add Space"
+ },
+ "canContinue": true,
+ "cpusText": "2 cores",
+ "disk": "80 GB (20-500) [Reset] ~The disk will be resized to 80 GB after downloading. Uses about 1.2 GB on this Mac at first, up to 80 GB as the Space fills it. ?A VM disk cannot shrink below the image's 20 GB.",
"fields": [
"os: System",
"image: Image [ghcr.io/org/app:tag]",
@@ -613,7 +1351,7 @@
"vm"
],
"labels": "Cancel | Back | Advanced",
- "memoryText": "4 GB",
+ "memoryText": "6 GB",
"nameInvalid": false,
"placement": "local",
"placementError": null,
@@ -1664,7 +2402,7 @@
"cpusText": "4 cores",
"disk": "200 GB (150-500) [Reset] ~The disk will be resized to 200 GB after downloading. Uses about 32 GB on this Mac at first, up to 200 GB as the Space fills it. ?A VM disk cannot shrink below the image's 150 GB.",
"fields": [
- "name: Name [Optional]",
+ "name: Name [space-000000002a]",
"open-when-ready: Open when ready"
],
"gpu": null,
@@ -1765,11 +2503,12 @@
"image": "ghcr.io/trycua/macos:26",
"kind": "vm",
"memoryMb": 8192,
+ "name": "space-000000002a",
"on": "local",
"runtime": "auto",
"spacesd": true
},
- "creating": "Creating macOS Tahoe 26. It appears in the list when it is ready.",
+ "creating": "Creating space-000000002a. It appears in the list when it is ready.",
"failed": "Could not create the Space: Not enough disk space for this Space. Free up space on this Mac (or run `cua cache prune` in Terminal), then try again.",
"openDesktop": true,
"summary": [
@@ -1780,7 +2519,7 @@
"Architecture: ARM",
"Runtime: Lume virtual machine (Apple silicon)",
"Resources: 4 cores, 8 GB memory, 200 GB disk",
- "Name: Chosen automatically",
+ "Name: space-000000002a",
"When ready: Open the desktop"
]
}
diff --git a/libs/cua/crates/cua-spaces-app-core/parity/golden/create-space.json b/libs/cua/crates/cua-spaces-app-core/parity/golden/create-space.json
index a0440155d1..45d4407efa 100644
--- a/libs/cua/crates/cua-spaces-app-core/parity/golden/create-space.json
+++ b/libs/cua/crates/cua-spaces-app-core/parity/golden/create-space.json
@@ -1732,7 +1732,7 @@
"cpusText": "4 cores",
"disk": null,
"fields": [
- "name: Name [Optional]",
+ "name: Name [space-000000002a]",
"open-when-ready: Open when ready"
],
"gpu": null,
@@ -1785,7 +1785,7 @@
"cpusText": "4 cores",
"disk": null,
"fields": [
- "name: Name [Optional] !Lowercase letters, digits and dashes",
+ "name: Name [space-000000002a] !Lowercase letters, digits and dashes",
"open-when-ready: Open when ready"
],
"gpu": null,
@@ -1838,7 +1838,7 @@
"cpusText": "4 cores",
"disk": null,
"fields": [
- "name: Name [Optional] !Lowercase letters, digits and dashes",
+ "name: Name [space-000000002a] !Lowercase letters, digits and dashes",
"open-when-ready: Open when ready"
],
"gpu": null,
@@ -1891,7 +1891,7 @@
"cpusText": "4 cores",
"disk": null,
"fields": [
- "name: Name [Optional]",
+ "name: Name [space-000000002a]",
"open-when-ready: Open when ready"
],
"gpu": null,
@@ -1944,7 +1944,7 @@
"cpusText": "4 cores",
"disk": null,
"fields": [
- "name: Name [Optional]",
+ "name: Name [space-000000002a]",
"open-when-ready: Open when ready"
],
"gpu": null,
@@ -2047,7 +2047,7 @@
"cpusText": "4 cores",
"disk": null,
"fields": [
- "name: Name [Optional]",
+ "name: Name [space-000000002a]",
"open-when-ready: Open when ready"
],
"gpu": null,
diff --git a/libs/cua/crates/cua-spaces-app-core/parity/golden/placement-picker.json b/libs/cua/crates/cua-spaces-app-core/parity/golden/placement-picker.json
index 68190d0be9..f0bf139d0d 100644
--- a/libs/cua/crates/cua-spaces-app-core/parity/golden/placement-picker.json
+++ b/libs/cua/crates/cua-spaces-app-core/parity/golden/placement-picker.json
@@ -41,7 +41,7 @@
"Runtime: Container on this Mac (gVisor when installed)",
"Resources: 2 cores, 4 GB memory",
"Disk: 2.8 GB–6.8 GB initially; grows with use",
- "Name: Chosen automatically",
+ "Name: space-000000002a",
"When ready: Open the desktop"
],
"systemsOff": []
@@ -87,7 +87,7 @@
"Runtime: Container on this Mac (gVisor when installed)",
"Resources: 2 cores, 4 GB memory",
"Disk: 2.8 GB–6.8 GB initially; grows with use",
- "Name: Chosen automatically",
+ "Name: space-000000002a",
"When ready: Open the desktop"
],
"systemsOff": []
@@ -133,7 +133,7 @@
"Runtime: Container on this Mac (gVisor when installed)",
"Resources: 2 cores, 4 GB memory",
"Disk: 2.8 GB–6.8 GB initially; grows with use",
- "Name: Chosen automatically",
+ "Name: space-000000002a",
"When ready: Open the desktop"
],
"systemsOff": []
@@ -176,7 +176,7 @@
"Kind: Container",
"Runtime: Container on Mac mini",
"Resources: 2 cores, 4 GB memory",
- "Name: Chosen automatically",
+ "Name: space-000000002a",
"When ready: Open the desktop"
],
"systemsOff": []
@@ -221,7 +221,7 @@
"Kind: Virtual machine",
"Runtime: Virtual machine on Mac mini",
"Resources: 4 cores, 8 GB memory",
- "Name: Chosen automatically",
+ "Name: space-000000002a",
"When ready: Open the desktop"
],
"systemsOff": []
@@ -264,7 +264,7 @@
"Kind: Container",
"Runtime: Container on Mac mini",
"Resources: 2 cores, 4 GB memory",
- "Name: Chosen automatically",
+ "Name: space-000000002a",
"When ready: Open the desktop"
],
"systemsOff": []
@@ -307,7 +307,7 @@
"Kind: Container",
"Runtime: Container on lab",
"Resources: 2 cores, 4 GB memory",
- "Name: Chosen automatically",
+ "Name: space-000000002a",
"When ready: Open the desktop"
],
"systemsOff": []
@@ -353,7 +353,7 @@
"Kind: Container",
"Runtime: Container on lab",
"Resources: 2 cores, 4 GB memory",
- "Name: Chosen automatically",
+ "Name: space-000000002a",
"When ready: Open the desktop"
],
"systemsOff": []
@@ -403,7 +403,7 @@
"Runtime: Container on t4g.medium",
"Cost: About $0.04/hour",
"Deletes itself: After 2 hours",
- "Name: Chosen automatically",
+ "Name: space-000000002a",
"When ready: Open the desktop"
],
"systemsOff": [
@@ -452,7 +452,7 @@
"Runtime: Container on this Mac (gVisor when installed)",
"Resources: 2 cores, 4 GB memory",
"Disk: 2.8 GB–6.8 GB initially; grows with use",
- "Name: Chosen automatically",
+ "Name: space-000000002a",
"When ready: Open the desktop"
],
"systemsOff": []
@@ -495,7 +495,7 @@
"Kind: Container",
"Runtime: Container on Mac mini",
"Resources: 2 cores, 4 GB memory",
- "Name: Chosen automatically",
+ "Name: space-000000002a",
"When ready: Open the desktop"
],
"systemsOff": []
@@ -534,7 +534,7 @@
"Kind: Container",
"Runtime: Container on Mac mini",
"Resources: 2 cores, 4 GB memory",
- "Name: Chosen automatically",
+ "Name: space-000000002a",
"When ready: Open the desktop"
],
"systemsOff": []
@@ -573,7 +573,7 @@
"Kind: Container",
"Runtime: Container on Mac mini",
"Resources: 2 cores, 4 GB memory",
- "Name: Chosen automatically",
+ "Name: space-000000002a",
"When ready: Open the desktop"
],
"systemsOff": []
@@ -609,7 +609,7 @@
"Kind: Container",
"Runtime: Container on Mac mini",
"Resources: 2 cores, 4 GB memory",
- "Name: Chosen automatically",
+ "Name: space-000000002a",
"When ready: Open the desktop"
],
"systemsOff": []
@@ -644,7 +644,7 @@
"Runtime: Container on this Mac (gVisor when installed)",
"Resources: 2 cores, 4 GB memory",
"Disk: 2.8 GB–6.8 GB initially; grows with use",
- "Name: Chosen automatically",
+ "Name: space-000000002a",
"When ready: Open the desktop"
],
"systemsOff": []
@@ -679,7 +679,7 @@
"Runtime: Container on this Mac (gVisor when installed)",
"Resources: 2 cores, 4 GB memory",
"Disk: 2.8 GB–6.8 GB initially; grows with use",
- "Name: Chosen automatically",
+ "Name: space-000000002a",
"When ready: Open the desktop"
],
"systemsOff": []
diff --git a/libs/cua/crates/cua-spaces-app-core/parity/golden/teleport-sign-ins.json b/libs/cua/crates/cua-spaces-app-core/parity/golden/teleport-sign-ins.json
index db554d7ab2..2f4dd9a98d 100644
--- a/libs/cua/crates/cua-spaces-app-core/parity/golden/teleport-sign-ins.json
+++ b/libs/cua/crates/cua-spaces-app-core/parity/golden/teleport-sign-ins.json
@@ -272,6 +272,639 @@
"entry": "com.google.Chrome",
"error": null,
"move": "app_with_state",
+ "passwords": {
+ "label": "Also send 2 saved passwords",
+ "on": false,
+ "rows": [],
+ "summary": ""
+ },
+ "permille": 0,
+ "planSensitive": [
+ "sign_ins"
+ ],
+ "report": null,
+ "review": {
+ "canConfirm": false,
+ "items": [
+ "state:Open tabs",
+ "secret:Cookies (secret)",
+ "state:Preferences"
+ ],
+ "leavesText": "28 KB leaves this Mac",
+ "needsAcknowledgement": true,
+ "needsRelayPlaintextAcknowledgement": false,
+ "title": "Teleport Google Chrome to Space B",
+ "warnings": []
+ },
+ "sections": [
+ "Apps: Google Chrome, Slack"
+ ],
+ "selectedId": "com.google.Chrome",
+ "sensitive": [],
+ "step": "consent"
+ },
+ "picker": "domains-loaded"
+ },
+ {
+ "frame": {
+ "canPlan": true,
+ "entry": "com.google.Chrome",
+ "error": null,
+ "move": "app_with_state",
+ "passwords": {
+ "label": "Also send 2 saved passwords",
+ "on": false,
+ "rows": [],
+ "summary": ""
+ },
+ "permille": 0,
+ "planSensitive": [
+ "sign_ins"
+ ],
+ "report": null,
+ "review": {
+ "canConfirm": false,
+ "items": [
+ "state:Open tabs",
+ "secret:Cookies (secret)",
+ "state:Preferences"
+ ],
+ "leavesText": "28 KB leaves this Mac",
+ "needsAcknowledgement": true,
+ "needsRelayPlaintextAcknowledgement": false,
+ "title": "Teleport Google Chrome to Space B",
+ "warnings": []
+ },
+ "sections": [
+ "Apps: Google Chrome, Slack"
+ ],
+ "selectedId": "com.google.Chrome",
+ "sensitive": [],
+ "step": "consent"
+ },
+ "picker": "vault-items"
+ },
+ {
+ "frame": {
+ "canPlan": true,
+ "entry": "com.google.Chrome",
+ "error": null,
+ "move": "app_with_state",
+ "passwords": {
+ "label": "Also send 2 saved passwords",
+ "on": true,
+ "rows": [],
+ "summary": ""
+ },
+ "permille": 0,
+ "planSensitive": [
+ "sign_ins"
+ ],
+ "report": null,
+ "review": {
+ "canConfirm": false,
+ "items": [
+ "state:Open tabs",
+ "secret:Cookies (secret)",
+ "state:Preferences"
+ ],
+ "leavesText": "28 KB leaves this Mac",
+ "needsAcknowledgement": true,
+ "needsRelayPlaintextAcknowledgement": false,
+ "title": "Teleport Google Chrome to Space B",
+ "warnings": []
+ },
+ "sections": [
+ "Apps: Google Chrome, Slack"
+ ],
+ "selectedId": "com.google.Chrome",
+ "sensitive": [],
+ "step": "consent"
+ },
+ "picker": "toggle-passwords"
+ },
+ {
+ "frame": {
+ "canPlan": true,
+ "entry": "com.google.Chrome",
+ "error": null,
+ "move": "app_with_state",
+ "passwords": {
+ "label": "Also send 2 saved passwords",
+ "on": true,
+ "rows": [],
+ "summary": ""
+ },
+ "permille": 0,
+ "planSensitive": [
+ "sign_ins"
+ ],
+ "report": null,
+ "review": {
+ "canConfirm": false,
+ "items": [
+ "state:Open tabs",
+ "secret:Cookies (secret)",
+ "state:Preferences"
+ ],
+ "leavesText": "28 KB leaves this Mac",
+ "needsAcknowledgement": true,
+ "needsRelayPlaintextAcknowledgement": false,
+ "title": "Teleport Google Chrome to Space B",
+ "warnings": []
+ },
+ "sections": [
+ "Apps: Google Chrome, Slack"
+ ],
+ "selectedId": "com.google.Chrome",
+ "sensitive": [],
+ "step": "consent"
+ },
+ "picker": "toggle-password"
+ },
+ {
+ "frame": {
+ "canPlan": true,
+ "entry": "com.google.Chrome",
+ "error": null,
+ "move": "app_with_state",
+ "passwords": {
+ "label": "Also send 2 saved passwords",
+ "on": true,
+ "rows": [
+ "bank.example (1 password) [ ]",
+ "github.com (2 passwords) [x]",
+ "google.com (1 password) [ ]"
+ ],
+ "summary": "1 of 3 sites"
+ },
+ "permille": 0,
+ "planSensitive": [
+ "sign_ins"
+ ],
+ "report": null,
+ "review": {
+ "canConfirm": false,
+ "items": [
+ "state:Open tabs",
+ "secret:Cookies (secret)",
+ "state:Preferences"
+ ],
+ "leavesText": "28 KB leaves this Mac",
+ "needsAcknowledgement": true,
+ "needsRelayPlaintextAcknowledgement": false,
+ "title": "Teleport Google Chrome to Space B",
+ "warnings": []
+ },
+ "sections": [
+ "Apps: Google Chrome, Slack"
+ ],
+ "selectedId": "com.google.Chrome",
+ "sensitive": [],
+ "step": "consent"
+ },
+ "picker": "vault-items"
+ },
+ {
+ "frame": {
+ "canPlan": true,
+ "entry": "com.google.Chrome",
+ "error": null,
+ "move": "app_with_state",
+ "passwords": {
+ "label": "Also send 2 saved passwords",
+ "on": true,
+ "rows": [
+ "bank.example (1 password) [ ]",
+ "github.com (2 passwords) [x]",
+ "google.com (1 password) [ ]"
+ ],
+ "summary": "1 of 3 sites"
+ },
+ "permille": 0,
+ "planSensitive": [
+ "sign_ins"
+ ],
+ "report": null,
+ "review": {
+ "canConfirm": false,
+ "items": [
+ "state:Open tabs",
+ "secret:Cookies (secret)",
+ "state:Preferences"
+ ],
+ "leavesText": "28 KB leaves this Mac",
+ "needsAcknowledgement": true,
+ "needsRelayPlaintextAcknowledgement": false,
+ "title": "Teleport Google Chrome to Space B",
+ "warnings": []
+ },
+ "sections": [
+ "Apps: Google Chrome, Slack"
+ ],
+ "selectedId": "com.google.Chrome",
+ "sensitive": [],
+ "step": "consent"
+ },
+ "picker": "toggle-passwords"
+ },
+ {
+ "frame": {
+ "canPlan": true,
+ "entry": "com.google.Chrome",
+ "error": null,
+ "move": "app_with_state",
+ "passwords": {
+ "label": "Also send 3 saved passwords",
+ "on": true,
+ "rows": [
+ "bank.example (1 password) [x]",
+ "github.com (2 passwords) [x]",
+ "google.com (1 password) [ ]"
+ ],
+ "summary": "2 of 3 sites"
+ },
+ "permille": 0,
+ "planSensitive": [
+ "sign_ins"
+ ],
+ "report": null,
+ "review": {
+ "canConfirm": false,
+ "items": [
+ "state:Open tabs",
+ "secret:Cookies (secret)",
+ "state:Preferences"
+ ],
+ "leavesText": "28 KB leaves this Mac",
+ "needsAcknowledgement": true,
+ "needsRelayPlaintextAcknowledgement": false,
+ "title": "Teleport Google Chrome to Space B",
+ "warnings": []
+ },
+ "sections": [
+ "Apps: Google Chrome, Slack"
+ ],
+ "selectedId": "com.google.Chrome",
+ "sensitive": [],
+ "step": "consent"
+ },
+ "picker": "toggle-password"
+ },
+ {
+ "frame": {
+ "canPlan": true,
+ "entry": "com.google.Chrome",
+ "error": null,
+ "move": "app_with_state",
+ "passwords": {
+ "label": "Also send 3 saved passwords",
+ "on": true,
+ "rows": [
+ "bank.example (1 password) [x]"
+ ],
+ "summary": "2 of 3 sites"
+ },
+ "permille": 0,
+ "planSensitive": [
+ "sign_ins"
+ ],
+ "report": null,
+ "review": {
+ "canConfirm": false,
+ "items": [
+ "state:Open tabs",
+ "secret:Cookies (secret)",
+ "state:Preferences"
+ ],
+ "leavesText": "28 KB leaves this Mac",
+ "needsAcknowledgement": true,
+ "needsRelayPlaintextAcknowledgement": false,
+ "title": "Teleport Google Chrome to Space B",
+ "warnings": []
+ },
+ "sections": [
+ "Apps: Google Chrome, Slack"
+ ],
+ "selectedId": "com.google.Chrome",
+ "sensitive": [],
+ "step": "consent"
+ },
+ "picker": "password-query"
+ },
+ {
+ "frame": {
+ "canPlan": true,
+ "entry": "com.google.Chrome",
+ "error": null,
+ "move": "app_with_state",
+ "passwords": {
+ "label": "Also send 2 saved passwords",
+ "on": true,
+ "rows": [
+ "bank.example (1 password) [ ]"
+ ],
+ "summary": "1 of 3 sites"
+ },
+ "permille": 0,
+ "planSensitive": [
+ "sign_ins"
+ ],
+ "report": null,
+ "review": {
+ "canConfirm": false,
+ "items": [
+ "state:Open tabs",
+ "secret:Cookies (secret)",
+ "state:Preferences"
+ ],
+ "leavesText": "28 KB leaves this Mac",
+ "needsAcknowledgement": true,
+ "needsRelayPlaintextAcknowledgement": false,
+ "title": "Teleport Google Chrome to Space B",
+ "warnings": []
+ },
+ "sections": [
+ "Apps: Google Chrome, Slack"
+ ],
+ "selectedId": "com.google.Chrome",
+ "sensitive": [],
+ "step": "consent"
+ },
+ "picker": "select-shown-passwords"
+ },
+ {
+ "frame": {
+ "canPlan": true,
+ "entry": "com.google.Chrome",
+ "error": null,
+ "move": "app_with_state",
+ "passwords": {
+ "label": "Also send 2 saved passwords",
+ "on": true,
+ "rows": [
+ "bank.example (1 password) [ ]",
+ "github.com (2 passwords) [x]",
+ "google.com (1 password) [ ]"
+ ],
+ "summary": "1 of 3 sites"
+ },
+ "permille": 0,
+ "planSensitive": [
+ "sign_ins"
+ ],
+ "report": null,
+ "review": {
+ "canConfirm": false,
+ "items": [
+ "state:Open tabs",
+ "secret:Cookies (secret)",
+ "state:Preferences"
+ ],
+ "leavesText": "28 KB leaves this Mac",
+ "needsAcknowledgement": true,
+ "needsRelayPlaintextAcknowledgement": false,
+ "title": "Teleport Google Chrome to Space B",
+ "warnings": []
+ },
+ "sections": [
+ "Apps: Google Chrome, Slack"
+ ],
+ "selectedId": "com.google.Chrome",
+ "sensitive": [],
+ "step": "consent"
+ },
+ "picker": "password-query"
+ },
+ {
+ "frame": {
+ "canPlan": true,
+ "entry": "com.google.Chrome",
+ "error": null,
+ "move": "app_with_state",
+ "passwords": {
+ "label": "Also send 2 saved passwords",
+ "on": true,
+ "rows": [
+ "bank.example (1 password) [ ]",
+ "github.com (2 passwords) [x]",
+ "google.com (1 password) [ ]"
+ ],
+ "summary": "1 of 3 sites"
+ },
+ "permille": 0,
+ "planSensitive": [
+ "sign_ins"
+ ],
+ "report": null,
+ "review": {
+ "canConfirm": false,
+ "items": [
+ "state:Open tabs",
+ "secret:Cookies (secret)",
+ "state:Preferences"
+ ],
+ "leavesText": "28 KB leaves this Mac",
+ "needsAcknowledgement": true,
+ "needsRelayPlaintextAcknowledgement": false,
+ "title": "Teleport Google Chrome to Space B",
+ "warnings": []
+ },
+ "sections": [
+ "Apps: Google Chrome, Slack"
+ ],
+ "selectedId": "com.google.Chrome",
+ "sensitive": [],
+ "step": "consent"
+ },
+ "picker": "vault-items"
+ },
+ {
+ "frame": {
+ "canPlan": true,
+ "entry": "com.google.Chrome",
+ "error": null,
+ "move": "app_with_state",
+ "passwords": {
+ "label": "Also send 2 saved passwords",
+ "on": true,
+ "rows": [
+ "github.com octocat () [x]",
+ "google.com [email protected] () [x]"
+ ],
+ "summary": "2 of 2 passwords"
+ },
+ "permille": 0,
+ "planSensitive": [
+ "sign_ins"
+ ],
+ "report": null,
+ "review": {
+ "canConfirm": false,
+ "items": [
+ "state:Open tabs",
+ "secret:Cookies (secret)",
+ "state:Preferences"
+ ],
+ "leavesText": "1 saved item from the Keyvault",
+ "needsAcknowledgement": true,
+ "needsRelayPlaintextAcknowledgement": false,
+ "title": "Teleport Google Chrome to Space B",
+ "warnings": []
+ },
+ "sections": [
+ "Apps: Google Chrome, Slack"
+ ],
+ "selectedId": "com.google.Chrome",
+ "sensitive": [],
+ "step": "consent"
+ },
+ "picker": "send-from"
+ },
+ {
+ "frame": {
+ "canPlan": true,
+ "entry": "com.google.Chrome",
+ "error": null,
+ "move": "app_with_state",
+ "passwords": {
+ "label": "Also send 1 saved password",
+ "on": true,
+ "rows": [
+ "github.com octocat () [x]",
+ "google.com [email protected] () [ ]"
+ ],
+ "summary": "1 of 2 passwords"
+ },
+ "permille": 0,
+ "planSensitive": [
+ "sign_ins"
+ ],
+ "report": null,
+ "review": {
+ "canConfirm": false,
+ "items": [
+ "state:Open tabs",
+ "secret:Cookies (secret)",
+ "state:Preferences"
+ ],
+ "leavesText": "1 saved item from the Keyvault",
+ "needsAcknowledgement": true,
+ "needsRelayPlaintextAcknowledgement": false,
+ "title": "Teleport Google Chrome to Space B",
+ "warnings": []
+ },
+ "sections": [
+ "Apps: Google Chrome, Slack"
+ ],
+ "selectedId": "com.google.Chrome",
+ "sensitive": [],
+ "step": "consent"
+ },
+ "picker": "toggle-password"
+ },
+ {
+ "frame": {
+ "canPlan": true,
+ "entry": "com.google.Chrome",
+ "error": null,
+ "move": "app_with_state",
+ "passwords": {
+ "label": "Also send 2 saved passwords",
+ "on": true,
+ "rows": [
+ "bank.example (1 password) [ ]",
+ "github.com (2 passwords) [x]",
+ "google.com (1 password) [ ]"
+ ],
+ "summary": "1 of 3 sites"
+ },
+ "permille": 0,
+ "planSensitive": [
+ "sign_ins"
+ ],
+ "report": null,
+ "review": {
+ "canConfirm": false,
+ "items": [
+ "state:Open tabs",
+ "secret:Cookies (secret)",
+ "state:Preferences"
+ ],
+ "leavesText": "28 KB leaves this Mac",
+ "needsAcknowledgement": true,
+ "needsRelayPlaintextAcknowledgement": false,
+ "title": "Teleport Google Chrome to Space B",
+ "warnings": []
+ },
+ "sections": [
+ "Apps: Google Chrome, Slack"
+ ],
+ "selectedId": "com.google.Chrome",
+ "sensitive": [],
+ "step": "consent"
+ },
+ "picker": "send-from"
+ },
+ {
+ "frame": {
+ "canPlan": true,
+ "entry": "com.google.Chrome",
+ "error": null,
+ "move": "app_with_state",
+ "passwords": {
+ "label": "Also send 3 saved passwords",
+ "on": true,
+ "rows": [
+ "bank.example (1 password) [x]",
+ "github.com (2 passwords) [x]",
+ "google.com (1 password) [ ]"
+ ],
+ "summary": "2 of 3 sites"
+ },
+ "permille": 0,
+ "planSensitive": [
+ "sign_ins"
+ ],
+ "report": null,
+ "review": {
+ "canConfirm": false,
+ "items": [
+ "state:Open tabs",
+ "secret:Cookies (secret)",
+ "state:Preferences"
+ ],
+ "leavesText": "28 KB leaves this Mac",
+ "needsAcknowledgement": true,
+ "needsRelayPlaintextAcknowledgement": false,
+ "title": "Teleport Google Chrome to Space B",
+ "warnings": []
+ },
+ "sections": [
+ "Apps: Google Chrome, Slack"
+ ],
+ "selectedId": "com.google.Chrome",
+ "sensitive": [],
+ "step": "consent"
+ },
+ "picker": "toggle-password"
+ },
+ {
+ "frame": {
+ "canPlan": true,
+ "entry": "com.google.Chrome",
+ "error": null,
+ "move": "app_with_state",
+ "passwords": {
+ "label": "Also send 3 saved passwords",
+ "on": true,
+ "rows": [
+ "bank.example (1 password) [x]",
+ "github.com (2 passwords) [x]",
+ "google.com (1 password) [ ]"
+ ],
+ "summary": "2 of 3 sites"
+ },
"permille": 0,
"planSensitive": [
"sign_ins"
@@ -305,6 +938,16 @@
"entry": "com.google.Chrome",
"error": null,
"move": "app_with_state",
+ "passwords": {
+ "label": "Also send 3 saved passwords",
+ "on": true,
+ "rows": [
+ "bank.example (1 password) [x]",
+ "github.com (2 passwords) [x]",
+ "google.com (1 password) [ ]"
+ ],
+ "summary": "2 of 3 sites"
+ },
"permille": 0,
"planSensitive": [
"sign_ins"
@@ -338,6 +981,16 @@
"entry": "com.google.Chrome",
"error": null,
"move": "app_with_state",
+ "passwords": {
+ "label": "Also send 3 saved passwords",
+ "on": true,
+ "rows": [
+ "bank.example (1 password) [x]",
+ "github.com (2 passwords) [x]",
+ "google.com (1 password) [ ]"
+ ],
+ "summary": "2 of 3 sites"
+ },
"permille": 0,
"planSensitive": [
"sign_ins"
@@ -371,6 +1024,16 @@
"entry": "com.google.Chrome",
"error": null,
"move": "app_with_state",
+ "passwords": {
+ "label": "Also send 3 saved passwords",
+ "on": true,
+ "rows": [
+ "bank.example (1 password) [x]",
+ "github.com (2 passwords) [x]",
+ "google.com (1 password) [ ]"
+ ],
+ "summary": "2 of 3 sites"
+ },
"permille": 0,
"planSensitive": [
"sign_ins"
@@ -403,6 +1066,14 @@
"acknowledgeRelayPlaintext": false,
"acknowledgeSensitive": true,
"approved": true,
+ "cookieDomains": [
+ "github.com"
+ ],
+ "includePasswords": true,
+ "passwordDomains": [
+ "bank.example",
+ "github.com"
+ ],
"saveToKeyvault": false
}
}
diff --git a/libs/cua/crates/cua-spaces-app-core/parity/golden/your-cloud.json b/libs/cua/crates/cua-spaces-app-core/parity/golden/your-cloud.json
index be2626e421..846f0e575c 100644
--- a/libs/cua/crates/cua-spaces-app-core/parity/golden/your-cloud.json
+++ b/libs/cua/crates/cua-spaces-app-core/parity/golden/your-cloud.json
@@ -38,7 +38,7 @@
"Runtime: Container on this Mac (gVisor when installed)",
"Resources: 2 cores, 4 GB memory",
"Disk: 2.8 GB–6.8 GB initially; grows with use",
- "Name: Chosen automatically",
+ "Name: space-000000002a",
"When ready: Open the desktop"
],
"systemsOff": []
@@ -81,7 +81,7 @@
"Runtime: Container on this Mac (gVisor when installed)",
"Resources: 2 cores, 4 GB memory",
"Disk: 2.8 GB–6.8 GB initially; grows with use",
- "Name: Chosen automatically",
+ "Name: space-000000002a",
"When ready: Open the desktop"
],
"systemsOff": []
@@ -537,7 +537,7 @@
"Runtime: Container on t4g.medium",
"Cost: About $0.04/hour",
"Deletes itself: After 2 hours",
- "Name: Chosen automatically",
+ "Name: space-000000002a",
"When ready: Open the desktop"
],
"systemsOff": [
@@ -578,7 +578,7 @@
"Runtime: Container on t4g.medium",
"Cost: About $0.04/hour",
"Deletes itself: After 2 hours",
- "Name: Chosen automatically",
+ "Name: space-000000002a",
"When ready: Open the desktop"
],
"systemsOff": [
@@ -622,7 +622,7 @@
"Runtime: Container on t4g.medium",
"Cost: About $0.04/hour",
"Deletes itself: After 2 hours",
- "Name: Chosen automatically",
+ "Name: space-000000002a",
"When ready: Open the desktop"
],
"systemsOff": [
@@ -663,7 +663,7 @@
"Runtime: Container on t4g.medium",
"Cost: About $0.04/hour",
"Deletes itself: After 2 hours",
- "Name: Chosen automatically",
+ "Name: space-000000002a",
"When ready: Open the desktop"
],
"systemsOff": [
@@ -708,7 +708,7 @@
"Runtime: Container on t4g.medium",
"Cost: About $0.04/hour",
"Deletes itself: After 2 hours",
- "Name: Chosen automatically",
+ "Name: space-000000002a",
"When ready: Open the desktop"
],
"systemsOff": [
@@ -753,7 +753,7 @@
"Runtime: Container on 2 CPU, 4 GiB",
"Cost: About $0.10/hour",
"Deletes itself: After 2 hours",
- "Name: Chosen automatically",
+ "Name: space-000000002a",
"When ready: Open the desktop"
],
"systemsOff": [
@@ -797,7 +797,7 @@
"Runtime: Container on this Mac (gVisor when installed)",
"Resources: 2 cores, 4 GB memory",
"Disk: 2.8 GB–6.8 GB initially; grows with use",
- "Name: Chosen automatically",
+ "Name: space-000000002a",
"When ready: Open the desktop"
],
"systemsOff": []
diff --git a/libs/cua/crates/cua-spaces-app-core/parity/placement-picker.json b/libs/cua/crates/cua-spaces-app-core/parity/placement-picker.json
index cbe7ce4048..c5c66cfa13 100644
--- a/libs/cua/crates/cua-spaces-app-core/parity/placement-picker.json
+++ b/libs/cua/crates/cua-spaces-app-core/parity/placement-picker.json
@@ -7,6 +7,7 @@
"localAvailable": true,
"localReason": null,
"localBackends": ["docker", "lume"],
+ "nameSeed": 42,
"maxCpus": 8,
"hostArch": "arm64",
"storage": null,
diff --git a/libs/cua/crates/cua-spaces-app-core/parity/teleport-sign-ins.json b/libs/cua/crates/cua-spaces-app-core/parity/teleport-sign-ins.json
index bfaccc56ae..3945afedb4 100644
--- a/libs/cua/crates/cua-spaces-app-core/parity/teleport-sign-ins.json
+++ b/libs/cua/crates/cua-spaces-app-core/parity/teleport-sign-ins.json
@@ -1,6 +1,6 @@
{
"name": "teleport-sign-ins",
- "about": "The signed-in state move's opt-ins: \"Keep me signed in\" (the session cookies) and the separate, unchecked \"Saved passwords\" and \"Browsing history\"; an app that offers none shows none.",
+ "about": "The signed-in state move's opt-ins: \"Keep me signed in\" (the session cookies) and the separate, unchecked \"Saved passwords\" and \"Browsing history\"; an app that offers none shows none. Ticking \"Saved passwords\" in the review lists them to pick, like the sites: reading the app, its sites with counts (starting from the sites kept signed in); from the Keyvault, each saved password's site and username, never a value. A Keyvault daemon that does not advertise password_domains gets no picker: the chosen sites' passwords, as before.",
"spaceName": "Space B",
"entries": [
{
@@ -157,6 +157,140 @@
{
"type": "planned"
},
+ {
+ "type": "domains-loaded",
+ "inventory": {
+ "provider_id": "chrome",
+ "app_display": "Google Chrome",
+ "domains": [
+ {
+ "domain": "github.com",
+ "cookies": 12,
+ "session_cookies": 0,
+ "local_storage": 0,
+ "passwords": 2,
+ "signin": true,
+ "identity_provider": false,
+ "unavailable": 0,
+ "unavailable_reason": ""
+ },
+ {
+ "domain": "google.com",
+ "cookies": 30,
+ "session_cookies": 0,
+ "local_storage": 0,
+ "passwords": 1,
+ "signin": true,
+ "identity_provider": true,
+ "unavailable": 0,
+ "unavailable_reason": ""
+ },
+ {
+ "domain": "bank.example",
+ "cookies": 0,
+ "session_cookies": 0,
+ "local_storage": 0,
+ "passwords": 1,
+ "signin": false,
+ "identity_provider": false,
+ "unavailable": 0,
+ "unavailable_reason": ""
+ }
+ ],
+ "notes": []
+ },
+ "remembered": null
+ },
+ {
+ "type": "vault-items",
+ "count": 0,
+ "newestMs": 0,
+ "nowMs": 1800000000000,
+ "selected": [],
+ "passwordIds": [],
+ "passwords": [],
+ "passwordPicks": false
+ },
+ {
+ "type": "toggle-passwords",
+ "value": true
+ },
+ {
+ "type": "toggle-password",
+ "key": "bank.example"
+ },
+ {
+ "type": "vault-items",
+ "count": 0,
+ "newestMs": 0,
+ "nowMs": 1800000000000,
+ "selected": [],
+ "passwordIds": [],
+ "passwords": [],
+ "passwordPicks": true
+ },
+ {
+ "type": "toggle-passwords",
+ "value": true
+ },
+ {
+ "type": "toggle-password",
+ "key": "bank.example"
+ },
+ {
+ "type": "password-query",
+ "text": "bank"
+ },
+ {
+ "type": "select-shown-passwords",
+ "value": false
+ },
+ {
+ "type": "password-query",
+ "text": ""
+ },
+ {
+ "type": "vault-items",
+ "count": 1,
+ "newestMs": 1800000000000,
+ "nowMs": 1800000000000,
+ "selected": [
+ "c1"
+ ],
+ "passwordIds": [
+ "p1",
+ "p2"
+ ],
+ "passwords": [
+ {
+ "id": "p1",
+ "site": "github.com",
+ "username": "octocat"
+ },
+ {
+ "id": "p2",
+ "site": "https://accounts.google.com/",
+ "username": "[email protected]"
+ }
+ ],
+ "passwordPicks": true
+ },
+ {
+ "type": "send-from",
+ "source": "vault"
+ },
+ {
+ "type": "toggle-password",
+ "key": "p2"
+ },
+ {
+ "type": "send-from",
+ "source": "live"
+ },
+ {
+ "type": "toggle-password",
+ "key": "bank.example"
+ },
{
"type": "confirm"
},
diff --git a/libs/cua/crates/cua-spaces-app-core/parity/your-cloud.json b/libs/cua/crates/cua-spaces-app-core/parity/your-cloud.json
index fa8912f093..a3fd6cb2a0 100644
--- a/libs/cua/crates/cua-spaces-app-core/parity/your-cloud.json
+++ b/libs/cua/crates/cua-spaces-app-core/parity/your-cloud.json
@@ -7,6 +7,7 @@
"localAvailable": true,
"localReason": null,
"localBackends": ["docker"],
+ "nameSeed": 42,
"maxCpus": 8,
"hostArch": "arm64",
"storage": null,
diff --git a/libs/cua/crates/cua-spaces-app-core/src/keyvault/credential.rs b/libs/cua/crates/cua-spaces-app-core/src/keyvault/credential.rs
index a6b41ea921..2bf65c4a33 100644
--- a/libs/cua/crates/cua-spaces-app-core/src/keyvault/credential.rs
+++ b/libs/cua/crates/cua-spaces-app-core/src/keyvault/credential.rs
@@ -289,6 +289,7 @@ mod tests {
KeyvaultOverview {
availability: availability.into(),
status: Some(KvStatus {
+ features: vec![],
version: "0".into(),
initialized: availability != "no_vault",
unlocked: availability == "ready",
diff --git a/libs/cua/crates/cua-spaces-app-core/src/keyvault/vault.rs b/libs/cua/crates/cua-spaces-app-core/src/keyvault/vault.rs
index 33e68f6b56..f49479bd1a 100644
--- a/libs/cua/crates/cua-spaces-app-core/src/keyvault/vault.rs
+++ b/libs/cua/crates/cua-spaces-app-core/src/keyvault/vault.rs
@@ -831,6 +831,14 @@ pub struct KvVaultSource {
/// only when ticked in the review.
#[serde(default)]
pub password_ids: Vec<String>,
+ /// The same passwords with their site and username (never a value),
+ /// for the review to list and pick from.
+ #[serde(default)]
+ pub passwords: Vec<crate::teleport::review::VaultPassword>,
+ /// The daemon enforces a choice of passwords by site
+ /// (`password_domains` in its status): the review may offer one.
+ #[serde(default)]
+ pub password_picks: bool,
}
/// The saved items of `provider_id` a teleport can send.
@@ -840,17 +848,27 @@ pub fn vault_source(o: &KeyvaultOverview, provider_id: &str) -> KvVaultSource {
..Default::default()
};
let all = shown(o, &state);
- let password_ids: Vec<String> = all
+ let passwords: Vec<crate::teleport::review::VaultPassword> = all
.iter()
.filter(|i| KvKind::from_wire(&i.kind) == KvKind::Password)
- .map(|i| i.id.clone())
+ .map(|i| crate::teleport::review::VaultPassword {
+ id: i.id.clone(),
+ site: i.domain.as_deref().map(site_of).unwrap_or_default(),
+ username: i.key.clone(),
+ })
.collect();
+ let password_ids: Vec<String> = passwords.iter().map(|p| p.id.clone()).collect();
let items: Vec<&KvItem> = all
.into_iter()
.filter(|i| KvKind::from_wire(&i.kind) != KvKind::Password)
.collect();
KvVaultSource {
password_ids,
+ passwords,
+ password_picks: o
+ .status
+ .as_ref()
+ .is_some_and(|s| s.features.iter().any(|f| f == "password_domains")),
count: items.len() as u32,
newest_ms: items.iter().map(|i| i.updated_ms as i64).max().unwrap_or(0),
ids: items.iter().map(|i| i.id.clone()).collect(),
@@ -1327,6 +1345,7 @@ mod tests {
}
// "Never ask again" skips the prompt, never the Touch ID check.
o.status = Some(KvStatus {
+ features: vec![],
version: "0".into(),
initialized: true,
unlocked: true,
@@ -1455,6 +1474,24 @@ mod tests {
assert_eq!(src.newest_ms, (NOW - 120_000));
assert_eq!(vault_source(&o, "slack").count, 2);
assert_eq!(vault_source(&o, "arc"), KvVaultSource::default());
+ // Its saved passwords by site and username (never a value), and a
+ // choice of them only from a daemon that enforces one.
+ assert!(
+ src.passwords
+ .iter()
+ .all(|p| src.password_ids.contains(&p.id))
+ );
+ assert!(!src.password_picks, "an older daemon lists no features");
+ let mut newer = o.clone();
+ newer.status = Some(KvStatus {
+ features: vec!["password_domains".into()],
+ ..serde_json::from_value(serde_json::json!({
+ "version": "1", "initialized": true, "unlocked": true, "disabled": false,
+ "caller_first_party": true, "caller_display": "Cua", "items": 9, "pending": 0,
+ }))
+ .unwrap()
+ });
+ assert!(vault_source(&newer, "chrome").password_picks);
}
#[test]
diff --git a/libs/cua/crates/cua-spaces-app-core/src/keyvault/view.rs b/libs/cua/crates/cua-spaces-app-core/src/keyvault/view.rs
index e31a9d44ab..a1fa23926d 100644
--- a/libs/cua/crates/cua-spaces-app-core/src/keyvault/view.rs
+++ b/libs/cua/crates/cua-spaces-app-core/src/keyvault/view.rs
@@ -986,6 +986,7 @@ mod host_words_tests {
KeyvaultOverview {
availability: "locked".into(),
status: Some(KvStatus {
+ features: vec![],
version: "1".into(),
initialized: true,
unlocked: false,
diff --git a/libs/cua/crates/cua-spaces-app-core/src/keyvault/wire.rs b/libs/cua/crates/cua-spaces-app-core/src/keyvault/wire.rs
index 3f614c1095..9c7a6da117 100644
--- a/libs/cua/crates/cua-spaces-app-core/src/keyvault/wire.rs
+++ b/libs/cua/crates/cua-spaces-app-core/src/keyvault/wire.rs
@@ -416,6 +416,11 @@ pub struct KvStatus {
/// "Never ask again" on the unlock prompt is on.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub skip_unlock_prompt: Option<bool>,
+ /// What the daemon supports beyond the original protocol
+ /// (`password_domains`: it reads only the saved passwords of the sites
+ /// picked for them); empty from a daemon that predates the list.
+ #[serde(default, skip_serializing_if = "Vec::is_empty")]
+ pub features: Vec<String>,
/// An earlier preview's vault was found and set aside.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub reset_notice: Option<String>,
diff --git a/libs/cua/crates/cua-spaces-app-core/src/machines.rs b/libs/cua/crates/cua-spaces-app-core/src/machines.rs
index 448b98869b..71909fe995 100644
--- a/libs/cua/crates/cua-spaces-app-core/src/machines.rs
+++ b/libs/cua/crates/cua-spaces-app-core/src/machines.rs
@@ -974,6 +974,7 @@ mod tests {
clouds: vec![],
experiments: crate::experiments::Experiments::default(),
gpus: None,
+ name_seed: None,
};
let state = wizard::initial(&env);
let offered: Vec<String> = wizard::placement_options(&state, &env)
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 bdab78ec47..83318a3446 100644
--- a/libs/cua/crates/cua-spaces-app-core/src/parity.rs
+++ b/libs/cua/crates/cua-spaces-app-core/src/parity.rs
@@ -334,7 +334,7 @@ pub mod frame {
},
})
};
- json!({
+ let mut out = json!({
"step": view["step"],
"canContinue": view["canContinue"],
"primaryLabel": view["primaryLabel"],
@@ -380,7 +380,21 @@ pub mod frame {
"fields": view["fields"].as_array().map(|a| a.iter().map(field).collect::<Vec<_>>()).unwrap_or_default(),
"imageField": image_field,
"address": address,
- })
+ });
+ // A slider's value being typed: `cpus: 9 !Choose 1 to 8 cores.`
+ // (only while one is).
+ if let Some(e) = view["resourceEdit"].as_object() {
+ out["resourceEdit"] = Value::String(format!(
+ "{}: {}{}",
+ e["field"].as_str().unwrap_or(""),
+ e["text"].as_str().unwrap_or(""),
+ e["error"]
+ .as_str()
+ .map(|m| format!(" !{m}"))
+ .unwrap_or_default()
+ ));
+ }
+ out
}
fn str_of(v: &Value) -> &str {
@@ -1186,7 +1200,7 @@ pub mod frame {
sensitive: &Value,
plan_sensitive: &Value,
) -> Value {
- json!({
+ let mut out = json!({
"step": state["step"],
"selectedId": state["selectedId"],
"entry": state["entry"]["id"],
@@ -1213,7 +1227,20 @@ pub mod frame {
o["group"].as_str().unwrap_or(""), o["label"].as_str().unwrap_or(""),
o["detail"].as_str().unwrap_or(""), if o["checked"] == true { "on" } else { "off" }))).collect::<Vec<_>>()).unwrap_or_default(),
"planSensitive": plan_sensitive,
- })
+ });
+ // Saved passwords, while the review offers them: the box's label
+ // and, ticked, `site user (counts) [x]` per choice.
+ if review["offersPasswords"] == true {
+ out["passwords"] = json!({
+ "label": review["passwordsLabel"],
+ "on": review["includePasswords"],
+ "summary": review["passwordSummary"],
+ "rows": review["passwords"].as_array().map(|a| a.iter().map(|p| Value::String(format!("{} {} ({}) [{}]",
+ p["site"].as_str().unwrap_or(""), p["username"].as_str().unwrap_or(""),
+ p["counts"].as_str().unwrap_or(""), if p["selected"] == true { "x" } else { " " }))).collect::<Vec<_>>()).unwrap_or_default(),
+ });
+ }
+ out
}
/// After each notch event.
diff --git a/libs/cua/crates/cua-spaces-app-core/src/teleport/flow.rs b/libs/cua/crates/cua-spaces-app-core/src/teleport/flow.rs
index 826954f5bf..ace09b0a12 100644
--- a/libs/cua/crates/cua-spaces-app-core/src/teleport/flow.rs
+++ b/libs/cua/crates/cua-spaces-app-core/src/teleport/flow.rs
@@ -10,7 +10,10 @@
//! webview uses; `json` carries the SDK's own JSON for the entry or plan so
//! the shell can hand it back to `plan` / `run` untouched.
-use super::review::{self, ReviewChoice, ReviewDomain, ReviewToggle, SendSource, VaultSource};
+use super::review::{
+ self, ReviewChoice, ReviewDomain, ReviewPassword, ReviewToggle, SendSource, VaultPassword,
+ VaultSource,
+};
use crate::keyvault::wire::KvInventory;
use crate::util::{contains_word, to_fixed};
use serde::{Deserialize, Serialize};
@@ -317,6 +320,10 @@ pub struct Consent {
/// Also send the saved passwords (ticked in the review).
#[serde(default, skip_serializing_if = "is_false")]
pub include_passwords: bool,
+ /// Reading the app: the sites whose saved passwords to send (the
+ /// review's per-site choice); `None` when no password is sent this way.
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub password_domains: Option<Vec<String>>,
}
fn is_false(b: &bool) -> bool {
@@ -594,12 +601,36 @@ pub enum PickerEvent {
/// The app's saved passwords (ids): sent only when ticked.
#[serde(default)]
password_ids: Vec<String>,
+ /// The same passwords with their site and username (never a
+ /// value), for the review to list.
+ #[serde(default)]
+ passwords: Vec<VaultPassword>,
+ /// The Keyvault daemon enforces a choice of passwords by site
+ /// (`password_domains` in its status); off for an older one.
+ #[serde(default)]
+ password_picks: bool,
},
/// Tick or untick "Also send saved passwords".
TogglePasswords {
/// Ticked.
value: bool,
},
+ /// Pick or drop one saved password choice (a site, or a saved item's
+ /// id: [`ReviewPassword::key`]).
+ TogglePassword {
+ /// The choice.
+ key: String,
+ },
+ /// Pick or drop every saved password choice the search shows.
+ SelectShownPasswords {
+ /// Pick (true) or drop.
+ value: bool,
+ },
+ /// The passwords list's search text.
+ PasswordQuery {
+ /// Text.
+ text: String,
+ },
/// The chosen saved items changed.
VaultSelection {
/// The ids.
@@ -779,31 +810,56 @@ pub fn can_plan(s: &PickerState) -> bool {
pub fn passwords_offered(s: &PickerState) -> bool {
match s.choice.source {
SendSource::Vault => !s.choice.vault.password_ids.is_empty(),
- SendSource::Live => password_count(s) > 0,
+ // Without the daemon's support, as before: the chosen sites'.
+ SendSource::Live if !s.choice.vault.password_picks => password_count(s) > 0,
+ SendSource::Live => s.choice.domains.iter().any(|d| d.passwords > 0),
+ }
+}
+
+/// The saved password choice in effect: the one made, else the default the
+/// first tick picks (`(sites, saved ids)`).
+fn password_picks(c: &ReviewChoice) -> (Vec<String>, Vec<String>) {
+ if c.passwords_picked && c.vault.password_picks {
+ (c.password_domains.clone(), c.password_items.clone())
+ } else {
+ review::default_passwords(c)
}
}
-/// How many saved passwords ticking the box would send.
+/// How many saved passwords ticking the box would send: those of the
+/// chosen sites (reading the app) or the chosen saved ones.
pub fn password_count(s: &PickerState) -> u32 {
+ let (domains, items) = password_picks(&s.choice);
match s.choice.source {
- SendSource::Vault => s.choice.vault.password_ids.len() as u32,
+ SendSource::Vault => s
+ .choice
+ .vault
+ .password_ids
+ .iter()
+ .filter(|id| items.contains(id))
+ .count() as u32,
SendSource::Live => s
.choice
.domains
.iter()
- .filter(|d| s.choice.selected_domains.contains(&d.domain))
+ .filter(|d| domains.contains(&d.domain))
.map(|d| d.passwords)
.sum(),
}
}
+/// Saved passwords go with this teleport: ticked, and at least one chosen.
+fn sends_passwords(s: &PickerState) -> bool {
+ s.choice.include_passwords && passwords_offered(s) && password_count(s) > 0
+}
+
/// The review can be confirmed: a plan, secrets acknowledged when any, and
/// the relay-plaintext warning acknowledged when it applies (S1).
pub fn can_confirm(s: &PickerState) -> bool {
let from_vault_ok = s.choice.source != SendSource::Vault || !s.choice.vault.selected.is_empty();
from_vault_ok
&& s.plan.as_ref().is_some_and(|p| {
- (!(p.sensitive || s.choice.include_passwords) || s.acknowledged)
+ (!(p.sensitive || sends_passwords(s)) || s.acknowledged)
&& (!p.relay_unsealed || s.acknowledged_relay_plaintext)
})
}
@@ -841,12 +897,33 @@ pub fn consent(s: &PickerState) -> Consent {
exclude: s.choice.excluded.clone(),
from_vault: vault.then(|| {
let mut ids = s.choice.vault.selected.clone();
- if s.choice.include_passwords {
- ids.extend(s.choice.vault.password_ids.iter().cloned());
+ if sends_passwords(s) {
+ let (_, items) = password_picks(&s.choice);
+ ids.extend(
+ s.choice
+ .vault
+ .password_ids
+ .iter()
+ .filter(|id| items.contains(id))
+ .cloned(),
+ );
}
ids
}),
- include_passwords: passwords_offered(s) && s.choice.include_passwords,
+ include_passwords: sends_passwords(s),
+ // Only to a daemon that enforces it: an older one reads the chosen
+ // sites' passwords, which is what the review then offered.
+ password_domains: (!vault && sends_passwords(s) && s.choice.vault.password_picks).then(
+ || {
+ let (domains, _) = password_picks(&s.choice);
+ s.choice
+ .domains
+ .iter()
+ .filter(|d| d.passwords > 0 && domains.contains(&d.domain))
+ .map(|d| d.domain.clone())
+ .collect()
+ },
+ ),
}
}
@@ -1158,10 +1235,23 @@ pub fn reduce(s: &PickerState, e: &PickerEvent) -> PickerState {
now_ms,
selected,
password_ids,
+ passwords,
+ password_picks,
} => {
if s.step == Step::Consent {
+ // The saved passwords picked stay picked while they exist;
+ // the first list of them starts with every one picked.
+ if s.choice.vault.password_ids.is_empty() {
+ n.choice.password_items = password_ids.clone();
+ } else {
+ n.choice
+ .password_items
+ .retain(|id| password_ids.contains(id));
+ }
n.choice.vault = VaultSource {
password_ids: password_ids.clone(),
+ passwords: passwords.clone(),
+ password_picks: *password_picks,
available: *count > 0,
items: *count,
saved: if *newest_ms > 0 {
@@ -1179,6 +1269,28 @@ pub fn reduce(s: &PickerState, e: &PickerEvent) -> PickerState {
PickerEvent::TogglePasswords { value } => {
if s.step == Step::Consent && passwords_offered(s) {
n.choice.include_passwords = *value;
+ // The first tick picks the default; the list then shows it.
+ if *value && !n.choice.passwords_picked {
+ let (domains, items) = review::default_passwords(&n.choice);
+ n.choice.password_domains = domains;
+ n.choice.password_items = items;
+ n.choice.passwords_picked = true;
+ }
+ }
+ }
+ PickerEvent::TogglePassword { key } => {
+ if s.step == Step::Consent && s.choice.include_passwords {
+ review::toggle_password(&mut n.choice, key);
+ }
+ }
+ PickerEvent::SelectShownPasswords { value } => {
+ if s.step == Step::Consent && s.choice.include_passwords {
+ review::set_shown_passwords(&mut n.choice, *value);
+ }
+ }
+ PickerEvent::PasswordQuery { text } => {
+ if s.step == Step::Consent {
+ n.choice.password_query = text.clone();
}
}
PickerEvent::VaultSelection { selected } => {
@@ -1310,6 +1422,17 @@ pub struct ReviewView {
pub include_passwords: bool,
/// "Also send 14 saved passwords".
pub passwords_label: String,
+ /// Ticked: the saved passwords to pick from (sites with counts when
+ /// reading the app, each saved password's site and username from the
+ /// Keyvault; never a value), filtered by the search.
+ #[serde(default)]
+ pub passwords: Vec<ReviewPassword>,
+ /// "2 of 5 sites", "2 of 5 passwords".
+ #[serde(default)]
+ pub password_summary: String,
+ /// The passwords search text.
+ #[serde(default)]
+ pub password_query: String,
/// What the Keychain will do for this source, in a line.
pub source_note: String,
}
@@ -1421,8 +1544,10 @@ pub fn review(s: &PickerState) -> Option<ReviewView> {
include_passwords: s.choice.include_passwords && passwords_offered(s),
passwords_label: {
let n = password_count(s);
- if n == 0 {
+ if !passwords_offered(s) {
String::new()
+ } else if n == 0 {
+ "Also send saved passwords".into()
} else {
format!(
"Also send {n} saved password{}",
@@ -1430,8 +1555,14 @@ pub fn review(s: &PickerState) -> Option<ReviewView> {
)
}
},
- needs_acknowledgement: plan.sensitive
- || (s.choice.include_passwords && passwords_offered(s)),
+ passwords: if s.choice.include_passwords && passwords_offered(s) {
+ review::password_rows(choice)
+ } else {
+ vec![]
+ },
+ password_summary: review::password_summary(choice),
+ password_query: choice.password_query.clone(),
+ needs_acknowledgement: plan.sensitive || sends_passwords(s),
acknowledged: s.acknowledged,
offers_save_to_keyvault: plan.sensitive,
save_to_keyvault: s.save_to_keyvault,
@@ -2056,6 +2187,8 @@ mod tests {
now_ms: now,
selected: vec!["a".into(), "b".into()],
password_ids: vec![],
+ passwords: vec![],
+ password_picks: false,
},
);
let rv = review(&s).unwrap();
@@ -2114,6 +2247,8 @@ mod tests {
now_ms: now,
selected: vec![],
password_ids: vec![],
+ passwords: vec![],
+ password_picks: false,
},
);
assert_eq!(review(&gone).unwrap().source, SendSource::Live);
@@ -2142,6 +2277,8 @@ mod tests {
now_ms: now,
selected: vec!["a".into(), "b".into()],
password_ids: vec!["p1".into(), "p2".into(), "p3".into()],
+ passwords: vec![],
+ password_picks: false,
},
);
let s = reduce(
@@ -2177,4 +2314,275 @@ mod tests {
let off = reduce(&on, &PickerEvent::TogglePasswords { value: false });
assert!(!consent(&off).include_passwords);
}
+
+ /// Ticking "Saved passwords" lists them to pick from, like the sites:
+ /// reading the app, its sites with how many passwords each (starting
+ /// from the sites chosen to keep you signed in); from the Keyvault, each
+ /// saved password's site and username. Never a value. Only the chosen
+ /// ones are sent.
+ #[test]
+ fn saved_passwords_can_be_reviewed_and_picked_by_site_or_login() {
+ use crate::keyvault::wire::KvDomainCount;
+ let now = 1_800_000_000_000_i64;
+ let mut inv = inventory();
+ inv.domains[0].passwords = 2; // github.com, a sign-in site
+ inv.domains.push(KvDomainCount {
+ domain: "bank.example".into(),
+ passwords: 1,
+ ..Default::default()
+ });
+ let s = reduce(
+ &review_state(),
+ &PickerEvent::DomainsLoaded {
+ inventory: inv,
+ remembered: None,
+ },
+ );
+ // The Keyvault daemon enforces a choice of passwords by site.
+ let s = daemon(&s, true);
+ let rv = review(&s).unwrap();
+ assert!(rv.offers_passwords && !rv.include_passwords);
+ assert_eq!(rv.passwords_label, "Also send 2 saved passwords");
+ assert!(rv.passwords.is_empty(), "the list shows once ticked");
+
+ let on = reduce(&s, &PickerEvent::TogglePasswords { value: true });
+ let rv = review(&on).unwrap();
+ let rows = |rv: &ReviewView| {
+ rv.passwords
+ .iter()
+ .map(|p| {
+ (
+ p.site.clone(),
+ p.username.clone(),
+ p.counts.clone(),
+ p.selected,
+ )
+ })
+ .collect::<Vec<_>>()
+ };
+ assert_eq!(
+ rows(&rv),
+ [
+ ("bank.example".into(), "".into(), "1 password".into(), false),
+ ("github.com".into(), "".into(), "2 passwords".into(), true),
+ ]
+ );
+ assert_eq!(rv.password_summary, "1 of 2 sites");
+ assert_eq!(
+ consent(&on).password_domains,
+ Some(vec!["github.com".to_string()])
+ );
+ assert_eq!(
+ consent(&on).cookie_domains,
+ Some(vec!["github.com".to_string(), "notion.so".to_string()])
+ );
+
+ // A site without its cookies: its password only.
+ let both = reduce(
+ &on,
+ &PickerEvent::TogglePassword {
+ key: "bank.example".into(),
+ },
+ );
+ let c = consent(&both);
+ assert_eq!(
+ c.password_domains,
+ Some(vec!["bank.example".to_string(), "github.com".to_string()])
+ );
+ assert!(c.include_passwords && c.approved);
+ assert_eq!(
+ review(&both).unwrap().passwords_label,
+ "Also send 3 saved passwords"
+ );
+ // The search filters; None drops what it shows.
+ let q = reduce(
+ &both,
+ &PickerEvent::PasswordQuery {
+ text: "bank".into(),
+ },
+ );
+ assert_eq!(review(&q).unwrap().passwords.len(), 1);
+ let q = reduce(&q, &PickerEvent::SelectShownPasswords { value: false });
+ assert_eq!(
+ consent(&q).password_domains,
+ Some(vec!["github.com".to_string()])
+ );
+ // Nothing picked: no password goes, though the box is ticked.
+ let none = reduce(&on, &PickerEvent::SelectShownPasswords { value: false });
+ let c = consent(&none);
+ assert!(!c.include_passwords && c.password_domains.is_none());
+ assert_eq!(
+ review(&none).unwrap().passwords_label,
+ "Also send saved passwords"
+ );
+ // Unticked and ticked again: the choice is kept.
+ let again = reduce(
+ &reduce(&both, &PickerEvent::TogglePasswords { value: false }),
+ &PickerEvent::TogglePasswords { value: true },
+ );
+ assert_eq!(
+ consent(&again).password_domains,
+ consent(&both).password_domains
+ );
+
+ // From the Keyvault: each saved password by site and username, all
+ // picked at first.
+ let v = reduce(
+ &s,
+ &PickerEvent::VaultItems {
+ count: 1,
+ newest_ms: now,
+ now_ms: now,
+ selected: vec!["a".into()],
+ password_ids: vec!["p1".into(), "p2".into()],
+ passwords: vec![
+ VaultPassword {
+ id: "p1".into(),
+ site: "github.com".into(),
+ username: "octocat".into(),
+ },
+ VaultPassword {
+ id: "p2".into(),
+ site: "".into(),
+ username: "".into(),
+ },
+ ],
+ password_picks: true,
+ },
+ );
+ let v = reduce(
+ &v,
+ &PickerEvent::SendFrom {
+ source: SendSource::Vault,
+ },
+ );
+ let v = reduce(&v, &PickerEvent::TogglePasswords { value: true });
+ let rv = review(&v).unwrap();
+ assert_eq!(
+ rows(&rv),
+ [
+ ("github.com".into(), "octocat".into(), "".into(), true),
+ ("Saved password".into(), "".into(), "".into(), true),
+ ]
+ );
+ assert_eq!(rv.password_summary, "2 of 2 passwords");
+ let one = reduce(&v, &PickerEvent::TogglePassword { key: "p2".into() });
+ let c = consent(&one);
+ assert_eq!(c.from_vault, Some(vec!["a".to_string(), "p1".to_string()]));
+ assert!(c.include_passwords && c.password_domains.is_none());
+ // Searching by username.
+ let q = reduce(
+ &one,
+ &PickerEvent::PasswordQuery {
+ text: "octo".into(),
+ },
+ );
+ assert_eq!(review(&q).unwrap().passwords.len(), 1);
+ // No row carries a value: only the site, username and counts exist.
+ let json = serde_json::to_string(&review(&one).unwrap().passwords).unwrap();
+ assert!(!json.contains("password\":"), "{json}");
+ }
+
+ /// What the Keyvault daemon says it supports: `picks` is the
+ /// `password_domains` feature (no saved items).
+ fn daemon(s: &PickerState, picks: bool) -> PickerState {
+ reduce(
+ s,
+ &PickerEvent::VaultItems {
+ count: 0,
+ newest_ms: 0,
+ now_ms: 0,
+ selected: vec![],
+ password_ids: vec![],
+ passwords: vec![],
+ password_picks: picks,
+ },
+ )
+ }
+
+ /// A Keyvault daemon that predates the per-site choice of passwords
+ /// would ignore it and read the passwords of every chosen site. With
+ /// one, the review offers the passwords as before (those of the sites
+ /// kept signed in, or every saved one) and lists none to pick, so it
+ /// never shows a choice that would not be kept; the consent carries no
+ /// `passwordDomains`.
+ #[test]
+ fn an_older_keyvault_daemon_gets_no_password_picker() {
+ use crate::keyvault::wire::KvDomainCount;
+ let mut inv = inventory();
+ inv.domains[0].passwords = 2; // github.com, a sign-in site
+ inv.domains.push(KvDomainCount {
+ domain: "bank.example".into(),
+ passwords: 1,
+ ..Default::default()
+ });
+ let loaded = reduce(
+ &review_state(),
+ &PickerEvent::DomainsLoaded {
+ inventory: inv,
+ remembered: None,
+ },
+ );
+ for s in [loaded.clone(), daemon(&loaded, false)] {
+ let rv = review(&s).unwrap();
+ assert!(rv.offers_passwords);
+ assert_eq!(rv.passwords_label, "Also send 2 saved passwords");
+ let on = reduce(&s, &PickerEvent::TogglePasswords { value: true });
+ let rv = review(&on).unwrap();
+ assert!(rv.include_passwords && rv.passwords.is_empty(), "no picker");
+ // Picking does nothing: the chosen sites' passwords go, as before.
+ let tried = reduce(
+ &on,
+ &PickerEvent::TogglePassword {
+ key: "bank.example".into(),
+ },
+ );
+ let tried = reduce(&tried, &PickerEvent::SelectShownPasswords { value: false });
+ let c = consent(&tried);
+ assert!(c.include_passwords);
+ assert_eq!(
+ c.password_domains, None,
+ "never sent to a daemon that ignores it"
+ );
+ assert_eq!(
+ review(&tried).unwrap().passwords_label,
+ "Also send 2 saved passwords"
+ );
+ // Dropping the only site with passwords takes the offer away.
+ let gone = reduce(
+ &on,
+ &PickerEvent::ToggleDomain {
+ domain: "github.com".into(),
+ },
+ );
+ assert!(!review(&gone).unwrap().offers_passwords);
+ assert!(!consent(&gone).include_passwords);
+ }
+ // From the Keyvault: every saved password, as before.
+ let v = reduce(
+ &loaded,
+ &PickerEvent::VaultItems {
+ count: 1,
+ newest_ms: 1,
+ now_ms: 1,
+ selected: vec!["a".into()],
+ password_ids: vec!["p1".into(), "p2".into()],
+ passwords: vec![],
+ password_picks: false,
+ },
+ );
+ let v = reduce(
+ &v,
+ &PickerEvent::SendFrom {
+ source: SendSource::Vault,
+ },
+ );
+ let v = reduce(&v, &PickerEvent::TogglePasswords { value: true });
+ let v = reduce(&v, &PickerEvent::TogglePassword { key: "p2".into() });
+ assert!(review(&v).unwrap().passwords.is_empty());
+ assert_eq!(
+ consent(&v).from_vault,
+ Some(vec!["a".to_string(), "p1".to_string(), "p2".to_string()])
+ );
+ }
}
diff --git a/libs/cua/crates/cua-spaces-app-core/src/teleport/review.rs b/libs/cua/crates/cua-spaces-app-core/src/teleport/review.rs
index 8604fc046e..6596a38d51 100644
--- a/libs/cua/crates/cua-spaces-app-core/src/teleport/review.rs
+++ b/libs/cua/crates/cua-spaces-app-core/src/teleport/review.rs
@@ -131,6 +131,51 @@ pub struct VaultSource {
/// The app's saved passwords (ids), sent only when ticked.
#[serde(default)]
pub password_ids: Vec<String>,
+ /// The same passwords with their site and username (never a value), for
+ /// the review to list.
+ #[serde(default)]
+ pub passwords: Vec<VaultPassword>,
+ /// The Keyvault daemon enforces a choice of passwords by site
+ /// (`password_domains` in its status). Without it the review offers
+ /// the passwords as before (those of the chosen sites, or every saved
+ /// one) and lists none to pick: it never shows a choice the daemon
+ /// would not keep.
+ #[serde(default)]
+ pub password_picks: bool,
+}
+
+/// One saved password of the Keyvault, as a review lists it: its site and
+/// username, never its value.
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase")]
+pub struct VaultPassword {
+ /// The item's id.
+ pub id: String,
+ /// Its site (`github.com`); empty when not known.
+ #[serde(default)]
+ pub site: String,
+ /// Its username; empty when not known or hidden.
+ #[serde(default)]
+ pub username: String,
+}
+
+/// One saved password choice in the review: a site of the browser (reading
+/// it now) or one saved password (from the Keyvault). Sites and usernames
+/// only: a password's value is never shown.
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase")]
+pub struct ReviewPassword {
+ /// What picking it toggles: the site (reading the app) or the item id
+ /// (from the Keyvault).
+ pub key: String,
+ /// The site (`github.com`), or "Saved password" when not known.
+ pub site: String,
+ /// The username, when known (a saved item).
+ pub username: String,
+ /// "2 passwords" (a site of the browser); empty for one saved item.
+ pub counts: String,
+ /// Chosen to send.
+ pub selected: bool,
}
/// The review's choices.
@@ -158,6 +203,19 @@ pub struct ReviewChoice {
/// them; never remembered).
#[serde(default)]
pub include_passwords: bool,
+ /// The sites whose saved passwords to send (reading the app).
+ #[serde(default)]
+ pub password_domains: Vec<String>,
+ /// The saved passwords to send (ids, from the Keyvault).
+ #[serde(default)]
+ pub password_items: Vec<String>,
+ /// The passwords list's search text.
+ #[serde(default)]
+ pub password_query: String,
+ /// The password choice was made (the default is picked the first time
+ /// the box is ticked).
+ #[serde(default)]
+ pub passwords_picked: bool,
}
/// The sites the minimal default picks: those that look like they keep a
@@ -283,6 +341,160 @@ pub fn set_shown_domains(c: &mut ReviewChoice, value: bool) {
sort_selected(c);
}
+/// The browser's sites that hold saved passwords (reading it now).
+fn password_sites(c: &ReviewChoice) -> impl Iterator<Item = &KvDomainCount> {
+ c.domains.iter().filter(|d| d.passwords > 0)
+}
+
+/// The saved passwords of the Keyvault, with what is known of each (a host
+/// that sends only ids lists them unnamed).
+fn vault_passwords(c: &ReviewChoice) -> Vec<VaultPassword> {
+ c.vault
+ .password_ids
+ .iter()
+ .map(|id| {
+ c.vault
+ .passwords
+ .iter()
+ .find(|p| &p.id == id)
+ .cloned()
+ .unwrap_or_else(|| VaultPassword {
+ id: id.clone(),
+ ..Default::default()
+ })
+ })
+ .collect()
+}
+
+/// The passwords the first tick picks: from the Keyvault, every saved one;
+/// reading the app, those of the sites chosen to keep you signed in.
+pub fn default_passwords(c: &ReviewChoice) -> (Vec<String>, Vec<String>) {
+ // Without the daemon's support this is also what is sent, unchanged.
+ let domains = password_sites(c)
+ .filter(|d| c.selected_domains.contains(&d.domain))
+ .map(|d| d.domain.clone())
+ .collect();
+ (domains, c.vault.password_ids.clone())
+}
+
+/// The saved passwords as the review lists them (filtered by the search):
+/// sites with counts when reading the app, else each saved password with
+/// its site and username.
+pub fn password_rows(c: &ReviewChoice) -> Vec<ReviewPassword> {
+ if !c.vault.password_picks {
+ return vec![];
+ }
+ let words: Vec<String> = c
+ .password_query
+ .split_whitespace()
+ .map(|w| w.to_lowercase())
+ .collect();
+ let shown = |text: String| words.iter().all(|w| text.to_lowercase().contains(w));
+ match c.source {
+ SendSource::Live => password_sites(c)
+ .filter(|d| shown(d.domain.clone()))
+ .map(|d| ReviewPassword {
+ key: d.domain.clone(),
+ site: d.domain.clone(),
+ username: String::new(),
+ counts: format!(
+ "{} password{}",
+ d.passwords,
+ if d.passwords == 1 { "" } else { "s" }
+ ),
+ selected: c.password_domains.contains(&d.domain),
+ })
+ .collect(),
+ SendSource::Vault => vault_passwords(c)
+ .into_iter()
+ .map(|p| ReviewPassword {
+ selected: c.password_items.contains(&p.id),
+ key: p.id,
+ site: if p.site.is_empty() {
+ "Saved password".into()
+ } else {
+ site_of(&p.site)
+ },
+ username: p.username,
+ counts: String::new(),
+ })
+ .filter(|r| shown(format!("{} {}", r.site, r.username)))
+ .collect(),
+ }
+}
+
+/// "2 of 5 sites" (reading the app) or "2 of 5 passwords" (saved).
+pub fn password_summary(c: &ReviewChoice) -> String {
+ // No choice to sum up without the daemon's support.
+ if !c.vault.password_picks {
+ return String::new();
+ }
+ let (picked, all, what) = match c.source {
+ SendSource::Live => (
+ password_sites(c)
+ .filter(|d| c.password_domains.contains(&d.domain))
+ .count(),
+ password_sites(c).count(),
+ "site",
+ ),
+ SendSource::Vault => (
+ c.vault
+ .password_ids
+ .iter()
+ .filter(|id| c.password_items.contains(id))
+ .count(),
+ c.vault.password_ids.len(),
+ "password",
+ ),
+ };
+ format!(
+ "{picked} of {all} {what}{}",
+ if all == 1 { "" } else { "s" }
+ )
+}
+
+/// Picks or drops one saved password choice ([`ReviewPassword::key`]).
+pub fn toggle_password(c: &mut ReviewChoice, key: &str) {
+ if !c.vault.password_picks {
+ return;
+ }
+ if !password_rows(&ReviewChoice {
+ password_query: String::new(),
+ ..c.clone()
+ })
+ .iter()
+ .any(|r| r.key == key)
+ {
+ return;
+ }
+ let list = match c.source {
+ SendSource::Live => &mut c.password_domains,
+ SendSource::Vault => &mut c.password_items,
+ };
+ match list.iter().position(|k| k == key) {
+ Some(n) => {
+ list.remove(n);
+ }
+ None => list.push(key.into()),
+ }
+}
+
+/// Picks or drops every saved password choice the search shows.
+pub fn set_shown_passwords(c: &mut ReviewChoice, value: bool) {
+ if !c.vault.password_picks {
+ return;
+ }
+ let shown: Vec<String> = password_rows(c).into_iter().map(|r| r.key).collect();
+ let list = match c.source {
+ SendSource::Live => &mut c.password_domains,
+ SendSource::Vault => &mut c.password_items,
+ };
+ list.retain(|k| !shown.contains(k));
+ if value {
+ list.extend(shown);
+ }
+}
+
fn sort_selected(c: &mut ReviewChoice) {
let order: Vec<&str> = c.domains.iter().map(|d| d.domain.as_str()).collect();
c.selected_domains
diff --git a/libs/cua/crates/cua-spaces-app-core/src/wizard.rs b/libs/cua/crates/cua-spaces-app-core/src/wizard.rs
index eea2a41f46..1879db54f4 100644
--- a/libs/cua/crates/cua-spaces-app-core/src/wizard.rs
+++ b/libs/cua/crates/cua-spaces-app-core/src/wizard.rs
@@ -1145,6 +1145,11 @@ pub struct WizardEnv {
/// Resources step shows no GPU row for it.
#[serde(default)]
pub gpus: Option<Vec<GpuChoice>>,
+ /// Picks the name an unnamed Space gets ([`generated_space_name`]);
+ /// `None`: this process's own randomness. A core without randomness
+ /// (the wasm build) is given one; tests give a fixed one.
+ #[serde(default)]
+ pub name_seed: Option<u64>,
}
/// A runtime's GPU option, as the wizard offers it.
@@ -1299,6 +1304,59 @@ pub struct WizardState {
pub gpu: bool,
/// The address form.
pub address: AddressForm,
+ /// The name the Space gets when Name is left empty
+ /// ([`generated_space_name`], chosen when the wizard opens).
+ #[serde(default)]
+ pub generated_name: String,
+ /// A slider's value being typed (its number was clicked).
+ #[serde(default)]
+ pub resource_edit: Option<ResourceEdit>,
+}
+
+/// A Resources slider whose value can be typed.
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "lowercase")]
+pub enum ResourceField {
+ /// CPU cores.
+ Cpus,
+ /// Memory, GB.
+ Memory,
+ /// Disk, GB.
+ Disk,
+}
+
+impl ResourceField {
+ /// The field id ([`WizardField::id`]).
+ pub fn id(self) -> &'static str {
+ match self {
+ ResourceField::Cpus => "cpus",
+ ResourceField::Memory => "memory",
+ ResourceField::Disk => "disk",
+ }
+ }
+}
+
+/// A slider's value as typed.
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase")]
+pub struct ResourceEdit {
+ /// Which slider.
+ pub field: ResourceField,
+ /// The text as typed.
+ pub text: String,
+}
+
+/// The name an unnamed Space gets: `space-` and ten hex digits, the form
+/// the SDK gives one it names itself (`cua_spaces::Spaces::create`). The
+/// wizard picks it when it opens, shows it, and creates the Space with it.
+pub fn generated_space_name(seed: Option<u64>) -> String {
+ let n = seed.unwrap_or_else(|| {
+ use std::hash::{BuildHasher, Hasher};
+ std::collections::hash_map::RandomState::new()
+ .build_hasher()
+ .finish()
+ });
+ format!("space-{:010x}", n & 0xff_ffff_ffff)
}
/// An input to the wizard.
@@ -1386,6 +1444,21 @@ pub enum WizardAction {
},
/// The disk slider's Reset: back to the image's own disk.
ResetDisk,
+ /// A slider's number clicked: its value can be typed.
+ EditResource {
+ /// Which slider.
+ field: ResourceField,
+ },
+ /// The typed value's text.
+ SetResourceText {
+ /// Text.
+ text: String,
+ },
+ /// Return (or leaving the field): the typed value is used when it is
+ /// within the slider's limits; otherwise the field stays with why.
+ CommitResource,
+ /// Escape: the slider's value stays.
+ CancelResource,
/// The GPU checkbox.
SetGpu {
/// Checked.
@@ -1475,6 +1548,8 @@ pub fn initial(env: &WizardEnv) -> WizardState {
host: None,
gpu: false,
address: AddressForm::default(),
+ generated_name: generated_space_name(env.name_seed),
+ resource_edit: None,
};
follow_to_host(&mut state, env);
state
@@ -1718,15 +1793,36 @@ pub fn reduce(state: &WizardState, action: &WizardAction, env: &WizardEnv) -> Wi
}
}
WizardAction::ResetDisk => s.disk_gb = None,
+ WizardAction::EditResource { field } => {
+ if let Some((value, _, _)) = resource_now(&s, env, *field) {
+ s.resource_edit = Some(ResourceEdit {
+ field: *field,
+ text: value.to_string(),
+ });
+ }
+ }
+ WizardAction::SetResourceText { text } => {
+ if let Some(e) = s.resource_edit.as_mut() {
+ e.text = text.clone();
+ }
+ }
+ WizardAction::CommitResource => commit_resource(&mut s, env),
+ WizardAction::CancelResource => s.resource_edit = None,
WizardAction::SetGpu { on } => s.gpu = *on,
WizardAction::SetName { name } => s.name = name.clone(),
WizardAction::SetOpenWhenReady { on } => s.open_when_ready = *on,
WizardAction::Next => {
+ // A typed value is used first (one that breaks the limits
+ // keeps the step, with why).
+ commit_resource(&mut s, env);
if s.step < 3 && view(&s, env).can_continue {
s.step += 1;
}
}
- WizardAction::Back => s.step = s.step.saturating_sub(1),
+ WizardAction::Back => {
+ s.resource_edit = None;
+ s.step = s.step.saturating_sub(1);
+ }
WizardAction::ShowAddress => s.mode = WizardMode::Address,
WizardAction::HideAddress => s.mode = WizardMode::Create,
WizardAction::SetAddress { url } => s.address.url = url.clone(),
@@ -1746,6 +1842,83 @@ pub fn reduce(state: &WizardState, action: &WizardAction, env: &WizardEnv) -> Wi
s
}
+/// A slider's value and limits now: `(value, min, max)`; `None` when it
+/// does not show.
+fn resource_now(s: &WizardState, env: &WizardEnv, field: ResourceField) -> Option<(u32, u32, u32)> {
+ let eff = effective(s, env);
+ let ((c0, c1), (m0, m1)) = size_ranges(eff.placement, env);
+ let (cpus, memory_gb) = effective_size(&eff, env);
+ match field {
+ ResourceField::Cpus => Some((cpus, c0, c1)),
+ ResourceField::Memory => Some((memory_gb, m0, m1)),
+ ResourceField::Disk => {
+ if eff.placement != Location::Local {
+ return None;
+ }
+ let (min, max) = disk_bounds(&image_of(&eff), env)?;
+ Some((eff.disk_gb.unwrap_or(min).clamp(min, max), min, max))
+ }
+ }
+}
+
+/// The typed text as a number: digits, with an optional unit
+/// (`8`, `8 GB`, `4 cores`).
+fn typed_number(text: &str) -> Option<u32> {
+ let t = text.trim().to_ascii_lowercase();
+ let digits = ["cores", "core", "gb", "g"]
+ .iter()
+ .find_map(|u| t.strip_suffix(u))
+ .unwrap_or(&t)
+ .trim();
+ if digits.is_empty() || !digits.bytes().all(|b| b.is_ascii_digit()) {
+ return None;
+ }
+ digits.parse().ok()
+}
+
+/// The typed value, or why it cannot be used: the slider's own limits
+/// (its min and max, the disk the image needs and the room on the volume).
+fn typed_value(s: &WizardState, env: &WizardEnv, edit: &ResourceEdit) -> Result<u32, String> {
+ let Some((_, min, max)) = resource_now(s, env, edit.field) else {
+ return Err(String::new());
+ };
+ let n = typed_number(&edit.text).ok_or_else(|| "Enter a whole number.".to_string())?;
+ if (min..=max).contains(&n) {
+ return Ok(n);
+ }
+ Err(match edit.field {
+ ResourceField::Cpus => format!("Choose {min} to {max} cores."),
+ ResourceField::Memory => format!("Choose {min} to {max} GB."),
+ ResourceField::Disk if n < min => {
+ format!("A VM disk cannot shrink below the image's {min} GB.")
+ }
+ ResourceField::Disk => match volume_of(&image_of(&effective(s, env)), env) {
+ Some(v) if max < MAX_DISK_GB => format!("{} has room for up to {max} GB.", v.name),
+ _ => format!("Choose {min} to {max} GB."),
+ },
+ })
+}
+
+/// Uses the typed value when it is within the limits (and closes the
+/// field); leaves the field open otherwise.
+fn commit_resource(s: &mut WizardState, env: &WizardEnv) {
+ let Some(edit) = s.resource_edit.clone() else {
+ return;
+ };
+ if resource_now(s, env, edit.field).is_none() {
+ s.resource_edit = None;
+ return;
+ }
+ if let Ok(n) = typed_value(s, env, &edit) {
+ match edit.field {
+ ResourceField::Cpus => s.cpus = n,
+ ResourceField::Memory => s.memory_gb = n,
+ ResourceField::Disk => s.disk_gb = Some(n),
+ }
+ s.resource_edit = None;
+ }
+}
+
/// How far along a step is.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "lowercase")]
@@ -2065,6 +2238,19 @@ pub struct WizardLabels {
pub advanced: String,
}
+/// A slider's value being typed.
+#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
+#[serde(rename_all = "camelCase")]
+pub struct ResourceEditView {
+ /// Which slider.
+ pub field: ResourceField,
+ /// The text as typed.
+ pub text: String,
+ /// Why it cannot be used, in one line (the slider's limits).
+ #[serde(default)]
+ pub error: Option<String>,
+}
+
/// The wizard as drawn.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
@@ -2159,8 +2345,16 @@ pub struct WizardView {
/// The GPU row (Resources), where the runtime offers a GPU.
#[serde(default)]
pub gpu: Option<GpuRow>,
+ /// A slider's value being typed: the field shows instead of its number
+ /// (its error is also the field's [`WizardField::error`]).
+ #[serde(default)]
+ pub resource_edit: Option<ResourceEditView>,
/// Name as typed.
pub name: String,
+ /// The name the Space gets: the one typed, else the generated one
+ /// (the Name field's placeholder).
+ #[serde(default)]
+ pub space_name: String,
/// The name breaks the DNS-label rule.
pub name_invalid: bool,
/// Why, in one line.
@@ -2250,7 +2444,15 @@ fn fields(
placement_error: Option<String>,
name_error: Option<String>,
disk_editable: bool,
+ resource_edit: Option<&ResourceEditView>,
) -> Vec<WizardField> {
+ // A typed value's error is its field's.
+ let typed = |id: &str| WizardField {
+ error: resource_edit
+ .filter(|e| e.field.id() == id)
+ .and_then(|e| e.error.clone()),
+ ..field(id, "")
+ };
let yours = state.placement == Location::Yours;
match (state.mode, state.step) {
(WizardMode::Address, _) => vec![
@@ -2299,15 +2501,32 @@ fn fields(
// The cloud picks the machine: no sliders, its facts only.
(WizardMode::Create, 1) if yours => vec![],
(WizardMode::Create, 1) => {
- let mut f = vec![field("cpus", "CPU cores"), field("memory", "Memory")];
+ let mut f = vec![
+ WizardField {
+ label: "CPU cores".into(),
+ ..typed("cpus")
+ },
+ WizardField {
+ label: "Memory".into(),
+ ..typed("memory")
+ },
+ ];
if disk_editable {
- f.push(field("disk", "Disk"));
+ f.push(WizardField {
+ label: "Disk".into(),
+ ..typed("disk")
+ });
}
f
}
(WizardMode::Create, 2) => vec![
WizardField {
- placeholder: Some("Optional".into()),
+ // The name it gets when left empty.
+ placeholder: Some(if state.generated_name.is_empty() {
+ "Optional".into()
+ } else {
+ state.generated_name.clone()
+ }),
error: name_error,
..field("name", "Name")
},
@@ -2751,13 +2970,24 @@ pub fn view_on(state: &WizardState, env: &WizardEnv, os: SpaceOs) -> WizardView
};
let name = state.name.trim().to_string();
let name_invalid = !name.is_empty() && !valid_space_name(&name);
+ // Left empty, the Space gets the name generated when the wizard opened.
+ let space_name = if name.is_empty() {
+ state.generated_name.clone()
+ } else {
+ name.clone()
+ };
+ let resource_edit = state.resource_edit.as_ref().map(|e| ResourceEditView {
+ field: e.field,
+ text: e.text.clone(),
+ error: typed_value(state, env, e).err().filter(|m| !m.is_empty()),
+ });
let custom = custom_ref(state).is_some();
let image_error = validate_image_ref(&state.image_text);
let disk = disk_view(state, &image, env, os);
let can_continue = image.os != SpaceOs::Unknown
&& match state.step {
0 => placeable && placement_ready && image_error.is_none(),
- 1 => disk.error.is_none(),
+ 1 => disk.error.is_none() && resource_edit.as_ref().is_none_or(|e| e.error.is_none()),
2 => !name_invalid,
_ => true,
};
@@ -3004,10 +3234,10 @@ pub fn view_on(state: &WizardState, env: &WizardEnv, os: SpaceOs) -> WizardView
}
summary.push(Fact {
label: "Name".into(),
- value: if name.is_empty() {
+ value: if space_name.is_empty() {
"Chosen automatically".into()
} else {
- name.clone()
+ space_name.clone()
},
copy: None,
help: None,
@@ -3031,7 +3261,7 @@ pub fn view_on(state: &WizardState, env: &WizardEnv, os: SpaceOs) -> WizardView
host: host.map(|h| h.id.clone()),
image: image.clone(),
runtime,
- name: (!name.is_empty()).then(|| name.clone()),
+ name: (!space_name.is_empty()).then(|| space_name.clone()),
// In your cloud the machine type sets the size.
cpus: (!yours).then_some(cpus),
memory_mb: (!yours).then_some(memory_gb * 1024),
@@ -3128,7 +3358,9 @@ pub fn view_on(state: &WizardState, env: &WizardEnv, os: SpaceOs) -> WizardView
},
resources_error: disk.error.clone(),
gpu,
+ resource_edit: resource_edit.clone(),
name: state.name.clone(),
+ space_name: space_name.clone(),
name_invalid,
name_error: name_error.clone(),
open_when_ready: state.open_when_ready,
@@ -3170,6 +3402,7 @@ pub fn view_on(state: &WizardState, env: &WizardEnv, os: SpaceOs) -> WizardView
placement_error_for_fields,
name_error,
disk.bounds.is_some(),
+ resource_edit.as_ref(),
),
labels: WizardLabels {
cancel: "Cancel".into(),
@@ -3212,6 +3445,7 @@ mod tests {
hosts: vec![],
experiments: crate::experiments::Experiments::default(),
gpus: None,
+ name_seed: Some(0x2a),
}
}
@@ -5039,4 +5273,220 @@ mod tests {
})
);
}
+
+ /// Clicking a slider's number lets its value be typed: a value within
+ /// the slider's limits is used; one outside keeps the field open with
+ /// why, and Continue waits for it.
+ #[test]
+ fn a_resource_value_can_be_typed_within_the_sliders_limits() {
+ let e = env();
+ let s = reduce(&initial(&e), &WizardAction::Next, &e);
+ assert_eq!(s.step, 1);
+ let edit = |s: &WizardState, field, text: &str| {
+ let s = reduce(s, &WizardAction::EditResource { field }, &e);
+ reduce(&s, &WizardAction::SetResourceText { text: text.into() }, &e)
+ };
+ let field_error = |v: &WizardView, id: &str| {
+ v.fields
+ .iter()
+ .find(|f| f.id == id)
+ .and_then(|f| f.error.clone())
+ };
+ // Clicking shows the value as it is.
+ let open = reduce(
+ &s,
+ &WizardAction::EditResource {
+ field: ResourceField::Cpus,
+ },
+ &e,
+ );
+ assert_eq!(
+ view(&open, &e).resource_edit.map(|r| r.text),
+ Some(view(&s, &e).cpus.to_string())
+ );
+ // Within the limits (a unit is fine): used, and the field closes.
+ let typed = reduce(
+ &edit(&s, ResourceField::Cpus, " 6 cores"),
+ &WizardAction::CommitResource,
+ &e,
+ );
+ let v = view(&typed, &e);
+ assert_eq!((v.cpus, v.cpus_text.as_str()), (6, "6 cores"));
+ assert!(v.resource_edit.is_none());
+ let typed = reduce(
+ &edit(&s, ResourceField::Memory, "12 GB"),
+ &WizardAction::CommitResource,
+ &e,
+ );
+ assert_eq!(view(&typed, &e).memory_text, "12 GB");
+ // Outside: the slider's limits, said on the field; nothing changes
+ // and Continue waits.
+ let (lo, hi) = MEMORY_GB_RANGE;
+ for (field, text, why) in [
+ (ResourceField::Cpus, "9", "Choose 1 to 8 cores.".to_string()),
+ (ResourceField::Cpus, "0", "Choose 1 to 8 cores.".to_string()),
+ (
+ ResourceField::Memory,
+ "64",
+ format!("Choose {lo} to {hi} GB."),
+ ),
+ (
+ ResourceField::Memory,
+ "lots",
+ "Enter a whole number.".to_string(),
+ ),
+ (
+ ResourceField::Memory,
+ "",
+ "Enter a whole number.".to_string(),
+ ),
+ ] {
+ let bad = reduce(&edit(&s, field, text), &WizardAction::CommitResource, &e);
+ let v = view(&bad, &e);
+ assert_eq!(
+ v.resource_edit.as_ref().and_then(|r| r.error.as_deref()),
+ Some(why.as_str()),
+ "{text}"
+ );
+ assert_eq!(field_error(&v, field.id()), Some(why.clone()));
+ assert!(!v.can_continue, "{text}");
+ assert_eq!(
+ (v.cpus, v.memory_gb),
+ (view(&s, &e).cpus, view(&s, &e).memory_gb)
+ );
+ assert_eq!(reduce(&bad, &WizardAction::Next, &e).step, 1, "{text}");
+ // Escape keeps the slider's value and clears the error.
+ let v = view(&reduce(&bad, &WizardAction::CancelResource, &e), &e);
+ assert!(
+ v.resource_edit.is_none()
+ && v.can_continue
+ && field_error(&v, field.id()).is_none()
+ );
+ }
+ // Continue uses a valid typed value.
+ let next = reduce(&edit(&s, ResourceField::Cpus, "3"), &WizardAction::Next, &e);
+ assert_eq!(
+ (next.step, next.cpus, next.resource_edit.clone()),
+ (2, 3, None)
+ );
+ }
+
+ /// The disk takes a typed size between the image's and the room on its
+ /// volume, with the slider's words when it is outside.
+ #[test]
+ fn a_typed_disk_size_keeps_the_images_disk_and_the_volumes_room() {
+ let e = WizardEnv {
+ storage: Some(LocalStorage {
+ reserve_bytes: 5 * GIB,
+ lume: Some(vol(212, "Macintosh HD")),
+ qemu: Some(StorageVolume {
+ total_bytes: 300 * GIB,
+ ..vol(212, "Macintosh HD")
+ }),
+ container: Some(vol(40, "Colima")),
+ pulled: vec![],
+ linux_runtime_download_bytes: 0,
+ }),
+ ..storage_env()
+ };
+ let s = on("ghcr.io/trycua/linux:24.04-disk", &e);
+ let min = view(&s, &e).min_disk_gb;
+ assert_eq!(view(&s, &e).max_disk_gb, 300);
+ let typed = |text: &str| {
+ let t = reduce(
+ &s,
+ &WizardAction::EditResource {
+ field: ResourceField::Disk,
+ },
+ &e,
+ );
+ let t = reduce(&t, &WizardAction::SetResourceText { text: text.into() }, &e);
+ reduce(&t, &WizardAction::CommitResource, &e)
+ };
+ let v = view(&typed("120"), &e);
+ assert_eq!((v.disk_gb, v.plan.disk_gb), (120, Some(120)));
+ let small = view(&typed(&(min - 1).to_string()), &e);
+ assert_eq!(
+ small.resource_edit.and_then(|r| r.error),
+ Some(format!(
+ "A VM disk cannot shrink below the image's {min} GB."
+ ))
+ );
+ let big = view(&typed("301"), &e);
+ assert_eq!(
+ big.resource_edit.and_then(|r| r.error).as_deref(),
+ Some("Macintosh HD has room for up to 300 GB.")
+ );
+ // A container has no disk slider: nothing to type.
+ let c = on("ghcr.io/trycua/linux:24.04", &e);
+ let c = reduce(
+ &c,
+ &WizardAction::EditResource {
+ field: ResourceField::Disk,
+ },
+ &e,
+ );
+ assert!(c.resource_edit.is_none());
+ }
+
+ /// Left empty, the Space gets the name generated when the wizard
+ /// opened: the Name field's placeholder, the Summary and the create all
+ /// say it. A typed name wins.
+ #[test]
+ fn an_unnamed_space_shows_and_gets_its_generated_name() {
+ let e = env();
+ let s = initial(&e);
+ assert_eq!(s.generated_name, "space-000000002a");
+ assert_eq!(generated_space_name(Some(u64::MAX)), "space-ffffffffff");
+ let other = generated_space_name(None);
+ assert!(other.starts_with("space-") && other.len() == 16 && valid_space_name(&other));
+ let mut s = s;
+ for _ in 0..2 {
+ s = reduce(&s, &WizardAction::Next, &e);
+ }
+ let v = view(&s, &e);
+ let placeholder = v
+ .fields
+ .iter()
+ .find(|f| f.id == "name")
+ .and_then(|f| f.placeholder.clone());
+ assert_eq!(placeholder.as_deref(), Some("space-000000002a"));
+ assert_eq!(v.space_name, "space-000000002a");
+ let name_row = |v: &WizardView| {
+ v.summary
+ .iter()
+ .find(|f| f.label == "Name")
+ .map(|f| f.value.clone())
+ };
+ assert_eq!(name_row(&v).as_deref(), Some("space-000000002a"));
+ assert_eq!(
+ create_args(&v.plan).name.as_deref(),
+ Some("space-000000002a")
+ );
+ assert_eq!(
+ creating_text(&v.plan),
+ "Creating space-000000002a. It appears in the list when it is ready."
+ );
+ let named = view(
+ &reduce(
+ &s,
+ &WizardAction::SetName {
+ name: " dev ".into(),
+ },
+ &e,
+ ),
+ &e,
+ );
+ assert_eq!(name_row(&named).as_deref(), Some("dev"));
+ assert_eq!(named.plan.name.as_deref(), Some("dev"));
+ // An older state without one keeps the old words and lets the SDK
+ // name it.
+ let old = WizardState {
+ generated_name: String::new(),
+ ..s
+ };
+ let v = view(&old, &e);
+ assert_eq!(name_row(&v).as_deref(), Some("Chosen automatically"));
+ assert_eq!(v.plan.name, None);
+ }
}
diff --git a/libs/cua/crates/cua-spaces-app-core/tests/wire_drift.rs b/libs/cua/crates/cua-spaces-app-core/tests/wire_drift.rs
index f2f19486cd..ce98cf594d 100644
--- a/libs/cua/crates/cua-spaces-app-core/tests/wire_drift.rs
+++ b/libs/cua/crates/cua-spaces-app-core/tests/wire_drift.rs
@@ -169,9 +169,11 @@ fn items_callers_grants_rules_deliveries_status() {
browse_until_ms: Some(9),
skip_unlock_prompt: Some(true),
reset_notice: Some("set aside".into()),
+ features: vec![cua_keyvault::broker::FEATURE_PASSWORD_DOMAINS.into()],
};
let kv: KvStatus = round(&st);
assert_eq!(kv.unlock_protectors, ["passphrase", "recovery"]);
+ assert_eq!(kv.features, ["password_domains"]);
assert_eq!(kv.auto_wipe, Some(true));
assert_eq!(kv.browse_until_ms, Some(9));
assert_eq!(kv.skip_unlock_prompt, Some(true));
diff --git a/libs/cua/crates/cua-spaces-cli/src/keyvault_cmd.rs b/libs/cua/crates/cua-spaces-cli/src/keyvault_cmd.rs
index b207c0b67f..15e331c281 100644
--- a/libs/cua/crates/cua-spaces-cli/src/keyvault_cmd.rs
+++ b/libs/cua/crates/cua-spaces-cli/src/keyvault_cmd.rs
@@ -405,6 +405,7 @@ pub async fn run(cmd: KeyvaultCmd, json: bool, out: &mut dyn Write) -> Result<i3
paths: None,
domains: None,
passwords: false,
+ password_domains: None,
};
let r = c.import(spec).await.map_err(kv_error)?;
if json {
diff --git a/libs/cua/crates/cua-spaces-cli/src/teleport.rs b/libs/cua/crates/cua-spaces-cli/src/teleport.rs
index 01c9b0df55..63537d2dfc 100644
--- a/libs/cua/crates/cua-spaces-cli/src/teleport.rs
+++ b/libs/cua/crates/cua-spaces-cli/src/teleport.rs
@@ -214,6 +214,7 @@ async fn push_through_keyvault(
paths: Some(paths.clone()),
domains: None,
passwords: false,
+ password_domains: None,
};
let mut client = cua_keyvault::client::KeyvaultClient::connect_default()
.await
diff --git a/libs/cua/crates/cua-spaces-ext/src/daemon/keyvault.rs b/libs/cua/crates/cua-spaces-ext/src/daemon/keyvault.rs
index 4a7bbcdbd9..c144406c88 100644
--- a/libs/cua/crates/cua-spaces-ext/src/daemon/keyvault.rs
+++ b/libs/cua/crates/cua-spaces-ext/src/daemon/keyvault.rs
@@ -618,7 +618,13 @@ impl Backend for DaemonBackend {
// source's key here, never written to disk; the receiver
// re-encrypts them under its own.
if spec.passwords && spec.confirm_passwords {
- let sites: Vec<String> = spec.domains.clone().unwrap_or_default();
+ // The review's choice of passwords, else those of the
+ // chosen sites.
+ let sites: Vec<String> = spec
+ .password_domains
+ .clone()
+ .or_else(|| spec.domains.clone())
+ .unwrap_or_default();
for l in self.site_logins_for(&spec.app, spec.profile.clone(), &sites)? {
keep(&mut out, &display, &scope, record::password_record(&l)?);
}
diff --git a/libs/cua/crates/cua-spaces-ext/src/teleport.rs b/libs/cua/crates/cua-spaces-ext/src/teleport.rs
index 353d642f86..40800a5bcc 100644
--- a/libs/cua/crates/cua-spaces-ext/src/teleport.rs
+++ b/libs/cua/crates/cua-spaces-ext/src/teleport.rs
@@ -572,6 +572,9 @@ pub struct TeleportSelection {
/// only when the user ticked them in the review. They are re-encrypted
/// for the destination browser's own key.
pub include_passwords: bool,
+ /// The sites whose saved passwords to send (the review's own choice of
+ /// passwords); `None`: those of `cookie_domains`.
+ pub password_domains: Option<Vec<String>>,
}
/// Session teleport on a [`Space`]: what it can import, and the export and
@@ -749,6 +752,10 @@ impl SpaceTeleport for Space {
paths: Some(approval.paths.clone()),
domains: selection.cookie_domains.clone(),
passwords: selection.include_passwords,
+ password_domains: selection
+ .password_domains
+ .clone()
+ .filter(|_| selection.include_passwords),
};
let mut client = cua_keyvault::client::KeyvaultClient::connect_default()
.await
@@ -777,16 +784,29 @@ impl SpaceTeleport for Space {
stage(cua_keyvault::broker::TeleportStage::Importing);
out
}
- None => client
- .import_and_teleport_launching(
- spec,
- self.id().to_string(),
- options.save_to_keyvault,
- options.launch_after,
- stage,
- )
- .await
- .map_err(|e| Error::TeleportRefused(format!("{}: {e}", approval.app)))?,
+ None => {
+ // A narrower choice of passwords goes only to a daemon that
+ // enforces it: an older one would read the passwords of
+ // every chosen site instead.
+ if spec.password_domains.is_some() {
+ let status = client
+ .status()
+ .await
+ .map_err(|e| Error::TeleportRefused(format!("{}: {e}", approval.app)))?;
+ password_domains_enforced(&status)
+ .map_err(|e| Error::TeleportRefused(format!("{}: {e}", approval.app)))?;
+ }
+ client
+ .import_and_teleport_launching(
+ spec,
+ self.id().to_string(),
+ options.save_to_keyvault,
+ options.launch_after,
+ stage,
+ )
+ .await
+ .map_err(|e| Error::TeleportRefused(format!("{}: {e}", approval.app)))?
+ }
};
let delivery = outcome.deliveries.first();
Ok(TeleportReceipt {
@@ -803,6 +823,28 @@ impl SpaceTeleport for Space {
}
}
+/// Whether the daemon reads only the saved passwords of the sites picked
+/// for them ([`cua_keyvault::broker::FEATURE_PASSWORD_DOMAINS`]). One that
+/// predates it would ignore the choice and send the passwords of every
+/// chosen site, so a teleport with a narrower choice is refused instead.
+pub fn password_domains_enforced(
+ status: &cua_keyvault::broker::Status,
+) -> std::result::Result<(), String> {
+ if status
+ .features
+ .iter()
+ .any(|f| f == cua_keyvault::broker::FEATURE_PASSWORD_DOMAINS)
+ {
+ Ok(())
+ } else {
+ Err(format!(
+ "the Cua Keyvault (version {}) cannot send the passwords of only the sites you picked; \
+ quit and reopen Cua to update it, or send the passwords of the chosen sites",
+ status.version
+ ))
+ }
+}
+
// ------------------------------------------------------------------ tools
/// The `teleport_manifest` and `teleport_app` contract tools and the
@@ -1036,6 +1078,28 @@ async fn teleport_app_broker(
mod tests {
use super::*;
+ /// An older daemon's status has no `features`: a narrower choice of
+ /// passwords is refused, never sent for it to widen (CUA-1641).
+ #[test]
+ fn a_daemon_that_predates_password_domains_is_refused() {
+ let old: cua_keyvault::broker::Status = serde_json::from_value(serde_json::json!({
+ "version": "0.8.0", "initialized": true, "unlocked": true, "disabled": false,
+ "caller_first_party": true, "caller_display": "Cua", "items": 3, "pending": 0,
+ }))
+ .unwrap();
+ assert!(old.features.is_empty());
+ let why = password_domains_enforced(&old).unwrap_err();
+ assert!(
+ why.contains("0.8.0") && why.contains("only the sites you picked"),
+ "{why}"
+ );
+ let new = cua_keyvault::broker::Status {
+ features: vec![cua_keyvault::broker::FEATURE_PASSWORD_DOMAINS.into()],
+ ..old
+ };
+ assert!(password_domains_enforced(&new).is_ok());
+ }
+
#[test]
fn catalog_lists_every_provider_with_names_and_aliases() {
let sessions = AppSessions::with_host(Arc::new(providers::FakeHost::new()));
diff --git a/libs/cua/crates/cua-spaces-ext/src/teleport_app.rs b/libs/cua/crates/cua-spaces-ext/src/teleport_app.rs
index 2ed3ebbc40..000cfd060d 100644
--- a/libs/cua/crates/cua-spaces-ext/src/teleport_app.rs
+++ b/libs/cua/crates/cua-spaces-ext/src/teleport_app.rs
@@ -328,6 +328,7 @@ impl SpaceAppTeleport for Space {
cookie_domains: plan.cookie_domains.clone(),
from_vault: plan.from_vault.clone(),
include_passwords: plan.include_passwords,
+ password_domains: plan.password_domains.clone(),
};
let app = plan.app.name.clone();
let receipt = self
diff --git a/libs/cua/crates/cua-spaces-ext/tests/keyvault_items.rs b/libs/cua/crates/cua-spaces-ext/tests/keyvault_items.rs
index d610c45692..304b3e3eb8 100644
--- a/libs/cua/crates/cua-spaces-ext/tests/keyvault_items.rs
+++ b/libs/cua/crates/cua-spaces-ext/tests/keyvault_items.rs
@@ -306,3 +306,73 @@ fn the_inventory_counts_cookies_per_site_without_decrypting_anything() {
inv.notes
);
}
+
+/// A teleport's own choice of saved passwords (`password_domains`) reads only
+/// those sites' logins, apart from the sites whose cookies go; without it
+/// the passwords follow the cookie sites.
+#[test]
+fn a_teleport_reads_only_the_passwords_of_the_sites_picked_for_them() {
+ use cua_teleport::passwords::{encrypt_for_tests, write_login_data_for_tests};
+ use cua_teleport::{HostOutput, Platform};
+ const SAFE_STORAGE: &str = "synthetic-safe-storage";
+ let home = tempfile::tempdir().unwrap();
+ let platform = Platform::current();
+ let profile = home
+ .path()
+ .join(cua_teleport::layout::chrome::user_data_dir_for(platform))
+ .join("Default");
+ let enc = |p: &str| match platform {
+ Platform::MacOS => encrypt_for_tests(b"v10", SAFE_STORAGE.as_bytes(), 1003, p),
+ _ => encrypt_for_tests(b"v10", b"peanuts", 1, p),
+ };
+ write_login_data_for_tests(
+ &profile,
+ &[
+ ("https://github.com/", "octocat", enc("gh-pass")),
+ ("https://bank.example/", "ada", enc("bank-pass")),
+ ],
+ )
+ .unwrap();
+ let host = Arc::new(FakeHost::new().with_home(home.path()).with_responder(|c| {
+ if c.args.iter().any(|a| a == "-w") {
+ Ok(HostOutput::ok(format!("{SAFE_STORAGE}\n").into_bytes()))
+ } else {
+ Ok(HostOutput::ok(b" \"acct\"<blob>=\"Chrome\"\n".to_vec()))
+ }
+ }));
+ // The in-memory browser exports (no real profile, no prompt); the saved
+ // logins are read from the synthetic profile through the FakeHost.
+ let (b, _reg) = backend();
+ let b = b.with_host(host);
+ let logins = |spec: &ImportSpec| -> Vec<String> {
+ b.capture(spec)
+ .unwrap()
+ .iter()
+ .filter(|c| c.meta.kind == cua_keyvault::ItemKind::Password)
+ .map(|c| c.meta.key.clone())
+ .collect()
+ };
+ let spec = ImportSpec {
+ app: "chrome".into(),
+ whole_app: true,
+ confirm_passwords: true,
+ passwords: true,
+ domains: Some(vec!["github.com".into()]),
+ ..Default::default()
+ };
+ assert_eq!(logins(&spec), ["octocat"], "the cookie sites' passwords");
+ let picked = ImportSpec {
+ password_domains: Some(vec!["bank.example".into()]),
+ ..spec.clone()
+ };
+ assert_eq!(
+ logins(&picked),
+ ["ada"],
+ "only the site picked for passwords"
+ );
+ let none = ImportSpec {
+ passwords: false,
+ ..picked
+ };
+ assert!(logins(&none).is_empty(), "not ticked: no password at all");
+}
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 781809ef6f..dae058ab89 100644
--- a/libs/cua/crates/cua-spaces-ffi/src/app_core.rs
+++ b/libs/cua/crates/cua-spaces-ffi/src/app_core.rs
@@ -1069,6 +1069,12 @@ pub fn app_wizard_action_from_json(json: String) -> Result<AppWizardAction> {
from_json("wizard action", &json)
}
+/// A teleport picker event from JSON (fixtures, parity).
+#[uniffi::export]
+pub fn app_picker_event_from_json(json: String) -> Result<AppPickerEvent> {
+ from_json("picker event", &json)
+}
+
/// One of your machines that provides Spaces (the SDK's `Spaces.hosts()`)
/// as the wizard reads it.
#[uniffi::export]
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 0539250018..def402b344 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
@@ -2248,6 +2248,38 @@ pub struct AppReviewToggle {
pub selected: bool,
}
+/// One saved password of the Keyvault, as a review lists it: its site and
+/// username, never its value.
+pub type AppVaultPassword = core::teleport::review::VaultPassword;
+#[uniffi::remote(Record)]
+pub struct AppVaultPassword {
+ /// The item's id.
+ pub id: String,
+ /// Its site (`github.com`); empty when not known.
+ pub site: String,
+ /// Its username; empty when not known or hidden.
+ pub username: String,
+}
+
+/// One saved password choice in the review: a site of the browser (reading
+/// it now) or one saved password (from the Keyvault). Sites and usernames
+/// only: a password's value is never shown.
+pub type AppReviewPassword = core::teleport::review::ReviewPassword;
+#[uniffi::remote(Record)]
+pub struct AppReviewPassword {
+ /// What picking it toggles: the site (reading the app) or the item id
+ /// (from the Keyvault).
+ pub key: String,
+ /// The site (`github.com`), or "Saved password" when not known.
+ pub site: String,
+ /// The username, when known (a saved item).
+ pub username: String,
+ /// "2 passwords" (a site of the browser); empty for one saved item.
+ pub counts: String,
+ /// Chosen to send.
+ pub selected: bool,
+}
+
/// The saved Keyvault items of the app being teleported.
pub type AppVaultSource = core::teleport::review::VaultSource;
#[uniffi::remote(Record)]
@@ -2262,6 +2294,15 @@ pub struct AppVaultSource {
pub selected: Vec<String>,
/// The app's saved passwords (ids), sent only when ticked.
pub password_ids: Vec<String>,
+ /// The same passwords with their site and username (never a value), for
+ /// the review to list.
+ pub passwords: Vec<AppVaultPassword>,
+ /// The Keyvault daemon enforces a choice of passwords by site
+ /// (`password_domains` in its status). Without it the review offers
+ /// the passwords as before (those of the chosen sites, or every saved
+ /// one) and lists none to pick: it never shows a choice the daemon
+ /// would not keep.
+ pub password_picks: bool,
}
/// The review's choices.
@@ -2287,6 +2328,15 @@ pub struct AppReviewChoice {
/// The saved passwords are ticked to send (off unless the user ticks
/// them; never remembered).
pub include_passwords: bool,
+ /// The sites whose saved passwords to send (reading the app).
+ pub password_domains: Vec<String>,
+ /// The saved passwords to send (ids, from the Keyvault).
+ pub password_items: Vec<String>,
+ /// The passwords list's search text.
+ pub password_query: String,
+ /// The password choice was made (the default is picked the first time
+ /// the box is ticked).
+ pub passwords_picked: bool,
}
/// What teleport can do with an app.
@@ -2528,6 +2578,9 @@ pub struct AppTeleportConsent {
pub from_vault: Option<Vec<String>>,
/// Also send the saved passwords (ticked in the review).
pub include_passwords: bool,
+ /// Reading the app: the sites whose saved passwords to send (the
+ /// review's per-site choice); `None` when no password is sent this way.
+ pub password_domains: Option<Vec<String>>,
}
/// The "needs the Cua app" prompt for a Keyvault refusal.
@@ -2748,12 +2801,34 @@ pub enum AppPickerEvent {
selected: Vec<String>,
/// The app's saved passwords (ids): sent only when ticked.
password_ids: Vec<String>,
+ /// The same passwords with their site and username (never a
+ /// value), for the review to list.
+ passwords: Vec<AppVaultPassword>,
+ /// The Keyvault daemon enforces a choice of passwords by site
+ /// (`password_domains` in its status); off for an older one.
+ password_picks: bool,
},
/// Tick or untick "Also send saved passwords".
TogglePasswords {
/// Ticked.
value: bool,
},
+ /// Pick or drop one saved password choice (a site, or a saved item's
+ /// id: [`ReviewPassword::key`]).
+ TogglePassword {
+ /// The choice.
+ key: String,
+ },
+ /// Pick or drop every saved password choice the search shows.
+ SelectShownPasswords {
+ /// Pick (true) or drop.
+ value: bool,
+ },
+ /// The passwords list's search text.
+ PasswordQuery {
+ /// Text.
+ text: String,
+ },
/// The chosen saved items changed.
VaultSelection {
/// The ids.
@@ -2853,6 +2928,14 @@ pub struct AppReviewView {
pub include_passwords: bool,
/// "Also send 14 saved passwords".
pub passwords_label: String,
+ /// Ticked: the saved passwords to pick from (sites with counts when
+ /// reading the app, each saved password's site and username from the
+ /// Keyvault; never a value), filtered by the search.
+ pub passwords: Vec<AppReviewPassword>,
+ /// "2 of 5 sites", "2 of 5 passwords".
+ pub password_summary: String,
+ /// The passwords search text.
+ pub password_query: String,
/// What the Keychain will do for this source, in a line.
pub source_note: String,
}
@@ -3208,6 +3291,10 @@ pub struct AppWizardEnv {
/// `gpu_support`), when known. A runtime not listed has none: the
/// Resources step shows no GPU row for it.
pub gpus: Option<Vec<AppGpuChoice>>,
+ /// Picks the name an unnamed Space gets ([`generated_space_name`]);
+ /// `None`: this process's own randomness. A core without randomness
+ /// (the wasm build) is given one; tests give a fixed one.
+ pub name_seed: Option<u64>,
}
/// Create or connect by address.
@@ -3236,6 +3323,28 @@ pub struct AppAddressForm {
pub error: Option<String>,
}
+/// A Resources slider whose value can be typed.
+pub type AppResourceField = core::wizard::ResourceField;
+#[uniffi::remote(Enum)]
+pub enum AppResourceField {
+ /// CPU cores.
+ Cpus,
+ /// Memory, GB.
+ Memory,
+ /// Disk, GB.
+ Disk,
+}
+
+/// A slider's value as typed.
+pub type AppResourceEdit = core::wizard::ResourceEdit;
+#[uniffi::remote(Record)]
+pub struct AppResourceEdit {
+ /// Which slider.
+ pub field: AppResourceField,
+ /// The text as typed.
+ pub text: String,
+}
+
/// The wizard's state.
pub type AppWizardState = core::wizard::WizardState;
#[uniffi::remote(Record)]
@@ -3283,6 +3392,11 @@ pub struct AppWizardState {
pub gpu: bool,
/// The address form.
pub address: AppAddressForm,
+ /// The name the Space gets when Name is left empty
+ /// ([`generated_space_name`], chosen when the wizard opens).
+ pub generated_name: String,
+ /// A slider's value being typed (its number was clicked).
+ pub resource_edit: Option<AppResourceEdit>,
}
/// An input to the wizard.
@@ -3367,6 +3481,21 @@ pub enum AppWizardAction {
},
/// The disk slider's Reset: back to the image's own disk.
ResetDisk,
+ /// A slider's number clicked: its value can be typed.
+ EditResource {
+ /// Which slider.
+ field: AppResourceField,
+ },
+ /// The typed value's text.
+ SetResourceText {
+ /// Text.
+ text: String,
+ },
+ /// Return (or leaving the field): the typed value is used when it is
+ /// within the slider's limits; otherwise the field stays with why.
+ CommitResource,
+ /// Escape: the slider's value stays.
+ CancelResource,
/// The GPU checkbox.
SetGpu {
/// Checked.
@@ -3661,6 +3790,18 @@ pub struct AppGpuRow {
pub learn_more_url: Option<String>,
}
+/// A slider's value being typed.
+pub type AppResourceEditView = core::wizard::ResourceEditView;
+#[uniffi::remote(Record)]
+pub struct AppResourceEditView {
+ /// Which slider.
+ pub field: AppResourceField,
+ /// The text as typed.
+ pub text: String,
+ /// Why it cannot be used, in one line (the slider's limits).
+ pub error: Option<String>,
+}
+
/// The wizard as drawn.
pub type AppWizardView = core::wizard::WizardView;
#[uniffi::remote(Record)]
@@ -3752,8 +3893,14 @@ pub struct AppWizardView {
pub resources_error: Option<String>,
/// The GPU row (Resources), where the runtime offers a GPU.
pub gpu: Option<AppGpuRow>,
+ /// A slider's value being typed: the field shows instead of its number
+ /// (its error is also the field's [`WizardField::error`]).
+ pub resource_edit: Option<AppResourceEditView>,
/// Name as typed.
pub name: String,
+ /// The name the Space gets: the one typed, else the generated one
+ /// (the Name field's placeholder).
+ pub space_name: String,
/// The name breaks the DNS-label rule.
pub name_invalid: bool,
/// Why, in one line.
@@ -4156,6 +4303,10 @@ pub struct KvStatus {
pub browse_until_ms: Option<u64>,
/// "Never ask again" on the unlock prompt is on.
pub skip_unlock_prompt: Option<bool>,
+ /// What the daemon supports beyond the original protocol
+ /// (`password_domains`: it reads only the saved passwords of the sites
+ /// picked for them); empty from a daemon that predates the list.
+ pub features: Vec<String>,
/// An earlier preview's vault was found and set aside.
pub reset_notice: Option<String>,
}
@@ -4754,6 +4905,12 @@ pub struct KvVaultSource {
/// The app's saved passwords (ids), never part of `ids`: they are sent
/// only when ticked in the review.
pub password_ids: Vec<String>,
+ /// The same passwords with their site and username (never a value),
+ /// for the review to list and pick from.
+ pub passwords: Vec<AppVaultPassword>,
+ /// The daemon enforces a choice of passwords by site
+ /// (`password_domains` in its status): the review may offer one.
+ pub password_picks: bool,
}
/// A sidebar category.
diff --git a/libs/cua/crates/cua-spaces-ffi/src/teleport.rs b/libs/cua/crates/cua-spaces-ffi/src/teleport.rs
index 9c7ed85cdf..6bb74ec221 100644
--- a/libs/cua/crates/cua-spaces-ffi/src/teleport.rs
+++ b/libs/cua/crates/cua-spaces-ffi/src/teleport.rs
@@ -310,6 +310,7 @@ impl Teleport {
paths: Some(paths.clone()),
domains: None,
passwords: false,
+ password_domains: None,
};
run(async move {
let mut client = cua_keyvault::client::KeyvaultClient::connect_default()
diff --git a/libs/cua/crates/cua-spaces-ffi/src/teleport_app.rs b/libs/cua/crates/cua-spaces-ffi/src/teleport_app.rs
index 33f1e4c36a..97ac83ac06 100644
--- a/libs/cua/crates/cua-spaces-ffi/src/teleport_app.rs
+++ b/libs/cua/crates/cua-spaces-ffi/src/teleport_app.rs
@@ -643,6 +643,10 @@ mod space_side {
/// Also send the saved passwords: only when ticked in the review.
#[uniffi(default = false)]
pub include_passwords: bool,
+ /// The sites whose saved passwords to send (the review's own
+ /// choice; `None`: those of `cookie_domains`).
+ #[uniffi(default = None)]
+ pub password_domains: Option<Vec<String>>,
}
/// One progress event of [`Teleport::run`].
@@ -873,6 +877,7 @@ mod space_side {
exclude: consent.exclude.clone(),
from_vault: consent.from_vault.clone(),
include_passwords: consent.include_passwords,
+ password_domains: consent.password_domains.clone(),
})
.map_err(crate::teleport_app::ux_err)?;
let sessions = sessions(self);
diff --git a/libs/cua/crates/cua-spaces/src/lib.rs b/libs/cua/crates/cua-spaces/src/lib.rs
index d7a0f6ea13..be1bc1c68a 100644
--- a/libs/cua/crates/cua-spaces/src/lib.rs
+++ b/libs/cua/crates/cua-spaces/src/lib.rs
@@ -124,7 +124,7 @@ pub use space::{SPACESD_FEATURE, ServiceSource, Space, SpaceInfo, SpacePower, Sp
pub use spaces::{
CreatePhase, CreateProgress, DEFAULT_PROBE_TIMEOUT, PendingSpace, ProgressSink,
RecoveredCreate, RecoveryOutcome, SpaceCreate, SpaceCreated, Spaces, SpacesBuilder,
- expects_spacesd, pool_key, sanitize_label, sized_pool_key,
+ expects_spacesd, is_generated_name, pool_key, sanitize_label, sized_pool_key,
};
/// The Spaces tool contract (manifest, input types).
diff --git a/libs/cua/crates/cua-spaces/src/spaces.rs b/libs/cua/crates/cua-spaces/src/spaces.rs
index 2ad1f0171e..38db6264e8 100644
--- a/libs/cua/crates/cua-spaces/src/spaces.rs
+++ b/libs/cua/crates/cua-spaces/src/spaces.rs
@@ -632,6 +632,16 @@ pub(crate) fn random_suffix() -> String {
format!("{:010x}", rand::random::<u64>() & 0xff_ffff_ffff)
}
+/// A name in the form [`SpaceCreate::name`] defaults to (`space-` and ten
+/// lowercase hex digits): one the SDK, or an app on its behalf, generated.
+/// A create under such a name cleans up after a failed start, as one with
+/// no name does.
+pub fn is_generated_name(name: &str) -> bool {
+ name.strip_prefix("space-").is_some_and(|hex| {
+ hex.len() == 10 && hex.bytes().all(|b| matches!(b, b'0'..=b'9' | b'a'..=b'f'))
+ })
+}
+
pub(crate) struct Inner {
pub(crate) registry: Registry,
/// Every Space's latest thumbnail ([`crate::thumbnails`]).
@@ -2085,7 +2095,13 @@ impl Spaces {
}
};
let create_id = opts.create_id.clone().filter(|c| !c.trim().is_empty());
- let generated = opts.name.as_deref().is_none_or(|n| n.trim().is_empty());
+ // A name in the SDK's own form counts as generated: an app that
+ // shows the name before creating picks it the same way
+ // ([`is_generated_name`]).
+ let generated = opts
+ .name
+ .as_deref()
+ .is_none_or(|n| n.trim().is_empty() || is_generated_name(n.trim()));
let named = |opts: &mut SpaceCreate| {
let name = sanitize_label(
&opts
@@ -3333,6 +3349,22 @@ mod tests {
assert_eq!(sanitize_label(&"a".repeat(80)).len(), 63);
}
+ #[test]
+ fn generated_names_are_the_sdks_own_form() {
+ let name = format!("space-{}", random_suffix());
+ assert!(is_generated_name(&name), "{name}");
+ assert!(is_generated_name("space-000000002a"));
+ for other in [
+ "space-2a",
+ "space-000000002A",
+ "dev",
+ "space-000000002ag",
+ "my-space-000000002a",
+ ] {
+ assert!(!is_generated_name(other), "{other}");
+ }
+ }
+
#[test]
fn pool_names_fit_and_differ_by_image_and_runtime() {
let spaces = Spaces::builder()
diff --git a/libs/cua/crates/cua-teleport/src/ux/plan.rs b/libs/cua/crates/cua-teleport/src/ux/plan.rs
index 14ec56f190..8cda5bb5e9 100644
--- a/libs/cua/crates/cua-teleport/src/ux/plan.rs
+++ b/libs/cua/crates/cua-teleport/src/ux/plan.rs
@@ -295,6 +295,10 @@ pub struct TeleportPlan {
/// Also send the saved passwords ([`Consent::include_passwords`]).
#[serde(default, skip_serializing_if = "is_false")]
pub include_passwords: bool,
+ /// The sites whose saved passwords to send
+ /// ([`Consent::password_domains`]); `None`: those of `cookie_domains`.
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub password_domains: Option<Vec<String>>,
}
fn is_false(b: &bool) -> bool {
@@ -341,6 +345,11 @@ pub struct Consent {
/// browser's own key.
#[serde(default)]
pub include_passwords: bool,
+ /// The review's per-site choice of saved passwords (reading the live
+ /// app): the registrable domains whose passwords to send. `None` sends
+ /// those of `cookie_domains` (every site when that is `None` too).
+ #[serde(default)]
+ pub password_domains: Option<Vec<String>>,
}
/// A plan the user approved. Only [`TeleportPlan::approve`] makes one.
@@ -418,6 +427,10 @@ impl TeleportPlan {
self.cookie_domains = consent.cookie_domains.clone();
self.from_vault = consent.from_vault.clone();
self.include_passwords = consent.include_passwords;
+ self.password_domains = consent
+ .password_domains
+ .clone()
+ .filter(|_| consent.include_passwords);
self.save_to_keyvault = self.sensitive && consent.save_to_keyvault;
Ok(ApprovedPlan(self))
}
@@ -670,6 +683,7 @@ pub fn build(
cookie_domains: None,
from_vault: None,
include_passwords: false,
+ password_domains: None,
})
}
diff --git a/libs/cua/scripts/generate-app-core-ffi.py b/libs/cua/scripts/generate-app-core-ffi.py
index e81636e179..c52ce3b1cc 100644
--- a/libs/cua/scripts/generate-app-core-ffi.py
+++ b/libs/cua/scripts/generate-app-core-ffi.py
@@ -33,9 +33,9 @@ TYPES = [
("teleport/transfer.rs", "teleport::transfer", ["TransferPhase", "TransferOverlayState", "TransferStatus", "TransferSignal", "SentFileInfo"]),
("teleport/windows.rs", "teleport::windows", ["OpenWindow", "OpenApp", "RemoteWindow", "RemoteWindowGroup", "PickerTab", "PickerAction", "PickerPrimary"]),
("teleport/grid.rs", "teleport::grid", ["PickerTileIcon", "PickerTileThumbnail", "PickerTile", "PickerTileSection", "PickerGrid", "PickerGridTab", "PickerGridTabItem", "PickerGridPrimary"]),
- ("teleport/review.rs", "teleport::review", ["SendSource", "RememberedChoice", "ReviewDomain", "ReviewToggle", "VaultSource", "ReviewChoice"]),
+ ("teleport/review.rs", "teleport::review", ["SendSource", "RememberedChoice", "ReviewDomain", "ReviewToggle", "VaultPassword", "ReviewPassword", "VaultSource", "ReviewChoice"]),
("teleport/flow.rs", "teleport::flow", ["Capability", "Move", "SensitiveGroup", "SensitiveOption", "CatalogEntry", "ConsentKind", "ConsentItem", "PlanStepView", "Plan", "RunPhase", "RunEvent", "RunReport", "Consent", "InstallCuaPrompt", "Step", "PickerState", "PickerEvent", "EntrySection", "ReviewView"]),
- ("wizard.rs", "wizard", ["LocalEngine", "CloudEngine", "ImageTier", "ImageDistro", "PlatformSize", "ImageSizes", "SandboxImage", "ImageGroup", "KindOption", "StorageVolume", "LocalStorage", "CloudPricing", "CloudOffer", "ConnectedCloud", "HostLimit", "SpaceHost", "RuntimeSwitch", "PlacementOption", "GpuChoice", "WizardEnv", "WizardMode", "AddressForm", "WizardState", "WizardAction", "StepState", "StepView", "Tile", "MenuOption", "CreatePlan", "CreateSpaceArgs", "AddressView", "AddressSubmit", "ImageSuggestion", "SuggestionGroup", "ImageFieldView", "WizardField", "WizardLabels", "WizardFact", "GpuRow", "WizardView"]),
+ ("wizard.rs", "wizard", ["LocalEngine", "CloudEngine", "ImageTier", "ImageDistro", "PlatformSize", "ImageSizes", "SandboxImage", "ImageGroup", "KindOption", "StorageVolume", "LocalStorage", "CloudPricing", "CloudOffer", "ConnectedCloud", "HostLimit", "SpaceHost", "RuntimeSwitch", "PlacementOption", "GpuChoice", "WizardEnv", "WizardMode", "AddressForm", "ResourceField", "ResourceEdit", "WizardState", "WizardAction", "StepState", "StepView", "Tile", "MenuOption", "CreatePlan", "CreateSpaceArgs", "AddressView", "AddressSubmit", "ImageSuggestion", "SuggestionGroup", "ImageFieldView", "WizardField", "WizardLabels", "WizardFact", "GpuRow", "ResourceEditView", "WizardView"]),
("keyvault/wire.rs", "keyvault::wire", ["KvItemPolicy", "KvItem", "KvFavicon", "KvDomainCount", "KvInventory", "KvSigning", "KvCaller", "KvSelector", "KvAccessRequest", "KvPending", "KvGrant", "KvRuleCaller", "KvRule", "KvDelivery", "KvAuditEntry", "KvStatus", "KvVerification", "KeyvaultOverview", "KvCommand"]),
("keyvault/view.rs", "keyvault::view", ["Tone", "SigningBadge", "Tri", "DecisionTone", "Decision", "PendingRow", "AccessKind", "AccessRow", "KvLabels", "KeyvaultPage"]),
("keyvault/vault.rs", "keyvault::vault", ["KvKind", "KvLock", "VaultState", "VaultAction", "VaultRow", "VaultSite", "VaultFiles", "VaultApp", "VaultSelection", "VaultView", "UnlockPrompt", "KvDeleteConfirm", "KvVaultSource"]),
diff --git a/libs/spaces-app-swift/Sources/CuaSpacesFFI/CuaSpacesFFI.swift b/libs/spaces-app-swift/Sources/CuaSpacesFFI/CuaSpacesFFI.swift
index f63c581a39..59e8d1f83b 100644
--- a/libs/spaces-app-swift/Sources/CuaSpacesFFI/CuaSpacesFFI.swift
+++ b/libs/spaces-app-swift/Sources/CuaSpacesFFI/CuaSpacesFFI.swift
@@ -26228,6 +26228,148 @@ public func FfiConverterTypeAppRemoteWindowGroup_lower(_ value: AppRemoteWindowG
}
+public struct AppResourceEdit: Equatable, Hashable {
+ /**
+ * Which slider.
+ */
+ public var field: AppResourceField
+ /**
+ * The text as typed.
+ */
+ public var text: String
+
+ // Default memberwise initializers are never public by default, so we
+ // declare one manually.
+ public init(
+ /**
+ * Which slider.
+ */field: AppResourceField,
+ /**
+ * The text as typed.
+ */text: String) {
+ self.field = field
+ self.text = text
+ }
+
+
+
+
+}
+
+#if compiler(>=6)
+extension AppResourceEdit: Sendable {}
+#endif
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public struct FfiConverterTypeAppResourceEdit: FfiConverterRustBuffer {
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AppResourceEdit {
+ return
+ try AppResourceEdit(
+ field: FfiConverterTypeAppResourceField.read(from: &buf),
+ text: FfiConverterString.read(from: &buf)
+ )
+ }
+
+ public static func write(_ value: AppResourceEdit, into buf: inout [UInt8]) {
+ FfiConverterTypeAppResourceField.write(value.field, into: &buf)
+ FfiConverterString.write(value.text, into: &buf)
+ }
+}
+
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeAppResourceEdit_lift(_ buf: RustBuffer) throws -> AppResourceEdit {
+ return try FfiConverterTypeAppResourceEdit.lift(buf)
+}
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeAppResourceEdit_lower(_ value: AppResourceEdit) -> RustBuffer {
+ return FfiConverterTypeAppResourceEdit.lower(value)
+}
+
+
+public struct AppResourceEditView: Equatable, Hashable {
+ /**
+ * Which slider.
+ */
+ public var field: AppResourceField
+ /**
+ * The text as typed.
+ */
+ public var text: String
+ /**
+ * Why it cannot be used, in one line (the slider's limits).
+ */
+ public var error: String?
+
+ // Default memberwise initializers are never public by default, so we
+ // declare one manually.
+ public init(
+ /**
+ * Which slider.
+ */field: AppResourceField,
+ /**
+ * The text as typed.
+ */text: String,
+ /**
+ * Why it cannot be used, in one line (the slider's limits).
+ */error: String?) {
+ self.field = field
+ self.text = text
+ self.error = error
+ }
+
+
+
+
+}
+
+#if compiler(>=6)
+extension AppResourceEditView: Sendable {}
+#endif
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public struct FfiConverterTypeAppResourceEditView: FfiConverterRustBuffer {
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AppResourceEditView {
+ return
+ try AppResourceEditView(
+ field: FfiConverterTypeAppResourceField.read(from: &buf),
+ text: FfiConverterString.read(from: &buf),
+ error: FfiConverterOptionString.read(from: &buf)
+ )
+ }
+
+ public static func write(_ value: AppResourceEditView, into buf: inout [UInt8]) {
+ FfiConverterTypeAppResourceField.write(value.field, into: &buf)
+ FfiConverterString.write(value.text, into: &buf)
+ FfiConverterOptionString.write(value.error, into: &buf)
+ }
+}
+
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeAppResourceEditView_lift(_ buf: RustBuffer) throws -> AppResourceEditView {
+ return try FfiConverterTypeAppResourceEditView.lift(buf)
+}
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeAppResourceEditView_lower(_ value: AppResourceEditView) -> RustBuffer {
+ return FfiConverterTypeAppResourceEditView.lower(value)
+}
+
+
public struct AppReviewChoice: Equatable, Hashable {
/**
* Where to send from.
@@ -26264,6 +26406,23 @@ public struct AppReviewChoice: Equatable, Hashable {
* them; never remembered).
*/
public var includePasswords: Bool
+ /**
+ * The sites whose saved passwords to send (reading the app).
+ */
+ public var passwordDomains: [String]
+ /**
+ * The saved passwords to send (ids, from the Keyvault).
+ */
+ public var passwordItems: [String]
+ /**
+ * The passwords list's search text.
+ */
+ public var passwordQuery: String
+ /**
+ * The password choice was made (the default is picked the first time
+ * the box is ticked).
+ */
+ public var passwordsPicked: Bool
// Default memberwise initializers are never public by default, so we
// declare one manually.
@@ -26294,7 +26453,20 @@ public struct AppReviewChoice: Equatable, Hashable {
/**
* The saved passwords are ticked to send (off unless the user ticks
* them; never remembered).
- */includePasswords: Bool) {
+ */includePasswords: Bool,
+ /**
+ * The sites whose saved passwords to send (reading the app).
+ */passwordDomains: [String],
+ /**
+ * The saved passwords to send (ids, from the Keyvault).
+ */passwordItems: [String],
+ /**
+ * The passwords list's search text.
+ */passwordQuery: String,
+ /**
+ * The password choice was made (the default is picked the first time
+ * the box is ticked).
+ */passwordsPicked: Bool) {
self.source = source
self.domains = domains
self.selectedDomains = selectedDomains
@@ -26303,6 +26475,10 @@ public struct AppReviewChoice: Equatable, Hashable {
self.vault = vault
self.loaded = loaded
self.includePasswords = includePasswords
+ self.passwordDomains = passwordDomains
+ self.passwordItems = passwordItems
+ self.passwordQuery = passwordQuery
+ self.passwordsPicked = passwordsPicked
}
@@ -26328,7 +26504,11 @@ public struct FfiConverterTypeAppReviewChoice: FfiConverterRustBuffer {
excluded: FfiConverterSequenceString.read(from: &buf),
vault: FfiConverterTypeAppVaultSource.read(from: &buf),
loaded: FfiConverterBool.read(from: &buf),
- includePasswords: FfiConverterBool.read(from: &buf)
+ includePasswords: FfiConverterBool.read(from: &buf),
+ passwordDomains: FfiConverterSequenceString.read(from: &buf),
+ passwordItems: FfiConverterSequenceString.read(from: &buf),
+ passwordQuery: FfiConverterString.read(from: &buf),
+ passwordsPicked: FfiConverterBool.read(from: &buf)
)
}
@@ -26341,6 +26521,10 @@ public struct FfiConverterTypeAppReviewChoice: FfiConverterRustBuffer {
FfiConverterTypeAppVaultSource.write(value.vault, into: &buf)
FfiConverterBool.write(value.loaded, into: &buf)
FfiConverterBool.write(value.includePasswords, into: &buf)
+ FfiConverterSequenceString.write(value.passwordDomains, into: &buf)
+ FfiConverterSequenceString.write(value.passwordItems, into: &buf)
+ FfiConverterString.write(value.passwordQuery, into: &buf)
+ FfiConverterBool.write(value.passwordsPicked, into: &buf)
}
}
@@ -26498,6 +26682,104 @@ public func FfiConverterTypeAppReviewDomain_lower(_ value: AppReviewDomain) -> R
}
+public struct AppReviewPassword: Equatable, Hashable {
+ /**
+ * What picking it toggles: the site (reading the app) or the item id
+ * (from the Keyvault).
+ */
+ public var key: String
+ /**
+ * The site (`github.com`), or "Saved password" when not known.
+ */
+ public var site: String
+ /**
+ * The username, when known (a saved item).
+ */
+ public var username: String
+ /**
+ * "2 passwords" (a site of the browser); empty for one saved item.
+ */
+ public var counts: String
+ /**
+ * Chosen to send.
+ */
+ public var selected: Bool
+
+ // Default memberwise initializers are never public by default, so we
+ // declare one manually.
+ public init(
+ /**
+ * What picking it toggles: the site (reading the app) or the item id
+ * (from the Keyvault).
+ */key: String,
+ /**
+ * The site (`github.com`), or "Saved password" when not known.
+ */site: String,
+ /**
+ * The username, when known (a saved item).
+ */username: String,
+ /**
+ * "2 passwords" (a site of the browser); empty for one saved item.
+ */counts: String,
+ /**
+ * Chosen to send.
+ */selected: Bool) {
+ self.key = key
+ self.site = site
+ self.username = username
+ self.counts = counts
+ self.selected = selected
+ }
+
+
+
+
+}
+
+#if compiler(>=6)
+extension AppReviewPassword: Sendable {}
+#endif
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public struct FfiConverterTypeAppReviewPassword: FfiConverterRustBuffer {
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AppReviewPassword {
+ return
+ try AppReviewPassword(
+ key: FfiConverterString.read(from: &buf),
+ site: FfiConverterString.read(from: &buf),
+ username: FfiConverterString.read(from: &buf),
+ counts: FfiConverterString.read(from: &buf),
+ selected: FfiConverterBool.read(from: &buf)
+ )
+ }
+
+ public static func write(_ value: AppReviewPassword, into buf: inout [UInt8]) {
+ FfiConverterString.write(value.key, into: &buf)
+ FfiConverterString.write(value.site, into: &buf)
+ FfiConverterString.write(value.username, into: &buf)
+ FfiConverterString.write(value.counts, into: &buf)
+ FfiConverterBool.write(value.selected, into: &buf)
+ }
+}
+
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeAppReviewPassword_lift(_ buf: RustBuffer) throws -> AppReviewPassword {
+ return try FfiConverterTypeAppReviewPassword.lift(buf)
+}
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeAppReviewPassword_lower(_ value: AppReviewPassword) -> RustBuffer {
+ return FfiConverterTypeAppReviewPassword.lower(value)
+}
+
+
public struct AppReviewToggle: Equatable, Hashable {
/**
* The consent item's key.
@@ -26723,6 +27005,20 @@ public struct AppReviewView: Equatable, Hashable {
* "Also send 14 saved passwords".
*/
public var passwordsLabel: String
+ /**
+ * Ticked: the saved passwords to pick from (sites with counts when
+ * reading the app, each saved password's site and username from the
+ * Keyvault; never a value), filtered by the search.
+ */
+ public var passwords: [AppReviewPassword]
+ /**
+ * "2 of 5 sites", "2 of 5 passwords".
+ */
+ public var passwordSummary: String
+ /**
+ * The passwords search text.
+ */
+ public var passwordQuery: String
/**
* What the Keychain will do for this source, in a line.
*/
@@ -26822,6 +27118,17 @@ public struct AppReviewView: Equatable, Hashable {
/**
* "Also send 14 saved passwords".
*/passwordsLabel: String,
+ /**
+ * Ticked: the saved passwords to pick from (sites with counts when
+ * reading the app, each saved password's site and username from the
+ * Keyvault; never a value), filtered by the search.
+ */passwords: [AppReviewPassword],
+ /**
+ * "2 of 5 sites", "2 of 5 passwords".
+ */passwordSummary: String,
+ /**
+ * The passwords search text.
+ */passwordQuery: String,
/**
* What the Keychain will do for this source, in a line.
*/sourceNote: String) {
@@ -26852,6 +27159,9 @@ public struct AppReviewView: Equatable, Hashable {
self.offersPasswords = offersPasswords
self.includePasswords = includePasswords
self.passwordsLabel = passwordsLabel
+ self.passwords = passwords
+ self.passwordSummary = passwordSummary
+ self.passwordQuery = passwordQuery
self.sourceNote = sourceNote
}
@@ -26898,6 +27208,9 @@ public struct FfiConverterTypeAppReviewView: FfiConverterRustBuffer {
offersPasswords: FfiConverterBool.read(from: &buf),
includePasswords: FfiConverterBool.read(from: &buf),
passwordsLabel: FfiConverterString.read(from: &buf),
+ passwords: FfiConverterSequenceTypeAppReviewPassword.read(from: &buf),
+ passwordSummary: FfiConverterString.read(from: &buf),
+ passwordQuery: FfiConverterString.read(from: &buf),
sourceNote: FfiConverterString.read(from: &buf)
)
}
@@ -26930,6 +27243,9 @@ public struct FfiConverterTypeAppReviewView: FfiConverterRustBuffer {
FfiConverterBool.write(value.offersPasswords, into: &buf)
FfiConverterBool.write(value.includePasswords, into: &buf)
FfiConverterString.write(value.passwordsLabel, into: &buf)
+ FfiConverterSequenceTypeAppReviewPassword.write(value.passwords, into: &buf)
+ FfiConverterString.write(value.passwordSummary, into: &buf)
+ FfiConverterString.write(value.passwordQuery, into: &buf)
FfiConverterString.write(value.sourceNote, into: &buf)
}
}
@@ -32704,6 +33020,11 @@ public struct AppTeleportConsent: Equatable, Hashable {
* Also send the saved passwords (ticked in the review).
*/
public var includePasswords: Bool
+ /**
+ * Reading the app: the sites whose saved passwords to send (the
+ * review's per-site choice); `None` when no password is sent this way.
+ */
+ public var passwordDomains: [String]?
// Default memberwise initializers are never public by default, so we
// declare one manually.
@@ -32732,7 +33053,11 @@ public struct AppTeleportConsent: Equatable, Hashable {
*/fromVault: [String]?,
/**
* Also send the saved passwords (ticked in the review).
- */includePasswords: Bool) {
+ */includePasswords: Bool,
+ /**
+ * Reading the app: the sites whose saved passwords to send (the
+ * review's per-site choice); `None` when no password is sent this way.
+ */passwordDomains: [String]?) {
self.approved = approved
self.acknowledgeSensitive = acknowledgeSensitive
self.saveToKeyvault = saveToKeyvault
@@ -32741,6 +33066,7 @@ public struct AppTeleportConsent: Equatable, Hashable {
self.exclude = exclude
self.fromVault = fromVault
self.includePasswords = includePasswords
+ self.passwordDomains = passwordDomains
}
@@ -32766,7 +33092,8 @@ public struct FfiConverterTypeAppTeleportConsent: FfiConverterRustBuffer {
cookieDomains: FfiConverterOptionSequenceString.read(from: &buf),
exclude: FfiConverterSequenceString.read(from: &buf),
fromVault: FfiConverterOptionSequenceString.read(from: &buf),
- includePasswords: FfiConverterBool.read(from: &buf)
+ includePasswords: FfiConverterBool.read(from: &buf),
+ passwordDomains: FfiConverterOptionSequenceString.read(from: &buf)
)
}
@@ -32779,6 +33106,7 @@ public struct FfiConverterTypeAppTeleportConsent: FfiConverterRustBuffer {
FfiConverterSequenceString.write(value.exclude, into: &buf)
FfiConverterOptionSequenceString.write(value.fromVault, into: &buf)
FfiConverterBool.write(value.includePasswords, into: &buf)
+ FfiConverterOptionSequenceString.write(value.passwordDomains, into: &buf)
}
}
@@ -33810,6 +34138,82 @@ public func FfiConverterTypeAppUsageToggle_lower(_ value: AppUsageToggle) -> Rus
}
+public struct AppVaultPassword: Equatable, Hashable {
+ /**
+ * The item's id.
+ */
+ public var id: String
+ /**
+ * Its site (`github.com`); empty when not known.
+ */
+ public var site: String
+ /**
+ * Its username; empty when not known or hidden.
+ */
+ public var username: String
+
+ // Default memberwise initializers are never public by default, so we
+ // declare one manually.
+ public init(
+ /**
+ * The item's id.
+ */id: String,
+ /**
+ * Its site (`github.com`); empty when not known.
+ */site: String,
+ /**
+ * Its username; empty when not known or hidden.
+ */username: String) {
+ self.id = id
+ self.site = site
+ self.username = username
+ }
+
+
+
+
+}
+
+#if compiler(>=6)
+extension AppVaultPassword: Sendable {}
+#endif
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public struct FfiConverterTypeAppVaultPassword: FfiConverterRustBuffer {
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AppVaultPassword {
+ return
+ try AppVaultPassword(
+ id: FfiConverterString.read(from: &buf),
+ site: FfiConverterString.read(from: &buf),
+ username: FfiConverterString.read(from: &buf)
+ )
+ }
+
+ public static func write(_ value: AppVaultPassword, into buf: inout [UInt8]) {
+ FfiConverterString.write(value.id, into: &buf)
+ FfiConverterString.write(value.site, into: &buf)
+ FfiConverterString.write(value.username, into: &buf)
+ }
+}
+
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeAppVaultPassword_lift(_ buf: RustBuffer) throws -> AppVaultPassword {
+ return try FfiConverterTypeAppVaultPassword.lift(buf)
+}
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeAppVaultPassword_lower(_ value: AppVaultPassword) -> RustBuffer {
+ return FfiConverterTypeAppVaultPassword.lower(value)
+}
+
+
public struct AppVaultSource: Equatable, Hashable {
/**
* The app has saved items that can be sent (passwords never are).
@@ -33831,6 +34235,19 @@ public struct AppVaultSource: Equatable, Hashable {
* The app's saved passwords (ids), sent only when ticked.
*/
public var passwordIds: [String]
+ /**
+ * The same passwords with their site and username (never a value), for
+ * the review to list.
+ */
+ public var passwords: [AppVaultPassword]
+ /**
+ * The Keyvault daemon enforces a choice of passwords by site
+ * (`password_domains` in its status). Without it the review offers
+ * the passwords as before (those of the chosen sites, or every saved
+ * one) and lists none to pick: it never shows a choice the daemon
+ * would not keep.
+ */
+ public var passwordPicks: Bool
// Default memberwise initializers are never public by default, so we
// declare one manually.
@@ -33849,12 +34266,25 @@ public struct AppVaultSource: Equatable, Hashable {
*/selected: [String],
/**
* The app's saved passwords (ids), sent only when ticked.
- */passwordIds: [String]) {
+ */passwordIds: [String],
+ /**
+ * The same passwords with their site and username (never a value), for
+ * the review to list.
+ */passwords: [AppVaultPassword],
+ /**
+ * The Keyvault daemon enforces a choice of passwords by site
+ * (`password_domains` in its status). Without it the review offers
+ * the passwords as before (those of the chosen sites, or every saved
+ * one) and lists none to pick: it never shows a choice the daemon
+ * would not keep.
+ */passwordPicks: Bool) {
self.available = available
self.items = items
self.saved = saved
self.selected = selected
self.passwordIds = passwordIds
+ self.passwords = passwords
+ self.passwordPicks = passwordPicks
}
@@ -33877,7 +34307,9 @@ public struct FfiConverterTypeAppVaultSource: FfiConverterRustBuffer {
items: FfiConverterUInt32.read(from: &buf),
saved: FfiConverterString.read(from: &buf),
selected: FfiConverterSequenceString.read(from: &buf),
- passwordIds: FfiConverterSequenceString.read(from: &buf)
+ passwordIds: FfiConverterSequenceString.read(from: &buf),
+ passwords: FfiConverterSequenceTypeAppVaultPassword.read(from: &buf),
+ passwordPicks: FfiConverterBool.read(from: &buf)
)
}
@@ -33887,6 +34319,8 @@ public struct FfiConverterTypeAppVaultSource: FfiConverterRustBuffer {
FfiConverterString.write(value.saved, into: &buf)
FfiConverterSequenceString.write(value.selected, into: &buf)
FfiConverterSequenceString.write(value.passwordIds, into: &buf)
+ FfiConverterSequenceTypeAppVaultPassword.write(value.passwords, into: &buf)
+ FfiConverterBool.write(value.passwordPicks, into: &buf)
}
}
@@ -33979,6 +34413,12 @@ public struct AppWizardEnv: Equatable, Hashable {
* Resources step shows no GPU row for it.
*/
public var gpus: [AppGpuChoice]?
+ /**
+ * Picks the name an unnamed Space gets ([`generated_space_name`]);
+ * `None`: this process's own randomness. A core without randomness
+ * (the wasm build) is given one; tests give a fixed one.
+ */
+ public var nameSeed: UInt64?
// Default memberwise initializers are never public by default, so we
// declare one manually.
@@ -34038,7 +34478,12 @@ public struct AppWizardEnv: Equatable, Hashable {
* The GPU option of each runtime that has one (the SDK's
* `gpu_support`), when known. A runtime not listed has none: the
* Resources step shows no GPU row for it.
- */gpus: [AppGpuChoice]?) {
+ */gpus: [AppGpuChoice]?,
+ /**
+ * Picks the name an unnamed Space gets ([`generated_space_name`]);
+ * `None`: this process's own randomness. A core without randomness
+ * (the wasm build) is given one; tests give a fixed one.
+ */nameSeed: UInt64?) {
self.defaultLocation = defaultLocation
self.cloudAvailable = cloudAvailable
self.localAvailable = localAvailable
@@ -34055,6 +34500,7 @@ public struct AppWizardEnv: Equatable, Hashable {
self.hosts = hosts
self.experiments = experiments
self.gpus = gpus
+ self.nameSeed = nameSeed
}
@@ -34088,7 +34534,8 @@ public struct FfiConverterTypeAppWizardEnv: FfiConverterRustBuffer {
clouds: FfiConverterSequenceTypeAppConnectedCloud.read(from: &buf),
hosts: FfiConverterSequenceTypeAppSpaceHost.read(from: &buf),
experiments: FfiConverterTypeAppExperiments.read(from: &buf),
- gpus: FfiConverterOptionSequenceTypeAppGpuChoice.read(from: &buf)
+ gpus: FfiConverterOptionSequenceTypeAppGpuChoice.read(from: &buf),
+ nameSeed: FfiConverterOptionUInt64.read(from: &buf)
)
}
@@ -34109,6 +34556,7 @@ public struct FfiConverterTypeAppWizardEnv: FfiConverterRustBuffer {
FfiConverterSequenceTypeAppSpaceHost.write(value.hosts, into: &buf)
FfiConverterTypeAppExperiments.write(value.experiments, into: &buf)
FfiConverterOptionSequenceTypeAppGpuChoice.write(value.gpus, into: &buf)
+ FfiConverterOptionUInt64.write(value.nameSeed, into: &buf)
}
}
@@ -34484,6 +34932,15 @@ public struct AppWizardState: Equatable, Hashable {
* The address form.
*/
public var address: AppAddressForm
+ /**
+ * The name the Space gets when Name is left empty
+ * ([`generated_space_name`], chosen when the wizard opens).
+ */
+ public var generatedName: String
+ /**
+ * A slider's value being typed (its number was clicked).
+ */
+ public var resourceEdit: AppResourceEdit?
// Default memberwise initializers are never public by default, so we
// declare one manually.
@@ -34550,7 +35007,14 @@ public struct AppWizardState: Equatable, Hashable {
*/gpu: Bool,
/**
* The address form.
- */address: AppAddressForm) {
+ */address: AppAddressForm,
+ /**
+ * The name the Space gets when Name is left empty
+ * ([`generated_space_name`], chosen when the wizard opens).
+ */generatedName: String,
+ /**
+ * A slider's value being typed (its number was clicked).
+ */resourceEdit: AppResourceEdit?) {
self.mode = mode
self.step = step
self.placement = placement
@@ -34571,6 +35035,8 @@ public struct AppWizardState: Equatable, Hashable {
self.host = host
self.gpu = gpu
self.address = address
+ self.generatedName = generatedName
+ self.resourceEdit = resourceEdit
}
@@ -34608,7 +35074,9 @@ public struct FfiConverterTypeAppWizardState: FfiConverterRustBuffer {
cloud: FfiConverterOptionString.read(from: &buf),
host: FfiConverterOptionString.read(from: &buf),
gpu: FfiConverterBool.read(from: &buf),
- address: FfiConverterTypeAppAddressForm.read(from: &buf)
+ address: FfiConverterTypeAppAddressForm.read(from: &buf),
+ generatedName: FfiConverterString.read(from: &buf),
+ resourceEdit: FfiConverterOptionTypeAppResourceEdit.read(from: &buf)
)
}
@@ -34633,6 +35101,8 @@ public struct FfiConverterTypeAppWizardState: FfiConverterRustBuffer {
FfiConverterOptionString.write(value.host, into: &buf)
FfiConverterBool.write(value.gpu, into: &buf)
FfiConverterTypeAppAddressForm.write(value.address, into: &buf)
+ FfiConverterString.write(value.generatedName, into: &buf)
+ FfiConverterOptionTypeAppResourceEdit.write(value.resourceEdit, into: &buf)
}
}
@@ -34818,10 +35288,20 @@ public struct AppWizardView: Equatable, Hashable {
* The GPU row (Resources), where the runtime offers a GPU.
*/
public var gpu: AppGpuRow?
+ /**
+ * A slider's value being typed: the field shows instead of its number
+ * (its error is also the field's [`WizardField::error`]).
+ */
+ public var resourceEdit: AppResourceEditView?
/**
* Name as typed.
*/
public var name: String
+ /**
+ * The name the Space gets: the one typed, else the generated one
+ * (the Name field's placeholder).
+ */
+ public var spaceName: String
/**
* The name breaks the DNS-label rule.
*/
@@ -35000,9 +35480,17 @@ public struct AppWizardView: Equatable, Hashable {
/**
* The GPU row (Resources), where the runtime offers a GPU.
*/gpu: AppGpuRow?,
+ /**
+ * A slider's value being typed: the field shows instead of its number
+ * (its error is also the field's [`WizardField::error`]).
+ */resourceEdit: AppResourceEditView?,
/**
* Name as typed.
*/name: String,
+ /**
+ * The name the Space gets: the one typed, else the generated one
+ * (the Name field's placeholder).
+ */spaceName: String,
/**
* The name breaks the DNS-label rule.
*/nameInvalid: Bool,
@@ -35078,7 +35566,9 @@ public struct AppWizardView: Equatable, Hashable {
self.resourceFacts = resourceFacts
self.resourcesError = resourcesError
self.gpu = gpu
+ self.resourceEdit = resourceEdit
self.name = name
+ self.spaceName = spaceName
self.nameInvalid = nameInvalid
self.nameError = nameError
self.openWhenReady = openWhenReady
@@ -35148,7 +35638,9 @@ public struct FfiConverterTypeAppWizardView: FfiConverterRustBuffer {
resourceFacts: FfiConverterSequenceTypeAppWizardFact.read(from: &buf),
resourcesError: FfiConverterOptionString.read(from: &buf),
gpu: FfiConverterOptionTypeAppGpuRow.read(from: &buf),
+ resourceEdit: FfiConverterOptionTypeAppResourceEditView.read(from: &buf),
name: FfiConverterString.read(from: &buf),
+ spaceName: FfiConverterString.read(from: &buf),
nameInvalid: FfiConverterBool.read(from: &buf),
nameError: FfiConverterOptionString.read(from: &buf),
openWhenReady: FfiConverterBool.read(from: &buf),
@@ -35204,7 +35696,9 @@ public struct FfiConverterTypeAppWizardView: FfiConverterRustBuffer {
FfiConverterSequenceTypeAppWizardFact.write(value.resourceFacts, into: &buf)
FfiConverterOptionString.write(value.resourcesError, into: &buf)
FfiConverterOptionTypeAppGpuRow.write(value.gpu, into: &buf)
+ FfiConverterOptionTypeAppResourceEditView.write(value.resourceEdit, into: &buf)
FfiConverterString.write(value.name, into: &buf)
+ FfiConverterString.write(value.spaceName, into: &buf)
FfiConverterBool.write(value.nameInvalid, into: &buf)
FfiConverterOptionString.write(value.nameError, into: &buf)
FfiConverterBool.write(value.openWhenReady, into: &buf)
@@ -39094,6 +39588,12 @@ public struct KvStatus: Equatable, Hashable {
* "Never ask again" on the unlock prompt is on.
*/
public var skipUnlockPrompt: Bool?
+ /**
+ * What the daemon supports beyond the original protocol
+ * (`password_domains`: it reads only the saved passwords of the sites
+ * picked for them); empty from a daemon that predates the list.
+ */
+ public var features: [String]
/**
* An earlier preview's vault was found and set aside.
*/
@@ -39151,6 +39651,11 @@ public struct KvStatus: Equatable, Hashable {
/**
* "Never ask again" on the unlock prompt is on.
*/skipUnlockPrompt: Bool?,
+ /**
+ * What the daemon supports beyond the original protocol
+ * (`password_domains`: it reads only the saved passwords of the sites
+ * picked for them); empty from a daemon that predates the list.
+ */features: [String],
/**
* An earlier preview's vault was found and set aside.
*/resetNotice: String?) {
@@ -39169,6 +39674,7 @@ public struct KvStatus: Equatable, Hashable {
self.unlockProtectors = unlockProtectors
self.browseUntilMs = browseUntilMs
self.skipUnlockPrompt = skipUnlockPrompt
+ self.features = features
self.resetNotice = resetNotice
}
@@ -39203,6 +39709,7 @@ public struct FfiConverterTypeKvStatus: FfiConverterRustBuffer {
unlockProtectors: FfiConverterSequenceString.read(from: &buf),
browseUntilMs: FfiConverterOptionUInt64.read(from: &buf),
skipUnlockPrompt: FfiConverterOptionBool.read(from: &buf),
+ features: FfiConverterSequenceString.read(from: &buf),
resetNotice: FfiConverterOptionString.read(from: &buf)
)
}
@@ -39223,6 +39730,7 @@ public struct FfiConverterTypeKvStatus: FfiConverterRustBuffer {
FfiConverterSequenceString.write(value.unlockProtectors, into: &buf)
FfiConverterOptionUInt64.write(value.browseUntilMs, into: &buf)
FfiConverterOptionBool.write(value.skipUnlockPrompt, into: &buf)
+ FfiConverterSequenceString.write(value.features, into: &buf)
FfiConverterOptionString.write(value.resetNotice, into: &buf)
}
}
@@ -40117,6 +40625,16 @@ public struct KvVaultSource: Equatable, Hashable {
* only when ticked in the review.
*/
public var passwordIds: [String]
+ /**
+ * The same passwords with their site and username (never a value),
+ * for the review to list and pick from.
+ */
+ public var passwords: [AppVaultPassword]
+ /**
+ * The daemon enforces a choice of passwords by site
+ * (`password_domains` in its status): the review may offer one.
+ */
+ public var passwordPicks: Bool
// Default memberwise initializers are never public by default, so we
// declare one manually.
@@ -40133,11 +40651,21 @@ public struct KvVaultSource: Equatable, Hashable {
/**
* The app's saved passwords (ids), never part of `ids`: they are sent
* only when ticked in the review.
- */passwordIds: [String]) {
+ */passwordIds: [String],
+ /**
+ * The same passwords with their site and username (never a value),
+ * for the review to list and pick from.
+ */passwords: [AppVaultPassword],
+ /**
+ * The daemon enforces a choice of passwords by site
+ * (`password_domains` in its status): the review may offer one.
+ */passwordPicks: Bool) {
self.count = count
self.newestMs = newestMs
self.ids = ids
self.passwordIds = passwordIds
+ self.passwords = passwords
+ self.passwordPicks = passwordPicks
}
@@ -40159,7 +40687,9 @@ public struct FfiConverterTypeKvVaultSource: FfiConverterRustBuffer {
count: FfiConverterUInt32.read(from: &buf),
newestMs: FfiConverterInt64.read(from: &buf),
ids: FfiConverterSequenceString.read(from: &buf),
- passwordIds: FfiConverterSequenceString.read(from: &buf)
+ passwordIds: FfiConverterSequenceString.read(from: &buf),
+ passwords: FfiConverterSequenceTypeAppVaultPassword.read(from: &buf),
+ passwordPicks: FfiConverterBool.read(from: &buf)
)
}
@@ -40168,6 +40698,8 @@ public struct FfiConverterTypeKvVaultSource: FfiConverterRustBuffer {
FfiConverterInt64.write(value.newestMs, into: &buf)
FfiConverterSequenceString.write(value.ids, into: &buf)
FfiConverterSequenceString.write(value.passwordIds, into: &buf)
+ FfiConverterSequenceTypeAppVaultPassword.write(value.passwords, into: &buf)
+ FfiConverterBool.write(value.passwordPicks, into: &buf)
}
}
@@ -41104,6 +41636,11 @@ public struct TeleportConsent: Equatable, Hashable {
* Also send the saved passwords: only when ticked in the review.
*/
public var includePasswords: Bool
+ /**
+ * The sites whose saved passwords to send (the review's own
+ * choice; `None`: those of `cookie_domains`).
+ */
+ public var passwordDomains: [String]?
// Default memberwise initializers are never public by default, so we
// declare one manually.
@@ -41134,7 +41671,11 @@ public struct TeleportConsent: Equatable, Hashable {
*/fromVault: [String]? = nil,
/**
* Also send the saved passwords: only when ticked in the review.
- */includePasswords: Bool = false) {
+ */includePasswords: Bool = false,
+ /**
+ * The sites whose saved passwords to send (the review's own
+ * choice; `None`: those of `cookie_domains`).
+ */passwordDomains: [String]? = nil) {
self.approved = approved
self.acknowledgeSensitive = acknowledgeSensitive
self.saveToKeyvault = saveToKeyvault
@@ -41143,6 +41684,7 @@ public struct TeleportConsent: Equatable, Hashable {
self.exclude = exclude
self.fromVault = fromVault
self.includePasswords = includePasswords
+ self.passwordDomains = passwordDomains
}
@@ -41168,7 +41710,8 @@ public struct FfiConverterTypeTeleportConsent: FfiConverterRustBuffer {
cookieDomains: FfiConverterOptionSequenceString.read(from: &buf),
exclude: FfiConverterSequenceString.read(from: &buf),
fromVault: FfiConverterOptionSequenceString.read(from: &buf),
- includePasswords: FfiConverterBool.read(from: &buf)
+ includePasswords: FfiConverterBool.read(from: &buf),
+ passwordDomains: FfiConverterOptionSequenceString.read(from: &buf)
)
}
@@ -41181,6 +41724,7 @@ public struct FfiConverterTypeTeleportConsent: FfiConverterRustBuffer {
FfiConverterSequenceString.write(value.exclude, into: &buf)
FfiConverterOptionSequenceString.write(value.fromVault, into: &buf)
FfiConverterBool.write(value.includePasswords, into: &buf)
+ FfiConverterOptionSequenceString.write(value.passwordDomains, into: &buf)
}
}
@@ -48887,7 +49431,15 @@ public enum AppPickerEvent: Equatable, Hashable {
*/selected: [String],
/**
* The app's saved passwords (ids): sent only when ticked.
- */passwordIds: [String]
+ */passwordIds: [String],
+ /**
+ * The same passwords with their site and username (never a
+ * value), for the review to list.
+ */passwords: [AppVaultPassword],
+ /**
+ * The Keyvault daemon enforces a choice of passwords by site
+ * (`password_domains` in its status); off for an older one.
+ */passwordPicks: Bool
)
/**
* Tick or untick "Also send saved passwords".
@@ -48897,6 +49449,31 @@ public enum AppPickerEvent: Equatable, Hashable {
* Ticked.
*/value: Bool
)
+ /**
+ * Pick or drop one saved password choice (a site, or a saved item's
+ * id: [`ReviewPassword::key`]).
+ */
+ case togglePassword(
+ /**
+ * The choice.
+ */key: String
+ )
+ /**
+ * Pick or drop every saved password choice the search shows.
+ */
+ case selectShownPasswords(
+ /**
+ * Pick (true) or drop.
+ */value: Bool
+ )
+ /**
+ * The passwords list's search text.
+ */
+ case passwordQuery(
+ /**
+ * Text.
+ */text: String
+ )
/**
* The chosen saved items changed.
*/
@@ -49014,24 +49591,33 @@ public struct FfiConverterTypeAppPickerEvent: FfiConverterRustBuffer {
case 22: return .sendFrom(source: try FfiConverterTypeAppSendSource.read(from: &buf)
)
- case 23: return .vaultItems(count: try FfiConverterUInt32.read(from: &buf), newestMs: try FfiConverterInt64.read(from: &buf), nowMs: try FfiConverterInt64.read(from: &buf), selected: try FfiConverterSequenceString.read(from: &buf), passwordIds: try FfiConverterSequenceString.read(from: &buf)
+ case 23: return .vaultItems(count: try FfiConverterUInt32.read(from: &buf), newestMs: try FfiConverterInt64.read(from: &buf), nowMs: try FfiConverterInt64.read(from: &buf), selected: try FfiConverterSequenceString.read(from: &buf), passwordIds: try FfiConverterSequenceString.read(from: &buf), passwords: try FfiConverterSequenceTypeAppVaultPassword.read(from: &buf), passwordPicks: try FfiConverterBool.read(from: &buf)
)
case 24: return .togglePasswords(value: try FfiConverterBool.read(from: &buf)
)
- case 25: return .vaultSelection(selected: try FfiConverterSequenceString.read(from: &buf)
+ case 25: return .togglePassword(key: try FfiConverterString.read(from: &buf)
)
- case 26: return .confirm
+ case 26: return .selectShownPasswords(value: try FfiConverterBool.read(from: &buf)
+ )
- case 27: return .progress(event: try FfiConverterTypeAppTeleportRunEvent.read(from: &buf)
+ case 27: return .passwordQuery(text: try FfiConverterString.read(from: &buf)
)
- case 28: return .finished(report: try FfiConverterTypeAppTeleportRunReport.read(from: &buf)
+ case 28: return .vaultSelection(selected: try FfiConverterSequenceString.read(from: &buf)
)
- case 29: return .back
+ case 29: return .confirm
+
+ case 30: return .progress(event: try FfiConverterTypeAppTeleportRunEvent.read(from: &buf)
+ )
+
+ case 31: return .finished(report: try FfiConverterTypeAppTeleportRunReport.read(from: &buf)
+ )
+
+ case 32: return .back
default: throw UniffiInternalError.unexpectedEnumCase
}
@@ -49154,13 +49740,15 @@ public struct FfiConverterTypeAppPickerEvent: FfiConverterRustBuffer {
FfiConverterTypeAppSendSource.write(source, into: &buf)
- case let .vaultItems(count,newestMs,nowMs,selected,passwordIds):
+ case let .vaultItems(count,newestMs,nowMs,selected,passwordIds,passwords,passwordPicks):
writeInt(&buf, Int32(23))
FfiConverterUInt32.write(count, into: &buf)
FfiConverterInt64.write(newestMs, into: &buf)
FfiConverterInt64.write(nowMs, into: &buf)
FfiConverterSequenceString.write(selected, into: &buf)
FfiConverterSequenceString.write(passwordIds, into: &buf)
+ FfiConverterSequenceTypeAppVaultPassword.write(passwords, into: &buf)
+ FfiConverterBool.write(passwordPicks, into: &buf)
case let .togglePasswords(value):
@@ -49168,27 +49756,42 @@ public struct FfiConverterTypeAppPickerEvent: FfiConverterRustBuffer {
FfiConverterBool.write(value, into: &buf)
- case let .vaultSelection(selected):
+ case let .togglePassword(key):
writeInt(&buf, Int32(25))
+ FfiConverterString.write(key, into: &buf)
+
+
+ case let .selectShownPasswords(value):
+ writeInt(&buf, Int32(26))
+ FfiConverterBool.write(value, into: &buf)
+
+
+ case let .passwordQuery(text):
+ writeInt(&buf, Int32(27))
+ FfiConverterString.write(text, into: &buf)
+
+
+ case let .vaultSelection(selected):
+ writeInt(&buf, Int32(28))
FfiConverterSequenceString.write(selected, into: &buf)
case .confirm:
- writeInt(&buf, Int32(26))
+ writeInt(&buf, Int32(29))
case let .progress(event):
- writeInt(&buf, Int32(27))
+ writeInt(&buf, Int32(30))
FfiConverterTypeAppTeleportRunEvent.write(event, into: &buf)
case let .finished(report):
- writeInt(&buf, Int32(28))
+ writeInt(&buf, Int32(31))
FfiConverterTypeAppTeleportRunReport.write(report, into: &buf)
case .back:
- writeInt(&buf, Int32(29))
+ writeInt(&buf, Int32(32))
}
}
@@ -49961,6 +50564,89 @@ public func FfiConverterTypeAppPowerControl_lower(_ value: AppPowerControl) -> R
}
+// Note that we don't yet support `indirect` for enums.
+// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
+
+public enum AppResourceField: Equatable, Hashable {
+
+ /**
+ * CPU cores.
+ */
+ case cpus
+ /**
+ * Memory, GB.
+ */
+ case memory
+ /**
+ * Disk, GB.
+ */
+ case disk
+
+
+
+
+
+}
+
+#if compiler(>=6)
+extension AppResourceField: Sendable {}
+#endif
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public struct FfiConverterTypeAppResourceField: FfiConverterRustBuffer {
+ typealias SwiftType = AppResourceField
+
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AppResourceField {
+ let variant: Int32 = try readInt(&buf)
+ switch variant {
+
+ case 1: return .cpus
+
+ case 2: return .memory
+
+ case 3: return .disk
+
+ default: throw UniffiInternalError.unexpectedEnumCase
+ }
+ }
+
+ public static func write(_ value: AppResourceField, into buf: inout [UInt8]) {
+ switch value {
+
+
+ case .cpus:
+ writeInt(&buf, Int32(1))
+
+
+ case .memory:
+ writeInt(&buf, Int32(2))
+
+
+ case .disk:
+ writeInt(&buf, Int32(3))
+
+ }
+ }
+}
+
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeAppResourceField_lift(_ buf: RustBuffer) throws -> AppResourceField {
+ return try FfiConverterTypeAppResourceField.lift(buf)
+}
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+public func FfiConverterTypeAppResourceField_lower(_ value: AppResourceField) -> RustBuffer {
+ return FfiConverterTypeAppResourceField.lower(value)
+}
+
+
// Note that we don't yet support `indirect` for enums.
// See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
@@ -53878,6 +54564,31 @@ public enum AppWizardAction: Equatable, Hashable {
* The disk slider's Reset: back to the image's own disk.
*/
case resetDisk
+ /**
+ * A slider's number clicked: its value can be typed.
+ */
+ case editResource(
+ /**
+ * Which slider.
+ */field: AppResourceField
+ )
+ /**
+ * The typed value's text.
+ */
+ case setResourceText(
+ /**
+ * Text.
+ */text: String
+ )
+ /**
+ * Return (or leaving the field): the typed value is used when it is
+ * within the slider's limits; otherwise the field stays with why.
+ */
+ case commitResource
+ /**
+ * Escape: the slider's value stays.
+ */
+ case cancelResource
/**
* The GPU checkbox.
*/
@@ -54025,35 +54736,45 @@ public struct FfiConverterTypeAppWizardAction: FfiConverterRustBuffer {
case 18: return .resetDisk
- case 19: return .setGpu(on: try FfiConverterBool.read(from: &buf)
+ case 19: return .editResource(field: try FfiConverterTypeAppResourceField.read(from: &buf)
+ )
+
+ case 20: return .setResourceText(text: try FfiConverterString.read(from: &buf)
+ )
+
+ case 21: return .commitResource
+
+ case 22: return .cancelResource
+
+ case 23: return .setGpu(on: try FfiConverterBool.read(from: &buf)
)
- case 20: return .setName(name: try FfiConverterString.read(from: &buf)
+ case 24: return .setName(name: try FfiConverterString.read(from: &buf)
)
- case 21: return .setOpenWhenReady(on: try FfiConverterBool.read(from: &buf)
+ case 25: return .setOpenWhenReady(on: try FfiConverterBool.read(from: &buf)
)
- case 22: return .next
+ case 26: return .next
- case 23: return .back
+ case 27: return .back
- case 24: return .showAddress
+ case 28: return .showAddress
- case 25: return .hideAddress
+ case 29: return .hideAddress
- case 26: return .setAddress(url: try FfiConverterString.read(from: &buf)
+ case 30: return .setAddress(url: try FfiConverterString.read(from: &buf)
)
- case 27: return .setToken(token: try FfiConverterString.read(from: &buf)
+ case 31: return .setToken(token: try FfiConverterString.read(from: &buf)
)
- case 28: return .setAddressName(name: try FfiConverterString.read(from: &buf)
+ case 32: return .setAddressName(name: try FfiConverterString.read(from: &buf)
)
- case 29: return .submitAddress
+ case 33: return .submitAddress
- case 30: return .addressFailed(error: try FfiConverterString.read(from: &buf)
+ case 34: return .addressFailed(error: try FfiConverterString.read(from: &buf)
)
default: throw UniffiInternalError.unexpectedEnumCase
@@ -54149,58 +54870,76 @@ public struct FfiConverterTypeAppWizardAction: FfiConverterRustBuffer {
writeInt(&buf, Int32(18))
- case let .setGpu(on):
+ case let .editResource(field):
writeInt(&buf, Int32(19))
+ FfiConverterTypeAppResourceField.write(field, into: &buf)
+
+
+ case let .setResourceText(text):
+ writeInt(&buf, Int32(20))
+ FfiConverterString.write(text, into: &buf)
+
+
+ case .commitResource:
+ writeInt(&buf, Int32(21))
+
+
+ case .cancelResource:
+ writeInt(&buf, Int32(22))
+
+
+ case let .setGpu(on):
+ writeInt(&buf, Int32(23))
FfiConverterBool.write(on, into: &buf)
case let .setName(name):
- writeInt(&buf, Int32(20))
+ writeInt(&buf, Int32(24))
FfiConverterString.write(name, into: &buf)
case let .setOpenWhenReady(on):
- writeInt(&buf, Int32(21))
+ writeInt(&buf, Int32(25))
FfiConverterBool.write(on, into: &buf)
case .next:
- writeInt(&buf, Int32(22))
+ writeInt(&buf, Int32(26))
case .back:
- writeInt(&buf, Int32(23))
+ writeInt(&buf, Int32(27))
case .showAddress:
- writeInt(&buf, Int32(24))
+ writeInt(&buf, Int32(28))
case .hideAddress:
- writeInt(&buf, Int32(25))
+ writeInt(&buf, Int32(29))
case let .setAddress(url):
- writeInt(&buf, Int32(26))
+ writeInt(&buf, Int32(30))
FfiConverterString.write(url, into: &buf)
case let .setToken(token):
- writeInt(&buf, Int32(27))
+ writeInt(&buf, Int32(31))
FfiConverterString.write(token, into: &buf)
case let .setAddressName(name):
- writeInt(&buf, Int32(28))
+ writeInt(&buf, Int32(32))
FfiConverterString.write(name, into: &buf)
case .submitAddress:
- writeInt(&buf, Int32(29))
+ writeInt(&buf, Int32(33))
case let .addressFailed(error):
- writeInt(&buf, Int32(30))
+ writeInt(&buf, Int32(34))
FfiConverterString.write(error, into: &buf)
}
@@ -58199,6 +58938,54 @@ fileprivate struct FfiConverterOptionTypeAppRelayUsageView: FfiConverterRustBuff
}
}
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+fileprivate struct FfiConverterOptionTypeAppResourceEdit: FfiConverterRustBuffer {
+ typealias SwiftType = AppResourceEdit?
+
+ public static func write(_ value: SwiftType, into buf: inout [UInt8]) {
+ guard let value = value else {
+ writeInt(&buf, Int8(0))
+ return
+ }
+ writeInt(&buf, Int8(1))
+ FfiConverterTypeAppResourceEdit.write(value, into: &buf)
+ }
+
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType {
+ switch try readInt(&buf) as Int8 {
+ case 0: return nil
+ case 1: return try FfiConverterTypeAppResourceEdit.read(from: &buf)
+ default: throw UniffiInternalError.unexpectedOptionalTag
+ }
+ }
+}
+
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+fileprivate struct FfiConverterOptionTypeAppResourceEditView: FfiConverterRustBuffer {
+ typealias SwiftType = AppResourceEditView?
+
+ public static func write(_ value: SwiftType, into buf: inout [UInt8]) {
+ guard let value = value else {
+ writeInt(&buf, Int8(0))
+ return
+ }
+ writeInt(&buf, Int8(1))
+ FfiConverterTypeAppResourceEditView.write(value, into: &buf)
+ }
+
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType {
+ switch try readInt(&buf) as Int8 {
+ case 0: return nil
+ case 1: return try FfiConverterTypeAppResourceEditView.read(from: &buf)
+ default: throw UniffiInternalError.unexpectedOptionalTag
+ }
+ }
+}
+
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
@@ -61672,6 +62459,31 @@ fileprivate struct FfiConverterSequenceTypeAppReviewDomain: FfiConverterRustBuff
}
}
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+fileprivate struct FfiConverterSequenceTypeAppReviewPassword: FfiConverterRustBuffer {
+ typealias SwiftType = [AppReviewPassword]
+
+ public static func write(_ value: [AppReviewPassword], into buf: inout [UInt8]) {
+ let len = Int32(value.count)
+ writeInt(&buf, len)
+ for item in value {
+ FfiConverterTypeAppReviewPassword.write(item, into: &buf)
+ }
+ }
+
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [AppReviewPassword] {
+ let len: Int32 = try readInt(&buf)
+ var seq = [AppReviewPassword]()
+ seq.reserveCapacity(Int(len))
+ for _ in 0 ..< len {
+ seq.append(try FfiConverterTypeAppReviewPassword.read(from: &buf))
+ }
+ return seq
+ }
+}
+
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
@@ -62422,6 +63234,31 @@ fileprivate struct FfiConverterSequenceTypeAppUnconfirmedMachine: FfiConverterRu
}
}
+#if swift(>=5.8)
+@_documentation(visibility: private)
+#endif
+fileprivate struct FfiConverterSequenceTypeAppVaultPassword: FfiConverterRustBuffer {
+ typealias SwiftType = [AppVaultPassword]
+
+ public static func write(_ value: [AppVaultPassword], into buf: inout [UInt8]) {
+ let len = Int32(value.count)
+ writeInt(&buf, len)
+ for item in value {
+ FfiConverterTypeAppVaultPassword.write(item, into: &buf)
+ }
+ }
+
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> [AppVaultPassword] {
+ let len: Int32 = try readInt(&buf)
+ var seq = [AppVaultPassword]()
+ seq.reserveCapacity(Int(len))
+ for _ in 0 ..< len {
+ seq.append(try FfiConverterTypeAppVaultPassword.read(from: &buf))
+ }
+ return seq
+ }
+}
+
#if swift(>=5.8)
@_documentation(visibility: private)
#endif
@@ -65062,6 +65899,16 @@ public func appPickerConsent(state: AppPickerState) -> AppTeleportConsent {
)
})
}
+/**
+ * A teleport picker event from JSON (fixtures, parity).
+ */
+public func appPickerEventFromJson(json: String)throws -> AppPickerEvent {
+ return try FfiConverterTypeAppPickerEvent_lift(try rustCallWithError(FfiConverterTypeCuaError_lift) {
+ uniffi_cua_spaces_ffi_fn_func_app_picker_event_from_json(
+ FfiConverterString.lower(json),$0
+ )
+})
+}
/**
* The picker grid's primary button for a tab ("Continue", "Teleport to
* <Space>", "Stream to This Mac"), live with a choosable tile selected.
@@ -67160,6 +68007,9 @@ private let initializationResult: InitializationResult = {
if (uniffi_cua_spaces_ffi_checksum_func_app_picker_consent() != 47226) {
return InitializationResult.apiChecksumMismatch
}
+ if (uniffi_cua_spaces_ffi_checksum_func_app_picker_event_from_json() != 64995) {
+ return InitializationResult.apiChecksumMismatch
+ }
if (uniffi_cua_spaces_ffi_checksum_func_app_picker_grid_primary() != 24894) {
return InitializationResult.apiChecksumMismatch
}
diff --git a/libs/spaces-app-swift/Sources/cua_spaces_ffiFFI/include/cua_spaces_ffiFFI.h b/libs/spaces-app-swift/Sources/cua_spaces_ffiFFI/include/cua_spaces_ffiFFI.h
index e72c6d9827..7611091b93 100644
--- a/libs/spaces-app-swift/Sources/cua_spaces_ffiFFI/include/cua_spaces_ffiFFI.h
+++ b/libs/spaces-app-swift/Sources/cua_spaces_ffiFFI/include/cua_spaces_ffiFFI.h
@@ -1437,6 +1437,11 @@ int8_t uniffi_cua_spaces_ffi_fn_func_app_picker_can_plan(RustBuffer state, RustC
RustBuffer uniffi_cua_spaces_ffi_fn_func_app_picker_consent(RustBuffer state, RustCallStatus *_Nonnull out_status
);
#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CUA_SPACES_FFI_FN_FUNC_APP_PICKER_EVENT_FROM_JSON
+#define UNIFFI_FFIDEF_UNIFFI_CUA_SPACES_FFI_FN_FUNC_APP_PICKER_EVENT_FROM_JSON
+RustBuffer uniffi_cua_spaces_ffi_fn_func_app_picker_event_from_json(RustBuffer json, RustCallStatus *_Nonnull out_status
+);
+#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_CUA_SPACES_FFI_FN_FUNC_APP_PICKER_GRID_PRIMARY
#define UNIFFI_FFIDEF_UNIFFI_CUA_SPACES_FFI_FN_FUNC_APP_PICKER_GRID_PRIMARY
RustBuffer uniffi_cua_spaces_ffi_fn_func_app_picker_grid_primary(RustBuffer tab, RustBuffer space_name, RustBuffer grid, RustCallStatus *_Nonnull out_status
@@ -3335,6 +3340,12 @@ uint16_t uniffi_cua_spaces_ffi_checksum_func_app_picker_can_plan(void
#define UNIFFI_FFIDEF_UNIFFI_CUA_SPACES_FFI_CHECKSUM_FUNC_APP_PICKER_CONSENT
uint16_t uniffi_cua_spaces_ffi_checksum_func_app_picker_consent(void
+);
+#endif
+#ifndef UNIFFI_FFIDEF_UNIFFI_CUA_SPACES_FFI_CHECKSUM_FUNC_APP_PICKER_EVENT_FROM_JSON
+#define UNIFFI_FFIDEF_UNIFFI_CUA_SPACES_FFI_CHECKSUM_FUNC_APP_PICKER_EVENT_FROM_JSON
+uint16_t uniffi_cua_spaces_ffi_checksum_func_app_picker_event_from_json(void
+
);
#endif
#ifndef UNIFFI_FFIDEF_UNIFFI_CUA_SPACES_FFI_CHECKSUM_FUNC_APP_PICKER_GRID_PRIMARY