Documentation
¶
Overview ¶
Package session provides session management and persistence.
Index ¶
- func DefaultStorageDir() (string, error)
- func GenerateName(ctx context.Context, llm domain.LLM, target string) (string, error)
- type Store
- func (st *Store) Create(workingDir string) (*domain.Session, error)
- func (st *Store) Delete(id string) error
- func (st *Store) FindActiveForDir(dir string) (*domain.SessionMetadata, error)
- func (st *Store) FindBlank(workingDir string) (*domain.SessionMetadata, error)
- func (st *Store) GenerateName(ctx context.Context, llm domain.LLM, target string) (string, error)
- func (st *Store) GetMetadata(id string) (*domain.SessionMetadata, error)
- func (st *Store) GetSession(id string) (*domain.Session, error)
- func (st *Store) List() ([]domain.SessionMetadata, error)
- func (st *Store) LoadChecksums(sessionID string) (map[string]string, error)
- func (st *Store) Rename(id, name string) error
- func (st *Store) SaveChecksums(sessionID string, checksums map[string]string) error
- func (st *Store) SaveMetadata(m *domain.SessionMetadata) error
- func (st *Store) SaveSession(s *domain.Session) error
- func (st *Store) SetActive(id, workingDir string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultStorageDir ¶
DefaultStorageDir returns the default session storage path (~/.config/autocmd/sessions).
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store manages session creation, loading, saving, and listing.
func (*Store) FindActiveForDir ¶
func (st *Store) FindActiveForDir(dir string) (*domain.SessionMetadata, error)
FindActiveForDir returns the active session metadata for the given working directory.
func (*Store) FindBlank ¶
func (st *Store) FindBlank(workingDir string) (*domain.SessionMetadata, error)
FindBlank returns the most recently updated session metadata that has no name and no messages.
func (*Store) GenerateName ¶
GenerateName is a facade for the session.GenerateName function.
func (*Store) GetMetadata ¶
func (st *Store) GetMetadata(id string) (*domain.SessionMetadata, error)
GetMetadata reads only the metadata.json for a session.
func (*Store) GetSession ¶
GetSession loads a full session from disk by ID (metadata, messages, displays).
func (*Store) List ¶
func (st *Store) List() ([]domain.SessionMetadata, error)
List returns metadata for all sessions sorted by update time (newest first).
func (*Store) LoadChecksums ¶
LoadChecksums retrieves the stored checksums for a session.
func (*Store) SaveChecksums ¶
SaveChecksums persists the checksums for a session.
func (*Store) SaveMetadata ¶
func (st *Store) SaveMetadata(m *domain.SessionMetadata) error
SaveMetadata persists only the metadata.json for a session.
func (*Store) SaveSession ¶
SaveSession persists a full session to disk (metadata, messages, displays).