hive-agent: show mark_todos_done ids in the terminal, not just a count
fmt_args_generic's generic array handling collapsed `ids: [4]` — the count — since mark_todos_done had no dedicated match arm. Added one, matching the file's existing per-tool pattern (extracted into its own helper to stay under the 100-line clippy limit on fmt_hyperhive_tool).
This commit is contained in:
parent
92bb5340b7
commit
85ef5e5fbe
2 changed files with 23 additions and 0 deletions
|
|
@ -605,10 +605,32 @@ fn fmt_hyperhive_tool(name: &str, short: &str, input: &Value) -> String {
|
|||
.map_or_else(|| "?".to_owned(), |n| n.to_string());
|
||||
format!("{short} {} #{id}", sv(input, "kind"))
|
||||
}
|
||||
"mcp__hyperhive__mark_todos_done" => fmt_hyperhive_mark_todos_done(short, input),
|
||||
_ => fmt_args_generic(short, input),
|
||||
}
|
||||
}
|
||||
|
||||
/// `mark_todos_done` — renders the acked ids so the terminal shows which
|
||||
/// todos a bulk-clear call actually covered, not just a bracketed count
|
||||
/// (`fmt_args_generic`'s generic array handling collapses to `ids: [N]`,
|
||||
/// the count alone, which isn't useful here).
|
||||
fn fmt_hyperhive_mark_todos_done(short: &str, input: &Value) -> String {
|
||||
let ids = match input.get("ids").and_then(Value::as_array) {
|
||||
Some(arr) if !arr.is_empty() => {
|
||||
let nums: Vec<String> = arr
|
||||
.iter()
|
||||
.filter_map(Value::as_u64)
|
||||
.take(8)
|
||||
.map(|n| n.to_string())
|
||||
.collect();
|
||||
let tail = if arr.len() > 8 { ", …" } else { "" };
|
||||
format!("[{}{tail}]", nums.join(", "))
|
||||
}
|
||||
_ => "[]".to_owned(),
|
||||
};
|
||||
format!("{short} {ids}")
|
||||
}
|
||||
|
||||
fn fmt_hyperhive_remind(short: &str, input: &Value) -> String {
|
||||
let when = if let Some(s) = input.get("delay_seconds").and_then(Value::as_u64) {
|
||||
if s < 60 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue