Documentation
¶
Overview ¶
Package attachments implements the v1 attachment manifest contract (Epic 68, design decisions D7/D8/D15): prompt text carrying file references the agent reads with its own tools.
Manifest format v1 — one line per file, appended after the user text separated by exactly one blank line, each line:
[llmsafespaces:attachment path="<path>" name="<name>"]
The format is a stable API contract locked by the golden fixtures in testdata/ (authoritative). Changes are additive-only; any format change requires a new version marker while this parser keeps supporting v1. Attribute values backslash-escape quotes (") and backslashes (\), and control characters are stripped from names, so a value can never break line structure. Compose is idempotent (D15): any pre-existing trailing v1 block is stripped before the new block is appended, so compose(compose(t, f), f) == compose(t, f). Parse consumes only the trailing block and treats unknown-version or unknown-attribute lines as plain text (forward compatibility). v1 carries path and name only: send-time validation is shape-only (D8 — the server cannot stat workspace files), so the bytes field sketched in the epic design doc is superseded and intentionally absent.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func ValidatePaths ¶
Types ¶
type Attachment ¶
func Parse ¶
func Parse(text string) ([]Attachment, string)