Versions in this module Expand all Collapse all v0 v0.1.0 Jul 14, 2026 Changes in this version + const DefaultCleanupPeriodDays + const ExportHTML + const ExportJSON + const ExportJSONL + const ExportMarkdown + const MaxRotatedSessionLogs + const MaxSessionJSONLBytes + var ErrAllSessionsEmpty = errors.New("all saved sessions are empty") + var ErrNoSessions = errors.New("no saved sessions") + var ErrSessionNotFound = errors.New("session not found") + func DefaultExportFilename(sess *Session) string + func DefaultExportFilenameForFormat(sess *Session, format string) string + func IsSessionReferenceAlias(reference string) bool + func NormalizeExportFormat(format string) (string, error) + func NormalizeSessionTag(tag string) string + func RenderHTML(sess *Session) string + func RenderMarkdown(sess *Session) string + func ValidateExportOutputPath(path string) error + func WorkspaceFingerprint(workspace string) string + type BackfillReport struct + Action string + BackfilledSessions []BackfilledSession + IdentityUpdates int + InputsAdded int + Kind string + SessionsScanned int + SessionsUpdated int + SkippedDisabled int + SkippedSessionDetails []BackfillSkippedSession + SkippedWithInputs int + Status string + type BackfillSkippedSession struct + ID string + Reason string + type BackfilledSession struct + ID string + IdentityUpdated bool + Inputs int + Path string + type ExportedSession struct + ID string + Identity SessionIdentity + Messages []anthropic.Message + type IdentityPlaceholder struct + Field string + Reason string + type ImportOptions struct + ID string + Overwrite bool + type ImportResult struct + Identity SessionIdentity + MessageCount int + OriginalSessionID string + Overwritten bool + Path string + SessionID string + Source string + type LookupError struct + Err error + LegacyDir string + OtherWorkspacePartitions int + OtherWorkspaceSessions int + Reference string + SearchDir string + Workspace string + WorkspaceFingerprint string + func (e LookupError) Error() string + func (e LookupError) Unwrap() error + type PathIsDirectoryError struct + Path string + func (e PathIsDirectoryError) Error() string + type PinResult struct + Action string + MessageCount int + MessageIndex int + Path string + PinnedMessages []int + SessionID string + type PromptEntry struct + Index int + Role string + SessionID string + Text string + Time time.Time + type PruneOptions struct + Confirm bool + EmptyOnly bool + ExcludeID string + Keep int + type PruneReport struct + Action string + CandidateCount int + Candidates []PrunedSession + Deleted []PrunedSession + DeletedCount int + DryRun bool + EmptyOnly bool + Keep int + Kind string + Scanned int + Status string + type PrunedSession struct + ID string + MessageCount int + ModifiedAt time.Time + Path string + Reason string + UpdatedAt time.Time + type Record struct + Action string + BranchName string + Identity *SessionIdentity + Input string + Message *anthropic.Message + MessageIndex int + ParentSessionID string + SessionID string + Time time.Time + Type string + Usage *anthropic.Usage + type RenameResult struct + MessageCount int + NewID string + NewPath string + OldID string + OldPath string + type ReplaceResult struct + OriginalMessages int + Path string + RemainingMessages int + RemovedMessages int + SessionID string + type RewindResult struct + OriginalMessages int + Path string + RemainingMessages int + RemovedMessages int + SessionID string + type Session struct + ID string + Identity SessionIdentity + Messages []anthropic.Message + Metadata SessionMetadata + Path string + type SessionIdentity struct + Placeholders []IdentityPlaceholder + Purpose string + Tag string + Title string + Workspace string + Worktree string + type SessionMetadata struct + BranchName string + CreatedAt time.Time + ModifiedAt time.Time + ParentSessionID string + PinnedMessages []int + UpdatedAt time.Time + type Store struct + Dir string + LegacyDir string + PersistenceDisabled bool + Workspace string + func NewStore(configHome string) *Store + func NewWorkspaceStore(configHome string, workspace string) *Store + func NewWorkspaceStoreWithCleanup(configHome string, workspace string, cleanupPeriodDays int) (*Store, error) + func (s *Store) Append(id string, msg anthropic.Message) error + func (s *Store) AppendInput(id string, input string) error + func (s *Store) AppendPromptHistoryDisabled(id string) error + func (s *Store) AppendWithUsage(id string, msg anthropic.Message, usage *anthropic.Usage) error + func (s *Store) ApplyCleanupPeriodDays(days int) error + func (s *Store) BackfillPromptHistory() (BackfillReport, error) + func (s *Store) Create(id string) (*Session, error) + func (s *Store) CreateWithIdentity(id string, identity SessionIdentity) (*Session, error) + func (s *Store) Delete(id string) error + func (s *Store) Exists(id string) (bool, error) + func (s *Store) Export(id string, format string) ([]byte, *Session, error) + func (s *Store) Fork(id string, branchName string) (*Session, error) + func (s *Store) Identity(id string) (SessionIdentity, error) + func (s *Store) Import(path string, opts ImportOptions) (ImportResult, error) + func (s *Store) LatestAnyID() (string, error) + func (s *Store) LatestID() (string, error) + func (s *Store) LatestIDExcluding(excludeID string) (string, error) + func (s *Store) LatestSessionExcluding(excludeID string) (*Session, error) + func (s *Store) List() ([]Session, error) + func (s *Store) Open(id string) (*Session, error) + func (s *Store) OpenExisting(id string) (*Session, error) + func (s *Store) PinMessage(id string, index int) (PinResult, error) + func (s *Store) PromptHistory(id string) ([]PromptEntry, error) + func (s *Store) Prune(opts PruneOptions) (PruneReport, error) + func (s *Store) RemoveAll() error + func (s *Store) RemoveOlderThan(cutoff time.Time) error + func (s *Store) Rename(oldID string, newID string) (RenameResult, error) + func (s *Store) RepairSessionIdentities() (BackfillReport, error) + func (s *Store) ReplaceMessages(sess *Session, messages []anthropic.Message) (ReplaceResult, error) + func (s *Store) Rewind(id string, removeMessages int) (RewindResult, error) + func (s *Store) SetTag(id string, tag string) (SessionIdentity, error) + func (s *Store) UnpinMessage(id string, index int) (PinResult, error) + func (s *Store) UpdateIdentity(id string, update SessionIdentity) (SessionIdentity, error) + func (s *Store) Usage(id string) ([]UsageEntry, error) + type UsageEntry struct + MessageIndex int + SessionID string + Time time.Time + Usage anthropic.Usage + type WorkspaceMismatchError struct + Actual string + Expected string + Path string + func (e WorkspaceMismatchError) Error() string