summaryrefslogtreecommitdiff
path: root/makima/src/daemon/cli/directive.rs
diff options
context:
space:
mode:
authorsoryu <soryu@soryu.co>2026-02-09 00:11:51 +0000
committersoryu <soryu@soryu.co>2026-02-09 00:11:51 +0000
commit8c23b3ab6f7fabca01b0468911bae073aa5ced32 (patch)
treef50159aee13b13f0b55618ac09e9be1f89a41bb2 /makima/src/daemon/cli/directive.rs
parent3662b334dfd68cfdf00ed44ae88927c2e1b2aabe (diff)
downloadsoryu-8c23b3ab6f7fabca01b0468911bae073aa5ced32.tar.gz
soryu-8c23b3ab6f7fabca01b0468911bae073aa5ced32.zip
Add new directive mechanism v3
Diffstat (limited to 'makima/src/daemon/cli/directive.rs')
-rw-r--r--makima/src/daemon/cli/directive.rs101
1 files changed, 101 insertions, 0 deletions
diff --git a/makima/src/daemon/cli/directive.rs b/makima/src/daemon/cli/directive.rs
new file mode 100644
index 0000000..5de60ed
--- /dev/null
+++ b/makima/src/daemon/cli/directive.rs
@@ -0,0 +1,101 @@
+//! Directive subcommand - directive management commands for orchestrator tasks.
+
+use clap::Args;
+use uuid::Uuid;
+
+/// Common arguments for directive commands.
+#[derive(Args, Debug, Clone)]
+pub struct DirectiveArgs {
+ /// API URL
+ #[arg(long, env = "MAKIMA_API_URL", default_value = "https://api.makima.jp", global = true)]
+ pub api_url: String,
+
+ /// API key for authentication
+ #[arg(long, env = "MAKIMA_API_KEY", global = true)]
+ pub api_key: String,
+
+ /// Directive ID
+ #[arg(long, env = "MAKIMA_DIRECTIVE_ID", global = true)]
+ pub directive_id: Uuid,
+}
+
+/// Arguments for listing directives (no directive_id required).
+#[derive(Args, Debug, Clone)]
+pub struct DirectiveListArgs {
+ /// API URL
+ #[arg(long, env = "MAKIMA_API_URL", default_value = "https://api.makima.jp", global = true)]
+ pub api_url: String,
+
+ /// API key for authentication
+ #[arg(long, env = "MAKIMA_API_KEY", global = true)]
+ pub api_key: String,
+}
+
+/// Arguments for add-step command.
+#[derive(Args, Debug)]
+pub struct AddStepArgs {
+ #[command(flatten)]
+ pub common: DirectiveArgs,
+
+ /// Step name
+ pub name: String,
+
+ /// Step description
+ #[arg(long)]
+ pub description: Option<String>,
+
+ /// Task plan for the step
+ #[arg(long)]
+ pub task_plan: Option<String>,
+
+ /// Comma-separated UUIDs of dependency steps
+ #[arg(long)]
+ pub depends_on: Option<String>,
+
+ /// Order index
+ #[arg(long, default_value = "0")]
+ pub order_index: i32,
+}
+
+/// Arguments for remove-step command.
+#[derive(Args, Debug)]
+pub struct RemoveStepArgs {
+ #[command(flatten)]
+ pub common: DirectiveArgs,
+
+ /// Step ID to remove
+ pub step_id: Uuid,
+}
+
+/// Arguments for set-deps command.
+#[derive(Args, Debug)]
+pub struct SetDepsArgs {
+ #[command(flatten)]
+ pub common: DirectiveArgs,
+
+ /// Step ID to update
+ pub step_id: Uuid,
+
+ /// Comma-separated UUIDs of dependency steps
+ pub depends_on: String,
+}
+
+/// Arguments for complete-step/fail-step/skip-step commands.
+#[derive(Args, Debug)]
+pub struct StepActionArgs {
+ #[command(flatten)]
+ pub common: DirectiveArgs,
+
+ /// Step ID
+ pub step_id: Uuid,
+}
+
+/// Arguments for update-goal command.
+#[derive(Args, Debug)]
+pub struct UpdateGoalArgs {
+ #[command(flatten)]
+ pub common: DirectiveArgs,
+
+ /// New goal text
+ pub goal: String,
+}