Settings, Agents
Settings > Agents: the coding agents' rows, the provider keys saved in the keychain, and the add or replace sheet.
Settings > Agents: the coding agents' rows, the provider keys saved in the keychain, and the add or replace sheet.
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.
The app_agent_setup* and app_agent_settings_* functions turn AgentSetup results into the coding agents' rows. app_agent_keys_view derives the key rows from app_agent_keys_input_from_json (the daemon's agent_keys.list answer: each saved key's provider, the variable a run gets it as, its last four characters and when it was added). app_agent_key_form drives the add or replace sheet, with app_agent_key_name_problem for an Other key's variable name; app_agent_key_remove_confirm is the confirmation before a key is removed.
AppAgentKeyConfirm record#Returned by app_agent_key_remove_confirm.
| Field | Type | Default | Description |
|---|---|---|---|
title | String | ||
message | String | ||
confirm_label / confirmLabel | String | ||
cancel_label / cancelLabel | String |
AppAgentKeyFormInput record#Returned by app_agent_key_form_input_from_json.
| Field | Type | Default | Description |
|---|---|---|---|
provider | String | anthropic, openai or other. | |
env | Option<String> | The row it opened from (replacing an Other key), when any. | |
name | String | The variable typed for a new Other key. | |
has_value / hasValue | bool | Something was typed in the key field (the page never sends the key). |
AppAgentKeyFormView record#Returned by app_agent_key_form.
| Field | Type | Default | Description |
|---|---|---|---|
title | String | ||
lede | String | ||
name_label / nameLabel | Option<String> | The variable field, for a new Other key. | |
name_placeholder / namePlaceholder | Option<String> | ||
name_error / nameError | Option<String> | Why the typed variable can't be used. | |
value_label / valueLabel | String | ||
value_placeholder / valuePlaceholder | String | ||
value_help / valueHelp | String | Under the key field. | |
save_label / saveLabel | String | ||
cancel_label / cancelLabel | String | ||
can_save / canSave | bool | ||
provider | String | What agent_keys.set gets besides the key. | |
env | Option<String> |
AppAgentKeyInput record#| Field | Type | Default | Description |
|---|---|---|---|
provider | String | anthropic, openai or other. | |
env | String | The variable a run gets it as. | |
last4 | String | Its last four characters (empty for a short key). | |
added_ms / addedMs | u64 | When it was added (Unix ms). |
AppAgentKeyRow record#| Field | Type | Default | Description |
|---|---|---|---|
env | String | The variable (the row's id). | |
provider | String | anthropic, openai or other. | |
title | String | "Anthropic", "OpenAI", or the variable. | |
detail | String | Who gets it. | |
set | bool | A key is saved. | |
status | String | "Not set", "•••• 0000", or "Saved" for a short key. | |
added_ms / addedMs | Option<u64> | When it was added (the page writes "Added <date>"). | |
action_label / actionLabel | String | "Add key" or "Replace". | |
remove_label / removeLabel | Option<String> | "Remove", when a key is saved. |
AppAgentKeysInput record#Returned by app_agent_keys_input_from_json.
| Field | Type | Default | Description |
|---|---|---|---|
keys | Vec<AppAgentKeyInput> | The keys saved, once read. | |
unavailable | Option<String> | Why this machine can't keep keys (the daemon's words), when it can't. | |
error | Option<String> | The keys could not be read (no daemon, a refused Keychain). |
AppAgentKeysView record#Returned by app_agent_keys_view.
| Field | Type | Default | Description |
|---|---|---|---|
title | String | ||
intro | String | Where the keys live and who gets them. | |
rows | Vec<AppAgentKeyRow> | ||
add_other_label / addOtherLabel | String | The button for an Other key. | |
other_help / otherHelp | String | What an Other key is. | |
notice | Option<String> | Why keys can't be saved or read, in place of the buttons. | |
can_edit / canEdit | bool | The buttons work. | |
added_label / addedLabel | String | "Added" (before the date the page formats). |
AppAgentSettingsRow record#Returned by app_agent_settings_rows.
| Field | Type | Default | Description |
|---|---|---|---|
agent | String | Registry id. | |
name | String | Display name. | |
installed | bool | Installed. | |
configured | bool | cua skills and the cua MCP server are both in place (where supported). | |
detail | String | One line for the row. | |
skills_installed / skillsInstalled | u32 | Bundled skills present. | |
skills_total / skillsTotal | u32 | Bundled skills. | |
mcp_config / mcpConfig | Option<String> | MCP config file. | |
skills_dir / skillsDir | Option<String> | Skills directory. |
AppAgentSetupOutcomeInput record#Returned by app_agent_setup_outcome, app_agent_setup_outcomes_from_json.
| Field | Type | Default | Description |
|---|---|---|---|
agents | Vec<String> | Agents it served. | |
target | String | skill or mcp. | |
item | String | Skill or server name. | |
change | String | created, updated, unchanged, removed, skipped, failed. | |
detail | String | Explanation. |
AppAgentSetupStatus record#Returned by app_agent_setup_status, app_agent_setup_statuses_from_json.
| Field | Type | Default | Description |
|---|---|---|---|
id | String | Registry id (claude-code, codex, ...). | |
name | String | Display name. | |
installed | bool | Looks installed. | |
skills_dir / skillsDir | Option<String> | User skills directory, when it supports skills. | |
mcp_config / mcpConfig | Option<String> | MCP config file, when it supports MCP. | |
cua_configured / cuaConfigured | bool | The cua MCP server is configured. | |
skills_installed / skillsInstalled | Vec<String> | Bundled skills present. | |
skills_outdated / skillsOutdated | Vec<String> | Installed skills that differ from the bundled copy. | |
error | Option<String> | Problem reading its config. |
AppAgentSetupSummary record#Returned by app_agent_setup_summary.
| Field | Type | Default | Description |
|---|---|---|---|
text | String | "cua MCP server configured, 3 skills installed". | |
failed | Vec<String> | "name: why" per failed target. | |
line | String | "Claude Code: done" / "Claude Code: failed". |
app_agent_key_form#The add or replace sheet.
func appAgentKeyForm(input: AppAgentKeysInput, form: AppAgentKeyFormInput) -> AppAgentKeyFormView| Parameter | Type | Default |
|---|---|---|
input | AppAgentKeysInput | required |
form | AppAgentKeyFormInput | required |
Returns AppAgentKeyFormView
app_agent_key_form_input_from_json#A sheet input from JSON (parity flows).
func appAgentKeyFormInputFromJson(json: String) throws -> AppAgentKeyFormInput| Parameter | Type | Default |
|---|---|---|
json | String | required |
Returns AppAgentKeyFormInput · Raises CuaError
app_agent_key_name_problem#Why name can't hold an Other key (None: it can).
func appAgentKeyNameProblem(name: String) -> String?| Parameter | Type | Default |
|---|---|---|
name | String | required |
Returns Option<String>
app_agent_key_remove_confirm#The question before removing the key env (None: none is saved).
func appAgentKeyRemoveConfirm(input: AppAgentKeysInput, env: String) -> AppAgentKeyConfirm?| Parameter | Type | Default |
|---|---|---|
input | AppAgentKeysInput | required |
env | String | required |
Returns Option<AppAgentKeyConfirm>
app_agent_keys_input_from_json#The section's input from JSON (agent_keys.list's answer, camelCase).
func appAgentKeysInputFromJson(json: String) throws -> AppAgentKeysInput| Parameter | Type | Default |
|---|---|---|
json | String | required |
Returns AppAgentKeysInput · Raises CuaError
app_agent_keys_view#Settings, Agents: the rows for the keys the daemon reported.
func appAgentKeysView(input: AppAgentKeysInput) -> AppAgentKeysView| Parameter | Type | Default |
|---|---|---|
input | AppAgentKeysInput | required |
Returns AppAgentKeysView
app_agent_settings_rows#Settings rows for the coding agents (total: bundled skills).
func appAgentSettingsRows(statuses: [AppAgentSetupStatus], total: UInt32) -> [AppAgentSettingsRow]| Parameter | Type | Default |
|---|---|---|
statuses | Vec<AppAgentSetupStatus> | required |
total | u32 | required |
Returns Vec<AppAgentSettingsRow>
app_agent_setup_outcome#The SDK's setup outcome as the app core reads it.
func appAgentSetupOutcome(outcome: AgentSetupOutcome) -> AppAgentSetupOutcomeInput| Parameter | Type | Default |
|---|---|---|
outcome | AgentSetupOutcome | required |
Returns AppAgentSetupOutcomeInput
app_agent_setup_outcomes_from_json#Agent setup outcomes from JSON (parity flows).
func appAgentSetupOutcomesFromJson(json: String) throws -> [AppAgentSetupOutcomeInput]| Parameter | Type | Default |
|---|---|---|
json | String | required |
Returns Vec<AppAgentSetupOutcomeInput> · Raises CuaError
app_agent_setup_status#The SDK's agent detection as the app core reads it.
func appAgentSetupStatus(info: AgentInfo) -> AppAgentSetupStatus| Parameter | Type | Default |
|---|---|---|
info | AgentInfo | required |
Returns AppAgentSetupStatus
app_agent_setup_statuses_from_json#Coding agents' setup states from JSON (fixtures, parity flows).
func appAgentSetupStatusesFromJson(json: String) throws -> [AppAgentSetupStatus]| Parameter | Type | Default |
|---|---|---|
json | String | required |
Returns Vec<AppAgentSetupStatus> · Raises CuaError
app_agent_setup_summary#What an agent setup did for one agent.
func appAgentSetupSummary(outcomes: [AppAgentSetupOutcomeInput], agent: String, name: String) -> AppAgentSetupSummary| Parameter | Type | Default |
|---|---|---|
outcomes | Vec<AppAgentSetupOutcomeInput> | required |
agent | String | required |
name | String | required |
Returns AppAgentSetupSummary