( messageID string, channel string, fromSessionID string, toSessionID string, body json.RawMessage, metadata contract.CoordinationMessageMetadataPayload, timestamp time.Time, )
| 756 | } |
| 757 | |
| 758 | func agentChannelMessageFromRequest( |
| 759 | messageID string, |
| 760 | channel string, |
| 761 | fromSessionID string, |
| 762 | toSessionID string, |
| 763 | body json.RawMessage, |
| 764 | metadata contract.CoordinationMessageMetadataPayload, |
| 765 | timestamp time.Time, |
| 766 | ) contract.AgentChannelMessagePayload { |
| 767 | return contract.AgentChannelMessagePayload{ |
| 768 | MessageID: strings.TrimSpace(messageID), |
| 769 | ChannelID: firstNonEmpty(strings.TrimSpace(metadata.CoordinationChannelID), strings.TrimSpace(channel)), |
| 770 | FromSessionID: strings.TrimSpace(fromSessionID), |
| 771 | ToSessionID: strings.TrimSpace(toSessionID), |
| 772 | Body: cloneRawMessage(body), |
| 773 | Metadata: metadata, |
| 774 | Timestamp: timestamp.UTC(), |
| 775 | } |
| 776 | } |
| 777 | |
| 778 | func filterAgentChannelEnvelopes(envelopes []network.Envelope, channel string) []network.Envelope { |
| 779 | channel = strings.TrimSpace(channel) |
no test coverage detected