Documentation
¶
Index ¶
- type Diagnostics
- type SQLiteStore
- func (s *SQLiteStore) AcceptMessage(ctx context.Context, message transcript.Message, run core.Run, ...) error
- func (s *SQLiteStore) AppendMessage(ctx context.Context, message transcript.Message) (int64, error)
- func (s *SQLiteStore) Close() error
- func (s *SQLiteStore) CreateApproval(ctx context.Context, approval core.Approval) error
- func (s *SQLiteStore) CreateClientDelivery(ctx context.Context, delivery core.ClientDelivery) error
- func (s *SQLiteStore) CreateMemory(ctx context.Context, entry core.MemoryEntry) error
- func (s *SQLiteStore) CreatePermissionRule(ctx context.Context, rule permission.Rule) error
- func (s *SQLiteStore) CreateSession(ctx context.Context, session core.Session) error
- func (s *SQLiteStore) CreateSessionInput(ctx context.Context, input core.SessionInput) error
- func (s *SQLiteStore) CreateTask(ctx context.Context, task core.Task) error
- func (s *SQLiteStore) DecideApproval(ctx context.Context, approval core.Approval) error
- func (s *SQLiteStore) DeleteExternalAgentSession(ctx context.Context, sessionID string) error
- func (s *SQLiteStore) DeleteMemory(ctx context.Context, id string) error
- func (s *SQLiteStore) DeletePermissionRule(ctx context.Context, ruleID string) error
- func (s *SQLiteStore) DeleteRunCheckpoint(ctx context.Context, runID string) error
- func (s *SQLiteStore) DeleteRunWakeup(ctx context.Context, runID string) error
- func (s *SQLiteStore) DeleteSession(ctx context.Context, sessionID string) error
- func (s *SQLiteStore) FinishTask(ctx context.Context, taskID string, end core.TaskEnd) (bool, error)
- func (s *SQLiteStore) GetActiveRunBySession(ctx context.Context, sessionID string) (core.Run, error)
- func (s *SQLiteStore) GetApproval(ctx context.Context, approvalID string) (core.Approval, error)
- func (s *SQLiteStore) GetBinding(ctx context.Context, client string, externalKey string) (core.ClientBinding, error)
- func (s *SQLiteStore) GetExternalAgentSession(ctx context.Context, sessionID string) (externalagents.SessionAttachment, error)
- func (s *SQLiteStore) GetLatestRunBySession(ctx context.Context, sessionID string) (core.Run, error)
- func (s *SQLiteStore) GetMemory(ctx context.Context, id string) (core.MemoryEntry, error)
- func (s *SQLiteStore) GetMessage(ctx context.Context, messageID string) (transcript.Message, error)
- func (s *SQLiteStore) GetRun(ctx context.Context, runID string) (core.Run, error)
- func (s *SQLiteStore) GetRunCheckpoint(ctx context.Context, runID string) (core.RunCheckpoint, error)
- func (s *SQLiteStore) GetRunWakeup(ctx context.Context, runID string) (core.RunWakeup, error)
- func (s *SQLiteStore) GetSession(ctx context.Context, sessionID string) (core.Session, error)
- func (s *SQLiteStore) GetSessionBudget(ctx context.Context, sessionID string) (core.SessionBudget, error)
- func (s *SQLiteStore) GetSessionEngineState(ctx context.Context, sessionID string) (json.RawMessage, error)
- func (s *SQLiteStore) GetSessionTodo(ctx context.Context, sessionID string) (todo.List, error)
- func (s *SQLiteStore) GetTask(ctx context.Context, taskID string) (core.Task, error)
- func (s *SQLiteStore) HasConsumedSessionInput(ctx context.Context, sessionID string, runID string) (bool, error)
- func (s *SQLiteStore) HasToolResult(ctx context.Context, sessionID string, runID string, toolCallID string) (bool, error)
- func (s *SQLiteStore) LatestCompaction(ctx context.Context, sessionID string) (transcript.Message, error)
- func (s *SQLiteStore) ListActiveRuns(ctx context.Context) ([]core.Run, error)
- func (s *SQLiteStore) ListApprovals(ctx context.Context, sessionID string, state core.ApprovalState) ([]core.Approval, error)
- func (s *SQLiteStore) ListClientDeliveries(ctx context.Context, filter core.ClientDeliveryFilter) ([]core.ClientDelivery, error)
- func (s *SQLiteStore) ListDueRunWakeups(ctx context.Context, at time.Time) ([]core.RunWakeup, error)
- func (s *SQLiteStore) ListMemories(ctx context.Context, filter core.MemoryFilter) ([]core.MemoryEntry, error)
- func (s *SQLiteStore) ListMessages(ctx context.Context, sessionID string, limit int) ([]transcript.Message, error)
- func (s *SQLiteStore) ListMessagesAfter(ctx context.Context, sessionID string, afterSeq int64, limit int) ([]transcript.Message, error)
- func (s *SQLiteStore) ListPendingSessionInputs(ctx context.Context, sessionID string) ([]core.SessionInput, error)
- func (s *SQLiteStore) ListPendingSteerInputs(ctx context.Context, sessionID string, runID string) ([]core.SessionInput, error)
- func (s *SQLiteStore) ListPermissionRules(ctx context.Context, sessionIDs []string) ([]permission.Rule, error)
- func (s *SQLiteStore) ListRunApprovals(ctx context.Context, sessionID string, runID string) ([]core.Approval, error)
- func (s *SQLiteStore) ListRunMessages(ctx context.Context, sessionID string, runID string) ([]transcript.Message, error)
- func (s *SQLiteStore) ListRunSteps(ctx context.Context, runID string) ([]core.RunStep, error)
- func (s *SQLiteStore) ListSessionRuns(ctx context.Context, sessionID string, limit int) ([]core.Run, error)
- func (s *SQLiteStore) ListSessions(ctx context.Context, filter core.SessionListFilter) ([]core.Session, error)
- func (s *SQLiteStore) ListTasks(ctx context.Context, filter core.TaskFilter) ([]core.Task, error)
- func (s *SQLiteStore) ListUsageRecords(ctx context.Context, filter core.UsageFilter) ([]core.UsageRecord, error)
- func (s *SQLiteStore) MarkTasksDelivered(ctx context.Context, taskIDs []string, runID string, at time.Time) error
- func (s *SQLiteStore) NextPendingSessionInput(ctx context.Context, sessionID string) (core.SessionInput, error)
- func (s *SQLiteStore) SaveBinding(ctx context.Context, binding core.ClientBinding) error
- func (s *SQLiteStore) SaveExternalAgentSession(ctx context.Context, attachment externalagents.SessionAttachment) error
- func (s *SQLiteStore) SaveMessageProgress(ctx context.Context, message transcript.Message) (int64, error)
- func (s *SQLiteStore) SaveRunCheckpoint(ctx context.Context, checkpoint core.RunCheckpoint) error
- func (s *SQLiteStore) SaveRunStep(ctx context.Context, step core.RunStep) error
- func (s *SQLiteStore) SaveRunWakeup(ctx context.Context, wakeup core.RunWakeup) error
- func (s *SQLiteStore) SaveSessionBudget(ctx context.Context, sessionID string, budget core.SessionBudget, ...) error
- func (s *SQLiteStore) SaveSessionEngineState(ctx context.Context, sessionID string, state json.RawMessage, ...) error
- func (s *SQLiteStore) SaveSessionTodo(ctx context.Context, list todo.List) error
- func (s *SQLiteStore) SealRun(ctx context.Context, run core.Run, reply *transcript.Message, replySaved bool) error
- func (s *SQLiteStore) SearchMessages(ctx context.Context, filter core.SearchFilter) ([]core.SearchResult, error)
- func (s *SQLiteStore) SetTaskCursor(ctx context.Context, taskID string, cursor int64) error
- func (s *SQLiteStore) SetTaskStatus(ctx context.Context, taskID string, status core.TaskStatus, at time.Time) error
- func (s *SQLiteStore) TouchRun(ctx context.Context, runID string, at time.Time) error
- func (s *SQLiteStore) UpdateClientDelivery(ctx context.Context, delivery core.ClientDelivery) error
- func (s *SQLiteStore) UpdateMemory(ctx context.Context, entry core.MemoryEntry) error
- func (s *SQLiteStore) UpdateMessage(ctx context.Context, message transcript.Message) error
- func (s *SQLiteStore) UpdateMessageProgress(ctx context.Context, message transcript.Message) error
- func (s *SQLiteStore) UpdateSession(ctx context.Context, session core.Session) error
- func (s *SQLiteStore) UpdateSessionInput(ctx context.Context, input core.SessionInput) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Diagnostics ¶
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) Close ¶
func (s *SQLiteStore) Close() error
func (*SQLiteStore) CreateApproval ¶
func (*SQLiteStore) CreateClientDelivery ¶
func (s *SQLiteStore) CreateClientDelivery(ctx context.Context, delivery core.ClientDelivery) error
func (*SQLiteStore) CreateMemory ¶ added in v0.1.12
func (s *SQLiteStore) CreateMemory(ctx context.Context, entry core.MemoryEntry) 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 (*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 (*SQLiteStore) DecideApproval ¶ added in v0.2.0
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) 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 (*SQLiteStore) GetApproval ¶
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) 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) (core.MemoryEntry, error)
func (*SQLiteStore) GetMessage ¶ added in v0.2.0
func (s *SQLiteStore) GetMessage(ctx context.Context, messageID string) (transcript.Message, 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 (*SQLiteStore) GetSession ¶
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) GetSessionTodo ¶ added in v0.2.0
GetSessionTodo returns the session's todo list; an empty one when none was written.
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 (*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) ListMemories ¶ added in v0.1.12
func (s *SQLiteStore) ListMemories(ctx context.Context, filter core.MemoryFilter) ([]core.MemoryEntry, 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 (*SQLiteStore) ListSessionRuns ¶ added in v0.2.0
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) 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
SaveRunStep appends step as the next step number of its run.
func (*SQLiteStore) SaveRunWakeup ¶ added in v0.2.0
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) SaveSessionTodo ¶ added in v0.2.0
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 (*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
TouchRun records activity of a run without changing anything else of it.
func (*SQLiteStore) UpdateClientDelivery ¶
func (s *SQLiteStore) UpdateClientDelivery(ctx context.Context, delivery core.ClientDelivery) error
func (*SQLiteStore) UpdateMemory ¶ added in v0.1.12
func (s *SQLiteStore) UpdateMemory(ctx context.Context, entry core.MemoryEntry) 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 (*SQLiteStore) UpdateSessionInput ¶ added in v0.1.13
func (s *SQLiteStore) UpdateSessionInput(ctx context.Context, input core.SessionInput) error
Source Files
¶
- diagnostics.go
- schema.go
- schema_compaction.go
- schema_messages.go
- schema_run_steps.go
- schema_tasks.go
- sqlite.go
- sqlite_approvals_files.go
- sqlite_client_capabilities.go
- sqlite_deliveries.go
- sqlite_external_agents.go
- sqlite_memory.go
- sqlite_messages.go
- sqlite_permission_rules.go
- sqlite_rows.go
- sqlite_run_checkpoints.go
- sqlite_run_steps.go
- sqlite_run_wakeups.go
- sqlite_search.go
- sqlite_session_budgets.go
- sqlite_session_engine_state.go
- sqlite_session_inputs.go
- sqlite_session_todos.go
- sqlite_sessions.go
- sqlite_tasks.go
- sqlite_time.go