mecha10-behavior-runtime 0.6.5

Behavior tree runtime for Mecha10 - unified AI and logic composition system
Documentation
//! Configuration management for behavior trees
//!
//! This module provides utilities for loading and validating behavior tree configurations,
//! resolved via a `config.json` scope layout rooted at `configs/behaviors/` (LAB-2072 moved it
//! under `configs/` so `mecha10 config push`/`pull`/`list` actually sync it - see
//! `mecha10_cli_core::paths::config`).
//!
//! # Configuration Hierarchy
//!
//! Behavior configurations follow a two-tier hierarchy, override precedence lowest to highest:
//!
//! 1. **Framework default** (`configs/behaviors/@mecha10/{name}/config.json`) - bundled at
//!    scaffold time
//! 2. **Project override** (`configs/behaviors/{name}/config.json`) - project-committed, wins
//!
//! There is no `@local` tier for behaviors (LAB-1990) - node configs have one, but it predates
//! and means something different from a "machine-local" scope, and behaviors never had a real
//! backing for that framing (nothing gitignores it, and `mecha10 config push` syncs it like any
//! other config).
//!
//! Resolution picks the highest-precedence tier present on disk - there's no field-level merging
//! across tiers (LAB-1990).
//!
//! # Example Structure
//!
//! ```text
//! my-robot/
//! └── configs/
//!     └── behaviors/
//!         ├── @mecha10/
//!         │   └── idle_wander/
//!         │       └── config.json      # Bundled framework default
//!         └── idle_wander/
//!             └── config.json          # Project-committed override (highest precedence)
//! ```
//!
//! # Usage
//!
//! ```rust,ignore
//! use mecha10_behavior_runtime::config::{load_behavior_config, validate_behavior_config};
//! use std::path::Path;
//!
//! // Resolve and load the highest-precedence tier present on disk
//! let config = load_behavior_config("idle_wander", Path::new("/path/to/project")).await?;
//!
//! // Validate before loading
//! let registry = NodeRegistry::new();
//! let result = validate_behavior_config(&config, &registry)?;
//! if !result.valid {
//!     for error in result.errors {
//!         eprintln!("Validation error: {}", error);
//!     }
//! }
//! ```

mod loader;
mod types;
mod validator;

pub use loader::{
    detect_project_root, get_current_environment, list_available_behaviors, load_behavior_config,
    resolve_behavior_config_path,
};
pub use types::{BehaviorConfig, CompositionConfig, NodeConfig, NodeReference, ParallelPolicyConfig};
pub use validator::{validate_behavior_composition_json, validate_behavior_config, ValidationResult};