session

package
v0.101.0 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compaction

type Compaction struct {
	Seq     int
	Cutoff  int
	Summary string
	Model   string
	Usage   ai.Usage
}

type Meta

type Meta struct {
	ID          string
	Title       string
	Model       string
	Provider    string
	CWD         string
	Goal        string
	ForkedFrom  string
	ForkSeq     int
	Tags        []string
	Pinned      bool
	Effort      string
	UsageIn     int
	UsageCached int
	UsageOut    int

	SubUsage  map[string]ai.Usage
	UpdatedAt time.Time

	TaskID string
}

type Schedule

type Schedule struct {
	ID       int
	Schedule string
	Prompt   string
	Anchor   time.Time
	LastFire time.Time
}

type Store

type Store struct {
	// contains filtered or unexported fields
}

func Open

func Open(path string) (*Store, error)

func (*Store) AddSchedule

func (s *Store) AddSchedule(sessionID, schedule, prompt string, anchor time.Time) (int, error)

func (*Store) ClearMessages

func (s *Store) ClearMessages(id string) error

func (*Store) ClearSnapshots

func (s *Store) ClearSnapshots(id string) error

func (*Store) Close

func (s *Store) Close() error

func (*Store) Compactions

func (s *Store) Compactions(id string) []Compaction

func (*Store) Create

func (s *Store) Create(cwd, model, provider string) (string, error)

func (*Store) DeleteCompaction

func (s *Store) DeleteCompaction(id string, seq int) error

func (*Store) DeleteFrom

func (s *Store) DeleteFrom(id string, from int) error

func (*Store) DeleteSchedule

func (s *Store) DeleteSchedule(sessionID string, id int) error

func (*Store) Fork

func (s *Store) Fork(srcID string, uptoSeq int, title string) (string, error)

func (*Store) ForkTitle

func (s *Store) ForkTitle(base string) (string, error)

func (*Store) ForksOf

func (s *Store) ForksOf(id string) ([]Meta, error)

func (*Store) LastExchange

func (s *Store) LastExchange(id string) (user, assistant string)

func (*Store) LatestInDir

func (s *Store) LatestInDir(dir string) (Meta, error)

func (*Store) Load

func (s *Store) Load(idOrPrefix string) (Meta, []ai.Message, error)

func (*Store) LoadTasks

func (s *Store) LoadTasks(sessionID string) ([]Task, error)

func (*Store) MarkFired

func (s *Store) MarkFired(sessionID string, id int, at time.Time) error

func (*Store) RawMessages

func (s *Store) RawMessages(id string) []ai.Message

func (*Store) Recent

func (s *Store) Recent(n int) ([]Meta, error)

func (*Store) RecordCompaction

func (s *Store) RecordCompaction(id string, cutoff int, summary, model string, usage ai.Usage) error

func (*Store) Save

func (s *Store) Save(id string, from int, msgs []ai.Message, model, provider string) error

func (*Store) SaveSubagentTranscript

func (s *Store) SaveSubagentTranscript(parentID, taskID string, msgs []ai.Message, model, provider string) (string, error)

func (*Store) SaveTask

func (s *Store) SaveTask(sessionID string, t Task) error

func (*Store) Schedules

func (s *Store) Schedules(sessionID string) []Schedule

func (*Store) SetEffort

func (s *Store) SetEffort(id, effort string) error

func (*Store) SetGoal

func (s *Store) SetGoal(id, goal string) error

func (*Store) SetPinned

func (s *Store) SetPinned(id string, pinned bool) error

func (*Store) SetSnapshot

func (s *Store) SetSnapshot(id string, seq int, ref string) error

func (*Store) SetTags

func (s *Store) SetTags(id string, tags []string) error

func (*Store) SetTitle

func (s *Store) SetTitle(id, title string) error

func (*Store) SetTodos

func (s *Store) SetTodos(id, todosJSON string) error

func (*Store) SetUsage

func (s *Store) SetUsage(id string, in, cached, out int, sub map[string]ai.Usage) error

func (*Store) Snapshots

func (s *Store) Snapshots(id string) map[int]string

func (*Store) SubagentTranscript

func (s *Store) SubagentTranscript(parentID, taskID string) ([]ai.Message, error)

func (*Store) Todos

func (s *Store) Todos(id string) string

func (*Store) UserHistory

func (s *Store) UserHistory(limit int) ([]string, error)

type Task

type Task struct {
	ID          string
	Description string
	Prompt      string
	Status      string
	Report      string
	StartedAt   time.Time
	EndedAt     time.Time
}

Jump to

Keyboard shortcuts

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