Documentation
¶
Index ¶
- Constants
- func GenerateTitle(messages []StoredMessage) string
- type Session
- type SessionMetadata
- type Store
- func (s *Store) Cleanup() error
- func (s *Store) Delete(id string) error
- func (s *Store) GetLatest() (*Session, error)
- func (s *Store) GetLatestByCwd(cwd string) (*Session, error)
- func (s *Store) List() ([]*SessionMetadata, error)
- func (s *Store) Load(id string) (*Session, error)
- func (s *Store) Save(session *Session) error
- type StoredMessage
Constants ¶
View Source
const (
// MaxTitleLength is the maximum length for a session title
MaxTitleLength = 60
)
View Source
const (
// SessionRetentionDays is how long sessions are kept before cleanup
SessionRetentionDays = 30
)
Variables ¶
This section is empty.
Functions ¶
func GenerateTitle ¶
func GenerateTitle(messages []StoredMessage) string
GenerateTitle generates a title from the first user message
Types ¶
type Session ¶
type Session struct {
Metadata SessionMetadata `json:"metadata"`
Messages []StoredMessage `json:"messages"`
}
Session represents a complete session with metadata and messages
type SessionMetadata ¶
type SessionMetadata struct {
ID string `json:"id"`
Title string `json:"title"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
Provider string `json:"provider"`
Model string `json:"model"`
Cwd string `json:"cwd"`
MessageCount int `json:"messageCount"`
}
SessionMetadata contains metadata about a session
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store manages session file storage
func (*Store) GetLatestByCwd ¶ added in v1.4.0
GetLatestByCwd returns the most recently updated session for the given working directory
func (*Store) List ¶
func (s *Store) List() ([]*SessionMetadata, error)
List returns all sessions sorted by update time (newest first)
type StoredMessage ¶
type StoredMessage struct {
Role string `json:"role"`
Content string `json:"content,omitempty"`
ToolCalls []provider.ToolCall `json:"toolCalls,omitempty"`
ToolResult *provider.ToolResult `json:"toolResult,omitempty"`
ToolName string `json:"toolName,omitempty"`
IsSummary bool `json:"isSummary,omitempty"`
}
StoredMessage represents a message stored in a session
Click to show internal directories.
Click to hide internal directories.