//! Local Kokoro (ort/ONNX Runtime) stub.
//!
//! Phase voice-plugin-extract Fase F Step 27 — feature scaffold
//! only. Real ort bridge lands in a follow-up — Kokoro v0.19 onnx
//! model + voice embedding loading + 24kHz post-processing.

use async_trait::async_trait;

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

#[derive(Debug, Clone, Default)]
pub struct KokoroTtsProvider {
    pub model_path: Option<std::path::PathBuf>,
}

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

    fn label(&self) -> &str {
        "Kokoro (ort/ONNX, local)"
    }

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

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

    fn is_configured(&self) -> bool {
        self.model_path
            .as_ref()
            .map(|p| p.is_file())
            .unwrap_or(false)
    }

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