//! Model definitions and lookup.
//!
//! Maps our user-friendly model names to internal Antigravity identifiers.
//! The `model_enum` values are protobuf enum numbers extracted from extension.js:
//! placeholder models use 1000+N (e.g. M26→1026), while named models like
//! `MODEL_CLAUDE_4_OPUS` have their own enum values (e.g. 290).
//! See `docs/ls-binary-analysis.md` for the full enum mapping.

/// Model definition: friendly name → (antigravity_id, protobuf_enum, label).
pub(crate) struct ModelDef {
    pub name: &'static str,
    #[allow(dead_code)]
    pub ag_id: &'static str,
    pub model_enum: u32,
    pub label: &'static str,
}

pub(crate) const MODELS: &[ModelDef] = &[
    ModelDef {
        name: "opus-4.6",
        ag_id: "MODEL_PLACEHOLDER_M26",
        model_enum: 1026,
        label: "Claude Opus 4.6 (Thinking)",
    },
    ModelDef {
        name: "opus-4.5",
        ag_id: "MODEL_PLACEHOLDER_M12",
        model_enum: 1012,
        label: "Claude Opus 4.5 (Thinking)",
    },
    ModelDef {
        name: "gemini-3-pro",
        ag_id: "MODEL_PLACEHOLDER_M8",
        model_enum: 1008,
        label: "Gemini 3 Pro (High)",
    },
    ModelDef {
        name: "gemini-3-pro-high",
        ag_id: "MODEL_PLACEHOLDER_M8",
        model_enum: 1008,
        label: "Gemini 3 Pro (High)",
    },
    ModelDef {
        name: "gemini-3-pro-low",
        ag_id: "MODEL_PLACEHOLDER_M7",
        model_enum: 1007,
        label: "Gemini 3 Pro (Low)",
    },
    ModelDef {
        name: "gemini-3-flash",
        ag_id: "MODEL_PLACEHOLDER_M18",
        model_enum: 1018,
        label: "Gemini 3 Flash",
    },
];

pub(crate) const DEFAULT_MODEL: &str = "opus-4.6";

pub(crate) fn lookup_model(name: &str) -> Option<&'static ModelDef> {
    MODELS.iter().find(|m| m.name == name)
}
