Help us shape the future of Go! Take the 2026 Go Developer Survey

input

package
v0.21.3 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActiveAtToken

func ActiveAtToken(v string) (partial string, ok bool)

ActiveAtToken reports the @path partial currently being typed at the END of v, if any: it is the last whitespace-delimited token when that token starts with '@' and v does not end in whitespace (a trailing space means the token is finished). The returned partial is the token without its leading '@' (possibly "").

func BuildBlocks

func BuildBlocks(input string, allowImages bool) ([]content.Block, error)

BuildBlocks parses input into content blocks: a leading prompt TextBlock (when non-empty) followed by one block per @path attachment, in order. allowImages gates image attachments; when false an image @path is rejected at the boundary rather than sent to a text-only model.

Classification (denylist + extension/modality) happens strictly BEFORE any filesystem syscall, so a denied, unsupported, or text-only-model attachment is rejected without ever opening a file.

func LastField

func LastField(v string) string

LastField returns the last whitespace-delimited field of v (or "").

func ListFiles

func ListFiles(partial string) []components.FileItem

ListFiles returns up to maxFileCompletions completion candidates for the @path partial: entries of the partial's directory whose name has the partial's base as a (case-insensitive) prefix. Dotfiles are hidden unless the prefix itself starts with '.'. A read error (missing/inaccessible directory) yields no candidates — the panel simply stays hidden. It only reads a directory listing; it opens no file.

Types

type AttachmentNotFoundError

type AttachmentNotFoundError struct {
	Path  string
	Cause error
}

AttachmentNotFoundError — @path does not exist (Cause wraps the os error).

func (AttachmentNotFoundError) Error

func (e AttachmentNotFoundError) Error() string

func (*AttachmentNotFoundError) Unwrap

func (e *AttachmentNotFoundError) Unwrap() error

type AttachmentReadError

type AttachmentReadError struct {
	Path  string
	Cause error
}

AttachmentReadError — reading @path failed (Cause wraps the os error).

func (AttachmentReadError) Error

func (e AttachmentReadError) Error() string

func (*AttachmentReadError) Unwrap

func (e *AttachmentReadError) Unwrap() error

type AttachmentTooLargeError

type AttachmentTooLargeError struct {
	Path      string
	Size, Max int64
}

AttachmentTooLargeError — @path exceeds the size cap.

func (AttachmentTooLargeError) Error

func (e AttachmentTooLargeError) Error() string

type BinaryAttachmentError

type BinaryAttachmentError struct{ Path string }

BinaryAttachmentError — an extensionless @path whose content is not UTF-8 text.

func (BinaryAttachmentError) Error

func (e BinaryAttachmentError) Error() string

type DeniedAttachmentError

type DeniedAttachmentError struct{ Path, Reason string }

DeniedAttachmentError — @path matched the secret/credential denylist.

func (DeniedAttachmentError) Error

func (e DeniedAttachmentError) Error() string

type EmptyInputError

type EmptyInputError struct{}

EmptyInputError — submitted input had no text and no attachments.

func (EmptyInputError) Error

func (e EmptyInputError) Error() string

type ImageUnsupportedError

type ImageUnsupportedError struct{ Ext string }

ImageUnsupportedError — image @path while the active model is text-only.

func (ImageUnsupportedError) Error

func (e ImageUnsupportedError) Error() string

type UnsupportedAttachmentError

type UnsupportedAttachmentError struct{ Ext string }

UnsupportedAttachmentError — @path extension is neither image nor plaintext.

func (UnsupportedAttachmentError) Error

Jump to

Keyboard shortcuts

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