MCPcopy Create free account
hub / github.com/LeenHawk/sgproxy / first_claudecode_user_text

Function first_claudecode_user_text

src/proxy.rs:745–760  ·  view source on GitHub ↗
(body: &Value)

Source from the content-addressed store, hash-verified

743}
744
745fn 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
762fn block_has_cache_control(block: &Value) -> bool {
763 block

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected