session

package
v0.779.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Role    string          `json:"role"`
	Content string          `json:"content,omitempty"`
	Raw     json.RawMessage `json:"raw,omitempty"`
}

Message captures one entry of conversation history. Content is a human-readable preview; Raw carries the full JSON of the underlying anthropic.MessageParam (including tool_use and tool_result blocks) so that resuming a session leaves the model-visible history byte-identical to what was sent originally.

type State

type State struct {
	ID        string    `json:"id"`
	Title     string    `json:"title,omitempty"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	Messages  []Message `json:"messages"`
	Model     string    `json:"model"`
	Notes     string    `json:"notes,omitempty"`

	// Handoff carries a structured HandoffArtifact (see
	// internal/agent/handoff.go) as raw JSON so /session resume can
	// surface findings / open threads / blocked tools without
	// re-scanning history. Optional; older session files leave it
	// absent and resume works unchanged.
	Handoff json.RawMessage `json:"handoff,omitempty"`
}

type Store

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

func NewStore

func NewStore(dir string) (*Store, error)

func (*Store) Delete

func (s *Store) Delete(id string) error

func (*Store) Latest

func (s *Store) Latest() (*State, error)

func (*Store) List

func (s *Store) List() ([]State, error)

func (*Store) Load

func (s *Store) Load(id string) (*State, error)

func (*Store) Save

func (s *Store) Save(state *State) error

Jump to

Keyboard shortcuts

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