Documentation
¶
Overview ¶
Package artifact defines runtime contracts for storing and loading run artifacts produced by tools.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("artifact not found")
ErrNotFound reports that an artifact does not exist in the requested agent/run scope.
Functions ¶
This section is empty.
Types ¶
type Content ¶
Content carries an artifact body inside the process. Runtime code converts Content to Ref before crossing workflow or hook boundaries.
type ListQuery ¶
type ListQuery struct {
AgentID string
RunID string
MimeType string
Metadata map[string]string
Limit int
}
ListQuery filters artifact refs within one agent/run scope.
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
MemoryStore is an in-process artifact store for tests and local development. Data is lost when the process exits.
func NewMemoryStore ¶
func NewMemoryStore() *MemoryStore
NewMemoryStore returns an empty in-memory artifact store.
type Ref ¶
type Ref struct {
ID string `json:"id"`
AgentID string `json:"agent_id"`
RunID string `json:"run_id"`
ToolCallID string `json:"tool_call_id,omitempty"`
Name string `json:"name,omitempty"`
MimeType string `json:"mime_type,omitempty"`
SizeBytes int64 `json:"size_bytes"`
Metadata map[string]string `json:"metadata,omitempty"`
CreatedAt time.Time `json:"created_at,omitempty"`
}
Ref is the workflow-safe artifact reference carried through planner, hook, and API boundaries. It intentionally contains no artifact body.
type SaveInput ¶
type SaveInput struct {
AgentID string
RunID string
ToolCallID string
Name string
MimeType string
Metadata map[string]string
Body []byte
}
SaveInput describes one artifact to persist.
type Store ¶
type Store interface {
Save(ctx context.Context, input SaveInput) (Ref, error)
List(ctx context.Context, query ListQuery) ([]Ref, error)
Load(ctx context.Context, query LoadQuery) (Content, error)
}
Store persists artifacts by agent and run. Implementations must be safe for concurrent use and must isolate artifacts across AgentID plus RunID.