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
//! Unified configuration system for the agentic tools ecosystem.
//!
//! This crate provides:
//! - [`AgenticConfig`]: The root configuration type with namespaced sub-configs
//! - [`load_merged`]: Two-layer config loading (global + local) with env overrides
//! - [`schema`]: JSON Schema generation for IDE autocomplete (Taplo support)
//! - [`validation`]: Advisory validation that produces warnings
//!
//! # Configuration Precedence (lowest to highest)
//! 1. Default values
//! 2. Global config (`~/.config/agentic/agentic.toml`)
//! 3. Local config (`./agentic.toml`)
//! 4. Environment variables
//!
//! # Example
//! ```no_run
//! use agentic_config::{load_merged, AgenticConfig};
//! use std::path::Path;
//!
//! let loaded = load_merged(Path::new(".")).unwrap();
//! println!("Locator model: {}", loaded.config.subagents.locator_model);
//!
//! for warning in &loaded.warnings {
//! eprintln!("Warning: {}", warning);
//! }
//! ```
//!
//! # Environment Variables
//! - `ANTHROPIC_BASE_URL`: Override Anthropic API base URL
//! - `ANTHROPIC_API_KEY`: Set Anthropic API key (env-only)
//! - `EXA_BASE_URL`: Override Exa API base URL
//! - `EXA_API_KEY`: Set Exa API key (env-only)
//! - `AGENTIC_SUBAGENTS_LOCATOR_MODEL`: Override `subagents.locator_model`
//! - `AGENTIC_SUBAGENTS_ANALYZER_MODEL`: Override `subagents.analyzer_model`
//! - `AGENTIC_REASONING_OPTIMIZER_MODEL`: Override `reasoning.optimizer_model`
//! - `AGENTIC_REASONING_EXECUTOR_MODEL`: Override `reasoning.executor_model`
//! - `AGENTIC_REASONING_EFFORT`: Override `reasoning.reasoning_effort`
//! - `AGENTIC_LOG_LEVEL`: Override log level
//! - `AGENTIC_LOG_JSON`: Enable JSON logging ("true" or "1")
compile_error!;
pub
// Re-exports for convenient access
pub use LoadedAgenticConfig;
pub use load_merged;
pub use agentic_config_dir;
pub use xdg_config_home;
pub use schema_json_pretty;
pub use AgenticConfig;