darq 0.1.0

darq CLI + TUI — autonomous issue → PR pipeline with SAT and a learning loop.
Documentation
//! Issue workflow commands: plan and build.

use clap::Subcommand;

use crate::daemon::client::DaemonClient;

#[derive(Subcommand, Debug)]
pub enum IssueCommands {
    /// Create an implementation plan for an issue
    Plan {
        /// Issue number
        number: u64,
    },
    /// Implement code + tests for an issue and open a PR
    Build {
        /// Issue number
        number: u64,
        /// Skip approval gate before PR creation
        #[arg(long)]
        auto_approve: bool,
    },
}

pub async fn handle(command: IssueCommands, client: &mut DaemonClient) -> anyhow::Result<()> {
    match command {
        IssueCommands::Plan { number } => {
            println!("[plan_issue] Planning issue #{number}...");
            super::run_workflow_chain(client, "plan_issue", number, 1, false).await
        }
        IssueCommands::Build {
            number,
            auto_approve,
        } => {
            if auto_approve {
                println!("[implement_issue] Building issue #{number} (auto-approve)...");
            } else {
                println!("[implement_issue] Building issue #{number}...");
            }
            super::run_workflow_chain(client, "implement_issue", number, 1, !auto_approve).await
        }
    }
}