Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Checkpoint ¶
type Checkpoint struct {
RunID string `json:"run_id"`
TaskName string `json:"task_name"` // empty for adhoc tasks
Iteration int `json:"iteration"`
Messages []anthropic.MessageParam `json:"messages"`
SystemPrompt string `json:"system_prompt"` // stored for debugging context
InputTokens int64 `json:"input_tokens"`
OutputTokens int64 `json:"output_tokens"`
CreatedAt time.Time `json:"created_at"`
}
Checkpoint captures the agent's conversation state at a point in time. Persisted to disk after each iteration so that failed runs can resume.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store persists and retrieves session checkpoints on the filesystem. Each run gets exactly one checkpoint file that is overwritten each iteration.
func NewStore ¶
NewStore creates a new session store backed by the given directory. Creates the directory if it doesn't exist.
func (*Store) Delete ¶
Delete removes a checkpoint file. Called after successful task completion. Returns nil if the file doesn't exist (idempotent).
func (*Store) HasCheckpoint ¶
HasCheckpoint returns true if a checkpoint exists for the given RunID.
func (*Store) List ¶
func (s *Store) List() ([]Checkpoint, error)
List returns all checkpoints in the store, sorted by creation time (newest first). Reads only metadata — does not load full message histories.
func (*Store) Load ¶
func (s *Store) Load(runID string) (*Checkpoint, error)
Load reads a checkpoint from disk for the given RunID. Returns an error if no checkpoint exists.
func (*Store) Save ¶
func (s *Store) Save(cp *Checkpoint) error
Save persists a checkpoint to disk, overwriting any previous checkpoint for the same RunID.