#![allow(clippy::module_name_repetitions)]
#![allow(clippy::too_many_arguments)]

//! TypeAgent Core Library
//!
//! Type-safe AI agent execution with a 3-layer pipeline architecture:
//!
//! ## Pipeline Layers
//!
//! ### Layer 0: Foundation
//! - **error** - Error types and result handling
//! - **utils** - Common utilities
//!
//! ### Layer 1: Parsing (MDX → AST)
//! - **parser** - Markup node parsing from MDX
//! - **formats** - Agent format detection
//!
//! ### Layer 2: Transpilation (AST → Nickel)
//! - **transpiler** - AST to Nickel code generation
//! - **nickel** - Nickel evaluation and type checking
//!
//! ### Layer 3: Execution (Nickel → Output)
//! - **executor** - Agent execution orchestration
//! - **cache** - Execution caching strategies
//! - **llm** - LLM provider abstraction
//! - **loader** - Agent definition loading
//!
//! ## Recommended Entry Points
//!
//! - [`AgentExecutor`] - Execute agents end-to-end
//! - [`LlmClient`] - Simplified LLM interactions
//! - [`AgentLoader`] - Load agent definitions from files

// ============================================================================
// LAYER 0: FOUNDATION
// ============================================================================

pub mod error;
pub mod utils;

// ============================================================================
// LAYER 1: PARSING (MDX → AST)
// ============================================================================

pub mod formats;
pub mod parser;

// ============================================================================
// LAYER 2: TRANSPILATION (AST → Nickel)
// ============================================================================

pub mod nickel;
pub mod transpiler;

// ============================================================================
// LAYER 3: EXECUTION (Nickel → Output)
// ============================================================================

pub mod cache;
pub mod executor;
pub mod llm;
mod loader;

// ============================================================================
// PUBLIC API EXPORTS (grouped by pipeline layer)
// ============================================================================

// Layer 0: Foundation
pub use error::{Error, Result};

// Layer 1: Parsing
pub use formats::{AgentFormat, FormatDetector};
pub use parser::{AgentDirective, MarkupNode, MarkupParser};

// Layer 2: Transpilation
pub use nickel::{AgentConfig, AgentDefinition, NickelEvaluator};
pub use transpiler::NickelTranspiler;

// Layer 3: Execution (recommended entry points)
pub use cache::{CacheManager, CacheStats, CacheStrategy};
pub use executor::{AgentExecutor, ExecutionResult};
pub use llm::LlmClient;
pub use loader::AgentLoader;
