messagesByRole
messagesByRole(
session,role):NormalizedMessage[]
Filters normalized session messages by role.
Parameters
Section titled “Parameters”session
Section titled “session”Normalized session produced by a harness run.
"system" | "user" | "assistant" | "tool"
Message role to keep.
Returns
Section titled “Returns”Example
Section titled “Example”const assistantText = messagesByRole(result.session, "assistant") .map((message) => message.content) .join("\n");