#[derive(Debug, Clone, Copy, PartialEq, Eq, clap::ValueEnum, Default)]
pub enum RecoveryStrategyArg {
#[default]
Fail,
Auto,
Force,
}
impl From<RecoveryStrategyArg> for crate::checkpoint::recovery::RecoveryStrategy {
fn from(arg: RecoveryStrategyArg) -> Self {
match arg {
RecoveryStrategyArg::Fail => Self::Fail,
RecoveryStrategyArg::Auto => Self::Auto,
RecoveryStrategyArg::Force => Self::Force,
}
}
}
#[derive(Parser, Debug, Default)]
pub struct RecoveryFlags {
#[arg(
long,
help = "Resume from last checkpoint (if one exists from a previous interrupted run)",
hide = true
)]
pub resume: bool,
#[arg(
long = "no-resume",
help = "Skip interactive resume prompt even if a checkpoint exists (for CI/automation)",
hide = true
)]
pub no_resume: bool,
#[arg(
long = "inspect-checkpoint",
help = "Display checkpoint information without resuming (use with --resume to see saved state)",
hide = true
)]
pub inspect_checkpoint: bool,
#[arg(
long,
value_enum,
default_value = "fail",
help = "Recovery strategy when checkpoint validation fails (fail=stop, auto=attempt recovery, force=continue anyway)"
)]
pub recovery_strategy: RecoveryStrategyArg,
#[arg(
long,
help = "Validate configuration and PROMPT.md without running agents",
hide = true
)]
pub dry_run: bool,
#[arg(long, short = 'd', help = "Show system info, agent status, and config for troubleshooting")]
pub diagnose: bool,
#[arg(
long = "extended-help",
visible_alias = "man",
help = "Show extended help with shell completion, all presets, and troubleshooting"
)]
pub extended_help: bool,
}
#[derive(Parser, Debug, Default)]
pub struct RebaseFlags {
#[arg(long, help = "Enable automatic rebase to main branch before and after pipeline")]
pub with_rebase: bool,
#[arg(
long,
help = "Only rebase to main branch, then exit (no pipeline execution)",
hide = true
)]
pub rebase_only: bool,
}