load_behavior_config

Function load_behavior_config 

Source
pub async fn load_behavior_config(
    behavior_name: &str,
    project_root: &Path,
    environment: &str,
) -> Result<Value>
Expand description

Load behavior configuration with environment-specific overrides

This function implements a fallback chain:

  1. Try environment-specific config: configs/{env}/behaviors/{name}.json
  2. Fall back to template: behaviors/{name}.json

§Arguments

  • behavior_name - Name of the behavior (e.g., “idle_wander”)
  • project_root - Root directory of the project
  • environment - Environment name (e.g., “dev”, “production”)

§Returns

Merged configuration with environment-specific overrides applied

§Example

use mecha10_behavior_runtime::config::load_behavior_config;

let config = load_behavior_config("idle_wander", "/path/to/project", "dev")?;