//! # sentryagent-idp
//!
//! Production-grade Rust SDK for the [SentryAgent.ai](https://sentryagent.ai)
//! AgentIdP API. Provides full coverage of the 14 API endpoints across agent
//! identity, OAuth 2.0 token management, credential rotation, audit logs, the
//! public marketplace, and agent-to-agent (A2A) delegation.
//!
//! ## Features
//!
//! - **Async-first** — every API call is `async` and backed by `tokio`.
//! - **Thread-safe token cache** — [`TokenManager`] refreshes tokens
//!   automatically before expiry; safe for concurrent use across tasks.
//! - **Typed errors** — every failure maps to a variant of [`AgentIdPError`].
//! - **Zero `unwrap()`** — all error paths use `?` or explicit `match`.
//!
//! ## Quickstart
//!
//! ```rust,no_run
//! use sentryagent_idp::{AgentIdPClient, RegisterAgentRequest};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//!     let client = AgentIdPClient::from_env()?;
//!
//!     let agent = client.register_agent(RegisterAgentRequest {
//!         name: "my-agent".to_owned(),
//!         description: Some("Does useful things".to_owned()),
//!         agent_type: "worker".to_owned(),
//!         capabilities: vec!["read:files".to_owned()],
//!         metadata: None,
//!     }).await?;
//!
//!     println!("Registered agent: {}", agent.id);
//!     Ok(())
//! }
//! ```
//!
//! ## Environment Variables
//!
//! | Variable | Purpose |
//! |---|---|
//! | `AGENTIDP_API_URL` | Base URL of the AgentIdP API |
//! | `AGENTIDP_CLIENT_ID` | OAuth 2.0 client identifier |
//! | `AGENTIDP_CLIENT_SECRET` | OAuth 2.0 client secret |

#![deny(warnings)]

pub mod agents;
pub mod audit;
pub mod client;
pub mod credentials;
pub mod delegation;
pub mod error;
pub mod marketplace;
pub mod models;
pub mod oauth2;
pub mod token_manager;

// Re-export the primary entry points at crate root for ergonomic use.
pub use client::AgentIdPClient;
pub use error::AgentIdPError;
pub use token_manager::TokenManager;

// Re-export all model types.
pub use models::{
    Agent,
    AgentList,
    AuditLogEntry,
    AuditLogFilters,
    AuditLogList,
    Credentials,
    DelegateRequest,
    DelegationToken,
    DelegationVerification,
    MarketplaceAgent,
    MarketplaceAgentList,
    MarketplaceFilters,
    RegisterAgentRequest,
    TokenResponse,
    UpdateAgentRequest,
};
