Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatSessionID ¶
FormatSessionID formats a session ID with optional name lookup. Use this when you only have a session ID string and need to display it. If the session has a name, returns "ses_xxx (name)", otherwise just "ses_xxx".
func ParseDuration ¶
ParseDuration parses human-readable duration strings
Types ¶
type Session ¶
type Session struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
ContextID string `json:"context_id"`
PreviousSessionID string `json:"previous_session_id,omitempty"`
StartedAt time.Time `json:"started_at"`
IsNew bool `json:"-"` // True if session was just created (not persisted)
}
Session represents the current terminal session
func ForceNewSession ¶
ForceNewSession creates a new session regardless of context
func GetOrCreate ¶
GetOrCreate returns the current session, creating a new one if: 1. No session file exists 2. The context has changed (new terminal/AI session)
func GetWithContextCheck ¶
GetWithContextCheck returns the current session and checks if context changed. If context changed, creates a new session automatically.