Documentation
¶
Index ¶
- type Manager
- func (m *Manager) Cleanup(maxAge int64) error
- func (m *Manager) Delete(sessionID string) error
- func (m *Manager) IsDuplicateMessage(sessionID string, message string, windowSeconds int) (bool, error)
- func (m *Manager) Load(sessionID string) (*SessionState, error)
- func (m *Manager) Save(state *SessionState) error
- func (m *Manager) ShouldSuppressQuestion(sessionID string, cooldownSeconds int) (bool, error)
- func (m *Manager) ShouldSuppressQuestionAfterAnyNotification(sessionID string, cooldownSeconds int) (bool, error)
- func (m *Manager) UpdateGhosttyTerminalID(sessionID, terminalID string) error
- func (m *Manager) UpdateInteractiveTool(sessionID, toolName, cwd string) error
- func (m *Manager) UpdateLastNotification(sessionID string, status analyzer.Status, message string) error
- func (m *Manager) UpdateState(sessionID string, status analyzer.Status, toolName, cwd string) error
- func (m *Manager) UpdateTaskComplete(sessionID string) error
- type SessionState
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
}
Manager manages session state
func (*Manager) IsDuplicateMessage ¶
func (m *Manager) IsDuplicateMessage(sessionID string, message string, windowSeconds int) (bool, error)
IsDuplicateMessage checks if the given message is a duplicate of a recent notification within the specified time window (in seconds)
func (*Manager) Load ¶
func (m *Manager) Load(sessionID string) (*SessionState, error)
Load loads session state from disk Returns nil if state file doesn't exist
func (*Manager) Save ¶
func (m *Manager) Save(state *SessionState) error
Save saves session state to disk
func (*Manager) ShouldSuppressQuestion ¶
ShouldSuppressQuestion checks if a question notification should be suppressed due to being within the cooldown window after a task completion
func (*Manager) ShouldSuppressQuestionAfterAnyNotification ¶
func (m *Manager) ShouldSuppressQuestionAfterAnyNotification(sessionID string, cooldownSeconds int) (bool, error)
ShouldSuppressQuestionAfterAnyNotification checks if a question notification should be suppressed due to being within the cooldown window after ANY notification
func (*Manager) UpdateGhosttyTerminalID ¶
UpdateGhosttyTerminalID stores the exact Ghostty terminal ID associated with a Claude session so future notification clicks can target the correct tab.
func (*Manager) UpdateInteractiveTool ¶
UpdateInteractiveTool updates the last interactive tool and timestamp
func (*Manager) UpdateLastNotification ¶
func (m *Manager) UpdateLastNotification(sessionID string, status analyzer.Status, message string) error
UpdateLastNotification updates the last notification timestamp, status, and message
func (*Manager) UpdateState ¶
UpdateState updates state based on the detected status
func (*Manager) UpdateTaskComplete ¶
UpdateTaskComplete updates the last task complete timestamp
type SessionState ¶
type SessionState struct {
SessionID string `json:"session_id"`
LastInteractiveTool string `json:"last_interactive_tool"`
LastTimestamp int64 `json:"last_ts"`
LastTaskCompleteTime int64 `json:"last_task_complete_ts,omitempty"`
LastNotificationTime int64 `json:"last_notification_ts,omitempty"`
LastNotificationStatus string `json:"last_notification_status,omitempty"`
LastNotificationMessage string `json:"last_notification_message,omitempty"`
GhosttyTerminalID string `json:"ghostty_terminal_id,omitempty"`
CWD string `json:"cwd"`
}
SessionState represents per-session state