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
//! agentctl-auth — Unified auth pool and LLM API client.
//!
//! Provides:
//! - **AuthPool**: credential management (load/save/add/remove/import from auth-profiles.json)
//! - **Credential testing**: validate API keys against provider endpoints
//! - **Claude client**: Messages API with OAuth stealth headers, token rotation on 429
//!
//! # Quick Start
//!
//! ```no_run
//! use agentctl_auth::{AuthPool, claude};
//!
//! # async fn example() -> anyhow::Result<()> {
//! // Load auth pool
//! let pool = AuthPool::load(&std::path::PathBuf::from("~/.agentctl/auth.toml"))?;
//!
//! // Get default Anthropic credential
//! let (name, cred) = pool.get_default("anthropic").unwrap();
//!
//! // Build a Claude client with token rotation
//! let client = claude::ClientBuilder::new()
//! .pool(&pool)
//! .build()?;
//!
//! let response = client.message(
//! "claude-sonnet-4-20250514",
//! &[claude::Message::user("Hello!")],
//! 4096,
//! ).await?;
//!
//! println!("Tokens used: {}", response.usage.input_tokens + response.usage.output_tokens);
//! # Ok(())
//! # }
//! ```
pub use ;
pub use AuthPool;
pub use ;
// Re-export key claude types for convenience
pub use ;