harn-cli 0.10.122

CLI for the Harn programming language — run, test, REPL, format, and lint
use clap::{Args, Subcommand};
use std::path::PathBuf;

#[derive(Debug, Args)]
pub(crate) struct TraceArgs {
    #[command(subcommand)]
    pub command: TraceCommand,
}

#[derive(Debug, Subcommand)]
pub(crate) enum TraceCommand {
    /// Convert a generic JSONL trace into a replayable `--llm-mock` fixture.
    Import(TraceImportArgs),
    /// Check captured provider requests for an append-only prompt prefix.
    #[command(name = "prefix-stability")]
    PrefixStability(TracePrefixStabilityArgs),
}

#[derive(Debug, Args)]
pub(crate) struct TracePrefixStabilityArgs {
    /// Transcript directory that contains `llm_transcript.jsonl` and raw provider captures.
    pub transcript_dir: PathBuf,
    /// Emit the versioned report as JSON.
    #[arg(long)]
    pub json: bool,
}

#[derive(Debug, Args)]
pub(crate) struct TraceImportArgs {
    /// Source JSONL trace file with `{prompt,response,tool_calls}` records.
    #[arg(long = "trace-file", value_name = "PATH")]
    pub trace_file: String,
    /// Optional trace id to filter when the source file contains multiple traces.
    #[arg(long = "trace-id", value_name = "ID")]
    pub trace_id: Option<String>,
    /// Output path for the generated replay fixture JSONL.
    #[arg(long = "output", value_name = "PATH")]
    pub output: String,
}