summaryrefslogtreecommitdiff
path: root/makima/src/daemon/cli
diff options
context:
space:
mode:
authorsoryu <soryu@soryu.co>2026-02-02 02:34:50 +0000
committersoryu <soryu@soryu.co>2026-02-02 02:34:50 +0000
commit151e9d87e117b7980e6aad522ac8f3633eeca87a (patch)
treee80fb4301361b3b12e5abf8e442603db2d0622dc /makima/src/daemon/cli
parenta2c147ddd59f55a07b5be0c8970169726b55c876 (diff)
downloadsoryu-151e9d87e117b7980e6aad522ac8f3633eeca87a.tar.gz
soryu-151e9d87e117b7980e6aad522ac8f3633eeca87a.zip
Make makima more opinionated and structured
Diffstat (limited to 'makima/src/daemon/cli')
-rw-r--r--makima/src/daemon/cli/mod.rs57
-rw-r--r--makima/src/daemon/cli/red_team.rs26
-rw-r--r--makima/src/daemon/cli/supervisor.rs4
3 files changed, 1 insertions, 86 deletions
diff --git a/makima/src/daemon/cli/mod.rs b/makima/src/daemon/cli/mod.rs
index c848e8e..0805edd 100644
--- a/makima/src/daemon/cli/mod.rs
+++ b/makima/src/daemon/cli/mod.rs
@@ -3,18 +3,15 @@
pub mod config;
pub mod contract;
pub mod daemon;
-pub mod red_team;
pub mod server;
pub mod supervisor;
pub mod view;
-use clap::{Args, Parser, Subcommand};
-use uuid::Uuid;
+use clap::{Parser, Subcommand};
pub use config::CliConfig;
pub use contract::ContractArgs;
pub use daemon::DaemonArgs;
-pub use red_team::handle_notify;
pub use server::ServerArgs;
pub use supervisor::SupervisorArgs;
pub use view::ViewArgs;
@@ -61,10 +58,6 @@ pub enum Commands {
/// Saves configuration to ~/.makima/config.toml for use by CLI commands.
#[command(subcommand)]
Config(ConfigCommand),
-
- /// Red team commands for adversarial monitoring
- #[command(name = "red-team", subcommand)]
- RedTeam(RedTeamCommand),
}
/// Config subcommands for CLI configuration.
@@ -203,54 +196,6 @@ pub enum ContractCommand {
CreateFile(contract::CreateFileArgs),
}
-/// Red team subcommands for adversarial monitoring.
-#[derive(Subcommand, Debug)]
-pub enum RedTeamCommand {
- /// Send a notification to the supervisor about a detected issue.
- /// Only available to red team tasks.
- Notify(RedTeamNotifyArgs),
-}
-
-/// Arguments for red-team notify command.
-#[derive(Args, Debug)]
-pub struct RedTeamNotifyArgs {
- /// API URL
- #[arg(long, env = "MAKIMA_API_URL", default_value = "https://api.makima.jp")]
- pub api_url: String,
-
- /// API key for authentication
- #[arg(long, env = "MAKIMA_API_KEY")]
- pub api_key: String,
-
- /// Current task ID (must be a red team task)
- #[arg(long, env = "MAKIMA_TASK_ID")]
- pub task_id: Uuid,
-
- /// Contract ID
- #[arg(long, env = "MAKIMA_CONTRACT_ID")]
- pub contract_id: Uuid,
-
- /// The notification message
- #[arg(index = 1)]
- pub message: String,
-
- /// Severity level: low, medium, high, critical
- #[arg(long, default_value = "medium")]
- pub severity: String,
-
- /// Related task ID (optional)
- #[arg(long)]
- pub task: Option<Uuid>,
-
- /// Related file path (optional)
- #[arg(long)]
- pub file: Option<String>,
-
- /// Additional context (optional)
- #[arg(long)]
- pub context: Option<String>,
-}
-
impl Cli {
/// Parse command-line arguments
pub fn parse_args() -> Self {
diff --git a/makima/src/daemon/cli/red_team.rs b/makima/src/daemon/cli/red_team.rs
deleted file mode 100644
index 771aae4..0000000
--- a/makima/src/daemon/cli/red_team.rs
+++ /dev/null
@@ -1,26 +0,0 @@
-//! Red Team subcommand - adversarial review notification commands.
-
-use crate::daemon::api::{ApiClient, RedTeamNotifyRequest};
-use super::RedTeamNotifyArgs;
-
-/// Handle the red-team notify command.
-pub async fn handle_notify(args: RedTeamNotifyArgs) -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
- let client = ApiClient::new(args.api_url, args.api_key)?;
-
- // Use --task if provided, otherwise fall back to MAKIMA_TASK_ID
- let related_task_id = args.task;
-
- let req = RedTeamNotifyRequest {
- message: args.message,
- severity: args.severity,
- related_task_id,
- file_path: args.file,
- context: args.context,
- };
-
- eprintln!("Sending red team notification...");
- let result = client.red_team_notify(req).await?;
- println!("{}", serde_json::to_string(&result.0)?);
-
- Ok(())
-}
diff --git a/makima/src/daemon/cli/supervisor.rs b/makima/src/daemon/cli/supervisor.rs
index cb84ffa..6f19697 100644
--- a/makima/src/daemon/cli/supervisor.rs
+++ b/makima/src/daemon/cli/supervisor.rs
@@ -48,10 +48,6 @@ pub struct SpawnArgs {
/// Repository URL (local path or remote URL). If not provided, will try to detect from current directory.
#[arg(long)]
pub repo: Option<String>,
-
- /// Create a separate worktree for the task (requires merge after). By default, tasks share the supervisor's worktree.
- #[arg(long)]
- pub own_worktree: bool,
}
/// Arguments for wait command.