//! Mecha10 Behavior Runtime
//!
//! This crate provides a unified behavior composition system for robotics and AI.
//! All behaviors implement the `BehaviorNode` trait with a simple tick-based interface.
//!
//! # Philosophy
//!
//! - **Behavior Logic** = Rust code (complex logic, high performance)
//! - **Behavior Composition** = JSON config (simple orchestration, hot-reloadable)
//! - **Configuration** = JSON with validation (parameters only)
//!
//! # Example
//!
//! ```rust
//! use mecha10_behavior_runtime::{BehaviorNode, NodeStatus, Context};
//! use async_trait::async_trait;
//!
//! #[derive(Debug)]
//! struct MyBehavior;
//!
//! #[async_trait]
//! impl BehaviorNode for MyBehavior {
//!     async fn tick(&mut self, ctx: &Context) -> anyhow::Result<NodeStatus> {
//!         // Your behavior logic here
//!         Ok(NodeStatus::Success)
//!     }
//! }
//! ```

pub mod actions;
mod behavior;
mod composition;
pub mod config;
mod execution;
mod loader;
mod registry;
mod status;

// Re-export core types
pub use actions::{register_builtin_actions, MoveNode, SensorCheckNode, TimerNode, WanderNode};
pub use behavior::{BehaviorNode, BehaviorNodeExt, BoxedBehavior};
pub use composition::{ParallelNode, ParallelPolicy, SelectOrNode, SequenceNode};
pub use config::{
    detect_project_root, get_current_environment, load_behavior_config, validate_behavior_config, BehaviorConfig,
    CompositionConfig, NodeConfig, NodeReference, ParallelPolicyConfig, ValidationResult,
};
pub use execution::{BehaviorExecutor, ExecutionContext, ExecutionStats};
pub use loader::BehaviorLoader;
pub use registry::NodeRegistry;
pub use status::NodeStatus;

// Re-export hot-reload module as public
pub mod hot_reload;

// Re-export mecha10-core Context
pub use mecha10_core::Context;

/// Prelude module for convenient imports
pub mod prelude {
    pub use crate::actions::{MoveNode, SensorCheckNode, TimerNode, WanderNode};
    pub use crate::behavior::{BehaviorNode, BehaviorNodeExt, BoxedBehavior};
    pub use crate::composition::{ParallelNode, ParallelPolicy, SelectOrNode, SequenceNode};
    pub use crate::config::{BehaviorConfig, CompositionConfig, NodeConfig, NodeReference, ParallelPolicyConfig};
    pub use crate::execution::{BehaviorExecutor, ExecutionContext, ExecutionStats};
    pub use crate::loader::BehaviorLoader;
    pub use crate::registry::NodeRegistry;
    pub use crate::status::NodeStatus;
    pub use async_trait::async_trait;
    pub use mecha10_core::Context;
}
