safeValidateUIMessages is an async function that validates UI messages like validateUIMessages, but instead of throwing it returns an object with a success key and either data or error.
For backward compatibility, validation still accepts rawInput on tool parts
in the output-error state. When a defined rawInput value is found,
safeValidateUIMessages emits an AI SDK deprecation warning through
AI_SDK_LOG_WARNINGS.
Migrate persisted messages to store tool arguments in input and remove
rawInput. For backward compatibility, conversion uses rawInput as a
fallback when input is null or undefined. rawInput will be removed in
the next major version.