store

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: MIT Imports: 26 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

This section is empty.

Types

type Diagnostics

type Diagnostics struct {
	Path        string
	Exists      bool
	SchemaReady bool
}

func CheckSQLite

func CheckSQLite(path string) (Diagnostics, error)

type SQLiteStore

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

func NewSQLite

func NewSQLite(path string) (*SQLiteStore, error)

func (*SQLiteStore) AcceptMessage

func (s *SQLiteStore) AcceptMessage(ctx context.Context, message transcript.Message, run core.Run, deliveries ...core.ClientDelivery) error

func (*SQLiteStore) AppendMessage added in v0.2.0

func (s *SQLiteStore) AppendMessage(ctx context.Context, message transcript.Message) (int64, error)

AppendMessage stores a message, indexes it for search and returns its seq.

func (*SQLiteStore) ClearTaskWorktree added in v0.2.1

func (s *SQLiteStore) ClearTaskWorktree(ctx context.Context, taskID string, at time.Time) error

ClearTaskWorktree records that a worktree subagent's worktree is gone.

func (*SQLiteStore) Close

func (s *SQLiteStore) Close() error

func (*SQLiteStore) CreateApproval

func (s *SQLiteStore) CreateApproval(ctx context.Context, approval core.Approval) error

func (*SQLiteStore) CreateClientDelivery

func (s *SQLiteStore) CreateClientDelivery(ctx context.Context, delivery core.ClientDelivery) error

func (*SQLiteStore) CreateFileCheckpoint added in v0.2.1

func (s *SQLiteStore) CreateFileCheckpoint(ctx context.Context, checkpoint core.FileCheckpoint) error

func (*SQLiteStore) CreateMemory added in v0.1.12

func (s *SQLiteStore) CreateMemory(ctx context.Context, entry memory.Entry) error

func (*SQLiteStore) CreatePermissionRule added in v0.2.0

func (s *SQLiteStore) CreatePermissionRule(ctx context.Context, rule permission.Rule) error

CreatePermissionRule stores a rule; a global rule belongs to no session.

func (*SQLiteStore) CreateSession

func (s *SQLiteStore) CreateSession(ctx context.Context, session core.Session) error

func (*SQLiteStore) CreateSessionInput added in v0.1.13

func (s *SQLiteStore) CreateSessionInput(ctx context.Context, input core.SessionInput) error

func (*SQLiteStore) CreateTask added in v0.2.0

func (s *SQLiteStore) CreateTask(ctx context.Context, task core.Task) error

func (*SQLiteStore) DB added in v0.2.1

func (s *SQLiteStore) DB() *sql.DB

DB is the store's one connection, shared by the packages whose tables are in the schema (skills, automation).

func (*SQLiteStore) DecideApproval added in v0.2.0

func (s *SQLiteStore) DecideApproval(ctx context.Context, approval core.Approval) error

DecideApproval records the decision on a pending approval; it fails with core.ErrNotFound when no pending approval has that id.

func (*SQLiteStore) DeleteExternalAgentSession added in v0.1.4

func (s *SQLiteStore) DeleteExternalAgentSession(ctx context.Context, sessionID string) error

func (*SQLiteStore) DeleteMemory added in v0.1.12

func (s *SQLiteStore) DeleteMemory(ctx context.Context, id string) error

func (*SQLiteStore) DeletePermissionRule added in v0.2.0

func (s *SQLiteStore) DeletePermissionRule(ctx context.Context, ruleID string) error

DeletePermissionRule removes a rule; ErrNotFound when no rule has the ID.

func (*SQLiteStore) DeleteRunCheckpoint added in v0.2.0

func (s *SQLiteStore) DeleteRunCheckpoint(ctx context.Context, runID string) error

func (*SQLiteStore) DeleteRunWakeup added in v0.2.0

func (s *SQLiteStore) DeleteRunWakeup(ctx context.Context, runID string) error

func (*SQLiteStore) DeleteSession

func (s *SQLiteStore) DeleteSession(ctx context.Context, sessionID string) error

func (*SQLiteStore) DeleteSessionGoal added in v0.2.1

func (s *SQLiteStore) DeleteSessionGoal(ctx context.Context, sessionID string) error

DeleteSessionGoal removes the session's goal; none is not an error.

func (*SQLiteStore) FileCheckpointTrees added in v0.2.1

func (s *SQLiteStore) FileCheckpointTrees(ctx context.Context, workingDir string) ([]string, error)

func (*SQLiteStore) FinishClientDelivery added in v0.2.1

func (s *SQLiteStore) FinishClientDelivery(ctx context.Context, id string, status core.ClientDeliveryStatus, errText string, at time.Time) error

func (*SQLiteStore) FinishTask added in v0.2.0

func (s *SQLiteStore) FinishTask(ctx context.Context, taskID string, end core.TaskEnd) (bool, error)

FinishTask ends a task that has not ended and reports whether it did; a task ended Delivered is no event for its session.

func (*SQLiteStore) GetActiveRunBySession added in v0.1.13

func (s *SQLiteStore) GetActiveRunBySession(ctx context.Context, sessionID string) (core.Run, error)

func (*SQLiteStore) GetApproval

func (s *SQLiteStore) GetApproval(ctx context.Context, approvalID string) (core.Approval, error)

func (*SQLiteStore) GetBinding

func (s *SQLiteStore) GetBinding(ctx context.Context, client string, externalKey string) (core.ClientBinding, error)

func (*SQLiteStore) GetExternalAgentSession added in v0.1.4

func (s *SQLiteStore) GetExternalAgentSession(ctx context.Context, sessionID string) (externalagents.SessionAttachment, error)

func (*SQLiteStore) GetFileCheckpoint added in v0.2.1

func (s *SQLiteStore) GetFileCheckpoint(ctx context.Context, id string) (core.FileCheckpoint, error)

func (*SQLiteStore) GetLatestRunBySession added in v0.2.0

func (s *SQLiteStore) GetLatestRunBySession(ctx context.Context, sessionID string) (core.Run, error)

GetLatestRunBySession returns the session's newest run, ordered by its user message.

func (*SQLiteStore) GetMemory added in v0.1.12

func (s *SQLiteStore) GetMemory(ctx context.Context, id string) (memory.Entry, error)

func (*SQLiteStore) GetMessage added in v0.2.0

func (s *SQLiteStore) GetMessage(ctx context.Context, messageID string) (transcript.Message, error)

func (*SQLiteStore) GetPermissionRule added in v0.2.1

func (s *SQLiteStore) GetPermissionRule(ctx context.Context, ruleID string) (permission.Rule, error)

GetPermissionRule returns a rule; ErrNotFound when no rule has the ID.

func (*SQLiteStore) GetRun

func (s *SQLiteStore) GetRun(ctx context.Context, runID string) (core.Run, error)

func (*SQLiteStore) GetRunCheckpoint added in v0.2.0

func (s *SQLiteStore) GetRunCheckpoint(ctx context.Context, runID string) (core.RunCheckpoint, error)

func (*SQLiteStore) GetRunWakeup added in v0.2.0

func (s *SQLiteStore) GetRunWakeup(ctx context.Context, runID string) (core.RunWakeup, error)

func (*SQLiteStore) GetSession

func (s *SQLiteStore) GetSession(ctx context.Context, sessionID string) (core.Session, error)

func (*SQLiteStore) GetSessionBudget added in v0.2.0

func (s *SQLiteStore) GetSessionBudget(ctx context.Context, sessionID string) (core.SessionBudget, error)

GetSessionBudget returns the session's budget overrides; none stored is the zero value.

func (*SQLiteStore) GetSessionEngineState added in v0.2.0

func (s *SQLiteStore) GetSessionEngineState(ctx context.Context, sessionID string) (json.RawMessage, error)

GetSessionEngineState returns the engine counters the session's next run starts from; nil when none were stored.

func (*SQLiteStore) GetSessionGoal added in v0.2.1

func (s *SQLiteStore) GetSessionGoal(ctx context.Context, sessionID string) (core.SessionGoal, error)

GetSessionGoal returns the session's goal, core.ErrNotFound when it has none.

func (*SQLiteStore) GetSessionTodo added in v0.2.0

func (s *SQLiteStore) GetSessionTodo(ctx context.Context, sessionID string) (todo.List, error)

GetSessionTodo returns the session's todo list; an empty one when none was written.

func (*SQLiteStore) GetTask added in v0.2.0

func (s *SQLiteStore) GetTask(ctx context.Context, taskID string) (core.Task, error)

func (*SQLiteStore) HasConsumedSessionInput added in v0.2.0

func (s *SQLiteStore) HasConsumedSessionInput(ctx context.Context, sessionID string, runID string) (bool, error)

HasConsumedSessionInput reports whether the run took a message of the session.

func (*SQLiteStore) HasToolResult added in v0.2.0

func (s *SQLiteStore) HasToolResult(ctx context.Context, sessionID string, runID string, toolCallID string) (bool, error)

HasToolResult reports whether a tool message of the session answers toolCallID.

func (*SQLiteStore) LatestCompaction added in v0.2.0

func (s *SQLiteStore) LatestCompaction(ctx context.Context, sessionID string) (transcript.Message, error)

LatestCompaction returns the session's newest context boundary.

func (*SQLiteStore) ListActiveRuns added in v0.1.15

func (s *SQLiteStore) ListActiveRuns(ctx context.Context) ([]core.Run, error)

func (*SQLiteStore) ListActiveSessionGoals added in v0.2.1

func (s *SQLiteStore) ListActiveSessionGoals(ctx context.Context) ([]core.SessionGoal, error)

ListActiveSessionGoals lists the goals sessions are working on.

func (*SQLiteStore) ListApprovals

func (s *SQLiteStore) ListApprovals(ctx context.Context, sessionID string, state core.ApprovalState) ([]core.Approval, error)

ListApprovals lists the approvals in state (any when empty) the session's runs and its subagents asked for, newest first.

func (*SQLiteStore) ListClientDeliveries

func (s *SQLiteStore) ListClientDeliveries(ctx context.Context, filter core.ClientDeliveryFilter) ([]core.ClientDelivery, error)

func (*SQLiteStore) ListDueRunWakeups added in v0.2.0

func (s *SQLiteStore) ListDueRunWakeups(ctx context.Context, at time.Time) ([]core.RunWakeup, error)

ListDueRunWakeups lists the wakeups due at at, earliest first.

func (*SQLiteStore) ListExternalAgentSessions added in v0.2.1

func (s *SQLiteStore) ListExternalAgentSessions(ctx context.Context, sessionIDs []string) ([]externalagents.SessionAttachment, error)

func (*SQLiteStore) ListFileCheckpoints added in v0.2.1

func (s *SQLiteStore) ListFileCheckpoints(ctx context.Context, sessionID string, limit int) ([]core.FileCheckpoint, error)

ListFileCheckpoints lists newest first; rows are ordered by insertion.

func (*SQLiteStore) ListMemories added in v0.1.12

func (s *SQLiteStore) ListMemories(ctx context.Context, filter memory.Filter) ([]memory.Entry, error)

func (*SQLiteStore) ListMessages

func (s *SQLiteStore) ListMessages(ctx context.Context, sessionID string, limit int) ([]transcript.Message, error)

ListMessages returns the latest limit messages (all when limit is 0) in seq order.

func (*SQLiteStore) ListMessagesAfter added in v0.2.0

func (s *SQLiteStore) ListMessagesAfter(ctx context.Context, sessionID string, afterSeq int64, limit int) ([]transcript.Message, error)

ListMessagesAfter returns up to limit messages (all when limit is 0) with seq > afterSeq, ascending.

func (*SQLiteStore) ListPendingSessionInputs added in v0.1.13

func (s *SQLiteStore) ListPendingSessionInputs(ctx context.Context, sessionID string) ([]core.SessionInput, error)

func (*SQLiteStore) ListPendingSteerInputs added in v0.1.13

func (s *SQLiteStore) ListPendingSteerInputs(ctx context.Context, sessionID string, runID string) ([]core.SessionInput, error)

func (*SQLiteStore) ListPermissionRules added in v0.2.0

func (s *SQLiteStore) ListPermissionRules(ctx context.Context, sessionIDs []string) ([]permission.Rule, error)

ListPermissionRules returns the global rules and the rules of the given sessions, oldest first.

func (*SQLiteStore) ListRunApprovals added in v0.2.0

func (s *SQLiteStore) ListRunApprovals(ctx context.Context, sessionID string, runID string) ([]core.Approval, error)

ListRunApprovals lists the approvals the run asked for, newest first.

func (*SQLiteStore) ListRunMessages added in v0.2.0

func (s *SQLiteStore) ListRunMessages(ctx context.Context, sessionID string, runID string) ([]transcript.Message, error)

ListRunMessages returns the messages of the run in seq order.

func (*SQLiteStore) ListRunSteps added in v0.2.0

func (s *SQLiteStore) ListRunSteps(ctx context.Context, runID string) ([]core.RunStep, error)

func (*SQLiteStore) ListSessionRuns added in v0.2.0

func (s *SQLiteStore) ListSessionRuns(ctx context.Context, sessionID string, limit int) ([]core.Run, error)

func (*SQLiteStore) ListSessions

func (s *SQLiteStore) ListSessions(ctx context.Context, filter core.SessionListFilter) ([]core.Session, error)

func (*SQLiteStore) ListTasks added in v0.2.0

func (s *SQLiteStore) ListTasks(ctx context.Context, filter core.TaskFilter) ([]core.Task, error)

ListTasks lists the tasks the filter selects, newest first.

func (*SQLiteStore) ListUsageRecords added in v0.1.7

func (s *SQLiteStore) ListUsageRecords(ctx context.Context, filter core.UsageFilter) ([]core.UsageRecord, error)

ListUsageRecords sums run_steps per run, oldest run first; Limit keeps the latest runs.

func (*SQLiteStore) MarkTasksDelivered added in v0.2.0

func (s *SQLiteStore) MarkTasksDelivered(ctx context.Context, taskIDs []string, runID string, at time.Time) error

MarkTasksDelivered records that runID told the tasks' sessions they finished; an empty runID means nothing is to be told.

func (*SQLiteStore) NextPendingSessionInput added in v0.1.13

func (s *SQLiteStore) NextPendingSessionInput(ctx context.Context, sessionID string) (core.SessionInput, error)

func (*SQLiteStore) ReleaseHeldClientDeliveries added in v0.2.1

func (s *SQLiteStore) ReleaseHeldClientDeliveries(ctx context.Context, at time.Time) error

func (*SQLiteStore) SaveBinding

func (s *SQLiteStore) SaveBinding(ctx context.Context, binding core.ClientBinding) error

func (*SQLiteStore) SaveExternalAgentSession added in v0.1.4

func (s *SQLiteStore) SaveExternalAgentSession(ctx context.Context, attachment externalagents.SessionAttachment) error

func (*SQLiteStore) SaveMessageProgress added in v0.2.0

func (s *SQLiteStore) SaveMessageProgress(ctx context.Context, message transcript.Message) (int64, error)

SaveMessageProgress stores a streaming snapshot without search indexing and returns its seq.

func (*SQLiteStore) SaveRunCheckpoint added in v0.2.0

func (s *SQLiteStore) SaveRunCheckpoint(ctx context.Context, checkpoint core.RunCheckpoint) error

func (*SQLiteStore) SaveRunStep added in v0.2.0

func (s *SQLiteStore) SaveRunStep(ctx context.Context, step core.RunStep) error

SaveRunStep appends step as the next step number of its run.

func (*SQLiteStore) SaveRunWakeup added in v0.2.0

func (s *SQLiteStore) SaveRunWakeup(ctx context.Context, wakeup core.RunWakeup) error

func (*SQLiteStore) SaveSessionBudget added in v0.2.0

func (s *SQLiteStore) SaveSessionBudget(ctx context.Context, sessionID string, budget core.SessionBudget, updatedAt time.Time) error

SaveSessionBudget replaces the session's budget overrides; an empty budget removes them.

func (*SQLiteStore) SaveSessionEngineState added in v0.2.0

func (s *SQLiteStore) SaveSessionEngineState(ctx context.Context, sessionID string, state json.RawMessage, updatedAt time.Time) error

SaveSessionEngineState replaces the engine counters the session's next run starts from.

func (*SQLiteStore) SaveSessionGoal added in v0.2.1

func (s *SQLiteStore) SaveSessionGoal(ctx context.Context, goal core.SessionGoal) error

SaveSessionGoal writes the session's goal, replacing the one it had.

func (*SQLiteStore) SaveSessionTodo added in v0.2.0

func (s *SQLiteStore) SaveSessionTodo(ctx context.Context, list todo.List) error

SaveSessionTodo replaces the session's todo list.

func (*SQLiteStore) SealRun added in v0.2.0

func (s *SQLiteStore) SealRun(ctx context.Context, run core.Run, reply *transcript.Message, replySaved bool) error

SealRun writes the run together with the reply it ends or parks with, if any, in one transaction: a saved reply is updated, another one inserted. An ended run keeps how it ended (core.ErrRunEnded), and the reply is not written.

func (*SQLiteStore) SearchMessages added in v0.1.7

func (s *SQLiteStore) SearchMessages(ctx context.Context, filter core.SearchFilter) ([]core.SearchResult, error)

func (*SQLiteStore) SetTaskCursor added in v0.2.0

func (s *SQLiteStore) SetTaskCursor(ctx context.Context, taskID string, cursor int64) error

func (*SQLiteStore) SetTaskStatus added in v0.2.0

func (s *SQLiteStore) SetTaskStatus(ctx context.Context, taskID string, status core.TaskStatus, at time.Time) error

SetTaskStatus moves a task that has not ended to status.

func (*SQLiteStore) TouchRun added in v0.2.0

func (s *SQLiteStore) TouchRun(ctx context.Context, runID string, at time.Time) error

TouchRun records activity of a run without changing anything else of it.

func (*SQLiteStore) TrimFileCheckpoints added in v0.2.1

func (s *SQLiteStore) TrimFileCheckpoints(ctx context.Context, workingDir string, keep int) (bool, error)

func (*SQLiteStore) UpdateMemory added in v0.1.12

func (s *SQLiteStore) UpdateMemory(ctx context.Context, entry memory.Entry) error

func (*SQLiteStore) UpdateMessage

func (s *SQLiteStore) UpdateMessage(ctx context.Context, message transcript.Message) error

func (*SQLiteStore) UpdateMessageProgress added in v0.2.0

func (s *SQLiteStore) UpdateMessageProgress(ctx context.Context, message transcript.Message) error

func (*SQLiteStore) UpdateSession

func (s *SQLiteStore) UpdateSession(ctx context.Context, session core.Session) error

func (*SQLiteStore) UpdateSessionInput added in v0.1.13

func (s *SQLiteStore) UpdateSessionInput(ctx context.Context, input core.SessionInput) error

Jump to

Keyboard shortcuts

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