getMessages method
Retrieves all messages associated with the session.
Returns copies: the underlying maps are deep-cloned before decoding so
mutating the returned Message objects (whose setters write through) can't
alter session state without a version bump or event. This mirrors the JS
implementation, which returns a structuredClone. (Note: getArtifacts
intentionally returns live data.)
Implementation
List<Message> getMessages() =>
_decodeJsonList(_deepClone(_json['messages']), Message.fromJson);