Helpers that operate on a list of decoded Part maps (the shape Parts take once JSON-decoded but before being encoded back for transport).
Owner filtering
The checkpoint-in-envelope convention (see A2aEngine.Types.DataPart)
stores worker/caller resumable state as a DataPart tagged
metadata: {"type" => "checkpoint", "owner" => <agent>, "session" => <id>}.
A broker forwarding a message to the next hop should only include
checkpoints whose owner matches the recipient — otherwise each
side's private state leaks to the other.
filter_by_owner/2 enforces that rule. TextParts, FileParts, and
DataParts without checkpoint metadata pass through unchanged —
this function only acts on tagged checkpoints.
Summary
Functions
Keep only the Parts that the named recipient is allowed to see.
Same rule at the part level. Useful for artifact-carried DataParts where the artifact itself is public but an embedded DataPart may be private.
Functions
Keep only the Parts that the named recipient is allowed to see.
- TextPart / FilePart → always kept.
- DataPart without checkpoint metadata → always kept.
- DataPart with
metadata.type == "checkpoint"→ kept only ifmetadata.owner == recipient.
Same rule at the part level. Useful for artifact-carried DataParts where the artifact itself is public but an embedded DataPart may be private.