Documentation
¶
Overview ¶
Package artifact defines stable storage contracts for binary or textual content referenced by durable Agent messages.
History stores only an artifact ID and safe metadata. Provider adapters open that ID through Store when they need the bytes for a model request. This keeps filesystem paths, object-store details, and encoded binary data out of the provider-neutral message contract.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("artifact: not found")
ErrNotFound reports that an artifact ID is unknown or no longer retained. Store implementations should wrap this value so callers can use errors.Is.
var StoreSlot = agentslot.One[ArtifactStore]("artifact.store")
StoreSlot is the standard immutable artifact storage ecosystem.
Functions ¶
Types ¶
type ArtifactStore ¶
type ArtifactStore interface {
Write(context.Context, WriteRequest) (Metadata, error)
Open(context.Context, string) (Content, error)
}
ArtifactStore persists immutable content and resolves stable IDs. Write returns only after the content is durable for this Store's documented retention scope. Open never exposes a local path or provider credential.
type Content ¶
type Content struct {
Metadata Metadata
Body io.ReadCloser
}
Content is one opened immutable artifact. The caller must close Body. A successful Store.Open returns metadata whose ID equals the requested ID and whose Size equals the readable content length.
type Metadata ¶
Metadata is the durable, provider-neutral description of stored content. ID is opaque to consumers. MediaType is a canonical MIME type without parameters. Size is the exact number of stored bytes.
type WriteRequest ¶
WriteRequest supplies content for one immutable artifact. Write must consume Body before it returns and must not retain the reader. Name is display-only metadata and may be empty.
func (WriteRequest) Validate ¶
func (r WriteRequest) Validate() error
Validate checks the caller-owned portion of an artifact write.