Documentation
¶
Overview ¶
Package session contains structures to track llm calls
Index ¶
- Variables
- func BuildCurrentSessionFilePath(path string) string
- func BuildSessionHistoryPath(path string) string
- func CreateOrCheckSessionDir(path string) (currentSessionExists bool, err error)
- func EndSession(sessionDir string) error
- func SaveCurrentSession(currentSessionDir string, session *Session) error
- func StartSession(startSession *StartSessionRequest) error
- type Command
- type FilesDiff
- type Git
- type GitState
- type Session
- type StartSessionRequest
- type Step
Constants ¶
This section is empty.
Variables ¶
var ( ErrSessionExists = errors.New("session already in progress") ErrNoActiveSession = errors.New("no active session found") ErrSessionWriteFail = errors.New("failed to write session file") ErrSessionReadFail = errors.New("failed to read session file") ErrSessionParseFail = errors.New("failed to parse session file") ErrSessionArchive = errors.New("failed to archive session file") ErrSessionDelete = errors.New("failed to delete session file") ErrSessionMkdir = errors.New("failed to create session history directory") ErrSessionRootCreate = errors.New("failed to create session root directory") ErrSessionHistoryCreate = errors.New("failed to create session history directory") ErrSessionFileExistanceFailed = errors.New("failed to check if current session file exists") ErrSessionDirNotSpecified = errors.New("failed as the session dir was not specified") ErrSessionNameSpecified = errors.New("failed as the session name was not specified") )
Custom session errors.
Functions ¶
func BuildCurrentSessionFilePath ¶
BuildCurrentSessionFilePath is the path to current session file path.
func BuildSessionHistoryPath ¶
BuildSessionHistoryPath is the path to all history sessions.
func CreateOrCheckSessionDir ¶
CreateOrCheckSessionDir initializes the session root directory and history dir for storage if they don't exist, returns whether the current session file exists.
func EndSession ¶
EndSession ends the current session and archives it.
func SaveCurrentSession ¶ added in v1.1.1
SaveCurrentSession will save session data.
func StartSession ¶
func StartSession(startSession *StartSessionRequest) error
StartSession starts a new coding session.
Types ¶
type Command ¶
type Command struct {
Prompt string `json:"prompt"`
Flags map[string]bool `json:"flags"`
AppliedFiles []string `json:"applied_files"`
}
Command represents the command details associated with a step.
type FilesDiff ¶
type FilesDiff struct {
Created []string `json:"created"`
Modified []string `json:"modified"`
Deleted []string `json:"deleted"`
}
FilesDiff represents the differences in files during the step.
type GitState ¶
type GitState struct {
Commit string `json:"commit"`
StateBeforeChange string `json:"state_before_change,omitempty"`
UncommittedFiles []string `json:"uncommitted_files,omitempty"`
}
GitState represents the state of the Git repository at a specific point.
type Session ¶
type Session struct {
ID string `json:"id"`
Name string `json:"name"`
CreatedAt time.Time `json:"created_at"`
CompletedAt time.Time `json:"completed_at"`
Steps []Step `json:"steps"`
}
Session represents a user session with an llm.
func LoadCurrentSession ¶ added in v1.1.1
LoadCurrentSession will load existing session from the current location.