(item: &Value)
| 995 | } |
| 996 | |
| 997 | fn dispatch_text(item: &Value) -> Option<String> { |
| 998 | let input = item.get("input").unwrap_or(item); |
| 999 | let mut parts = Vec::new(); |
| 1000 | for key in ["description", "prompt", "subagent_type"] { |
| 1001 | if let Some(value) = input |
| 1002 | .get(key) |
| 1003 | .or_else(|| item.get(key)) |
| 1004 | .and_then(Value::as_str) |
| 1005 | .filter(|value| !value.trim().is_empty()) |
| 1006 | { |
| 1007 | parts.push(value.to_string()); |
| 1008 | } |
| 1009 | } |
| 1010 | (!parts.is_empty()).then(|| parts.join("\n\n")) |
| 1011 | } |
| 1012 | |
| 1013 | fn content_kind(content: &Value) -> Option<&'static str> { |
| 1014 | if content.is_array() { |
no test coverage detected