Default Space

The account's default Space, the order to try when it is offline, and where a new task runs now.

The relay keeps one default Space per account: where a new task runs unless you pick another. Devices.spaces_settings reads it, set_spaces_settings replaces it, and resolve_default_space says where a task goes now: the default when it is online, else the next online computer in fallback (while fallback_on), else this computer. A new computer is never made. cua spaces default is the same from the CLI.

Default Space#

Methods of Devices.

Devices.spaces_settings#

The account's default Space and fallback order. A relay that predates them answers "the Cua relay needs an update".

async def spaces_settings(self) -> SpacesSettings

Returns SpacesSettings · Async · Raises CuaError

Devices.set_spaces_settings#

Replaces the account's default Space settings (the whole object; updated_at is set by the relay). Returns what the relay saved.

async def set_spaces_settings(self, settings: SpacesSettings) -> SpacesSettings
ParameterTypeDefault
settingsSpacesSettingsrequired

Returns SpacesSettings · Async · Raises CuaError

Devices.resolve_default_space#

Where the default Space resolves now: the first online entry of the default, the fallback order, then this computer (its own relay machine id, when it has one). Creates nothing.

async def resolve_default_space(self) -> DefaultSpace

Returns DefaultSpace · Async · Raises CuaError

SpacesSettings record#

The account's default Space and the order to try when it is offline.

Returned by Devices.set_spaces_settings, Devices.spaces_settings.

FieldTypeDefaultDescription
default_space / defaultSpaceOption<String>relay:<machine> or relay:<machine>/<name>; none when unset.
fallbackVec<String>The order to try when the default is offline; empty means every online computer you can use, oldest first.
fallback_on / fallbackOnboolfalse: only the default, then this device.
updated_at / updatedAtu64Unix seconds the relay saved it (ignored when writing).

DefaultSpace record#

Where the default Space resolves now.

Returned by Devices.resolve_default_space.

FieldTypeDefaultDescription
spaceOption<String>The first online entry; none when this device is the answer (reason here).
reasonStringdefault, fallback, here or unset.
default_space / defaultSpaceOption<String>The chosen default, online or not.
default_online / defaultOnlineOption<bool>Whether the default is online; none when unset.
orderVec<DefaultSpaceStep>The order the relay tried.

DefaultSpaceStep record#

One entry of the order Devices.resolve_default_space tried.

FieldTypeDefaultDescription
spaceStringThe Space id.
nameStringIts display name.
onlineboolConnected and sharing now.
roleStringdefault, fallback or here.