pub fn format_json(doc: &Document) -> String
Format a document as agent-friendly JSON.
Returns an error message in the output if serialization fails (should not happen for well-formed Document values).