//! Built-in 2026-Q1 list-price rate table.
//!
//! Owns the literal-rate constructor that populates [`super::PriceTable`]
//! with the providers shipped by klieo. Kept in a sibling module so the
//! `Rates` + `PriceTable` types in [`super`] do not balloon with literal
//! pricing data that changes on a separate cadence from the type-level
//! lookup logic.
//!
//! See the parent [`crate::pricing`] module docs for upstream pricing URLs
//! and the rate-source refresh cadence.

use super::{PriceTable, Rates};

/// Construct a [`PriceTable`] pre-populated with the built-in 2026-Q1
/// list-price rates.
///
/// The hardcoded literals are statically valid (finite, non-negative);
/// `expect` documents the invariant and surfaces a panic if a future edit
/// accidentally introduces an invalid literal.
pub(super) fn with_default_rates() -> PriceTable {
    let mut t = PriceTable::new();
    let invariant = "built-in rate literal must be finite and non-negative";
    // --- Anthropic (https://www.anthropic.com/pricing) ---
    // Family aliases — versioned IDs (claude-sonnet-4-6 etc.) collapse to
    // these via PriceTable::lookup.
    t.set("anthropic", "claude-sonnet-4-x", Rates::new(0.003, 0.015))
        .expect(invariant);
    t.set("anthropic", "claude-opus-4-x", Rates::new(0.015, 0.075))
        .expect(invariant);
    t.set("anthropic", "claude-haiku-4-x", Rates::new(0.001, 0.005))
        .expect(invariant);
    // --- OpenAI (https://openai.com/api/pricing/) ---
    t.set("openai", "gpt-4o", Rates::new(0.0025, 0.01))
        .expect(invariant);
    t.set("openai", "gpt-4o-mini", Rates::new(0.00015, 0.0006))
        .expect(invariant);
    // --- Google (https://ai.google.dev/gemini-api/docs/pricing) ---
    t.set("google", "gemini-2.0-flash", Rates::new(0.0001, 0.0004))
        .expect(invariant);
    // --- Ollama: local execution, zero list price ---
    t.set("ollama", "*", Rates::new(0.0, 0.0)).expect(invariant);
    t
}
