Versions in this module Expand all Collapse all v0 v0.2.0 May 15, 2026 Changes in this version + func BuildBM25Score(queryTerms []string, doc string, docLen int, avgDocLen float64, ...) float64 + func Export(s *Session, format string, redact bool) ([]byte, error) + func ExportHTML(session *ExportedSession) string + func ExportJSON(session *ExportedSession) string + func ExportMarkdown(session *ExportedSession) string + func ExportReplay(session *ExportedSession) string + func ExtractDecisions(messages []Message) []string + func ExtractGoal(messages []Message) string + func ExtractPendingTasks(messages []Message) []string + func ExtractUserPrompts(steps []ReplayStep) []string + func FormatDivergences(divs []Divergence) string + func FormatHandover(handover *Handover) string + func FormatResults(results []FTSResult, showContext int) string + func GenerateHandoverPrompt(handover *Handover) string + func GenerateShareLink(session *ExportedSession) string + func RedactSecrets(text string) string + func SaveHandover(handover *Handover, path string) error + type CheckpointManager struct + Checkpoints []*SessionCheckpoint + Dir string + MaxCheckpoints int + func NewCheckpointManager(dir string) *CheckpointManager + func (cm *CheckpointManager) AutoCheckpoint(messages []Message, files []string) (*SessionCheckpoint, error) + func (cm *CheckpointManager) Create(name, description string, messages []Message, files []string) (*SessionCheckpoint, error) + func (cm *CheckpointManager) Delete(id string) error + func (cm *CheckpointManager) DiffFromCheckpoint(checkpointID string, currentFiles []string) []string + func (cm *CheckpointManager) FormatCheckpoints() string + func (cm *CheckpointManager) Get(id string) *SessionCheckpoint + func (cm *CheckpointManager) List() []*SessionCheckpoint + func (cm *CheckpointManager) Load() error + func (cm *CheckpointManager) Prune() + func (cm *CheckpointManager) Restore(checkpointID string) ([]Message, error) + func (cm *CheckpointManager) Save() error + func (cm *CheckpointManager) ShouldAutoCheckpoint(messageCount, toolCalls int) bool + type CoherenceState struct + CurrentAct ConversationalAct + IntentSummary string + LastUpdatedTurn int + Pivots []Pivot + Threads []*SessionThread + type CoherenceTracker struct + func NewCoherenceTracker(updateInterval, maxThreads int) *CoherenceTracker + func (ct *CoherenceTracker) ClassifyAct(message string) ConversationalAct + func (ct *CoherenceTracker) FormatForPrompt() string + func (ct *CoherenceTracker) GetState() CoherenceState + func (ct *CoherenceTracker) RecordPivot(turn int, from, to string) + func (ct *CoherenceTracker) UpdateIntent(message string, turn int) + type ConversationalAct string + const ActConfirm + const ActCorrect + const ActElaborate + const ActExplore + const ActInstruct + const ActPivot + const ActQuestion + const ActUnknown + type Divergence struct + Expected string + Got string + StepIndex int + Type string + func DetectDivergence(expected, actual string) *Divergence + type ExportFormat string + const FormatHTML + const FormatJSON + const FormatMarkdown + const FormatReplay + type ExportedMessage struct + Content string + Role string + Timestamp time.Time + TokenCount int + ToolName string + ToolResult string + type ExportedSession struct + CreatedAt time.Time + ID string + Messages []ExportedMessage + Metadata map[string]string + Model string + Provider string + Stats SessionExportStats + func Import(data string, format ExportFormat) (*ExportedSession, error) + func ImportFromAider(historyData string) (*ExportedSession, error) + func ImportFromClaude(jsonlData string) (*ExportedSession, error) + func RedactSensitive(session *ExportedSession) *ExportedSession + type FTSResult struct + Content string + Highlights []Highlight + MessageIndex int + Preview string + Role string + Score float64 + SessionID string + Timestamp time.Time + type ForkCheckpoint struct + CreatedAt time.Time + Data []byte + Kind string + StepID string + ThreadID string + type ForkOptions struct + FromStepID string + NewThreadName string + SourceThreadID string + type ForkableStore interface + CopyCheckpoints func(from string, to string, upToStep string) error + CreateThread func(name string) (string, error) + GetForkCheckpoints func(threadID string) ([]ForkCheckpoint, error) + type Handover struct + Context HandoverContext + CreatedAt time.Time + FromModel string + SessionID string + Status string + ToModel string + func LoadHandover(path string) (*Handover, error) + type HandoverContext struct + CurrentState string + FilesModified []string + Goal string + KeyDecisions []string + PendingTasks []string + Progress string + TokensBudgetRemaining int + Warnings []string + type HandoverManager struct + Handovers []*Handover + func NewHandoverManager() *HandoverManager + func (m *HandoverManager) AcceptHandover(handover *Handover, toModel string) error + func (m *HandoverManager) PrepareHandover(sessionID, fromModel string, messages []Message, files []string) *Handover + type Highlight struct + End int + Start int + func HighlightMatches(content string, query string) []Highlight + type IndexedMessage struct + Index int + Preview string + Role string + Timestamp time.Time + type InputProvenance string + const ProvenanceCron + const ProvenanceExternalUser + const ProvenanceInterSession + const ProvenanceInternalSystem + const ProvenanceWebhook + type MessageRecord struct + Content string + CreatedAt time.Time + ID int64 + IsError bool + Role string + SessionID string + Tokens int + ToolName string + ToolUseID string + type Pivot struct + From string + To string + Turn int + type ProvenanceTag struct + Channel string + SessionID string + Source InputProvenance + Trusted bool + func NewCronProvenance() ProvenanceTag + func NewInterSessionProvenance(fromSession string) ProvenanceTag + func NewSystemProvenance() ProvenanceTag + func NewUserProvenance() ProvenanceTag + func NewWebhookProvenance(channel string) ProvenanceTag + func (p ProvenanceTag) RequiresSecurityWrap() bool + type Replay struct + Breakpoints []int + CurrentStep int + SessionID string + Speed float64 + Status string + Steps []ReplayStep + func LoadFromExport(data string) (*Replay, error) + func NewReplay(sessionID string) *Replay + func (r *Replay) FormatReplayStatus() string + func (r *Replay) Pause() + func (r *Replay) Play(ctx context.Context, executeFn func(string) (string, error)) (*ReplayResult, error) + func (r *Replay) PlayStep(ctx context.Context, step int, executeFn func(string) (string, error)) (*ReplayStep, error) + func (r *Replay) RemoveBreakpoint(stepIndex int) + func (r *Replay) Resume() + func (r *Replay) SetBreakpoint(stepIndex int) + func (r *Replay) Stop() + type ReplayResult struct + Divergences []Divergence + Duration time.Duration + OriginalSteps int + ReplayedSteps int + type ReplayStep struct + Content string + Index int + OriginalDuration time.Duration + Role string + Timestamp time.Time + ToolArgs string + ToolName string + type SQLiteStore struct + func NewSQLiteStore(dbPath string) (*SQLiteStore, error) + func (s *SQLiteStore) AppendMessage(sessionID string, msg *MessageRecord) error + func (s *SQLiteStore) Close() error + func (s *SQLiteStore) Compact(sessionID string, keepLast int) error + func (s *SQLiteStore) CreateSession(sess *SessionRecord) error + func (s *SQLiteStore) DeleteSession(id string) error + func (s *SQLiteStore) ForkSession(originalID, newID string) error + func (s *SQLiteStore) GetMessages(sessionID string) ([]*MessageRecord, error) + func (s *SQLiteStore) GetSession(id string) (*SessionRecord, error) + func (s *SQLiteStore) GetSessionStats(id string) (*SessionStats, error) + func (s *SQLiteStore) ListSessions(projectDir string, limit int) ([]*SessionRecord, error) + func (s *SQLiteStore) SearchSessions(query string) ([]*SessionRecord, error) + func (s *SQLiteStore) UpdateSession(id string, updates map[string]interface{}) error + type SearchEngine struct + Index map[string]*SessionIndex + SessionDir string + func NewSearchEngine(sessionDir string) *SearchEngine + func (se *SearchEngine) IndexSession(sessionID string, messages []Message) error + func (se *SearchEngine) RebuildIndex() error + func (se *SearchEngine) Search(query string, opts SearchOptions) []FTSResult + func (se *SearchEngine) SearchRegex(pattern string, opts SearchOptions) []FTSResult + type SearchOptions struct + DateAfter time.Time + DateBefore time.Time + MaxResults int + RoleFilter string + SessionFilter string + type SessionCheckpoint struct + Auto bool + Description string + FilesState map[string]string + ID string + MessageCount int + Name string + Timestamp time.Time + TokenCount int + type SessionExportStats struct + AssistantMessages int + Duration time.Duration + ToolCalls int + TotalMessages int + TotalTokens int + UserMessages int + func CalculateStats(messages []ExportedMessage) SessionExportStats + type SessionExporter struct + IncludeSystemPrompt bool + IncludeToolResults bool + MaxMessages int + RedactSecrets bool + func NewSessionExporter() *SessionExporter + func (e *SessionExporter) Export(session *ExportedSession, format ExportFormat) (string, error) + type SessionIndex struct + CreatedAt time.Time + ID string + Messages []IndexedMessage + Model string + Provider string + Terms map[string][]int + type SessionRecord struct + CreatedAt time.Time + ID string + Model string + ParentID string + ProjectDir string + Provider string + Status string + Title string + TotalCostUSD float64 + TotalTokens int + UpdatedAt time.Time + type SessionStats struct + Duration time.Duration + MessageCount int + ToolCalls int + TotalCostUSD float64 + TotalTokens int + type SessionThread struct + Decisions []string + ID string + LastMentionedTurn int + OpenQuestions []string + StartedAtTurn int + Status string + Topic string + type ThreadFork struct + CreatedAt time.Time + ForkPointStepID string + NewThreadID string + OriginalThreadID string + func ForkThread(store ForkableStore, opts ForkOptions) (*ThreadFork, error) v0.1.0 May 12, 2026 Changes in this version + func AddTag(sess *Session, tag string) + func CheckForRecovery() []string + func CleanOldSessions(maxAge time.Duration) (int, error) + func CompressOldSessions(maxAge time.Duration) (int, error) + func ComputeChecksum(sess *Session) string + func Diff(a, b *Session) string + func ExportToMarkdown(sess *Session) string + func FormatCheckpointList(checkpoints []Checkpoint) string + func MigrateToJSONL(id string) error + func RemoveTag(sess *Session, tag string) + func RewindLastExchange(sess *Session) error + func RewindTo(sess *Session, checkpointIndex int) error + func Save(s *Session) error + func SaveMessages(path string, messages []Message) error + func SessionPath(projectDir, sessionID string) string + func Stats(sess *Session) map[string]interface + type AutoSaver struct + func NewAutoSaver(interval time.Duration, saveFn func()) *AutoSaver + func (as *AutoSaver) Reset() + func (as *AutoSaver) Stop() + func (as *AutoSaver) Touch() + type BatchedWAL struct + func NewBatchedWAL(wal *WAL) *BatchedWAL + func (b *BatchedWAL) Append(msg Message) error + func (b *BatchedWAL) Close() error + func (b *BatchedWAL) Flush() error + type Checkpoint struct + Index int + MessageID string + Preview string + Role string + Timestamp time.Time + TokenCount int + ToolName string + func ListCheckpoints(sess *Session) []Checkpoint + type CheckpointTrigger int + const TriggerContextShift + const TriggerFileWrite + const TriggerPlanChange + const TriggerToolError + const TriggerUserFeedback + func (ct CheckpointTrigger) String() string + type Entry struct + CWD string + ID string + Preview string + UpdatedAt time.Time + func List() ([]Entry, error) + type IntegrityCheck struct + Errors []string + Stats IntegrityStats + Valid bool + Warnings []string + func ValidateIntegrity(sess *Session) *IntegrityCheck + type IntegrityStats struct + AssistantMessages int + EmptyMessages int + MessageCount int + OrphanedResults int + ToolResults int + ToolUses int + UserMessages int + type LockFile struct + func AcquireLock(sessionID string) (*LockFile, error) + func (l *LockFile) Refresh() + func (l *LockFile) Release() + type Message struct + Content string + Role string + ToolResult *ToolResult + ToolUse []ToolCall + func LoadMessages(path string) ([]Message, error) + type SearchResult struct + MsgIndex int + Preview string + Role string + SessionID string + func SearchSessions(query string, maxResults int) ([]SearchResult, error) + type Session struct + CWD string + CreatedAt time.Time + ID string + Messages []Message + Model string + Name string + Provider string + UpdatedAt time.Time + func DecompressSession(id string) (*Session, error) + func Fork(sessionID string, atIndex int) (*Session, error) + func Load(id string) (*Session, error) + func LoadLatest() (*Session, error) + func LoadLatestForCWD(cwd string) (*Session, error) + func RecoverFromWAL(sessionID string) (*Session, error) + type SessionLockedError struct + ID string + func (e *SessionLockedError) Error() string + type SessionMeta struct + CWD string + CreatedAt time.Time + GitBranch string + ID string + Model string + MsgCount int + Name string + Provider string + Tags []string + TokenCount int + UpdatedAt time.Time + type SmartCheckpointer struct + func NewSmartCheckpointer(store *SnapshotStore) *SmartCheckpointer + func (sc *SmartCheckpointer) CheckpointsTaken() int + func (sc *SmartCheckpointer) EventsSeen() int + func (sc *SmartCheckpointer) FormatTriggers() string + func (sc *SmartCheckpointer) OnEvent(event CheckpointTrigger, session *Session, action string) + func (sc *SmartCheckpointer) SetTrigger(trigger CheckpointTrigger, enabled bool) + func (sc *SmartCheckpointer) ShouldCheckpoint(event CheckpointTrigger, session *Session) bool + func (sc *SmartCheckpointer) Stats() string + type Snapshot struct + Action string + ID int + Label string + MsgIndex int + Timestamp time.Time + type SnapshotStore struct + func NewSnapshotStore(sessionID string) *SnapshotStore + func (ss *SnapshotStore) Cleanup() + func (ss *SnapshotStore) Format() string + func (ss *SnapshotStore) List() []Snapshot + func (ss *SnapshotStore) Load() error + func (ss *SnapshotStore) Rewind(id int) (*Session, error) + func (ss *SnapshotStore) Take(action string, sess *Session) error + type ToolCall struct + Arguments map[string]interface{} + ID string + Name string + type ToolResult struct + Content string + IsError bool + ToolUseID string + type WAL struct + func NewWAL(sessionID string) (*WAL, error) + func (w *WAL) Append(msg Message) error + func (w *WAL) AppendMeta(model, provider, cwd string) error + func (w *WAL) Close() error + func (w *WAL) Remove() error