pub fn format_response(id: &str, result: Value) -> String
Format a successful response as JSON string (newline-terminated).