Documentation
¶
Overview ¶
Package render turns mail into the text a Claude session sees: a small batch in full, a large one as a digest of one line per message.
Index ¶
- func Batch(to, owner string, msgs []Mail, maxMsgs, maxBytes int) string
- func HookBatch(to, owner string, msgs []Mail, maxMsgs, maxBytes int) string
- func IsDigest(msgs []Mail, maxMsgs, maxBytes int) bool
- func Line(m Mail) string
- func One(m Mail) string
- func Sender(owner string, m Mail) string
- type Mail
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Batch ¶
Batch renders msgs for the endpoint named to, of owner: in full when there are at most maxMsgs and their bodies total at most maxBytes, otherwise as a digest. The first line is a short summary of the count and the senders, since Claude Code shows it as the terminal line after its own "← mash:".
func HookBatch ¶ added in v0.3.2
HookBatch is Batch for the hook, whose digest says plainly that a listed message stays unread until the model reads it with the read tool (ADR 0046). A batch shown in full is the same as Batch's.
func IsDigest ¶ added in v0.3.2
IsDigest reports whether Batch and HookBatch render msgs as a digest, not in full.
Types ¶
type Mail ¶
type Mail struct {
Seq uint64
From string
// Instance is the sender's verified instance id; empty when it sent none
// or the binding did not verify.
Instance string
Trust sap.Trust
At time.Time
Body []byte
// Owner is the sender's owner (its directory record's owner); empty when the directory does not know it.
Owner string
// Urgent is a verified sender's signed urgent mark.
Urgent bool
// Kind is the sender's kind (blocker, question, task, result, fyi); the zero value reads as task.
Kind kind.Kind
// Redelivered: a hook began to show this message and was interrupted, so it may already have been seen.
Redelivered bool
}
Mail is one message as delivered.