//! Cartesia Sonic stub.
//!
//! Phase voice-plugin-extract Fase F Step 27 — feature scaffold
//! only.

use async_trait::async_trait;

use super::{CostClass, SynthesizeOutput, SynthesizeRequest, TtsProvider};
use crate::error::{Result, VoiceError};

#[derive(Debug, Clone, Default)]
pub struct CartesiaTtsProvider {
    pub api_key: Option<String>,
}

#[async_trait]
impl TtsProvider for CartesiaTtsProvider {
    fn id(&self) -> &'static str {
        "cartesia"
    }

    fn label(&self) -> &str {
        "Cartesia Sonic"
    }

    fn auto_select_order(&self) -> u32 {
        70
    }

    fn cost_class(&self) -> CostClass {
        CostClass::Premium
    }

    fn is_configured(&self) -> bool {
        self.api_key.as_deref().map(str::is_empty).map(|e| !e).unwrap_or(false)
    }

    async fn synthesize(&self, _req: SynthesizeRequest<'_>) -> Result<SynthesizeOutput> {
        Err(VoiceError::NotSupported(
            "cartesia provider stub — REST integration ships in a follow-up",
        ))
    }
}
