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
|
|
@ -188,6 +188,7 @@ tools (Read, Write, etc.) keep their name as-is.
|
||||||
| `get_agent_meta*` | `get_agent_meta*()` or `get_agent_meta* name` |
|
| `get_agent_meta*` | `get_agent_meta*()` or `get_agent_meta* name` |
|
||||||
| `cancel_loose_end*` | `cancel_loose_end* kind #id` |
|
| `cancel_loose_end*` | `cancel_loose_end* kind #id` |
|
||||||
| `ack_until*` | `ack_until* ≤N` |
|
| `ack_until*` | `ack_until* ≤N` |
|
||||||
|
| `mark_todos_done*` | `mark_todos_done* [id1, id2, …]` (first 8 ids, `…` past that) |
|
||||||
| **Lifecycle** | |
|
| **Lifecycle** | |
|
||||||
| `kill*/restart*/start*/update*` | `kill* name` (etc.) |
|
| `kill*/restart*/start*/update*` | `kill* name` (etc.) |
|
||||||
| `get_logs*` | `get_logs* name` or `get_logs* name NL` |
|
| `get_logs*` | `get_logs* name` or `get_logs* name NL` |
|
||||||
|
|
|
||||||
|
|
@ -605,10 +605,32 @@ fn fmt_hyperhive_tool(name: &str, short: &str, input: &Value) -> String {
|
||||||
.map_or_else(|| "?".to_owned(), |n| n.to_string());
|
.map_or_else(|| "?".to_owned(), |n| n.to_string());
|
||||||
format!("{short} {} #{id}", sv(input, "kind"))
|
format!("{short} {} #{id}", sv(input, "kind"))
|
||||||
}
|
}
|
||||||
|
"mcp__hyperhive__mark_todos_done" => fmt_hyperhive_mark_todos_done(short, input),
|
||||||
_ => fmt_args_generic(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 {
|
fn fmt_hyperhive_remind(short: &str, input: &Value) -> String {
|
||||||
let when = if let Some(s) = input.get("delay_seconds").and_then(Value::as_u64) {
|
let when = if let Some(s) = input.get("delay_seconds").and_then(Value::as_u64) {
|
||||||
if s < 60 {
|
if s < 60 {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue