1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! Configuration management for behavior trees
//!
//! This module provides utilities for loading and validating behavior tree configurations
//! with support for environment-specific overrides.
//!
//! # Configuration Hierarchy
//!
//! Behavior configurations follow a three-tier hierarchy:
//!
//! 1. **Template** (`behaviors/{name}.json`) - Base behavior definition
//! 2. **Common** (`configs/common/behaviors/{name}.json`) - Shared overrides
//! 3. **Environment** (`configs/{env}/behaviors/{name}.json`) - Environment-specific overrides
//!
//! # Example Structure
//!
//! ```text
//! my-robot/
//! ├── behaviors/
//! │ └── idle_wander.json # Base template
//! └── configs/
//! ├── dev/
//! │ └── behaviors/
//! │ └── idle_wander.json # Dev overrides (faster tick rate)
//! ├── production/
//! │ └── behaviors/
//! │ └── idle_wander.json # Production overrides (conservative)
//! └── common/
//! └── behaviors/
//! └── idle_wander.json # Shared overrides
//! ```
//!
//! # Usage
//!
//! ```rust,ignore
//! use mecha10_behavior_runtime::config::{load_behavior_config, validate_behavior_config};
//! use std::path::Path;
//!
//! // Load with environment-specific overrides
//! let config = load_behavior_config(
//! "idle_wander",
//! Path::new("/path/to/project"),
//! "dev"
//! ).await?;
//!
//! // Validate before loading
//! let registry = NodeRegistry::new();
//! let result = validate_behavior_config(&config, ®istry)?;
//! if !result.valid {
//! for error in result.errors {
//! eprintln!("Validation error: {}", error);
//! }
//! }
//! ```
pub use ;
pub use ;
pub use ;