agent

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InvocationNotFoundErrorName = "InvocationNotFound"
	ReceiptNotFoundErrorName    = "ReceiptNotFound"
)

Variables

View Source
var (
	// ErrInvocationNotFound indicates an invocation was not found that matches the passed details.
	ErrInvocationNotFound = errors.New(InvocationNotFoundErrorName, "invocation not found")
	// ErrReceiptNotFound indicates a receipt was not found that matches the passed details.
	ErrReceiptNotFound = errors.New(ReceiptNotFoundErrorName, "receipt not found")
)

Functions

func Index

func Index(message message.AgentMessage) iter.Seq2[IndexEntry, error]

Types

type IndexEntry

type IndexEntry struct {
	Invocation *InvocationSource
	Receipt    *ReceiptSource
}

IndexEntry is either an indexed invocation OR an indexed receipt.

type InvocationSource

type InvocationSource struct {
	Task       cid.Cid
	Invocation invocation.Invocation
	Message    cid.Cid
}

type ReceiptSource

type ReceiptSource struct {
	Task    cid.Cid
	Receipt receipt.AnyReceipt
	Message cid.Cid
}

type Store

type Store interface {
	// Write an agent message to the store.
	Write(ctx context.Context, message message.AgentMessage, index []IndexEntry, source []byte) error
	// GetInvocation retrieves an invocation by its task CID. May return [ErrInvocationNotFound].
	GetInvocation(ctx context.Context, task cid.Cid) (invocation.Invocation, error)
	// GetReceipt retrieves a receipt by its task CID. May return [ErrReceiptNotFound].
	GetReceipt(ctx context.Context, task cid.Cid) (receipt.AnyReceipt, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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