MCPcopy Create free account
hub / github.com/compozy/agh / parseEnvelopeSummary

Function parseEnvelopeSummary

internal/network/router.go:1735–1763  ·  view source on GitHub ↗
(data []byte)

Source from the content-addressed store, hash-verified

1733}
1734
1735func parseEnvelopeSummary(data []byte) *Envelope {
1736 var env Envelope
1737 if err := json.Unmarshal(data, &env); err != nil {
1738 return nil
1739 }
1740
1741 return &Envelope{
1742 Protocol: strings.TrimSpace(env.Protocol),
1743 ID: strings.TrimSpace(env.ID),
1744 WorkspaceID: strings.TrimSpace(env.WorkspaceID),
1745 Kind: Kind(strings.TrimSpace(string(env.Kind))),
1746 Channel: strings.TrimSpace(env.Channel),
1747 Surface: normalizeOptionalSurface(env.Surface),
1748 ThreadID: normalizeOptionalIdentifier(env.ThreadID),
1749 DirectID: normalizeOptionalIdentifier(env.DirectID),
1750 From: strings.TrimSpace(env.From),
1751 To: normalizeOptionalIdentifier(env.To),
1752 Mentions: normalizeEnvelopeMentions(env.Mentions),
1753 WorkID: normalizeOptionalIdentifier(env.WorkID),
1754 ReplyTo: normalizeOptionalIdentifier(env.ReplyTo),
1755 TraceID: normalizeOptionalIdentifier(env.TraceID),
1756 CausationID: normalizeOptionalIdentifier(env.CausationID),
1757 TS: env.TS,
1758 ExpiresAt: cloneInt64Ptr(env.ExpiresAt),
1759 Body: cloneRawMessage(env.Body),
1760 Proof: cloneProof(env.Proof),
1761 Ext: cloneExtensionMap(env.Ext),
1762 }
1763}
1764
1765func rejectionReceiptStatus(reason ReasonCode) (ReceiptStatus, bool) {
1766 switch reason {

Callers 1

Calls 8

KindTypeAlias · 0.85
normalizeOptionalSurfaceFunction · 0.85
cloneProofFunction · 0.85
cloneInt64PtrFunction · 0.70
cloneRawMessageFunction · 0.70
cloneExtensionMapFunction · 0.70

Tested by

no test coverage detected