Documentation
¶
Overview ¶
Package store persists per-conversation state as a JSON file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Checkpoint ¶
type Checkpoint struct {
Cwd string `json:"cwd"`
Commit string `json:"commit"`
Prompt string `json:"prompt"`
At time.Time `json:"at"`
}
Checkpoint is a git snapshot taken before a turn.
type Conversation ¶
type Conversation struct {
Agent string `json:"agent,omitempty"`
Model string `json:"model,omitempty"`
Mode string `json:"mode,omitempty"`
Project string `json:"project,omitempty"`
Cwd string `json:"cwd,omitempty"`
SessionID string `json:"session_id,omitempty"`
AlwaysAllow []string `json:"always_allow,omitempty"`
Voice bool `json:"voice,omitempty"`
TotalCost float64 `json:"total_cost_usd,omitempty"`
Sessions []SessionRecord `json:"sessions,omitempty"`
Checkpoints []Checkpoint `json:"checkpoints,omitempty"`
}
Conversation is one chat, or one forum topic in a chat.
func (*Conversation) PushCheckpoint ¶
func (c *Conversation) PushCheckpoint(cp Checkpoint)
func (*Conversation) RecordSession ¶
func (c *Conversation) RecordSession(r SessionRecord)
RecordSession moves id to the front of the recent sessions list.
type SessionRecord ¶
type SessionRecord struct {
ID string `json:"id"`
Agent string `json:"agent"`
Cwd string `json:"cwd"`
Title string `json:"title"`
Updated time.Time `json:"updated"`
}
SessionRecord remembers a past session so /sessions can resume it.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) Get ¶
func (st *Store) Get(key string) Conversation
Get returns a deep copy of the conversation.
Click to show internal directories.
Click to hide internal directories.