(body: &Value)
| 743 | } |
| 744 | |
| 745 | fn first_claudecode_user_text(body: &Value) -> String { |
| 746 | body.get("messages") |
| 747 | .and_then(Value::as_array) |
| 748 | .and_then(|messages| { |
| 749 | messages.iter().find_map(|message| { |
| 750 | let message_map = message.as_object()?; |
| 751 | if message_map.get("role").and_then(Value::as_str) != Some("user") { |
| 752 | return None; |
| 753 | } |
| 754 | message_map |
| 755 | .get("content") |
| 756 | .and_then(first_text_from_claude_content) |
| 757 | }) |
| 758 | }) |
| 759 | .unwrap_or_default() |
| 760 | } |
| 761 | |
| 762 | fn block_has_cache_control(block: &Value) -> bool { |
| 763 | block |
no outgoing calls
no test coverage detected