//! Rust client SDK for the Quantum AI API.
//!
//! Supports text generation (with streaming), session chat, multi-agent orchestration,
//! image/video/audio generation, embeddings, RAG search, compute provisioning,
//! voice management, API key management, and model listing through a single API endpoint.
//!
//! # Example
//!
//! ```no_run
//! # async fn example() -> quantum_sdk::Result<()> {
//! let client = quantum_sdk::Client::new("your-api-key");
//!
//! let resp = client.chat(&quantum_sdk::ChatRequest {
//!     model: "claude-sonnet-4-6".into(),
//!     messages: vec![quantum_sdk::ChatMessage::user("Hello!")],
//!     ..Default::default()
//! }).await?;
//!
//! println!("{}", resp.text());
//! # Ok(())
//! # }
//! ```

pub mod account;
pub mod agent;
pub mod audio;
pub mod auth;
pub mod batch;
pub mod chat;
pub mod client;
pub mod compute;
pub mod contact;
pub mod credits;
pub mod documents;
pub mod embeddings;
pub mod error;
pub mod image;
pub mod jobs;
pub mod mesh;
pub mod keys;
pub mod missions;
pub mod models;
pub mod rag;
pub mod realtime;
pub mod scraper;
pub mod search;
pub mod security;
pub mod session;
pub mod video;
pub mod vision;
pub mod voices;

// Re-export primary types at crate root for convenience.
pub use client::{Client, ClientBuilder, ResponseMeta, DEFAULT_BASE_URL, TICKS_PER_USD};
pub use error::{ApiError, Error, Result};

// Chat types
pub use chat::{
    ChatMessage, ChatRequest, ChatResponse, ChatStream, ChatTool, ChatUsage, Citation, ContentBlock,
    StreamDelta, StreamEvent, StreamToolUse, StreamToolUseComplete, StreamToolUseInputDelta,
    StreamToolUseStart,
};

// Session types
pub use session::{
    ContextConfig, ContextMetadata, SessionChatRequest, SessionChatResponse, SessionContext,
    SessionToolResult, ToolResult,
};

// Agent types
pub use agent::{
    AgentEvent, AgentRequest, AgentStream, AgentStreamEvent, AgentWorker, AgentWorkerConfig,
    MissionEvent, MissionRequest, MissionWorker, MissionWorkerConfig,
};

// Image types
pub use image::{
    GeneratedImage, ImageEditRequest, ImageEditResponse, ImageRequest, ImageResponse,
};

// Video types
pub use video::{
    Avatar, AvatarsResponse, DigitalTwinRequest, GeneratedVideo, HeyGenAvatarsResponse,
    HeyGenTemplatesResponse, HeyGenVoice, HeyGenVoicesResponse, JobResponse, PhotoAvatarRequest,
    StudioClip, StudioVideoRequest, TranslateRequest, VideoRequest, VideoResponse,
    VideoStudioRequest, VideoTemplate, VideoTemplatesResponse, VideoTranslateRequest,
};

// Audio types
pub use audio::{
    AlignRequest, AlignResponse, AlignedWord, AlignmentSegment, AudioResponse, DialogueRequest,
    DialogueResponse, DialogueTurn, DubRequest, DubResponse, ElevenMusicClip, ElevenMusicRequest,
    ElevenMusicResponse, FinetuneInfo,
    IsolateVoiceRequest, IsolateRequest,
    IsolateVoiceResponse, ListFinetunesResponse,
    MusicAdvancedClip, MusicAdvancedRequest, MusicAdvancedResponse, MusicClip,
    MusicFinetuneCreateRequest, MusicFinetuneInfo, MusicFinetuneListResponse, MusicRequest,
    MusicResponse, MusicSection,
    RemixVoiceRequest, RemixRequest,
    RemixVoiceResponse, SoundEffectRequest,
    SoundEffectResponse, SpeechToSpeechRequest, SpeechToSpeechResponse, StarfishTTSRequest,
    StarfishTTSResponse,
    SpeechToTextRequest, SttRequest,
    SpeechToTextResponse, SttResponse,
    TextToSpeechRequest, TtsRequest,
    TextToSpeechResponse, TtsResponse,
    VoiceDesignRequest, VoiceDesignResponse, VoicePreview,
};

// Account types
pub use account::{
    BalanceResponse, PricingEntry, PricingResponse, UsageEntry, UsageQuery, UsageResponse,
    UsageSummaryMonth, UsageSummaryResponse,
};

// Auth types
pub use auth::{AuthAppleRequest, AuthResponse, AuthUser};

// Batch types
pub use batch::{
    BatchJob, BatchJobInfo, BatchJobInput, BatchJobsResponse, BatchJsonlResponse,
    BatchSubmitRequest, BatchSubmitResponse,
};

// Credits types
pub use credits::{
    CreditBalanceResponse, CreditPack, CreditPacksResponse, CreditPurchaseRequest,
    CreditPurchaseResponse, CreditTier, CreditTiersResponse, DevProgramApplyRequest,
    DevProgramApplyResponse,
};

// Jobs types
pub use jobs::{
    JobAcceptedResponse, JobCreateRequest, JobCreateResponse, JobListEntry, JobListResponse,
    JobStatusResponse, JobStreamEvent, JobSummary, ListJobsResponse,
};

// Keys types
pub use keys::{CreateKeyRequest, CreateKeyResponse, KeyDetails, ListKeysResponse, StatusResponse};

// Compute types
pub use compute::{
    BillingEntry, BillingRequest, BillingResponse, ComputeInstance, ComputeInstanceInfo,
    ComputeTemplate, DeleteResponse, InstanceResponse, InstancesResponse, ProvisionRequest,
    ProvisionResponse, SSHKeyRequest, TemplatesResponse,
};

// Voices types
pub use voices::{
    AddVoiceFromLibraryRequest, AddVoiceFromLibraryResponse, CloneVoiceFile, CloneVoiceRequest,
    CloneVoiceResponse, SharedVoice, SharedVoicesResponse, Voice, VoiceInfo, VoiceLibraryQuery,
    VoicesResponse,
};

// 3D Mesh pipeline types
pub use mesh::{
    AnimateRequest, AnimationPostProcess, BasicAnimations, Generate3DRequest, ModelUrls,
    PostProcess, RemeshRequest, RetextureRequest, RigRequest,
};

// Contact types
pub use contact::{ContactRequest, ContactResponse};

// Embeddings types
pub use embeddings::{EmbedRequest, EmbedResponse};

// Document types
pub use documents::{
    ChunkDocumentRequest, ChunkRequest,
    ChunkDocumentResponse, ChunkResponse,
    DocumentChunk, DocumentRequest, DocumentResponse,
    ProcessDocumentRequest, ProcessRequest,
    ProcessDocumentResponse, ProcessResponse,
};

// RAG types
pub use rag::{
    Collection, CollectionDocument, CollectionSearchRequest, CollectionSearchResult,
    CollectionUploadResult, CreateCollectionRequest, RagCorpus, RagResult, RagSearchRequest,
    RagSearchResponse,
    SurrealRagProviderInfo, SurrealRagProvider,
    SurrealRagProvidersResponse, SurrealRagResult,
    SurrealRagSearchRequest, SurrealRagSearchResponse,
};

// Scraper types
pub use scraper::{
    ScrapeRequest, ScrapeResponse, ScrapeTarget, ScreenshotJobResponse, ScreenshotRequest,
    ScreenshotResponse, ScreenshotResult, ScreenshotURL,
};

// Search types
pub use search::{
    ContextChunk, ContextOptions, Discussion, DiscussionResult, GoogleSearchCitation,
    GoogleSearchRequest, GoogleSearchResponse, GoogleSearchSupport, Infobox, InfoboxResult,
    LLMContextResponse, NewsResult, SearchAnswerCitation, SearchAnswerChoice,
    SearchAnswerMessage, SearchAnswerRequest, SearchAnswerResponse, SearchContextChunk,
    SearchContextRequest, SearchContextResponse, SearchContextSource, SearchMessage,
    SearchOptions, VideoResult, WebResult, WebSearchRequest, WebSearchResponse,
};

// Model types
pub use models::{ModelInfo, PricingInfo};

// Realtime voice types
pub use realtime::{
    realtime_connect_direct, realtime_connect_direct_to, RealtimeConfig, RealtimeEvent,
    RealtimeReceiver, RealtimeSender, RealtimeSession, RealtimeSessionResponse,
};

// Vision types
pub use vision::{
    DetectedObject, OcrResult, QualityAssessment, RelevanceCheck, TextOverlay, VisionContext,
    VisionRequest, VisionResponse,
};

// Mission types
pub use missions::{
    MissionApproveRequest, MissionChatRequest, MissionChatResponse, MissionCheckpoint,
    MissionCheckpointsResponse, MissionConfirmStructure, MissionCreateRequest,
    MissionCreateResponse, MissionDetail, MissionImportRequest, MissionListResponse,
    MissionPlanUpdate, MissionStatusResponse, MissionTask,
};

// Security types
pub use security::{
    SecurityAssessment, SecurityBlocklistEntry, SecurityBlocklistResponse, SecurityCheckResponse,
    SecurityFinding, SecurityReportRequest, SecurityReportResponse, SecurityScanHtmlRequest,
    SecurityScanResponse, SecurityScanUrlRequest,
};

// Error helpers
pub use error::{is_auth_error, is_not_found_error, is_rate_limit_error};
