Documentation
¶
Index ¶
- func ActiveAtToken(v string) (partial string, ok bool)
- func BuildBlocks(input string, allowImages bool) ([]content.Block, error)
- func LastField(v string) string
- func ListFiles(partial string) []components.FileItem
- type AttachmentNotFoundError
- type AttachmentReadError
- type AttachmentTooLargeError
- type BinaryAttachmentError
- type DeniedAttachmentError
- type EmptyInputError
- type ImageUnsupportedError
- type UnsupportedAttachmentError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActiveAtToken ¶
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 ¶
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 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 ¶
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 ¶
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 ¶
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 ¶
func (e UnsupportedAttachmentError) Error() string