pub struct Config {
pub version: String,
pub project: ProjectConfig,
pub tools: ToolsConfig,
pub review: ReviewConfig,
pub push_main: bool,
pub agents: AgentsConfig,
pub models: ModelsConfig,
pub env: HashMap<String, String>,
}Expand description
Top-level .botbox.toml config.
All structs use snake_case (TOML native) with alias attributes for
backwards compatibility when loading legacy camelCase JSON configs.
Fields§
§version: String§project: ProjectConfig§tools: ToolsConfig§review: ReviewConfig§push_main: bool§agents: AgentsConfig§models: ModelsConfig§env: HashMap<String, String>Environment variables to pass to all spawned agents.
Values support shell variable expansion (e.g. $HOME, ${HOME}).
Implementations§
Source§impl Config
impl Config
Sourcepub fn load(path: &Path) -> Result<Self>
pub fn load(path: &Path) -> Result<Self>
Load config from a file (TOML or JSON, auto-detected by extension).
Sourcepub fn parse_toml(toml_str: &str) -> Result<Self>
pub fn parse_toml(toml_str: &str) -> Result<Self>
Parse config from a TOML string.
Sourcepub fn parse_json(json: &str) -> Result<Self>
pub fn parse_json(json: &str) -> Result<Self>
Parse config from a JSON string (for backwards compatibility).
Sourcepub fn to_toml(&self) -> Result<String>
pub fn to_toml(&self) -> Result<String>
Serialize config to a TOML string with helpful comments.
Sourcepub fn default_agent(&self) -> String
pub fn default_agent(&self) -> String
Returns the effective agent name (project.default_agent or “{name}-dev”).
Sourcepub fn channel(&self) -> String
pub fn channel(&self) -> String
Returns the effective channel name (project.channel or project.name).
Sourcepub fn resolved_env(&self) -> HashMap<String, String>
pub fn resolved_env(&self) -> HashMap<String, String>
Returns env vars with shell variables expanded (e.g. $HOME → /home/user).
Also propagates OTEL_EXPORTER_OTLP_ENDPOINT from the process environment if set and
not already defined in the config, so telemetry flows through to spawned agents.
Sourcepub fn resolve_model_pool(&self, model: &str) -> Vec<String>
pub fn resolve_model_pool(&self, model: &str) -> Vec<String>
Resolve a model string to the full pool of models for that tier. Tier names (fast/balanced/strong) return a shuffled Vec of all models in the pool. Legacy short names (opus/sonnet/haiku) and explicit model strings return a single-element Vec.
Sourcepub fn resolve_model(&self, model: &str) -> String
pub fn resolve_model(&self, model: &str) -> String
Resolve a model string: if it matches a tier name (fast/balanced/strong), randomly pick from that tier’s pool. Otherwise pass through as-is.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Config
impl JsonSchema for Config
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read more