(content: &Value)
| 981 | } |
| 982 | |
| 983 | fn content_is_only_subagent_dispatch(content: &Value) -> bool { |
| 984 | let Some(items) = content.as_array() else { |
| 985 | return false; |
| 986 | }; |
| 987 | !items.is_empty() |
| 988 | && items.iter().all(|item| { |
| 989 | item.get("type").and_then(Value::as_str) == Some("tool_use") |
| 990 | && item |
| 991 | .get("name") |
| 992 | .and_then(Value::as_str) |
| 993 | .is_some_and(is_subagent_dispatch_tool) |
| 994 | }) |
| 995 | } |
| 996 | |
| 997 | fn dispatch_text(item: &Value) -> Option<String> { |
| 998 | let input = item.get("input").unwrap_or(item); |
no test coverage detected