diff --git a/cli/src/commands/edit.rs b/cli/src/commands/edit.rs index b569eb9..1cee3d7 100644 --- a/cli/src/commands/edit.rs +++ b/cli/src/commands/edit.rs @@ -16,6 +16,8 @@ pub struct EditOptions { pub tags_remove: Vec, pub due: Option, pub clear_due: bool, + pub agent_assignable: bool, + pub no_agent_assignable: bool, } pub async fn run(client: &Client, options: EditOptions) -> Result<()> { @@ -57,6 +59,19 @@ pub async fn run(client: &Client, options: EditOptions) -> Result<()> { } }; + // Determine agent_assignable value + let agent_assignable = if options.agent_assignable && options.no_agent_assignable { + return Err(crate::error::BlazeError::InvalidInput( + "Cannot specify both --agent-assignable and --no-agent-assignable".into() + )); + } else if options.agent_assignable { + Some(true) + } else if options.no_agent_assignable { + Some(false) + } else { + None + }; + let update = CardUpdate { title: options.title, description: options.description, @@ -64,6 +79,7 @@ pub async fn run(client: &Client, options: EditOptions) -> Result<()> { priority: options.priority, tags, due_date, + agent_assignable, }; // Check if any fields are being updated @@ -73,6 +89,7 @@ pub async fn run(client: &Client, options: EditOptions) -> Result<()> { && update.priority.is_none() && update.tags.is_none() && update.due_date.is_none() + && update.agent_assignable.is_none() && !options.clear_due { return Err(crate::error::BlazeError::InvalidInput( diff --git a/cli/src/main.rs b/cli/src/main.rs index 73a68a0..fb08717 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -132,6 +132,14 @@ enum Commands { /// Clear due date #[arg(long)] clear_due: bool, + + /// Mark as agent-assignable (agent can work on this autonomously) + #[arg(long)] + agent_assignable: bool, + + /// Mark as NOT agent-assignable + #[arg(long)] + no_agent_assignable: bool, }, /// Move a card to a different column @@ -409,6 +417,8 @@ async fn run() -> error::Result<()> { tags_remove, due, clear_due, + agent_assignable, + no_agent_assignable, } => { let client = client::Client::new(&url, token)?; let options = edit::EditOptions { @@ -421,6 +431,8 @@ async fn run() -> error::Result<()> { tags_remove, due, clear_due, + agent_assignable, + no_agent_assignable, }; edit::run(&client, options).await } diff --git a/cli/src/types.rs b/cli/src/types.rs index ff4d6c3..1faac9a 100644 --- a/cli/src/types.rs +++ b/cli/src/types.rs @@ -171,6 +171,8 @@ pub struct CardUpdate { pub due_date: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub tags: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub agent_assignable: Option, } /// Request body for moving a card