#![cfg_attr(coverage_nightly, coverage(off))]
use super::commands::QddCommands;
use super::{AnalyzeCommands, Commands, RefactorCommands};
use crate::cli::handlers;
use crate::cli::handlers::cache::CacheCommand;
use crate::cli::handlers::memory::MemoryCommand;
use crate::stateless_server::StatelessTemplateServer;
use std::sync::Arc;
mod config_commands;
#[cfg(feature = "demo")]
mod demo_commands;
mod metrics_commands;
mod quality_commands;
mod roadmap_commands;
mod scaffold_commands;
mod semantic_commands;
mod test_commands;
pub(crate) mod test_record;
#[path = "command_dispatcher_work.rs"]
mod command_dispatcher_work;
#[path = "command_dispatcher_scoring.rs"]
mod command_dispatcher_scoring;
#[allow(dead_code)]
#[allow(async_fn_in_trait)]
pub trait CommandHandler: Send + Sync {
async fn execute(&self, server: Arc<StatelessTemplateServer>) -> anyhow::Result<()>;
}
#[allow(dead_code)]
#[allow(async_fn_in_trait)]
pub trait AnalyzeCommandHandler: Send + Sync {
async fn execute(&self) -> anyhow::Result<()>;
}
pub struct CommandDispatcher;
impl CommandDispatcher {
pub async fn execute_command(
command: Commands,
server: Arc<StatelessTemplateServer>,
) -> anyhow::Result<()> {
Self::route_command(command, server).await
}
}
include!("command_routing.rs");
include!("command_delegation.rs");
include!("quality_routing.rs");
#[cfg(test)]
#[path = "tests.rs"]
mod tests;