struct
ACP::Protocol::ConfigOption
- ACP::Protocol::ConfigOption
- Struct
- Value
- Object
Overview
A single session configuration option and its current state.
Matches the Rust SDK's SessionConfigOption + SessionConfigSelect.
See: https://agentclientprotocol.com/protocol/session-config-options#configoption
Included Modules
- JSON::Serializable
Defined in:
acp/protocol/types.crConstructors
- .new(id : String, name : String, config_type : String = "select", current_value : String | Nil = nil, options : Array(ConfigOptionValue) | Nil = nil, groups : Array(ConfigOptionGroup) | Nil = nil, description : String | Nil = nil, category : String | Nil = nil, meta : Hash(String, JSON::Any) | Nil = nil)
- .new(pull : JSON::PullParser)
Instance Method Summary
- #after_initialize : Nil
-
#all_values : Array(ConfigOptionValue)
Returns all option values across all groups (flattened).
-
#category : String | Nil
Optional semantic category to help Clients provide consistent UX.
-
#category=(category : String | Nil)
Optional semantic category to help Clients provide consistent UX.
-
#config_type : String
The type of input control (required).
-
#config_type=(config_type : String)
The type of input control (required).
-
#current_value : String | Nil
The currently selected value (required).
-
#current_value=(current_value : String | Nil)
The currently selected value (required).
-
#description : String | Nil
Optional description providing more details.
-
#description=(description : String | Nil)
Optional description providing more details.
-
#grouped? : Bool
Returns true if this option uses grouped values.
-
#groups : Array(ConfigOptionGroup) | Nil
Grouped list of available values for this option (nil when flat).
-
#id : String
Unique identifier for this config option (required).
-
#id=(id : String)
Unique identifier for this config option (required).
-
#label : String
Backward-compatible alias for
#name. -
#meta : Hash(String, JSON::Any) | Nil
Extension metadata.
-
#meta=(meta : Hash(String, JSON::Any) | Nil)
Extension metadata.
-
#name : String
Human-readable label (required).
-
#name=(name : String)
Human-readable label (required).
-
#options : Array(ConfigOptionValue) | Nil
Flat list of available values for this option (nil when grouped).
-
#options_raw : Array(JSON::Any) | Nil
Raw wire form of the selectable values.
-
#value : String | Nil
Backward-compatible alias for
#current_value.
Constructor Detail
Instance Method Detail
Populate the typed #options/#groups views from the raw wire array
after JSON deserialization. A group element is identified by the
presence of the "group" key (per SessionConfigSelectGroup).
Returns all option values across all groups (flattened).
If the option has flat #options, returns those.
If the option has #groups, returns all values from all groups.
Optional semantic category to help Clients provide consistent UX.
Reserved categories: "mode", "model", "thought_level".
Names beginning with _ are free for custom use.
See: https://agentclientprotocol.com/protocol/session-config-options#option-categories
Optional semantic category to help Clients provide consistent UX.
Reserved categories: "mode", "model", "thought_level".
Names beginning with _ are free for custom use.
See: https://agentclientprotocol.com/protocol/session-config-options#option-categories
The type of input control (required). Currently only "select" is supported.
Maps to the Rust SDK's SessionConfigKind.
The type of input control (required). Currently only "select" is supported.
Maps to the Rust SDK's SessionConfigKind.
The currently selected value (required).
Maps to the Rust SDK's SessionConfigSelect.current_value.
The currently selected value (required).
Maps to the Rust SDK's SessionConfigSelect.current_value.
Grouped list of available values for this option (nil when flat).
Used when options are organized into logical sections (e.g., by provider).
Maps to the Rust SDK's SessionConfigSelectOptions::Grouped.
Unique identifier for this config option (required).
Maps to the Rust SDK's SessionConfigId.
Unique identifier for this config option (required).
Maps to the Rust SDK's SessionConfigId.
Flat list of available values for this option (nil when grouped).
Maps to the Rust SDK's SessionConfigSelectOptions::Ungrouped.
Raw wire form of the selectable values. Per the ACP schema
(SessionConfigSelect.options -> SessionConfigSelectOptions) this is
a SINGLE "options" array that is EITHER a flat list of
SessionConfigSelectOption values OR a list of
SessionConfigSelectGroup groups. There is NO separate "groups" key.
We keep the raw array here and expose typed #options/#groups views.
Exposed read-only: the typed views and this wire array are derived from
each other at construction / deserialization, so a public setter could
silently desync them. Construct a new ConfigOption to change the values.