diff options
Diffstat (limited to 'makima/src/bin/makima.rs')
| -rw-r--r-- | makima/src/bin/makima.rs | 93 |
1 files changed, 1 insertions, 92 deletions
diff --git a/makima/src/bin/makima.rs b/makima/src/bin/makima.rs index 8115387..ee5895c 100644 --- a/makima/src/bin/makima.rs +++ b/makima/src/bin/makima.rs @@ -7,7 +7,7 @@ use std::sync::Arc; use makima::daemon::api::{ApiClient, CreateContractRequest}; use makima::daemon::cli::{ Cli, CliConfig, Commands, ConfigCommand, ContractCommand, - DirectiveCommand, SupervisorCommand, ViewArgs, + SupervisorCommand, ViewArgs, }; use makima::daemon::tui::{self, Action, App, ListItem, ViewType, TuiWsClient, WsEvent, OutputLine, OutputMessageType, WsConnectionState, RepositorySuggestion}; use makima::daemon::config::{DaemonConfig, RepoEntry}; @@ -29,7 +29,6 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> { Commands::Daemon(args) => run_daemon(args).await, Commands::Supervisor(cmd) => run_supervisor(cmd).await, Commands::Contract(cmd) => run_contract(cmd).await, - Commands::Directive(cmd) => run_directive(cmd).await, Commands::View(args) => run_view(args).await, Commands::Config(cmd) => run_config(cmd).await, } @@ -712,96 +711,6 @@ async fn run_contract( Ok(()) } -/// Run a directive subcommand. -async fn run_directive( - cmd: DirectiveCommand, -) -> Result<(), Box<dyn std::error::Error + Send + Sync>> { - match cmd { - DirectiveCommand::Status(args) => { - let client = ApiClient::new(args.api_url, args.api_key)?; - let result = client.directive_status(args.directive_id).await?; - println!("{}", serde_json::to_string(&result.0)?); - } - DirectiveCommand::Goals(args) => { - let client = ApiClient::new(args.api_url, args.api_key)?; - let result = client.directive_status(args.directive_id).await?; - // Extract goal-related fields from directive - let directive = &result.0; - let goals = serde_json::json!({ - "goal": directive.get("goal"), - "requirements": directive.get("requirements"), - "acceptanceCriteria": directive.get("acceptanceCriteria"), - "constraints": directive.get("constraints"), - "externalDependencies": directive.get("externalDependencies"), - }); - println!("{}", serde_json::to_string(&goals)?); - } - DirectiveCommand::Chains(args) => { - let client = ApiClient::new(args.api_url, args.api_key)?; - let result = client.directive_chains(args.directive_id).await?; - println!("{}", serde_json::to_string(&result.0)?); - } - DirectiveCommand::Chain(args) => { - let client = ApiClient::new(args.common.api_url, args.common.api_key)?; - let result = client - .directive_chain(args.common.directive_id, args.chain_id) - .await?; - println!("{}", serde_json::to_string(&result.0)?); - } - DirectiveCommand::Steps(args) => { - let client = ApiClient::new(args.common.api_url, args.common.api_key)?; - let result = client - .directive_chain(args.common.directive_id, args.chain_id) - .await?; - // Extract steps from chain response - let steps = result.0.get("steps").cloned().unwrap_or(serde_json::json!([])); - println!("{}", serde_json::to_string(&steps)?); - } - DirectiveCommand::UpdateStatus(args) => { - let client = ApiClient::new(args.common.api_url, args.common.api_key)?; - let req = makima::daemon::api::directive::UpdateDirectiveRequest { - status: Some(args.status), - version: None, - }; - let result = client - .directive_update(args.common.directive_id, req) - .await?; - println!("{}", serde_json::to_string(&result.0)?); - } - DirectiveCommand::Start(args) => { - let client = ApiClient::new(args.api_url, args.api_key)?; - let result = client.directive_start(args.directive_id).await?; - println!("{}", serde_json::to_string(&result.0)?); - } - DirectiveCommand::Evaluate(args) => { - let client = ApiClient::new(args.common.api_url, args.common.api_key)?; - let result = client - .directive_evaluate_step(args.common.directive_id, args.step_id) - .await?; - println!("{}", serde_json::to_string(&result.0)?); - } - DirectiveCommand::Evaluations(args) => { - let client = ApiClient::new(args.common.api_url, args.common.api_key)?; - let result = client - .directive_evaluations(args.common.directive_id, args.step_id) - .await?; - println!("{}", serde_json::to_string(&result.0)?); - } - DirectiveCommand::SubmitPlan(args) => { - let client = ApiClient::new(args.api_url, args.api_key)?; - // Read plan JSON from stdin - let mut plan_json = String::new(); - io::stdin().read_to_string(&mut plan_json)?; - let result = client - .directive_submit_plan(args.directive_id, &plan_json) - .await?; - println!("{}", serde_json::to_string(&result.0)?); - } - } - - Ok(()) -} - /// Run the TUI view command. async fn run_view(args: ViewArgs) -> Result<(), Box<dyn std::error::Error + Send + Sync>> { // Load CLI config for defaults |
