//! Arguments for `mcptest propose` (WOR-1262).

use clap::Args;

/// Arguments for `mcptest propose`.
///
/// The flag surface mirrors the ticket contract: one tool, its args, exactly
/// one target shape (`--url` or `--server-command`), and the two knobs that
/// change how many live calls are made. There is no gating beyond
/// `--execute-destructive` because the command is human-invoked; the
/// write-gated equivalent for agents is the `propose_assertions` verb on
/// `mcptest mcp-server`.
#[derive(Debug, Args)]
pub struct ProposeArgs {
    /// Tool to call on the target server.
    #[arg(long, value_name = "TOOL")]
    pub tool: String,

    /// Arguments for the call, as a JSON object string. Default `{}`.
    #[arg(long, value_name = "JSON")]
    pub args: Option<String>,

    /// HTTP endpoint of the target MCP server. Exactly one of --url or
    /// --server-command is required.
    #[arg(
        long,
        value_name = "URL",
        conflicts_with = "server_command",
        required_unless_present = "server_command"
    )]
    pub url: Option<String>,

    /// Command line of a local stdio MCP server, quoted as one string
    /// (split with POSIX shell rules).
    #[arg(
        long = "server-command",
        value_name = "CMD",
        required_unless_present = "url"
    )]
    pub server_command: Option<String>,

    /// Env var that holds a bearer token to attach to every request.
    /// URL targets only.
    #[arg(
        long = "bearer-token-env",
        value_name = "NAME",
        conflicts_with = "server_command"
    )]
    pub bearer_token_env: Option<String>,

    /// Observe one call only. Skips the two-call stability probe, so no
    /// exact-value assertions are proposed.
    #[arg(long = "single-call")]
    pub single_call: bool,

    /// Allow exactly one live call to a tool classified destructive
    /// (delete_*, destructiveHint, ...). Off by default; without it the
    /// command refuses such tools.
    #[arg(long = "execute-destructive")]
    pub execute_destructive: bool,
}
