mod bridge;
mod dispatch;
mod error;
mod install;
mod migrate;
mod pick;
mod schema;
use std::process::ExitCode;
use agent_harness_adapter_core::cli;
use clap::{Parser, Subcommand};
#[derive(Debug, Parser)]
#[command(name = "agent-harness-adapter", version, about)]
struct Cli {
#[command(subcommand)]
command: Cmd,
}
#[derive(Debug, Subcommand)]
enum Cmd {
Install(install::InstallArgs),
Uninstall(install::UninstallArgs),
Status(install::StatusArgs),
Hook(bridge::HookArgs),
Schema {
contract: schema::Contract,
},
}
fn main() -> ExitCode {
let args = Cli::parse();
cli::finish(match args.command {
Cmd::Install(a) => install::run_install(&a),
Cmd::Uninstall(a) => install::run_uninstall(&a),
Cmd::Status(a) => install::run_status(&a),
Cmd::Hook(a) => bridge::run(&a).map_err(error::Error::from),
Cmd::Schema { contract } => schema::run(contract).map_err(error::Error::from),
})
}