App core: Cua Volume storage, mount and sync
Settings, Storage (this machine or an S3-compatible bucket, the Finder volume, the cache), the first run's Cua Volume page and the Drive page's devices and conflicts.
Settings, Storage (this machine or an S3-compatible bucket, the Finder volume, the cache), the first run's Cua Volume page and the Drive page's devices and conflicts.
These APIs are part of the Cua Spaces app export for building Spaces UIs. They are source-available under FSL-1.1-MIT and ship for Swift only (import CuaSpacesFFI); the Rust tab shows the cua-spaces-ffi crate they come from. The open source SDK packages for Python, TypeScript and Kotlin do not include them.
app_storage_reduce and app_storage_section drive Settings, Storage from the daemon's volume_storage, volume_mount_status and volume_cache_stats answers; its request names the tool to run (volume_storage_set, volume_mount, volume_cache_set, ...). S3 keys travel only in the volume_storage_set request. AppDriveCard is the first run's Cua Volume page (off by default), drawn over the app_drive_mount_preview miniature. AppDriveSyncInput feeds the Drive page's devices and conflicts.
AppConflictView record#| Field | Type | Default | Description |
|---|---|---|---|
path | String | The file (what Resolve sends). | |
text | String | ||
trailing | String | ||
reveal | Option<String> | The copy to show in the file manager (mounted only). | |
open_label / openLabel | Option<String> | "Open" when reveal is set. | |
resolve_label / resolveLabel | String | "Resolve". |
AppDriveCacheInput record#| Field | Type | Default | Description |
|---|---|---|---|
size_bytes / sizeBytes | u64 | ||
capacity_bytes / capacityBytes | u64 |
AppDriveCard record#| Field | Type | Default | Description |
|---|---|---|---|
label | String | "Add Cua Volume to Finder" (Linux: "Mount Cua Volume"). | |
image_label / imageLabel | String | The miniature's spoken description. | |
checked | bool | Ticked. | |
enabled | bool | The checkbox can be used (the daemon can mount here). | |
busy | bool | Mounting or unmounting. | |
note | Option<String> | One muted line under it (checking, why not, what to approve). | |
error | Option<String> | Why mounting failed. | |
settings_label / settingsLabel | Option<String> | "Open System Settings" while macOS waits for the extension's approval. | |
settings_url / settingsUrl | Option<String> | Where it goes. | |
storage_title / storageTitle | Option<String> | "Where your files live" (none until the daemon answered). | |
storage_options / storageOptions | Vec<AppSettingsOption> | This Mac, Your S3 bucket, Set up later. | |
storage_rows / storageRows | Vec<AppSettingsRow> | The bucket's fields, Test connection and its answer (Your S3 bucket), drawn like Settings' rows. | |
storage_note / storageNote | Option<String> | One muted line for Set up later. | |
stored_in / storedIn | Option<String> | This Mac: "Stored in ~/.cua/volume/data" (the daemon's path). | |
mounted_at / mountedAt | Option<String> | The mounted volume: "In Finder at ~/Cua Volume". | |
stored_path / storedPath | Option<String> | Full paths for tooltips and Show in Finder: stored, mounted. | |
mounted_path / mountedPath | Option<String> | ||
can_continue / canContinue | bool | Continue can be pressed. |
AppDriveCheckInput record#| Field | Type | Default | Description |
|---|---|---|---|
ok | bool | ||
reachable | bool | ||
authorized | bool | ||
versioning | bool | ||
detail | Option<String> | ||
applied | bool | Saved, and the daemon switched to it. |
AppDriveConflictInput record#| Field | Type | Default | Description |
|---|---|---|---|
path | String | The file (the drive's path). | |
conflict_path / conflictPath | String | The visible copy holding the losing write. | |
winner_device / winnerDevice | String | ||
loser_device / loserDevice | String | ||
ts_ms / tsMs | u64 |
AppDriveDeviceInput record#| Field | Type | Default | Description |
|---|---|---|---|
id | String | ||
name | String | ||
this_device / thisDevice | bool | ||
last_seen_ms / lastSeenMs | u64 | Its last heartbeat or change (Unix ms). | |
last_change_ms / lastChangeMs | u64 |
AppDriveMountFrame record#Returned by app_drive_mount_preview_frame, app_drive_mount_preview_still.
| Field | Type | Default | Description |
|---|---|---|---|
volume | f64 | The volume in the sidebar, 0 absent to 1 shown (and selected). | |
flight | Option<AppPreviewPoint> | The file in flight: its icon's top left (drawn above both windows). | |
arrived | Vec<f64> | Each file in the volume, 0 absent to 1 shown. |
AppDriveMountInput record#Returned by app_drive_mount_from_json.
| Field | Type | Default | Description |
|---|---|---|---|
enabled | bool | The user's opt-in. | |
state | String | off, mounting, mounted, needs_approval, unsupported, error. | |
method | String | fskit, nfs, fuse, none. | |
path | Option<String> | The mount point when mounted. | |
volume_name / volumeName | String | "Cua Volume". | |
detail | Option<String> | One sentence for error, needs_approval, unsupported. | |
settings_url / settingsUrl | Option<String> | needs_approval: System Settings' file system extensions. |
AppDriveMountPreview record#Returned by app_drive_mount_preview.
| Field | Type | Default | Description |
|---|---|---|---|
width | f64 | Stage width. | |
height | f64 | Stage height. | |
loop_ms / loopMs | u32 | One loop (ms). | |
space | AppPreviewWindow | The Space (left). | |
finder | AppPreviewWindow | The Finder window (right). | |
sidebar | AppLogicalRect | The Finder window's sidebar (a shade darker than its content). | |
places | Vec<AppLogicalRect> | The sidebar's other places (placeholder bars). | |
volume | AppLogicalRect | The volume's row in the sidebar (the selection highlight). | |
volume_icon / volumeIcon | AppLogicalRect | The volume's drive glyph. | |
volume_label / volumeLabel | String | The volume's name, drawn from volume_label_x, centred on the row. | |
volume_label_x / volumeLabelX | f64 | Where the name starts. | |
font_size / fontSize | f64 | The name's font size. | |
source_icons / sourceIcons | Vec<AppLogicalRect> | The Space's files (icons), top to bottom. | |
source_labels / sourceLabels | Vec<AppLogicalRect> | Their name bars. | |
dest_icons / destIcons | Vec<AppLogicalRect> | Where each file lands in the volume (icons). | |
dest_labels / destLabels | Vec<AppLogicalRect> | Their name bars. |
AppDriveS3Input record#| Field | Type | Default | Description |
|---|---|---|---|
endpoint | Option<String> | None: AWS. | |
region | String | ||
bucket | String | ||
root | String | A key prefix inside the bucket. | |
path_style / pathStyle | bool |
AppDriveStorageInput record#| Field | Type | Default | Description |
|---|---|---|---|
backend | String | fs or s3 (cloud is never offered). | |
fs_path / fsPath | String | Where fs keeps the bytes. | |
s3 | Option<AppDriveS3Input> | ||
has_keys / hasKeys | bool | S3 keys are saved in the credential store. |
AppDriveStorageUpdate record#| Field | Type | Default | Description |
|---|---|---|---|
backend | String | ||
s3 | Option<AppDriveS3Input> | ||
access_key_id / accessKeyId | Option<String> | Both keys or neither. | |
secret_access_key / secretAccessKey | Option<String> | ||
dry_run / dryRun | bool | Only check ("Test connection"). |
AppDriveSyncInput record#Returned by app_drive_sync_from_json.
| Field | Type | Default | Description |
|---|---|---|---|
device_id / deviceId | String | ||
device_name / deviceName | String | ||
feed | String | live, off (one device on this machine's store), error. | |
last_poll_ms / lastPollMs | u64 | This device's last poll of the feed (Unix ms). | |
pending_uploads / pendingUploads | u32 | Local writes not yet in the bucket. | |
conflicts | Vec<AppDriveConflictInput> | ||
devices | Vec<AppDriveDeviceInput> | This device first. | |
last_error / lastError | Option<String> |
AppStorageForm record#| Field | Type | Default | Description |
|---|---|---|---|
backend | String | ||
endpoint | String | ||
region | String | ||
bucket | String | ||
root | String | ||
path_style / pathStyle | bool | ||
access_key_id / accessKeyId | String | ||
secret_access_key / secretAccessKey | String |
AppStorageInput record#Returned by app_storage_input_from_json.
| Field | Type | Default | Description |
|---|---|---|---|
os | AppSpaceOs | This machine's system (the words: "This Mac", "Show in Finder"). | |
home | Option<String> | The home folder, to show paths as ~/.... | |
storage | Option<AppDriveStorageInput> | None until read (or when the daemon cannot answer). | |
mount | Option<AppDriveMountInput> | ||
cache | Option<AppDriveCacheInput> |
AppStorageState record#Returned by app_storage_initial, app_storage_reduce, app_storage_state_from_json.
| Field | Type | Default | Description |
|---|---|---|---|
form | AppStorageForm | ||
dirty | bool | The form differs from what is saved. | |
busy | bool | ||
request | Option<AppStorageRequest> | ||
check | Option<AppDriveCheckInput> | The last test or save. | |
error | Option<String> | ||
manual | bool | The bucket's fields show (else the agent prompt). | |
seen | Option<String> | The last volume_storage seen (bucket, endpoint, region, keys), to notice the agent connecting a bucket while the prompt shows. |
AppDriveStepRequest enum#.mount
.unmount| Variant | Description |
|---|---|
Mount | volume_mount; answer with drive-mounted. |
Unmount | volume_unmount; answer with drive-mounted. |
AppStorageAction enum#.loaded(storage: AppDriveStorageInput)
.setBackend(backend: String)
.setField(field: AppStorageField, value: String)
.setPathStyle(on: Bool)
.test
.save
.checked(check: AppDriveCheckInput)
.saved(check: AppDriveCheckInput)
.adopted(check: AppDriveCheckInput)
.showManual(on: Bool)
.setMount(on: Bool)
.reveal(path: String)
.openUrl(url: String)
.setCache(capacityBytes: UInt64)
.clearCache
.done
.failed(error: String)| Variant | Description |
|---|---|
Loaded | volume_storage was read: the form follows it unless edited. Fields: storage: AppDriveStorageInput |
SetBackend | The backend choice (fs, s3). Fields: backend: String |
SetField | Fields: field: AppStorageField, value: String |
SetPathStyle | Fields: on: bool |
Test | "Test connection". |
Save | The section's Save. |
Checked | A test's answer. Fields: check: AppDriveCheckInput |
Saved | A save's answer. Fields: check: AppDriveCheckInput |
Adopted | An adopted bucket's answer. Fields: check: AppDriveCheckInput |
ShowManual | "Enter details manually" (on) or "Use a prompt instead" (off). Fields: on: bool |
SetMount | "Show Cua Volume in Finder" on or off. Fields: on: bool |
Reveal | "Show in Finder" / "Open". Fields: path: String |
OpenUrl | "Open System Settings". Fields: url: String |
SetCache | Fields: capacity_bytes: u64 |
ClearCache | |
Done | |
Failed | Fields: error: String |
AppStorageChoice enum#.local
.s3
.later| Variant | Description |
|---|---|
Local | This machine (the fs backend, no setup). |
S3 | The user's own S3-compatible bucket. |
Later | Decide later, in Settings, Storage. |
AppStorageField enum#.endpoint
.region
.bucket
.accessKeyId
.secretAccessKey| Variant | Description |
|---|---|
Endpoint | |
Region | |
Bucket | |
AccessKeyId | |
SecretAccessKey |
AppStorageRequest enum#.test(update: AppDriveStorageUpdate)
.save(update: AppDriveStorageUpdate)
.adopt(update: AppDriveStorageUpdate)
.mount
.unmount
.reveal(path: String)
.openUrl(url: String)
.setCache(capacityBytes: UInt64)
.clearCache| Variant | Description |
|---|---|
Test | volume_storage_set with dry_run; answer with checked. Fields: update: AppDriveStorageUpdate |
Save | volume_storage_set; answer with saved. Fields: update: AppDriveStorageUpdate |
Adopt | volume_storage_set (keys from the credential store) for a bucket the user's agent configured; answer with adopted. Fields: update: AppDriveStorageUpdate |
Mount | volume_mount. |
Unmount | volume_unmount. |
Reveal | Show the mount in the file manager (the shell's own call). Fields: path: String |
OpenUrl | Open a URL (System Settings' file system extensions). Fields: url: String |
SetCache | volume_cache_set. Fields: capacity_bytes: u64 |
ClearCache | volume_cache_clear. |
app_drive_mount_from_json#volume_mount_status's JSON as the core takes it.
func appDriveMountFromJson(json: String) throws -> AppDriveMountInput| Parameter | Type | Default |
|---|---|---|
json | String | required |
Returns AppDriveMountInput · Raises CuaError
app_drive_mount_preview#The first run's Cua Volume page: its miniature (files from a Space arriving in the Cua Volume volume in Finder).
func appDriveMountPreview() -> AppDriveMountPreviewReturns AppDriveMountPreview
app_drive_mount_preview_frame#The page's miniature t_ms into its loop (it wraps).
func appDriveMountPreviewFrame(tMs: UInt32) -> AppDriveMountFrame| Parameter | Type | Default |
|---|---|---|
t_ms | u32 | required |
Returns AppDriveMountFrame
app_drive_mount_preview_still#The page's miniature with Reduce Motion: files arriving, still.
func appDriveMountPreviewStill() -> AppDriveMountFrameReturns AppDriveMountFrame
app_drive_sync_from_json#volume_sync_status's JSON as the core takes it.
func appDriveSyncFromJson(json: String) throws -> AppDriveSyncInput| Parameter | Type | Default |
|---|---|---|
json | String | required |
Returns AppDriveSyncInput · Raises CuaError
app_storage_action_from_json#A Storage action from JSON (a test's or save's answer, parity flows).
func appStorageActionFromJson(json: String) throws -> AppStorageAction| Parameter | Type | Default |
|---|---|---|
json | String | required |
Returns AppStorageAction · Raises CuaError
app_storage_choose#What a Storage row's choice asks for.
func appStorageChoose(id: String, option: String) -> AppStorageAction?| Parameter | Type | Default |
|---|---|---|
id | String | required |
option | String | required |
Returns Option<AppStorageAction>
app_storage_edit#What a Storage field's edit asks for.
func appStorageEdit(id: String, value: String) -> AppStorageAction?| Parameter | Type | Default |
|---|---|---|
id | String | required |
value | String | required |
Returns Option<AppStorageAction>
app_storage_initial#Settings' Storage section before anything is read.
func appStorageInitial() -> AppStorageStateReturns AppStorageState
app_storage_input_from_json#Storage input from JSON (the daemon's answers, as they come).
func appStorageInputFromJson(json: String) throws -> AppStorageInput| Parameter | Type | Default |
|---|---|---|
json | String | required |
Returns AppStorageInput · Raises CuaError
app_storage_press#What a Storage row's button asks for.
func appStoragePress(input: AppStorageInput, id: String) -> AppStorageAction?| Parameter | Type | Default |
|---|---|---|
input | AppStorageInput | required |
id | String | required |
Returns Option<AppStorageAction>
app_storage_reduce#Advances the Storage section.
func appStorageReduce(state: AppStorageState, action: AppStorageAction) -> AppStorageState| Parameter | Type | Default |
|---|---|---|
state | AppStorageState | required |
action | AppStorageAction | required |
Returns AppStorageState
app_storage_request_text#One line naming a Storage command.
func appStorageRequestText(request: AppStorageRequest) -> String| Parameter | Type | Default |
|---|---|---|
request | AppStorageRequest | required |
Returns String
app_storage_section#The Storage section as drawn (a Settings section).
func appStorageSection(input: AppStorageInput, state: AppStorageState) -> AppSettingsSection| Parameter | Type | Default |
|---|---|---|
input | AppStorageInput | required |
state | AppStorageState | required |
Returns AppSettingsSection
app_storage_state_from_json#Settings, Storage's state from JSON (fixtures, parity).
func appStorageStateFromJson(json: String) throws -> AppStorageState| Parameter | Type | Default |
|---|---|---|
json | String | required |
Returns AppStorageState · Raises CuaError
app_storage_update_json#The Storage request as the tool's JSON arguments (volume_storage_set).
func appStorageUpdateJson(update: AppDriveStorageUpdate) -> String| Parameter | Type | Default |
|---|---|---|
update | AppDriveStorageUpdate | required |
Returns String
37 items, across this page and its subpages, grouped by page. Methods are listed on their object.
App core: Cua Volume storage, mount and sync: app_drive_mount_from_json, app_drive_mount_preview, app_drive_mount_preview_frame, app_drive_mount_preview_still, app_drive_sync_from_json, app_storage_action_from_json, app_storage_choose, app_storage_edit, app_storage_initial, app_storage_input_from_json, app_storage_press, app_storage_reduce, app_storage_request_text, app_storage_section, app_storage_state_from_json, app_storage_update_json, AppConflictView, AppDriveCacheInput, AppDriveCard, AppDriveCheckInput, AppDriveConflictInput, AppDriveDeviceInput, AppDriveMountFrame, AppDriveMountInput, AppDriveMountPreview, AppDriveS3Input, AppDriveStepRequest, AppDriveStorageInput, AppDriveStorageUpdate, AppDriveSyncInput, AppStorageAction, AppStorageChoice, AppStorageField, AppStorageForm, AppStorageInput, AppStorageRequest, AppStorageState