//! Arguments for `mcptest doctor`.

use clap::Args;

/// Arguments for `mcptest doctor`.
///
/// Tool-catalog token cost is the first structured check. The
/// remaining health probes (server reachability, schema check) land with
/// the runner and gain their own flags then. The `--url` flag
/// opts into the layered URL-target connectivity pipeline
/// (DNS, TCP, TLS, auth, MCP initialize) implemented in
/// [`crate::commands::doctor`].
#[derive(Debug, Args, Default)]
pub struct DoctorArgs {
    /// Disable the tool catalog token cost check.
    #[arg(long = "no-tool-tokens")]
    pub no_tool_tokens: bool,

    /// Run the URL-target connectivity pipeline against this base URL.
    #[arg(long = "url", value_name = "URL")]
    pub url: Option<String>,

    /// Env var that holds a bearer token to attach to the MCP
    /// `initialize` handshake when `--url` is in use.
    #[arg(long = "bearer-token-env", value_name = "NAME")]
    pub bearer_token_env: Option<String>,

    /// Opt into live auth probes. Off by default so the auth
    /// pre-flight stays offline and deterministic. When set, doctor makes one
    /// real network call per configured scheme: SigV4 signs and sends an
    /// `sts:GetCallerIdentity`, and Web Bot Auth fetches the configured key
    /// directory. Network failures are reported and never leak a secret.
    #[arg(long = "probe")]
    pub probe: bool,

    /// Override the tokenizer used for the catalog token cost check.
    ///
    /// Defaults to `cl100k_base` (GPT-3.5/4). Other supported names:
    /// `o200k_base` (GPT-4o family), `gpt2`, `claude` (currently
    /// aliased to `cl100k_base`), and `whitespace` (a transport-free
    /// approximation kept for tests).
    #[arg(long = "tokenizer", value_name = "NAME", default_value = "cl100k_base")]
    pub tokenizer: String,

    /// Run the MCP migration doctor against `--url`. Accepts a
    /// target spec version (today only `2026-07-28`). Reads the server's
    /// `initialize` response and reports one row per breaking change from
    /// the migration pair-corpus. v1 does the static
    /// deprecated-capability checks (Roots / Sampling / Logging) and
    /// skips the rest with rationale until the matching tickets land.
    /// Pair with `mcptest lint` for the YAML and cassette scan.
    #[arg(long = "target-version", value_name = "VERSION")]
    pub target_version: Option<String>,
}
