diff options
| author | soryu <soryu@soryu.co> | 2026-01-11 05:52:14 +0000 |
|---|---|---|
| committer | soryu <soryu@soryu.co> | 2026-01-15 00:21:16 +0000 |
| commit | 87044a747b47bd83249d61a45842c7f7b2eae56d (patch) | |
| tree | ef2000ce79ffcc2723ef841acef5aa1deb1d5378 /makima/src/daemon/cli/contract.rs | |
| parent | 077820c4167c168072d217a1b01df840463a12a8 (diff) | |
| download | soryu-87044a747b47bd83249d61a45842c7f7b2eae56d.tar.gz soryu-87044a747b47bd83249d61a45842c7f7b2eae56d.zip | |
Contract system
Diffstat (limited to 'makima/src/daemon/cli/contract.rs')
| -rw-r--r-- | makima/src/daemon/cli/contract.rs | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/makima/src/daemon/cli/contract.rs b/makima/src/daemon/cli/contract.rs new file mode 100644 index 0000000..5fef5ec --- /dev/null +++ b/makima/src/daemon/cli/contract.rs @@ -0,0 +1,87 @@ +//! Contract subcommand - task-contract interaction commands. + +use clap::Args; +use uuid::Uuid; + +/// Common arguments for contract commands. +#[derive(Args, Debug, Clone)] +pub struct ContractArgs { + /// API URL + #[arg(long, env = "MAKIMA_API_URL", default_value = "http://localhost:8080", global = true)] + pub api_url: String, + + /// API key for authentication + #[arg(long, env = "MAKIMA_API_KEY", global = true)] + pub api_key: String, + + /// Current task ID (optional) + #[arg(long, env = "MAKIMA_TASK_ID", global = true)] + pub task_id: Option<Uuid>, + + /// Contract ID + #[arg(long, env = "MAKIMA_CONTRACT_ID", global = true)] + pub contract_id: Uuid, +} + +/// Arguments for file command (get specific file). +#[derive(Args, Debug)] +pub struct FileArgs { + #[command(flatten)] + pub common: ContractArgs, + + /// File ID to retrieve + pub file_id: Uuid, +} + +/// Arguments for report command. +#[derive(Args, Debug)] +pub struct ReportArgs { + #[command(flatten)] + pub common: ContractArgs, + + /// Progress message + pub message: String, +} + +/// Arguments for completion-action command. +#[derive(Args, Debug)] +pub struct CompletionActionArgs { + #[command(flatten)] + pub common: ContractArgs, + + /// Comma-separated list of modified files + #[arg(long)] + pub files: Option<String>, + + /// Number of lines added + #[arg(long, default_value = "0")] + pub lines_added: i32, + + /// Number of lines removed + #[arg(long, default_value = "0")] + pub lines_removed: i32, + + /// Whether there are code changes + #[arg(long)] + pub code: bool, +} + +/// Arguments for update-file command. +#[derive(Args, Debug)] +pub struct UpdateFileArgs { + #[command(flatten)] + pub common: ContractArgs, + + /// File ID to update + pub file_id: Uuid, +} + +/// Arguments for create-file command. +#[derive(Args, Debug)] +pub struct CreateFileArgs { + #[command(flatten)] + pub common: ContractArgs, + + /// Name of the new file + pub name: String, +} |
