//! Arguments for `mcptest posture` (WOR-1432).

use std::path::PathBuf;

use clap::{Args, ValueEnum};

/// Score an MCP deployment's runtime and gateway posture.
///
/// Reads a deployment descriptor (mcptest's own posture schema, a ToolHive run
/// profile, or a Kubernetes pod spec) or synthesizes one for a bare stdio
/// launch, then scores nine posture dimensions. Each result is tagged observed,
/// claimed, or unknown. This validates a secure runtime; it does not operate
/// one (managed policy and dashboards stay enterprise).
#[derive(Debug, Args)]
pub struct PostureArgs {
    /// Deployment manifest to assess (JSON or YAML). Auto-detects an mcptest
    /// posture descriptor, a ToolHive profile, or a Kubernetes pod spec.
    #[arg(long, value_name = "FILE")]
    pub manifest: Option<PathBuf>,

    /// Assess a bare stdio launch by command. A raw subprocess is unisolated by
    /// construction, so this scores the inherent posture of running it directly.
    #[arg(long, value_name = "CMD", conflicts_with = "manifest")]
    pub stdio_command: Option<String>,

    /// Fail the run (exit 6) when the share of scored checks that pass falls
    /// below this percentage (0 to 100).
    #[arg(long, value_name = "PERCENT")]
    pub threshold: Option<f64>,

    /// Output format.
    #[arg(long, value_enum, value_name = "FORMAT", default_value_t = PostureFormat::Pretty)]
    pub format: PostureFormat,
}

/// Output formats for `mcptest posture --format`.
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq, ValueEnum)]
#[value(rename_all = "kebab-case")]
pub enum PostureFormat {
    /// Human-friendly table (default).
    #[default]
    Pretty,
    /// One JSON object: the posture report.
    Json,
}
