UiMessage
One turn in the transcript, as an ordered list of UiParts.
A message is not the same unit as a protocol message. An assistant that reasons, speaks, calls a tool and speaks again emits four message ids across three event families; this model folds that turn into one UiMessage whose parts are in the order the agent produced them, and each part keeps the protocol id it came from. That is the whole reason this type exists: the transcript shape the upstream SDK maintains -- an assistant message with a single content string and a separate toolCalls list, and reasoning in a sibling channel keyed by its own id -- cannot say whether the tool call came before or after the sentence.
There is no TOOL role. A tool's output belongs to the call that asked for it, so a TOOL_CALL_RESULT lands on the ToolCallPart rather than opening a message of its own.