Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions cli/src/commands/edit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ pub struct EditOptions {
pub tags_remove: Vec<String>,
pub due: Option<String>,
pub clear_due: bool,
pub agent_assignable: bool,
pub no_agent_assignable: bool,
}

pub async fn run(client: &Client, options: EditOptions) -> Result<()> {
Expand Down Expand Up @@ -57,13 +59,27 @@ 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,
column: options.column,
priority: options.priority,
tags,
due_date,
agent_assignable,
};

// Check if any fields are being updated
Expand All @@ -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(
Expand Down
12 changes: 12 additions & 0 deletions cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand All @@ -421,6 +431,8 @@ async fn run() -> error::Result<()> {
tags_remove,
due,
clear_due,
agent_assignable,
no_agent_assignable,
};
edit::run(&client, options).await
}
Expand Down
2 changes: 2 additions & 0 deletions cli/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ pub struct CardUpdate {
pub due_date: Option<DateTime<Utc>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<String>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub agent_assignable: Option<bool>,
}

/// Request body for moving a card
Expand Down