Documentation
¶
Index ¶
- type Manager
- func (m *Manager) EndSession(ctx context.Context, sessionID string) error
- func (m *Manager) EndStaleSessions(ctx context.Context, maxAge time.Duration) (int, error)
- func (m *Manager) GetActiveSession(ctx context.Context, sourceSessionID string) (*Session, error)
- func (m *Manager) RecordActivity(ctx context.Context, sessionID string) error
- func (m *Manager) SessionStats(ctx context.Context) (total int, active int, err error)
- func (m *Manager) StartSession(ctx context.Context, sourceTool, sourceSessionID, projectID, directory string) (string, error)
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func (*Manager) EndSession ¶
EndSession sets ended_at on the session.
func (*Manager) EndStaleSessions ¶
EndStaleSessions ends sessions with no activity for longer than maxAge. Returns the count of sessions closed.
func (*Manager) GetActiveSession ¶
GetActiveSession returns the active (not ended) session for sourceSessionID, or nil.
func (*Manager) RecordActivity ¶
RecordActivity bumps last_activity_at and increments message_count.
func (*Manager) SessionStats ¶
SessionStats returns total and active session counts.
type Session ¶
type Session struct {
ID string `json:"id"`
ProjectID *string `json:"project_id,omitempty"`
Source string `json:"source"`
SourceSessionID string `json:"source_session_id,omitempty"`
Title string `json:"title,omitempty"`
Directory string `json:"directory,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
LastActivityAt *time.Time `json:"last_activity_at,omitempty"`
EndedAt *time.Time `json:"ended_at,omitempty"`
MessageCount int `json:"message_count"`
SourceTool string `json:"source_tool,omitempty"`
Metadata any `json:"metadata,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.