Documentation
¶
Overview ¶
Package session persists conversation history as append-only JSONL files with a meta sidecar carrying the summary and logical truncation offset.
Index ¶
- type Store
- func (s *Store) Append(key string, msg provider.Message) error
- func (s *Store) Clear(key string) error
- func (s *Store) Compact(key string) error
- func (s *Store) History(key string) ([]provider.Message, error)
- func (s *Store) List() ([]string, error)
- func (s *Store) SetSkip(key string, skip int) error
- func (s *Store) SetSummary(key, summary string, keepLast int) error
- func (s *Store) SetSummaryAt(key, summary string, skip int) error
- func (s *Store) Skip(key string) int
- func (s *Store) Summary(key string) string
- func (s *Store) TotalLen(key string) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is safe for concurrent use; operations on different sessions do not block each other.
func (*Store) SetSummary ¶
SetSummary records a summary and logically truncates all but the last keepLast messages (counted at call time).
func (*Store) SetSummaryAt ¶
SetSummaryAt records a summary with an absolute physical skip offset. Because the log is append-only, an offset computed from an earlier snapshot stays valid even if messages were appended meanwhile — this is what compaction must use so a mid-summarize append can never shift the cut past the chosen turn-safe boundary.