//! `imaige-core` — the async, HTTP-only Rust client for the Imaige AI API.
//!
//! This crate is the single source of truth for the SDK's logic. The
//! `imaige-uniffi`, `imaige-napi`, `imaige-python`, and `imaige-wasm` crates
//! are thin language-binding shells over it.
//!
//! # Model
//!
//! Image / video / text generation is an **async job model**. A generation
//! POST enqueues work and returns a [`JobHandle`] (`202 {jobId, mode,
//! estimatedCostCents}`). There are three ways to consume a job:
//!
//! 1. [`ImaigeClient::wait_for_job`] — poll to completion, returning a
//!    [`JobResult`] with durable media URLs.
//! 2. The `*_and_wait` convenience methods (e.g.
//!    [`ImaigeClient::generate_image_and_wait`]).
//! 3. [`ImaigeClient::stream_job`] — a `Stream` of progressive [`JobEvent`]s
//!    parsed from the job's Server-Sent-Events endpoint.
//!
//! # Example
//!
//! ```no_run
//! use imaige_core::{ImaigeClient, GenerateImageRequest};
//!
//! # async fn run() -> Result<(), imaige_core::ImaigeError> {
//! let client = ImaigeClient::new("https://api.imaige.io", "imk_abcd1234_secret...")?;
//! let req = GenerateImageRequest {
//!     prompt: "a neon city at dusk".into(),
//!     model: "example-model".into(),
//!     negative_prompt: None,
//!     image_size: Some("landscape_16_9".into()),
//!     num_images: Some(1),
//!     seed: None,
//!     attribution: Default::default(),
//! };
//! let result = client.generate_image_and_wait(&req).await?;
//! for url in &result.media_urls {
//!     println!("{url}");
//! }
//! # Ok(())
//! # }
//! ```

mod client;
mod error;
mod sse;
mod types;

pub use client::{media_url, ClientConfig, ImaigeClient, DEFAULT_BASE_URL, MEDIA_BASE};
pub use error::{ImaigeError, Result};
pub use sse::{SseDecoder, SseFrame};
pub use types::{
    AnalyzeImageRequest, AnimateVideoRequest, Attribution, ChatMessage, GenerateImageRequest,
    GenerateTextRequest, JobEvent, JobFilter, JobHandle, JobList, JobResult, JobRow, JobStatus,
    Mode, ModelInfo, RemoveBackgroundRequest, TextResult, TextUsage, TransformImageRequest,
    UpscaleImageRequest,
};
