//! Arguments for `mcptest exec --connection-server`.

use std::path::PathBuf;

use clap::Args;

/// Arguments for `mcptest exec --connection-server`.
///
/// The SDK side spawns this command, pipes newline-delimited JSON-RPC
/// over stdin/stdout, and reads canonical responses back. The flags
/// here mirror the runtime knobs the YAML runner already exposes so a
/// pytest or Vitest worker can toggle them per session without
/// restating its server config.
#[derive(Debug, Args, Default)]
pub struct ExecArgs {
    /// Required mode toggle. Only the IPC connection-server flavor
    /// ships in v1.1; the flag stays explicit so future modes can land
    /// additively.
    #[arg(long = "connection-server", default_value_t = true)]
    pub connection_server: bool,

    /// Optional path to the mcptest config (defaults to `mcptest.yaml`).
    #[arg(long, value_name = "PATH")]
    pub config: Option<PathBuf>,

    /// Path the dispatcher writes a verbatim transcript to. SDK
    /// debugging only; production runs leave it unset.
    #[arg(long = "debug-output", value_name = "PATH")]
    pub debug_output: Option<PathBuf>,

    /// Emit extra detail on stderr (envelope counts, lifecycle events).
    #[arg(long)]
    pub verbose: bool,

    /// Pin the IPC envelope version. The dispatcher rejects sessions
    /// that ask for a version newer than what the binary supports.
    #[arg(long = "ipc-version", value_name = "VERSION")]
    pub ipc_version: Option<String>,

    /// Disable the cache for this session.
    #[arg(long = "no-cache")]
    pub no_cache: bool,

    /// Disable the cassette layer (no replay, no record).
    #[arg(long = "no-cassette")]
    pub no_cassette: bool,

    /// Record new cassettes for any unmocked call seen this session.
    #[arg(long = "record-cassettes")]
    pub record_cassettes: bool,
}
