summaryrefslogtreecommitdiff
path: root/makima/src/daemon/cli/contract.rs
diff options
context:
space:
mode:
Diffstat (limited to 'makima/src/daemon/cli/contract.rs')
-rw-r--r--makima/src/daemon/cli/contract.rs96
1 files changed, 96 insertions, 0 deletions
diff --git a/makima/src/daemon/cli/contract.rs b/makima/src/daemon/cli/contract.rs
index a443b85..b5bd7cc 100644
--- a/makima/src/daemon/cli/contract.rs
+++ b/makima/src/daemon/cli/contract.rs
@@ -1,4 +1,8 @@
//! Contract subcommand - task-contract interaction commands.
+//!
+//! This module contains two types of commands:
+//! 1. Task-contract interaction commands (used by agents via `makima contract`)
+//! 2. Contract management helper commands (used by users via `makima contracts`)
use clap::Args;
use uuid::Uuid;
@@ -85,3 +89,95 @@ pub struct CreateFileArgs {
/// Name of the new file
pub name: String,
}
+
+// =============================================================================
+// Contract Management Helper Commands (makima contracts)
+// =============================================================================
+
+/// Common arguments for contracts management commands.
+#[derive(Args, Debug, Clone)]
+pub struct ContractsCommonArgs {
+ /// 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,
+}
+
+/// Arguments for pause command.
+#[derive(Args, Debug)]
+pub struct PauseArgs {
+ #[command(flatten)]
+ pub common: ContractsCommonArgs,
+
+ /// Contract ID to pause
+ pub contract_id: Uuid,
+
+ /// Reason for pausing the contract
+ #[arg(long)]
+ pub reason: Option<String>,
+}
+
+/// Arguments for resume command.
+#[derive(Args, Debug)]
+pub struct ResumeArgs {
+ #[command(flatten)]
+ pub common: ContractsCommonArgs,
+
+ /// Contract ID to resume
+ pub contract_id: Uuid,
+}
+
+/// Arguments for advance command.
+#[derive(Args, Debug)]
+pub struct AdvanceArgs {
+ #[command(flatten)]
+ pub common: ContractsCommonArgs,
+
+ /// Contract ID to advance
+ pub contract_id: Uuid,
+
+ /// Target phase to advance to
+ #[arg(long)]
+ pub phase: String,
+
+ /// Force the phase transition even if deliverables are incomplete
+ #[arg(long)]
+ pub force: bool,
+}
+
+/// Arguments for restart-supervisor command.
+#[derive(Args, Debug)]
+pub struct RestartSupervisorArgs {
+ #[command(flatten)]
+ pub common: ContractsCommonArgs,
+
+ /// Contract ID to restart supervisor for
+ pub contract_id: Uuid,
+}
+
+/// Arguments for show command.
+#[derive(Args, Debug)]
+pub struct ShowArgs {
+ #[command(flatten)]
+ pub common: ContractsCommonArgs,
+
+ /// Contract ID to show
+ pub contract_id: Uuid,
+
+ /// Show verbose output with all details
+ #[arg(long, short = 'v')]
+ pub verbose: bool,
+}
+
+/// Arguments for health command.
+#[derive(Args, Debug)]
+pub struct HealthArgs {
+ #[command(flatten)]
+ pub common: ContractsCommonArgs,
+
+ /// Contract ID to check health for
+ pub contract_id: Uuid,
+}