pub fn envelope(code: &str, message: impl Into<String>, details: Value) -> ValueExpand description
Build the uniform { code, message, details } envelope used on both the
warning wire (WarningHint’s custom Serialize) and the MCP error wire
(tool_error_with_payload payloads in engine_err_with_suggestions).
Agents and other decoders branch on code (UPPER_SNAKE_CASE, stable)
and parse details by code when they need structured fields.