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
62
63
64
65
66
67
68
69
70
71
72
73
74
//! # Configuration Module
//!
//! Modern configuration system for Inferno with builder pattern, presets, and validation.
//!
//! ## Quick Start
//!
//! ```no_run
//! use inferno::core::config::{ConfigBuilder, Preset, LogLevel};
//!
//! // Simple configuration
//! let config = ConfigBuilder::new()
//! .models_dir("./models")
//! .build()?;
//!
//! // Use a preset
//! let config = ConfigBuilder::new()
//! .preset(Preset::Production)
//! .build()?;
//!
//! // Customize a preset
//! let config = ConfigBuilder::new()
//! .preset(Preset::Development)
//! .log_level(LogLevel::Trace)
//! .models_dir("./my-models")
//! .build()?;
//! # Ok::<(), anyhow::Error>(())
//! ```
//!
//! ## Architecture
//!
//! The new configuration system is organized into logical groups:
//!
//! - **Core**: Essential settings (models_dir, logging, etc.)
//! - **Builder**: Fluent API for constructing configs
//! - **Presets**: Predefined configurations (Dev, Prod, Test, Benchmark)
//! - **Types**: Type-safe enums (LogLevel, LogFormat)
//!
//! ## Migration from Old System
//!
//! The old `Config` struct is still available for backward compatibility:
//!
//! ```no_run
//! use inferno::config::Config;
//!
//! // Old way (still works)
//! let config = Config::load()?;
//! # Ok::<(), anyhow::Error>(())
//! ```
//!
//! New code should use `ConfigBuilder`:
//!
//! ```no_run
//! use inferno::core::config::{ConfigBuilder, Preset};
//!
//! // New way (recommended)
//! let config = ConfigBuilder::new()
//! .preset(Preset::Development)
//! .build()?;
//! # Ok::<(), anyhow::Error>(())
//! ```
// Re-export commonly used types
pub use ConfigBuilder;
pub use CoreConfig;
pub use Preset;
pub use ;
// For backward compatibility, also re-export from crate::config
// This will be handled in the main config.rs file