//! # Monk SDK
//!
//! Production-grade Rust client for the **Monk Events API**.
//!
//! ## Features
//!
//! * Automatic retries with exponential backoff and full jitter
//! * Lightweight circuit breaker to avoid hammering a degraded server
//! * In-memory event buffer with background batch flushing
//! * Client-side validation (fail fast, save a round-trip)
//! * Idempotency-key management (auto-generated UUIDv4 when omitted)
//! * Typed request/response models with `serde`
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! use monk_sdk::{MonkClient, Event};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//!     let client = MonkClient::builder()
//!         .base_url("https://events.monk.dev")
//!         .api_key("mk_live_abc123")
//!         .build()?;
//!
//!     // Single event (retried automatically on transient failure)
//!     let resp = client.ingest(
//!         Event::builder()
//!             .customer_id("cust_123")
//!             .event_name("api_call")
//!             .property("tokens", 42)
//!             .build()?
//!     ).await?;
//!
//!     println!("accepted: {}", resp.idempotency_key);
//!     Ok(())
//! }
//! ```

mod buffer;
mod client;
pub mod config;
pub mod error;
pub mod models;
mod retry;
pub mod validation;

// Re-export the primary public API at crate root for ergonomic imports.
pub use client::{ListEventsRequest, MonkClient, MonkClientBuilder, UsageRequest};
pub use config::{BackpressureStrategy, BufferConfig, ClientConfig, RetryConfig};
pub use error::MonkError;
pub use models::{
    ApiErrorBody, ApiErrorDetail, BatchIngestResponse, Event, EventBuilder, EventListResponse,
    EventResponse, HealthResponse, IngestResponse, ReadyResponse, UsageBucket, UsageResponse,
};
