Documentation
¶
Overview ¶
Package attach writes the places a message points at (wire.MessageRef: a design, a document, a board, a file of the project, a merge request, a task) into the words the agent gets: one block under the person's text, a line per place, each led by a tag the page reads back into a chip. The block is plain enough for the agent to read and stable enough for the page to strip: `<attached>`, a header, `<ref kind=".." id=".." title=".."/> line`, `</attached>`.
Index ¶
Constants ¶
const ( // Open and Close bound the block. Open = "<attached>" Close = "</attached>" )
const ( LongTextUnits = 12_000 LongTextLines = 200 )
LongText: a message this long (UTF-16 units, as the page counts) or of this many lines is not pasted into the agent's box — Claude Code refuses some long pastes without a word, its Enter does nothing — but kept in a file: the box gets its start and the file's path.
const RefUpload wire.RefKind = "upload"
RefUpload is the tag's kind of a file the person uploaded with the message: no place of the project (wire.RefKind), so no chip of a place; the page reads it back into the message's file.
Variables ¶
This section is empty.
Functions ¶
func Head ¶
Head is the start of a long message the box gets: its first headRunes characters, cut at a line's or a word's end when one is near, and an ellipsis.
func IsLongText ¶
IsLongText says whether text goes to the agent as a file (see LongTextUnits).
func LineOf ¶
func LineOf(r wire.MessageRef) string
LineOf is the line of a place the runtime needs nothing more to describe: everything but a design.
func OneLine ¶
OneLine is s on one line, without control characters and without the block's own tags.
Types ¶
type Item ¶
type Item struct {
Ref wire.MessageRef
Line string
// Body is what the agent reads under the line, on lines of its own (another chat's excerpt); "" for none.
Body string
}
Item is a place and the line the agent reads about it.
func LongTextItem ¶
func LongTextItem(ref wire.AttachmentRef, path string, chars int) Item
LongTextItem is the file a long message was kept in: the agent reads that the whole message is there and that the words above are only its start.
func UploadItem ¶ added in v0.16.86
func UploadItem(ref wire.AttachmentRef, path string) Item
UploadItem is a file the person attached that the agent cannot take pasted: it stays on the machine, the agent reads its name and its path. The name is the person's, the file on disk is named by its upload.