attach

package
v0.16.397 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: AGPL-3.0 Imports: 7 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 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

View Source
const (
	// Open and Close bound the block.
	Open  = "<attached>"
	Close = "</attached>"
)
View Source
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.

View Source
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 Block

func Block(items []Item) string

Block is the places as the agent reads them; "" for none.

func Head(text string) string

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

func IsLongText(text string) bool

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

func OneLine(s string) string

OneLine is s on one line, without control characters and without the block's own tags.

func Strip

func Strip(text string) string

Strip is the person's words without the block: what a title or a summary is made of.

func Tag

func Tag(r wire.MessageRef) string

Tag is the line's lead the page reads the chip from.

func With

func With(text, block string) string

With is the person's words with the block under them.

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.

Jump to

Keyboard shortcuts

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