render

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 1, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func Batch

func Batch(to, owner string, msgs []Mail, maxMsgs, maxBytes int) string

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 Line

func Line(m Mail) string

Line renders a message as one line: seq, sender, time, size, first line, kind.

func One

func One(m Mail) string

One renders a message in full; the body is quoted.

func Sender

func Sender(owner string, m Mail) string

Sender is the one place a sender's name is shown, for a receiver of owner, by the sender's endpoint name:

  • a sender whose owner is unknown (not in the directory): the name alone;
  • another owner than the receiver's: owner/name (devops/nats-ops);
  • otherwise: the name as is.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL