struct ACP::Protocol::ConfigOption

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

Defined in:

acp/protocol/types.cr

Constructors

Instance Method Summary

Constructor Detail

def self.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) #

[View source]
def self.new(pull : JSON::PullParser) #

[View source]

Instance Method Detail

def all_values : Array(ConfigOptionValue) #

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.


[View source]
def category : String | Nil #

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


[View source]
def category=(category : String | Nil) #

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


[View source]
def config_type : String #

The type of input control (required). Currently only "select" is supported. Maps to the Rust SDK's SessionConfigKind.


[View source]
def config_type=(config_type : String) #

The type of input control (required). Currently only "select" is supported. Maps to the Rust SDK's SessionConfigKind.


[View source]
def current_value : String | Nil #

The currently selected value (required). Maps to the Rust SDK's SessionConfigSelect.current_value.


[View source]
def current_value=(current_value : String | Nil) #

The currently selected value (required). Maps to the Rust SDK's SessionConfigSelect.current_value.


[View source]
def description : String | Nil #

Optional description providing more details.


[View source]
def description=(description : String | Nil) #

Optional description providing more details.


[View source]
def grouped? : Bool #

Returns true if this option uses grouped values.


[View source]
def groups : Array(ConfigOptionGroup) | Nil #

Grouped list of available values for this option. Used when options are organized into logical sections (e.g., by provider). Maps to the Rust SDK's SessionConfigSelectOptions::Grouped.


[View source]
def groups=(groups : Array(ConfigOptionGroup) | Nil) #

Grouped list of available values for this option. Used when options are organized into logical sections (e.g., by provider). Maps to the Rust SDK's SessionConfigSelectOptions::Grouped.


[View source]
def id : String #

Unique identifier for this config option (required). Maps to the Rust SDK's SessionConfigId.


[View source]
def id=(id : String) #

Unique identifier for this config option (required). Maps to the Rust SDK's SessionConfigId.


[View source]
def label : String #

Backward-compatible alias for #name.


[View source]
def meta : Hash(String, JSON::Any) | Nil #

Extension metadata.


[View source]
def meta=(meta : Hash(String, JSON::Any) | Nil) #

Extension metadata.


[View source]
def name : String #

Human-readable label (required).


[View source]
def name=(name : String) #

Human-readable label (required).


[View source]
def options : Array(ConfigOptionValue) | Nil #

Flat list of available values for this option. Used when options are not grouped. Maps to the Rust SDK's SessionConfigSelectOptions::Flat.


[View source]
def options=(options : Array(ConfigOptionValue) | Nil) #

Flat list of available values for this option. Used when options are not grouped. Maps to the Rust SDK's SessionConfigSelectOptions::Flat.


[View source]
def value : String | Nil #

Backward-compatible alias for #current_value.


[View source]