//! Configuration management module
//!
//! This module handles loading and managing knowledge base configuration.
//!
//! ## Configuration Sources
//!
//! Configuration can be loaded from (in order of preference):
//! 1. **Nickel (.ncl)** - Type-safe, composable configuration (recommended)
//! 2. **TOML (.toml)** - Human-friendly fallback
//! 3. **JSON (.json)** - Machine-readable fallback
//! 4. **Defaults** - Built-in defaults if no config file found
//!
//! ## Nickel Pattern
//!
//! The Nickel configuration pattern works as follows:
//! ```text
//! .ncl file → nickel export --format json → JSON → serde → Rust struct
//! ```
//!
//! This gives us:
//! - Type safety in config files (Nickel schemas)
//! - Composition and reuse (Nickel imports)
//! - Runtime type-safe Rust structs (serde)
//!
//! ## Example
//!
//! ```no_run
//! use kogral_core::config::loader;
//! use std::path::Path;
//!
//! // Load from current directory (searches for .kogral/config.{ncl,toml,json})
//! let config = loader::load_config(None, None)?;
//!
//! // Load from specific file
//! let config = loader::load_config_from_file(Path::new(".kogral/config.toml"))?;
//!
//! // Initialize new .kb directory
//! let config_path = loader::init_kogral_directory(Path::new("."), "toml")?;
//! # Ok::<(), kogral_core::error::KbError>(())
//! ```

pub mod loader;
pub mod nickel;
pub mod schema;

// Re-exports for convenience
pub use loader::{
    find_kogral_directory, init_kogral_directory, load_config, load_config_from_file,
};
pub use schema::{
    EmbeddingConfig, EmbeddingProvider, GraphConfig, InheritanceConfig, KbConfig, McpConfig,
    QueryConfig, StorageConfig, SyncConfig, TemplateConfig,
};
