MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / composeHumanOutbound

Function composeHumanOutbound

internal/relay/flow_test.go:59–72  ·  view source on GitHub ↗

composeHumanOutbound stands in for a Gmail user sending to an agent — no Reply-To, no X-E2A-* headers, envelope from Gmail's MTA.

(t *testing.T, human, to, subject, body, replyToMsgID string)

Source from the content-addressed store, hash-verified

57// composeHumanOutbound stands in for a Gmail user sending to an agent —
58// no Reply-To, no X-E2A-* headers, envelope from Gmail's MTA.
59func composeHumanOutbound(t *testing.T, human, to, subject, body, replyToMsgID string) []byte {
60 t.Helper()
61 var buf strings.Builder
62 fmt.Fprintf(&buf, "From: %s\r\n", human)
63 fmt.Fprintf(&buf, "To: %s\r\n", to)
64 fmt.Fprintf(&buf, "Subject: %s\r\n", subject)
65 if replyToMsgID != "" {
66 fmt.Fprintf(&buf, "In-Reply-To: %s\r\n", replyToMsgID)
67 fmt.Fprintf(&buf, "References: %s\r\n", replyToMsgID)
68 }
69 buf.WriteString("\r\n")
70 buf.WriteString(body)
71 return []byte(buf.String())
72}
73
74// --- Flow 1: Human → Agent → Human --------------------------------------
75

Callers 2

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected