session

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatSessionList

func FormatSessionList(sessions []SessionSummary) string

FormatSessionList formats sessions for display

Types

type ConversationEntry added in v0.4.1

type ConversationEntry struct {
	Role      string `json:"role"` // "user", "assistant", "system", "tool"
	Content   string `json:"content,omitempty"`
	ToolName  string `json:"toolName,omitempty"`
	ToolInput string `json:"toolInput,omitempty"`
	Timestamp int64  `json:"ts"`
}

ConversationEntry stores one message in the conversation log

type Session

type Session struct {
	ID        string    `json:"id"`
	Project   string    `json:"project"`
	StartTime time.Time `json:"startTime"`
	Dir       string    `json:"dir"`
	Model     string    `json:"model,omitempty"`
	Title     string    `json:"title,omitempty"` // brief summary
	Turns     int       `json:"turns,omitempty"`
	Cost      float64   `json:"cost,omitempty"`
	// contains filtered or unexported fields
}

Session represents a conversation session

func New

func New(sessDir, cwd string) *Session

New creates a new session

func Resume

func Resume(sessDir, cwd string) *Session

Resume loads the most recent session for the given directory

func (*Session) LoadConversation added in v0.4.1

func (s *Session) LoadConversation() []ConversationEntry

LoadConversation loads the conversation log for this session

func (*Session) Save

func (s *Session) Save() error

Save persists the session to disk

func (*Session) SaveConversation added in v0.4.1

func (s *Session) SaveConversation(entries []ConversationEntry) error

SaveConversation saves the conversation log alongside the session

func (*Session) UpdateMeta

func (s *Session) UpdateMeta(model string, turns int, cost float64, title string)

UpdateMeta updates session metadata

type SessionSummary

type SessionSummary struct {
	ID        string
	Project   string
	StartTime time.Time
	Title     string
	Turns     int
	Dir       string
}

SessionSummary is a lightweight view for listing

func ListRecent

func ListRecent(sessDir string, maxCount int, filterDir string) []SessionSummary

ListRecent lists recent sessions, newest first

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL