storage

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Header struct {
	Version   int       `json:"version"`
	SessionID string    `json:"session_id"`
	Cwd       string    `json:"cwd"`
	Created   time.Time `json:"created"`
}

Header is the first line of the file.

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(dir string) *Manager

func (*Manager) Create

func (m *Manager) Create(cwd string) (*Store, error)

func (*Manager) List

func (m *Manager) List() ([]SessionInfo, error)

List returns sessions newest first, skipping files that are unreadable or from another version.

func (*Manager) Open

func (m *Manager) Open(id string) (*Store, State, error)

type Model

type Model struct {
	Provider string `json:"provider"`
	Model    string `json:"model"`
	Effort   string `json:"effort,omitempty"`
}

type SessionInfo

type SessionInfo struct {
	ID           string
	Path         string
	Cwd          string
	Created      time.Time
	Updated      time.Time
	MessageCount int    // messages of the conversation, not those the harness added
	FirstMessage string // first user message, truncated to 80 runes
}

type State

type State struct {
	Messages []agentcore.Message
	Model    Model // zero when none was recorded
	// Usage includes responses that a compaction later replaced, and the
	// compactions themselves.
	Usage agentcore.Usage
}

func Replay

func Replay(path string) (State, error)

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store is safe for concurrent use.

func (*Store) Append

func (s *Store) Append(m agentcore.Message) error

func (*Store) AppendCompaction

func (s *Store) AppendCompaction(c *agentcore.Compaction) error

func (*Store) AppendModel

func (s *Store) AppendModel(m Model) error

func (*Store) Close

func (s *Store) Close() error

func (*Store) Header

func (s *Store) Header() Header

func (*Store) Path

func (s *Store) Path() string

Jump to

Keyboard shortcuts

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