Documentation
¶
Overview ¶
Package artifact stores durable chat attachments and tool images beside the workspace registry.
Index ¶
- Constants
- Variables
- type Content
- type Record
- type Store
- func (s *Store) Delete(id string) error
- func (s *Store) DeleteChat(chatID string, retained ...map[string]string) error
- func (s *Store) Get(id string) (Content, error)
- func (s *Store) Reference(chatID, id string) (Record, string, error)
- func (s *Store) ResolveInputs(chatID string, attachments []agent.Attachment) ([]agent.Attachment, error)
- func (s *Store) SaveImage(chatID string, img image.Image) (Record, error)
- func (s *Store) Upload(chatID, id string, req UploadChunk) (UploadState, error)
- type UploadChunk
- type UploadState
Constants ¶
View Source
const MaxAttachmentBytes = 16 << 20
View Source
const MaxBytes = 8 << 20
View Source
const MaxUploadChunk = 384 << 10
View Source
const UploadVersion = 1
Variables ¶
View Source
var ErrImageLimit = errors.New("capture exceeds the supported image size")
View Source
var ErrStorageFull = errors.New("workspace attachment storage is full; remove unneeded chats before adding more files")
View Source
var ErrUpload = errors.New("invalid attachment upload")
View Source
var ErrUploadConflict = errors.New("attachment upload differs from its saved content")
Functions ¶
This section is empty.
Types ¶
type Record ¶
type Record struct {
ID string `json:"id"`
ChatID string `json:"chatId,omitempty"`
Mime string `json:"mime"`
Bytes int `json:"bytes"`
Width int `json:"width"`
Height int `json:"height"`
CreatedAt time.Time `json:"createdAt"`
Kind string `json:"kind,omitempty"`
Name string `json:"name,omitempty"`
SHA256 string `json:"sha256,omitempty"`
}
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) DeleteChat ¶
func (*Store) ResolveInputs ¶
func (s *Store) ResolveInputs(chatID string, attachments []agent.Attachment) ([]agent.Attachment, error)
func (*Store) Upload ¶
func (s *Store) Upload(chatID, id string, req UploadChunk) (UploadState, error)
type UploadChunk ¶
type UploadChunk struct {
Name string `json:"name"`
Mime string `json:"mime"`
Bytes int `json:"bytes"`
SHA256 string `json:"sha256"`
Offset int `json:"offset"`
Data []byte `json:"data"`
}
UploadChunk is replayable after a lost response. Bytes never enter the registry or a turn request; only the completed, verified reference does.
type UploadState ¶
Click to show internal directories.
Click to hide internal directories.