Documentation
¶
Index ¶
- func DecodeProjectPath(encoded string) string
- func WithFilter(sessions []common.SessionMetadata, filter SessionFilter) []common.SessionMetadata
- type ProjectStats
- type SessionFilter
- type Store
- func (s *Store) GetProjectSessionsDir(projectPath string) string
- func (s *Store) GetProjectStats(ctx context.Context, projectPath string) (*ProjectStats, error)
- func (s *Store) GetProjectsDir() string
- func (s *Store) GetRecentSessions(ctx context.Context, projectPath string, limit int) ([]common.SessionMetadata, error)
- func (s *Store) GetRecentSessionsFiltered(ctx context.Context, projectPath string, limit int, filter SessionFilter) ([]common.SessionMetadata, error)
- func (s *Store) GetSession(ctx context.Context, sessionID string) (*common.SessionMetadata, error)
- func (s *Store) GetSessionEvents(ctx context.Context, sessionID string, offset, limit int) ([]common.SessionEvent, error)
- func (s *Store) GetSessionSummary(ctx context.Context, sessionID string, firstN, lastM int) (*common.SessionSummary, error)
- func (s *Store) ListProjects(ctx context.Context) ([]string, error)
- func (s *Store) ListSessions(ctx context.Context, projectPath string) ([]common.SessionMetadata, error)
- func (s *Store) ListSessionsFiltered(ctx context.Context, projectPath string, filter SessionFilter) ([]common.SessionMetadata, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeProjectPath ¶
DecodeProjectPath decodes an encoded project path back to the original path -root-tingly-polish -> /root/tingly-polish
func WithFilter ¶
func WithFilter(sessions []common.SessionMetadata, filter SessionFilter) []common.SessionMetadata
WithFilter creates a new slice with only sessions that pass the filter
Types ¶
type ProjectStats ¶
type ProjectStats struct {
TotalSessions int `json:"total_sessions"`
ActiveSessions int `json:"active_sessions"`
CompletedSessions int `json:"completed_sessions"`
ErrorSessions int `json:"error_sessions"`
TotalCostUSD float64 `json:"total_cost_usd"`
TotalTokens int64 `json:"total_tokens"`
OldestSession time.Time `json:"oldest_session"`
NewestSession time.Time `json:"newest_session"`
}
GetProjectStats returns statistics about sessions in a project
type SessionFilter ¶
type SessionFilter func(metadata common.SessionMetadata) bool
SessionFilter defines a function to filter sessions Returns true if the session should be included, false to exclude
func CombineFilters ¶
func CombineFilters(filters ...SessionFilter) SessionFilter
CombineFilters returns a filter that only passes if all filters pass
func DefaultSessionFilter ¶
func DefaultSessionFilter() SessionFilter
DefaultSessionFilter returns the default filter that excludes: - Meta messages (isMeta=true) - Empty or very short content (< 5 chars) - Sessions with no meaningful content
func ExcludePatterns ¶
func ExcludePatterns(patterns []string) SessionFilter
ExcludePatterns returns a filter that excludes sessions containing specific patterns
func ExcludeShortContent ¶
func ExcludeShortContent(minLength int) SessionFilter
ExcludeShortContent returns a filter that excludes sessions with very short content
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements session.Store for Claude Code
func (*Store) GetProjectSessionsDir ¶
GetProjectSessionsDir returns the directory where sessions are stored for a project
func (*Store) GetProjectStats ¶
GetProjectStats returns statistics for a project
func (*Store) GetProjectsDir ¶
GetProjectsDir returns the base projects directory
func (*Store) GetRecentSessions ¶
func (s *Store) GetRecentSessions(ctx context.Context, projectPath string, limit int) ([]common.SessionMetadata, error)
GetRecentSessions returns the N most recent sessions
func (*Store) GetRecentSessionsFiltered ¶
func (s *Store) GetRecentSessionsFiltered(ctx context.Context, projectPath string, limit int, filter SessionFilter) ([]common.SessionMetadata, error)
GetRecentSessionsFiltered returns the N most recent sessions that pass the filter
func (*Store) GetSession ¶
GetSession retrieves a specific session's metadata
func (*Store) GetSessionEvents ¶
func (s *Store) GetSessionEvents(ctx context.Context, sessionID string, offset, limit int) ([]common.SessionEvent, error)
GetSessionEvents retrieves events from a session
func (*Store) GetSessionSummary ¶
func (s *Store) GetSessionSummary(ctx context.Context, sessionID string, firstN, lastM int) (*common.SessionSummary, error)
GetSessionSummary returns a summary (first N and last M events)
func (*Store) ListProjects ¶
ListProjects returns all project directories that have sessions
func (*Store) ListSessions ¶
func (s *Store) ListSessions(ctx context.Context, projectPath string) ([]common.SessionMetadata, error)
ListSessions returns all sessions for a project, ordered by start time (newest first)
func (*Store) ListSessionsFiltered ¶
func (s *Store) ListSessionsFiltered(ctx context.Context, projectPath string, filter SessionFilter) ([]common.SessionMetadata, error)
ListSessionsFiltered returns sessions that pass the filter, ordered by start time (newest first)