//! Arguments for `mcptest mock`.

use std::path::PathBuf;

use clap::Args;

/// Arguments for `mcptest mock`.
///
/// The mock loads its tool catalog from `--tools-from <PATH>` and spawns a
/// stdio MCP server. v1.0 ships stdio only; HTTP transport lives in a v1.x
/// follow-up. The CLI keeps the flag name explicit so future input formats
/// (cassette-driven mocks) can land additively. `--fault`
/// turns the mock into a deliberately unresponsive server so an
/// agent's recovery path can be tested.
#[derive(Debug, Args)]
pub struct MockArgs {
    /// Path to a YAML manifest (`mock_server.tools[]`) or a `tools/list`
    /// baseline JSON snapshot. Mutually exclusive with `--preset`; exactly
    /// one is required.
    #[arg(long = "tools-from", value_name = "PATH")]
    pub tools_from: Option<PathBuf>,

    /// Serve a built-in catalog instead of a file. `evil` is a deliberately
    /// misbehaving server (poisoned descriptions, tool shadowing, injected
    /// output, schema-violating results) for client/agent hardening tests.
    #[arg(long = "preset", value_name = "NAME")]
    pub preset: Option<String>,

    /// Inject a server fault on every `tools/call`. One of `none`, `hang`,
    /// `wedged`, `slow:<ms>`, `recover-after:<n>`, or `reply-after-cancel:<ms>`.
    /// `hang`/`wedged` make calls never return (reachable but unresponsive);
    /// `slow:<ms>` delays the response (and suppresses it if the request is
    /// cancelled mid-flight); `recover-after:<n>` hangs n times then recovers;
    /// `reply-after-cancel:<ms>` replies even after a cancellation (the
    /// non-conformant cancel-after-completion race).
    #[arg(long = "fault", value_name = "KIND", default_value = "none")]
    pub fault: String,
}
