attachments

package
v0.6.71 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: AGPL-3.0, Apache-2.0, MIT Imports: 9 Imported by: 0

Documentation

Overview

Package attachments downloads files attached to an agent run or its prompts and describes them to the coding agent.

Index

Constants

View Source
const EnvDir = "PLRL_AGENT_RUN_ATTACHMENTS_DIR"

EnvDir overrides the canonical attachments directory. Used in tests.

Variables

This section is empty.

Functions

func AppendHint

func AppendHint(prompt string, files []File) string

AppendHint appends a section listing the downloaded files to prompt.

func Dir

func Dir() string

Dir returns the attachments directory, honoring PLRL_AGENT_RUN_ATTACHMENTS_DIR.

func ReadDirs

func ReadDirs() []string

ReadDirs returns the attachments directory when it exists so agents with restricted filesystem access can read downloaded files.

Types

type File

type File struct {
	Filename string
	Filetype string
	Size     int64
	// Path is the local path of the downloaded file, empty when Err is set.
	Path string
	Err  error
}

File is an attachment and where it was downloaded to.

func Download

func Download(ctx context.Context, client *http.Client, dir string, attachments []*console.AgentAttachmentFragment) []File

Download fetches each attachment into dir. Failures are recorded on the returned files rather than aborting, so the agent can still be told about them.

Jump to

Keyboard shortcuts

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