#![cfg_attr(coverage_nightly, coverage(off))]
use super::Commands;
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;
pub(crate) mod contract_query_handlers;
#[path = "command_dispatcher_scoring.rs"]
mod command_dispatcher_scoring;
#[allow(async_fn_in_trait)]
pub trait CommandHandler: Send + Sync {
async fn execute(&self, server: Arc<StatelessTemplateServer>) -> anyhow::Result<()>;
}
#[allow(async_fn_in_trait)]
pub trait AnalyzeCommandHandler: Send + Sync {
async fn execute(&self) -> anyhow::Result<()>;
}
pub struct CommandDispatcher;
impl CommandDispatcher {
#[provable_contracts_macros::contract("pmat-core.yaml", equation = "check_compliance")]
pub async fn execute_command(
command: Commands,
server: Arc<StatelessTemplateServer>,
) -> anyhow::Result<()> {
Self::route_command(command, server).await
}
}
#[path = "command_routing.rs"]
mod command_routing;
#[path = "command_delegation.rs"]
mod command_delegation;
#[path = "query_routing.rs"]
mod query_routing;
#[path = "quality_routing.rs"]
mod quality_routing;
#[cfg(test)]
#[path = "tests.rs"]
mod tests;