store

package
v1.1.0-solo.4 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: Apache-2.0 Imports: 8 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

View Source
const HistorySchemaVersion = 1

HistorySchemaVersion versions the portable history contract independently of SQLite migrations and transport framing. Additive nullable fields allow old histories to be recovered without discarding fields from newer clients.

Variables

View Source
var HistoryColumns = map[string][]string{
	"sessions":          {"id", "agent", "agent_sid", "worktree", "started_at", "ended_at", "forked_from"},
	"turns":             {"id", "session_id", "seq", "prompt", "reasoning", "tool_calls", "files_read", "started_at", "ended_at", "tokens_in", "tokens_out", "cost_usd"},
	"keyframes":         {"id", "turn_id", "seq", "manifest_hash", "git_head", "tag", "created_at"},
	"ops":               {"id", "turn_id", "session_id", "path", "kind", "start_line", "end_line", "before_hash", "after_hash", "source", "at", "detail", "actor", "parent_op_id"},
	"commits":           {"sha", "keyframe_id", "at"},
	"messages":          {"id", "session_id", "turn_id", "role", "content", "at"},
	"comments":          {"id", "file", "line", "body", "turn_id", "session_id", "at"},
	"trails":            {"id", "title", "kind", "base_step", "head_step", "created_at"},
	"sync_updates":      {"id", "table_name", "row_id", "data"},
	"context_snapshots": {"id", "source_step", "created_at", "payload", "fingerprint"},
}
View Source
var HistoryTables = []string{"sessions", "turns", "keyframes", "ops", "commits", "messages", "comments", "trails", "sync_updates", "context_snapshots"}

Functions

func RecordUpdate

func RecordUpdate(tx *sql.Tx, table, rowID string) error

RecordUpdate stores an immutable snapshot of a row after a local mutation. Sync can then append the correction without changing an earlier upload.

Types

type Commit

type Commit struct {
	SHA, KeyframeID string
	At              int64
}

type DB

type DB struct{ *sql.DB }

func Open

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

type Keyframe

type Keyframe struct {
	ID, TurnID, ManifestHash, GitHead, Tag string
	Seq, CreatedAt                         int64
}

type Op

type Op struct {
	ID, TurnID, SessionID, Path, Kind, Detail, BeforeHash, AfterHash, Source string
	StartLine, EndLine, At                                                   int64
}

type Session

type Session struct {
	ID, Agent, AgentSID, Worktree string
	StartedAt                     int64
}

type Turn

type Turn struct {
	ID, SessionID, Prompt, Reasoning, ToolCalls, FilesRead string
	Seq, StartedAt, EndedAt                                int64
	TokensIn, TokensOut                                    int64
	CostUSD                                                float64
}

Jump to

Keyboard shortcuts

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