Versions in this module Expand all Collapse all v1 v1.2.0 Mar 19, 2026 Changes in this version + func ContextWithUserID(ctx context.Context, userID string) context.Context + func UserIDFromContext(ctx context.Context) string + type AdminStore struct + func NewAdminStore(pool *pgxpool.Pool, tracer observability.Tracer, logger *zap.Logger) *AdminStore + func (s *AdminStore) CountSessionsByUser(ctx context.Context) ([]agent.UserSessionCount, error) + func (s *AdminStore) GetSystemStats(ctx context.Context) (*agent.SystemStats, error) + func (s *AdminStore) ListAllSessions(ctx context.Context, limit, offset int) ([]agent.AdminSession, int32, error) + func (s *AdminStore) ValidatePermissions(ctx context.Context) error + type ArtifactStore struct + func NewArtifactStore(pool *pgxpool.Pool, tracer observability.Tracer) *ArtifactStore + func (s *ArtifactStore) Close() error + func (s *ArtifactStore) Delete(ctx context.Context, id string, hard bool) error + func (s *ArtifactStore) Get(ctx context.Context, id string) (*artifacts.Artifact, error) + func (s *ArtifactStore) GetByName(ctx context.Context, name string, sessionID string) (*artifacts.Artifact, error) + func (s *ArtifactStore) GetStats(ctx context.Context) (*artifacts.Stats, error) + func (s *ArtifactStore) Index(ctx context.Context, artifact *artifacts.Artifact) error + func (s *ArtifactStore) List(ctx context.Context, filter *artifacts.Filter) ([]*artifacts.Artifact, error) + func (s *ArtifactStore) RecordAccess(ctx context.Context, id string) error + func (s *ArtifactStore) Search(ctx context.Context, query string, sessionID string, limit int) ([]*artifacts.Artifact, error) + func (s *ArtifactStore) Update(ctx context.Context, artifact *artifacts.Artifact) error + type Backend struct + func NewBackend(ctx context.Context, cfg *loomv1.PostgresStorageConfig, ...) (*Backend, error) + func (b *Backend) AdminStore() *AdminStore + func (b *Backend) ArtifactStore() artifacts.ArtifactStore + func (b *Backend) Close() error + func (b *Backend) ErrorStore() agent.ErrorStore + func (b *Backend) HumanRequestStore() shuttle.HumanRequestStore + func (b *Backend) Migrate(ctx context.Context) error + func (b *Backend) Migrator() *Migrator + func (b *Backend) Ping(ctx context.Context) error + func (b *Backend) Pool() *pgxpool.Pool + func (b *Backend) RawPendingMigrations(ctx context.Context) ([]Migration, error) + func (b *Backend) ResultStore() storage.ResultStore + func (b *Backend) SessionStorage() agent.SessionStorage + type ErrorStore struct + func NewErrorStore(pool *pgxpool.Pool, tracer observability.Tracer) *ErrorStore + func (s *ErrorStore) Close() error + func (s *ErrorStore) Get(ctx context.Context, errorID string) (*agent.StoredError, error) + func (s *ErrorStore) List(ctx context.Context, filters agent.ErrorFilters) ([]*agent.StoredError, error) + func (s *ErrorStore) Store(ctx context.Context, storedErr *agent.StoredError) (string, error) + type HumanRequestStore struct + func NewHumanRequestStore(pool *pgxpool.Pool, tracer observability.Tracer) *HumanRequestStore + func (s *HumanRequestStore) Close() error + func (s *HumanRequestStore) Get(ctx context.Context, id string) (*shuttle.HumanRequest, error) + func (s *HumanRequestStore) ListBySession(ctx context.Context, sessionID string) ([]*shuttle.HumanRequest, error) + func (s *HumanRequestStore) ListPending(ctx context.Context) ([]*shuttle.HumanRequest, error) + func (s *HumanRequestStore) Store(ctx context.Context, req *shuttle.HumanRequest) error + func (s *HumanRequestStore) Update(ctx context.Context, req *shuttle.HumanRequest) error + type Migration struct + Description string + DownSQL string + UpSQL string + Version int + type Migrator struct + func NewMigrator(pool *pgxpool.Pool, tracer observability.Tracer) (*Migrator, error) + func (m *Migrator) CurrentVersion(ctx context.Context) (int, error) + func (m *Migrator) MigrateDown(ctx context.Context, steps int) error + func (m *Migrator) MigrateUp(ctx context.Context) error + func (m *Migrator) PendingMigrations(ctx context.Context) ([]Migration, error) + type ResultStore struct + func NewResultStore(pool *pgxpool.Pool, tracer observability.Tracer) *ResultStore + func (s *ResultStore) Close() error + func (s *ResultStore) Delete(ctx context.Context, id string) error + func (s *ResultStore) GetMetadata(ctx context.Context, id string) (*storage.SQLResultMetadata, error) + func (s *ResultStore) Query(ctx context.Context, id, query string) (interface{}, error) + func (s *ResultStore) Store(ctx context.Context, id string, data interface{}) (*loomv1.DataReference, error) + type SessionStore struct + func NewSessionStore(pool *pgxpool.Pool, tracer observability.Tracer, logger *zap.Logger) *SessionStore + func (s *SessionStore) Close() error + func (s *SessionStore) DeleteSession(ctx context.Context, sessionID string) error + func (s *SessionStore) GetStats(ctx context.Context) (*agent.Stats, error) + func (s *SessionStore) ListSessions(ctx context.Context) ([]string, error) + func (s *SessionStore) LoadAgentSessions(ctx context.Context, agentID string) ([]string, error) + func (s *SessionStore) LoadMemorySnapshots(ctx context.Context, sessionID string, snapshotType string, limit int) ([]agent.MemorySnapshot, error) + func (s *SessionStore) LoadMessages(ctx context.Context, sessionID string) ([]agent.Message, error) + func (s *SessionStore) LoadMessagesForAgent(ctx context.Context, agentID string) ([]agent.Message, error) + func (s *SessionStore) LoadMessagesFromParentSession(ctx context.Context, sessionID string) ([]agent.Message, error) + func (s *SessionStore) LoadSession(ctx context.Context, sessionID string) (*agent.Session, error) + func (s *SessionStore) PurgeDeleted(ctx context.Context, graceInterval string) error + func (s *SessionStore) RegisterCleanupHook(hook agent.SessionCleanupHook) + func (s *SessionStore) RestoreSession(ctx context.Context, sessionID string) error + func (s *SessionStore) SaveMemorySnapshot(ctx context.Context, sessionID, snapshotType, content string, tokenCount int) error + func (s *SessionStore) SaveMessage(ctx context.Context, sessionID string, msg agent.Message) error + func (s *SessionStore) SaveSession(ctx context.Context, session *agent.Session) error + func (s *SessionStore) SaveToolExecution(ctx context.Context, sessionID string, exec agent.ToolExecution) error + func (s *SessionStore) SearchMessages(ctx context.Context, sessionID, query string, limit int) ([]agent.Message, error) + func (s *SessionStore) SearchMessagesByAgent(ctx context.Context, agentID, query string, limit int) ([]agent.Message, error) + func (s *SessionStore) SoftDeleteSession(ctx context.Context, sessionID string) error