Your cloud
The "Connect a cloud" sheet and the New Space wizard's "Your cloud": providers with their found mark, Test that creates nothing, Connect, and what a connected cloud runs at what cost.
The "Connect a cloud" sheet and the New Space wizard's "Your cloud": providers with their found mark, Test that creates nothing, Connect, and what a connected cloud runs at what cost.
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_cloud_connect_reduce applies an action and app_cloud_connect_view derives the sheet; its request is the cloud_test or cloud_connect call to run. app_connected_clouds_from_status_json turns the SDK's cloud_status into the wizard's clouds.
AppConnectedCloud record#Returned by app_connected_cloud_from_json, app_connected_clouds_from_status_json.
| Field | Type | Default | Description |
|---|---|---|---|
name | String | The SDK's on word: aws, gcp, modal. | |
title | String | AWS, Google Cloud, Modal. | |
label | String | "AWS \u{b7} us-west-2". | |
is_default / isDefault | bool | It is the default location (default.on). | |
ttl_hours / ttlHours | u32 | Hours after which a Space there deletes itself (0: never). | |
offers | Vec<AppCloudOffer> | What it runs. |
AppCloudOffer record#| Field | Type | Default | Description |
|---|---|---|---|
image | String | The image family: linux, linux-slim, linux-vm, windows, omarchy, macos. | |
kind | String | container or vm. | |
supported | bool | Whether it can run there. | |
reason | String | Why not (one line), or a note. | |
machine_type / machineType | String | The machine type the cloud picks (t4g.medium). | |
usd_per_hour / usdPerHour | f64 | Estimated US dollars per hour while it runs. |
app_connected_clouds_from_status_json#The wizard's connected clouds from the SDK's cloud_status JSON.
func appConnectedCloudsFromStatusJson(json: String) throws -> [AppConnectedCloud]| Parameter | Type | Default |
|---|---|---|
json | String | required |
Returns Vec<AppConnectedCloud> · Raises CuaError
app_connected_cloud_from_json#A connected cloud from JSON (parity flows).
func appConnectedCloudFromJson(json: String) throws -> AppConnectedCloud| Parameter | Type | Default |
|---|---|---|
json | String | required |
Returns AppConnectedCloud · Raises CuaError
app_is_cloud_word#Whether a default.on value names one of the user's clouds.
func appIsCloudWord(on: String) -> Bool| Parameter | Type | Default |
|---|---|---|
on | String | required |
Returns bool
AppCloudCheckInput record#| Field | Type | Default | Description |
|---|---|---|---|
name | String | credentials, permissions, quota, ... | |
ok | bool | Passed. | |
detail | String | What was found, or what to fix. |
AppCloudCheckRow record#| Field | Type | Default | Description |
|---|---|---|---|
ok | bool | Passed. | |
text | String | "credentials: account 418638388952". |
AppCloudConnectInput record#Returned by app_cloud_connect_input_from_json, app_cloud_connect_input_from_status_json.
| Field | Type | Default | Description |
|---|---|---|---|
providers | Vec<AppCloudProviderInput> | The providers this build supports. |
AppCloudConnectState record#Returned by app_cloud_connect_initial, app_cloud_connect_reduce.
| Field | Type | Default | Description |
|---|---|---|---|
selected | Option<String> | The chosen provider (aws); None: the first with credentials. | |
value | String | The region, project or environment as typed (empty: the default). | |
profile | String | The profile as typed (empty: the default). | |
make_default / makeDefault | bool | Also make it the default location. | |
phase | AppCloudConnectPhase | Where it is. |
AppCloudConnectView record#Returned by app_cloud_connect_view.
| Field | Type | Default | Description |
|---|---|---|---|
title | String | "Connect a cloud". | |
rows | Vec<AppCloudProviderRow> | The providers. | |
field | Option<AppCloudField> | The region, project or environment field. | |
profile_field / profileField | Option<AppCloudField> | The profile field (AWS, Modal). | |
checks | Vec<AppCloudCheckRow> | The checks the last test ran. | |
result | Option<String> | One line under the checks ("Ready. Nothing was created."). | |
touches | Vec<String> | "What Cua will touch": what the selected provider creates, that only Cua's own tagged resources are ever touched, how cost and auto-stop work, and the command to remove everything. Empty when no real provider is chosen (including "No cloud"). | |
make_default_label / makeDefaultLabel | String | "Make default". | |
make_default / makeDefault | bool | Its value. | |
test_label / testLabel | String | "Test" / "Testing\u{2026}". | |
can_test / canTest | bool | Test can be pressed. | |
test_help / testHelp | String | Test's tooltip. | |
connect_label / connectLabel | String | "Connect" / "Connecting\u{2026}". | |
can_connect / canConnect | bool | Connect can be pressed. | |
cancel_label / cancelLabel | String | "Cancel". | |
error | Option<String> | The last error. | |
done | bool | Connected: close the sheet and refresh. | |
request | Option<AppCloudConnectRequest> | The call to run now (while testing or connecting). |
AppCloudField record#| Field | Type | Default | Description |
|---|---|---|---|
id | String | region, project, environment, profile. | |
label | String | "Region". | |
placeholder | String | The default the provider uses when it is empty. | |
value | String | As typed. |
AppCloudProviderInput record#| Field | Type | Default | Description |
|---|---|---|---|
name | String | aws, gcp, modal. | |
title | String | AWS, Google Cloud, Modal. | |
connected | bool | Connected already. | |
found | bool | This machine has its CLI sign-in (or config). | |
source | String | Where ("~/.aws profile default"), never a secret. | |
profile | String | AWS or Modal profile (the connected or detected one). | |
region | String | Region. | |
project | String | GCP project. | |
environment | String | Modal environment. | |
label | String | "AWS \u{b7} us-west-2". |
AppCloudProviderRow record#| Field | Type | Default | Description |
|---|---|---|---|
id | String | aws. | |
title | String | AWS. | |
detail | String | The one line after the title ("Connected, AWS \u{b7} us-west-2", "~/.aws profile default", "No sign-in found"). | |
found | bool | This machine has its sign-in (the found mark). | |
selected | bool | Chosen. |
AppCloudTargetArgs record#| Field | Type | Default | Description |
|---|---|---|---|
provider | String | aws, gcp, modal. | |
profile | Option<String> | AWS or Modal profile. | |
region | Option<String> | AWS region. | |
project | Option<String> | GCP project. | |
environment | Option<String> | Modal environment. |
AppCloudConnectAction enum#.select(name: String)
.setValue(text: String)
.setProfile(text: String)
.setMakeDefault(on: Bool)
.test
.tested(ok: Bool, account: String, checks: [AppCloudCheckInput])
.connect
.connected(label: String)
.failed(error: String)| Variant | Description |
|---|---|
Select | A provider row. Fields: name: String |
SetValue | The region, project or environment field. Fields: text: String |
SetProfile | The profile field. Fields: text: String |
SetMakeDefault | "Make default". Fields: on: bool |
Test | Test pressed (the shell runs the view's request). |
Tested | The test finished. Fields: ok: bool, account: String, checks: Vec<AppCloudCheckInput> |
Connect | Connect pressed (the shell runs the view's request). |
Connected | Connected. Fields: label: String |
Failed | A call failed. Fields: error: String |
AppCloudConnectPhase enum#.idle
.testing
.tested(ok: Bool, account: String, checks: [AppCloudCheckInput])
.connecting
.connected(label: String)
.failed(error: String)| Variant | Description |
|---|---|
Idle | Nothing running. |
Testing | cloud_test is running. |
Tested | A test finished. Fields: ok: bool, account: String, checks: Vec<AppCloudCheckInput> |
Connecting | cloud_connect is running. |
Connected | Connected (the shell closes the sheet and refreshes). Fields: label: String |
Failed | A call failed. Fields: error: String |
AppCloudConnectRequest enum#.test(target: AppCloudTargetArgs)
.connect(target: AppCloudTargetArgs, makeDefault: Bool)| Variant | Description |
|---|---|
Test | cloud_test. Fields: target: AppCloudTargetArgs |
Connect | cloud_connect. Fields: target: AppCloudTargetArgs, make_default: bool |
app_cloud_connect_action_from_json#A "Connect a cloud" action from JSON (parity flows).
func appCloudConnectActionFromJson(json: String) throws -> AppCloudConnectAction| Parameter | Type | Default |
|---|---|---|
json | String | required |
Returns AppCloudConnectAction · Raises CuaError
app_cloud_connect_initial#A new "Connect a cloud" sheet.
func appCloudConnectInitial() -> AppCloudConnectStateReturns AppCloudConnectState
app_cloud_connect_input_from_json#"Connect a cloud" input from JSON (fixtures, parity flows).
func appCloudConnectInputFromJson(json: String) throws -> AppCloudConnectInput| Parameter | Type | Default |
|---|---|---|
json | String | required |
Returns AppCloudConnectInput · Raises CuaError
app_cloud_connect_input_from_status_json#The sheet's input from the SDK's cloud_status JSON.
func appCloudConnectInputFromStatusJson(json: String) throws -> AppCloudConnectInput| Parameter | Type | Default |
|---|---|---|
json | String | required |
Returns AppCloudConnectInput · Raises CuaError
app_cloud_connect_reduce#Advances the "Connect a cloud" sheet.
func appCloudConnectReduce(input: AppCloudConnectInput, state: AppCloudConnectState, action: AppCloudConnectAction) -> AppCloudConnectState| Parameter | Type | Default |
|---|---|---|
input | AppCloudConnectInput | required |
state | AppCloudConnectState | required |
action | AppCloudConnectAction | required |
Returns AppCloudConnectState
app_cloud_connect_view#The "Connect a cloud" sheet as drawn.
func appCloudConnectView(input: AppCloudConnectInput, state: AppCloudConnectState) -> AppCloudConnectView| Parameter | Type | Default |
|---|---|---|
input | AppCloudConnectInput | required |
state | AppCloudConnectState | required |
Returns AppCloudConnectView