session

package
v0.807.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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