pub struct RalphConfig {Show 26 fields
pub event_loop: EventLoopConfig,
pub cli: CliConfig,
pub core: CoreConfig,
pub hats: HashMap<String, HatConfig>,
pub events: HashMap<String, EventMetadata>,
pub agent: Option<String>,
pub agent_priority: Vec<String>,
pub prompt_file: Option<String>,
pub completion_promise: Option<String>,
pub max_iterations: Option<u32>,
pub max_runtime: Option<u64>,
pub max_cost: Option<f64>,
pub verbose: bool,
pub archive_prompts: bool,
pub enable_metrics: bool,
pub max_tokens: Option<u32>,
pub retry_delay: Option<u32>,
pub adapters: AdaptersConfig,
pub suppress_warnings: bool,
pub tui: TuiConfig,
pub memories: MemoriesConfig,
pub tasks: TasksConfig,
pub hooks: HooksConfig,
pub skills: SkillsConfig,
pub features: FeaturesConfig,
pub robot: RobotConfig,
}Expand description
Top-level configuration for Ralph Orchestrator.
Supports both v1.x flat format and v2.0 nested format:
- v1:
agent: claude,max_iterations: 100 - v2:
cli: { backend: claude },event_loop: { max_iterations: 100 }
Fields§
§event_loop: EventLoopConfigEvent loop configuration (v2 nested style).
cli: CliConfigCLI backend configuration (v2 nested style).
core: CoreConfigCore paths and settings shared across all hats.
hats: HashMap<String, HatConfig>Custom hat definitions (optional). If empty, default planner and builder hats are used.
events: HashMap<String, EventMetadata>Event metadata definitions (optional). Defines what each event topic means, enabling auto-derived instructions. If a hat uses custom events, define them here for proper behavior injection.
agent: Option<String>V1 field: Backend CLI (maps to cli.backend). Values: “claude”, “kiro”, “gemini”, “codex”, “amp”, “pi”, “auto”, or “custom”.
agent_priority: Vec<String>V1 field: Fallback order for auto-detection.
prompt_file: Option<String>V1 field: Path to prompt file (maps to event_loop.prompt_file).
completion_promise: Option<String>V1 field: Completion detection string (maps to event_loop.completion_promise).
max_iterations: Option<u32>V1 field: Maximum loop iterations (maps to event_loop.max_iterations).
max_runtime: Option<u64>V1 field: Maximum runtime in seconds (maps to event_loop.max_runtime_seconds).
max_cost: Option<f64>V1 field: Maximum cost in USD (maps to event_loop.max_cost_usd).
verbose: boolEnable verbose output.
archive_prompts: boolArchive prompts after completion (DEFERRED: warn if enabled).
enable_metrics: boolEnable metrics collection (DEFERRED: warn if enabled).
max_tokens: Option<u32>V1 field: Token limits (DROPPED: controlled by CLI tool).
retry_delay: Option<u32>V1 field: Retry delay (DROPPED: handled differently in v2).
adapters: AdaptersConfigV1 adapter settings (partially supported).
suppress_warnings: boolSuppress all warnings (for CI environments).
tui: TuiConfigTUI configuration.
memories: MemoriesConfigMemories configuration for persistent learning across sessions.
tasks: TasksConfigTasks configuration for runtime work tracking.
hooks: HooksConfigLifecycle hooks configuration.
skills: SkillsConfigSkills configuration for the skill discovery and injection system.
features: FeaturesConfigFeature flags for optional capabilities.
robot: RobotConfigRObot (Ralph-Orchestrator bot) configuration for Telegram-based interaction.
Implementations§
Source§impl RalphConfig
impl RalphConfig
Sourcepub fn from_file(path: impl AsRef<Path>) -> Result<Self, ConfigError>
pub fn from_file(path: impl AsRef<Path>) -> Result<Self, ConfigError>
Loads configuration from a YAML file.
Sourcepub fn parse_yaml(content: &str) -> Result<Self, ConfigError>
pub fn parse_yaml(content: &str) -> Result<Self, ConfigError>
Parses configuration from a YAML string.
Sourcepub fn normalize(&mut self)
pub fn normalize(&mut self)
Normalizes v1 flat fields into v2 nested structure.
V1 flat fields take precedence over v2 nested fields when both are present. This allows users to use either format or mix them.
Sourcepub fn validate(&self) -> Result<Vec<ConfigWarning>, ConfigError>
pub fn validate(&self) -> Result<Vec<ConfigWarning>, ConfigError>
Validates the configuration and returns warnings.
This method checks for:
- Deferred features that are enabled (archive_prompts, enable_metrics)
- Dropped fields that are present (max_tokens, retry_delay, tool_permissions)
- Ambiguous trigger routing across custom hats
- Mutual exclusivity of prompt and prompt_file
Returns a list of warnings that should be displayed to the user.
Sourcepub fn effective_backend(&self) -> &str
pub fn effective_backend(&self) -> &str
Gets the effective backend name, resolving “auto” using the priority list.
Sourcepub fn get_agent_priority(&self) -> Vec<&str>
pub fn get_agent_priority(&self) -> Vec<&str>
Returns the agent priority list for auto-detection. If empty, returns the default priority order.
Sourcepub fn adapter_settings(&self, backend: &str) -> &AdapterSettings
pub fn adapter_settings(&self, backend: &str) -> &AdapterSettings
Gets the adapter settings for a specific backend.
Trait Implementations§
Source§impl Clone for RalphConfig
impl Clone for RalphConfig
Source§fn clone(&self) -> RalphConfig
fn clone(&self) -> RalphConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more