Versions in this module Expand all Collapse all v3 v3.4.0 Oct 11, 2026 v3.3.2 Oct 10, 2026 v3.3.1 Oct 10, 2026 v3.3.0 Oct 9, 2026 v3.2.1 Oct 7, 2026 v3.2.0 Oct 7, 2026 v3.1.0 Oct 4, 2026 Changes in this version + var ErrPrincipalTokenRevoked = errors.New("principal token is revoked") type CloudStore + func (cs *CloudStore) MarkPrincipalTokenUsed(ctx context.Context, tokenID string) error v3.0.0 Oct 1, 2026 Changes in this version + const AuditActionChunkPush + const AuditActionMutationPush + const AuditOutcomeRejectedProjectPaused + const PrincipalKindHuman + const PrincipalKindServiceAccount + const PrincipalRoleAdmin + const PrincipalRoleMember + var ErrAdminAlreadyExists = errors.New("cloudstore: a managed admin already exists") + var ErrAuthAuditInsertFailed = errors.New("cloudstore: auth audit insert failed") + var ErrChunkConflict = errors.New("cloudstore: chunk id conflict") + var ErrChunkNotFound = errors.New("cloudstore: chunk not found") + var ErrDashboardContributorNotFound = errors.New("cloudstore: dashboard contributor not found") + var ErrDashboardObservationNotFound = errors.New("cloudstore: dashboard observation not found") + var ErrDashboardProjectForbidden = errors.New("cloudstore: dashboard project is outside allowed scope") + var ErrDashboardProjectInvalid = errors.New("cloudstore: dashboard project is invalid") + var ErrDashboardProjectNotFound = errors.New("cloudstore: dashboard project not found") + var ErrDashboardPromptNotFound = errors.New("cloudstore: dashboard prompt not found") + var ErrDashboardSessionNotFound = errors.New("cloudstore: dashboard session not found") + var ErrInvalidPrincipalKind = errors.New("cloudstore: invalid principal kind") + var ErrInvalidPrincipalRole = errors.New("cloudstore: invalid principal role") + var ErrLastActiveAdmin = errors.New("cloudstore: cannot remove last active admin") + var ErrPrincipalDisabled = errors.New("cloudstore: principal is disabled") + var ErrPrincipalNotFound = errors.New("cloudstore: principal not found") + var ErrPrincipalTokenNotFound = errors.New("cloudstore: principal token not found") + var ErrPromptPairClaimConflict = errors.New("cloudstore: prompt pair claim conflict") + var ErrPromptSourceAttestationUnbound = errors.New(...) + var ErrSensitiveAuditMetadata = errors.New("cloudstore: sensitive auth audit metadata is not allowed") + var ErrSessionAuthorityConflict = errors.New("cloudstore: session authority conflict") + var ErrSessionAuthorityNotFound = errors.New("cloudstore: session authority not found") + var ErrStrandedAdminRecoveryIneligible = errors.New("cloudstore: stranded admin token recovery is not eligible") + func NormalizeProjectGrant(project string) string + type AuditEntry struct + Action string + Contributor string + EntryCount int + Metadata map[string]any + Outcome string + Project string + ReasonCode string + type AuditFilter struct + Contributor string + OccurredAtFrom time.Time + OccurredAtTo time.Time + Outcome string + Project string + type AuthAuditEvent struct + Action string + ActorPrincipalID string + ActorSource string + ID string + Metadata map[string]any + OccurredAt time.Time + Outcome string + Project string + ReasonCode string + TargetPrincipalID string + type AuthAuditQuery struct + Limit int + type CloudStore struct + func New(cfg cloud.Config) (*CloudStore, error) + func (cs *CloudStore) AdminOverview() (DashboardAdminOverview, error) + func (cs *CloudStore) AttestPromptSource(ctx context.Context, ...) (*PromptSourceAttestation, error) + func (cs *CloudStore) BackfillMutationChunks(ctx context.Context, project string, apply bool) (MutationChunkBackfillReport, error) + func (cs *CloudStore) ClaimPromptPair(ctx context.Context, ...) error + func (cs *CloudStore) Close() error + func (cs *CloudStore) CreateFirstAdminHumanUser(ctx context.Context, params CreateHumanUserParams) (HumanUser, error) + func (cs *CloudStore) CreateHumanUser(ctx context.Context, params CreateHumanUserParams) (HumanUser, error) + func (cs *CloudStore) CreatePrincipal(ctx context.Context, params CreatePrincipalParams) (Principal, error) + func (cs *CloudStore) CreatePrincipalToken(ctx context.Context, params CreatePrincipalTokenParams) (PrincipalToken, error) + func (cs *CloudStore) CreatePrincipalTokenWithAudit(ctx context.Context, params CreatePrincipalTokenParams, audit AuthAuditEvent) (PrincipalToken, error) + func (cs *CloudStore) CreateProjectGrant(ctx context.Context, params CreateProjectGrantParams) (ProjectGrant, error) + func (cs *CloudStore) CreateUser(username, email, _ string) (*User, error) + func (cs *CloudStore) DashboardStoreForProjects(projects []string) (*DashboardScopedStore, error) + func (cs *CloudStore) FindPrincipalTokenByHash(ctx context.Context, tokenHash string) (PrincipalToken, Principal, error) + func (cs *CloudStore) GetContributorDetail(name string) (DashboardContributorRow, []DashboardSessionRow, []DashboardObservationRow, ...) + func (cs *CloudStore) GetObservationDetail(project, sessionID, syncID string) (DashboardObservationRow, DashboardSessionRow, []DashboardObservationRow, error) + func (cs *CloudStore) GetPrincipal(ctx context.Context, id string) (Principal, error) + func (cs *CloudStore) GetProjectSyncControl(project string) (*ProjectSyncControl, error) + func (cs *CloudStore) GetPromptDetail(project, sessionID, syncID string) (DashboardPromptRow, DashboardSessionRow, []DashboardPromptRow, error) + func (cs *CloudStore) GetPromptPairClaim(ctx context.Context, sessionID, sourceInboxID string) (*PromptPairClaim, error) + func (cs *CloudStore) GetSessionAuthority(ctx context.Context, sessionID string) (*SessionAuthority, error) + func (cs *CloudStore) GetSessionDetail(project, sessionID string) (DashboardSessionRow, []DashboardObservationRow, []DashboardPromptRow, error) + func (cs *CloudStore) GetUserByEmail(email string) (*User, error) + func (cs *CloudStore) GetUserByUsername(username string) (*User, error) + func (cs *CloudStore) HasActiveAdmin(ctx context.Context) (bool, error) + func (cs *CloudStore) InsertAuditEntry(ctx context.Context, entry AuditEntry) error + func (cs *CloudStore) InsertAuthAuditEvent(ctx context.Context, event AuthAuditEvent) error + func (cs *CloudStore) InsertMutationBatch(ctx context.Context, batch []MutationEntry) ([]int64, error) + func (cs *CloudStore) IsProjectSyncEnabled(project string) (bool, error) + func (cs *CloudStore) KnownSessionIDs(ctx context.Context, project string) (map[string]struct{}, error) + func (cs *CloudStore) ListAuditEntriesPaginated(ctx context.Context, filter AuditFilter, limit, offset int) ([]DashboardAuditRow, int, error) + func (cs *CloudStore) ListAuthAuditEvents(ctx context.Context, query AuthAuditQuery) ([]AuthAuditEvent, error) + func (cs *CloudStore) ListContributors(query string) ([]DashboardContributorRow, error) + func (cs *CloudStore) ListContributorsPaginated(query string, limit, offset int) ([]DashboardContributorRow, int, error) + func (cs *CloudStore) ListDistinctTypes() ([]string, error) + func (cs *CloudStore) ListHumanUsers(ctx context.Context) ([]HumanUser, error) + func (cs *CloudStore) ListMutationsSince(ctx context.Context, sinceSeq int64, limit int, allowedProjects []string) ([]StoredMutation, bool, int64, error) + func (cs *CloudStore) ListPrincipalTokens(ctx context.Context, principalID string) ([]PrincipalToken, error) + func (cs *CloudStore) ListPrincipals(ctx context.Context) ([]Principal, error) + func (cs *CloudStore) ListProjectGrants(ctx context.Context, principalID string) ([]ProjectGrant, error) + func (cs *CloudStore) ListProjectSyncControls() ([]ProjectSyncControl, error) + func (cs *CloudStore) ListProjects(query string) ([]DashboardProjectRow, error) + func (cs *CloudStore) ListProjectsPaginated(query string, limit, offset int) ([]DashboardProjectRow, int, error) + func (cs *CloudStore) ListRecentObservations(project string, query string, limit int) ([]DashboardObservationRow, error) + func (cs *CloudStore) ListRecentObservationsPaginated(project, query, obsType string, limit, offset int) ([]DashboardObservationRow, int, error) + func (cs *CloudStore) ListRecentPrompts(project string, query string, limit int) ([]DashboardPromptRow, error) + func (cs *CloudStore) ListRecentPromptsPaginated(project, query string, limit, offset int) ([]DashboardPromptRow, int, error) + func (cs *CloudStore) ListRecentSessions(project string, query string, limit int) ([]DashboardSessionRow, error) + func (cs *CloudStore) ListRecentSessionsPaginated(project, query string, limit, offset int) ([]DashboardSessionRow, int, error) + func (cs *CloudStore) ProjectDetail(project string) (DashboardProjectDetail, error) + func (cs *CloudStore) ReadChunk(ctx context.Context, project, chunkID string) ([]byte, error) + func (cs *CloudStore) ReadManifest(ctx context.Context, project string) (*engramsync.Manifest, error) + func (cs *CloudStore) RecoverStrandedAdminTokenWithAudit(ctx context.Context, params RecoverStrandedAdminTokenParams, ...) (PrincipalToken, error) + func (cs *CloudStore) RegisterSessionAuthority(ctx context.Context, sessionID, project, actor string) error + func (cs *CloudStore) RevokePrincipalToken(ctx context.Context, tokenID, revokedByPrincipalID, reason string) error + func (cs *CloudStore) RevokeProjectGrant(ctx context.Context, principalID, project string) error + func (cs *CloudStore) SetDashboardAllowedProjects(projects []string) + func (cs *CloudStore) SetHumanUserEnabled(ctx context.Context, principalID string, enabled bool) error + func (cs *CloudStore) SetProjectSyncEnabled(project string, enabled bool, updatedBy, reason string) error + func (cs *CloudStore) SystemHealth() (DashboardSystemHealth, error) + func (cs *CloudStore) UpdatePrincipal(ctx context.Context, id string, params UpdatePrincipalParams) error + func (cs *CloudStore) VerifyPromptSourceAttestation(ctx context.Context, id int64, ...) (bool, error) + func (cs *CloudStore) WouldRemoveLastActiveAdmin(ctx context.Context, principalID string) (bool, error) + func (cs *CloudStore) WriteChunk(ctx context.Context, project, chunkID, createdBy, clientCreatedAt string, ...) error + type CreateHumanUserParams struct + DisplayName string + Email string + Role string + Username string + type CreatePrincipalParams struct + DisplayName string + Enabled *bool + Kind string + Role string + type CreatePrincipalTokenParams struct + CreatedByPrincipalID string + Name string + PrincipalID string + TokenHash string + TokenPrefix string + type CreateProjectGrantParams struct + GrantedByPrincipalID string + PrincipalID string + Project string + type DashboardAdminOverview struct + Chunks int + Contributors int + Projects int + type DashboardAuditRow struct + Action string + Contributor string + EntryCount int + ID int64 + Metadata map[string]any + OccurredAt string + Outcome string + Project string + ReasonCode string + type DashboardContributorRow struct + Chunks int + CreatedBy string + LastChunkAt string + Projects int + type DashboardObservationRow struct + ChunkID string + Content string + CreatedAt string + Project string + SessionID string + SyncID string + Title string + ToolName string + TopicKey string + Type string + type DashboardProjectDetail struct + Contributors []DashboardContributorRow + Observations []DashboardObservationRow + Project string + Prompts []DashboardPromptRow + Sessions []DashboardSessionRow + Stats DashboardProjectRow + type DashboardProjectRow struct + Chunks int + Observations int + Project string + Prompts int + Sessions int + type DashboardPromptRow struct + ChunkID string + Content string + CreatedAt string + Project string + SessionID string + SyncID string + type DashboardScopedStore struct + func (s *DashboardScopedStore) AdminOverview() (DashboardAdminOverview, error) + func (s *DashboardScopedStore) GetContributorDetail(name string) (DashboardContributorRow, []DashboardSessionRow, []DashboardObservationRow, ...) + func (s *DashboardScopedStore) GetObservationDetail(project, sessionID, syncID string) (DashboardObservationRow, DashboardSessionRow, []DashboardObservationRow, error) + func (s *DashboardScopedStore) GetProjectSyncControl(project string) (*ProjectSyncControl, error) + func (s *DashboardScopedStore) GetPromptDetail(project, sessionID, syncID string) (DashboardPromptRow, DashboardSessionRow, []DashboardPromptRow, error) + func (s *DashboardScopedStore) GetSessionDetail(project, sessionID string) (DashboardSessionRow, []DashboardObservationRow, []DashboardPromptRow, error) + func (s *DashboardScopedStore) IsProjectSyncEnabled(project string) (bool, error) + func (s *DashboardScopedStore) ListAuditEntriesPaginated(context.Context, AuditFilter, int, int) ([]DashboardAuditRow, int, error) + func (s *DashboardScopedStore) ListContributors(query string) ([]DashboardContributorRow, error) + func (s *DashboardScopedStore) ListContributorsPaginated(query string, limit, offset int) ([]DashboardContributorRow, int, error) + func (s *DashboardScopedStore) ListDistinctTypes() ([]string, error) + func (s *DashboardScopedStore) ListProjectSyncControls() ([]ProjectSyncControl, error) + func (s *DashboardScopedStore) ListProjects(query string) ([]DashboardProjectRow, error) + func (s *DashboardScopedStore) ListProjectsPaginated(query string, limit, offset int) ([]DashboardProjectRow, int, error) + func (s *DashboardScopedStore) ListRecentObservations(project, query string, limit int) ([]DashboardObservationRow, error) + func (s *DashboardScopedStore) ListRecentObservationsPaginated(project, query, obsType string, limit, offset int) ([]DashboardObservationRow, int, error) + func (s *DashboardScopedStore) ListRecentPrompts(project, query string, limit int) ([]DashboardPromptRow, error) + func (s *DashboardScopedStore) ListRecentPromptsPaginated(project, query string, limit, offset int) ([]DashboardPromptRow, int, error) + func (s *DashboardScopedStore) ListRecentSessions(project, query string, limit int) ([]DashboardSessionRow, error) + func (s *DashboardScopedStore) ListRecentSessionsPaginated(project, query string, limit, offset int) ([]DashboardSessionRow, int, error) + func (s *DashboardScopedStore) ProjectDetail(project string) (DashboardProjectDetail, error) + func (s *DashboardScopedStore) SetProjectSyncEnabled(project string, enabled bool, updatedBy, reason string) error + func (s *DashboardScopedStore) SystemHealth() (DashboardSystemHealth, error) + type DashboardSessionRow struct + Directory string + EndedAt string + Project string + SessionID string + StartedAt string + Summary string + type DashboardSystemHealth struct + Chunks int + Contributors int + DBConnected bool + Observations int + Projects int + Prompts int + Sessions int + type HumanUser struct + CreatedAt time.Time + DisplayName string + Email string + Enabled bool + PrincipalID string + Role string + Username string + type MutationBatchEntryError struct + BatchIndex int + Entity string + EntityKey string + Err error + func (e *MutationBatchEntryError) Error() string + func (e *MutationBatchEntryError) Unwrap() error + type MutationChunkBackfillReport struct + AlreadyMaterialized int + Applied bool + CandidateMutations int + ChunksInserted int + ChunksPlanned int + InvalidMutations int + Project string + type MutationEntry struct + CreatedBy string + Entity string + EntityKey string + Op string + Payload json.RawMessage + Project string + type Principal struct + CreatedAt time.Time + DisplayName string + Enabled bool + ID string + Kind string + Role string + UpdatedAt time.Time + type PrincipalToken struct + CreatedAt time.Time + CreatedByPrincipalID string + ID string + LastUsedAt *time.Time + Name string + PrincipalID string + RevocationReason string + RevokedAt *time.Time + RevokedByPrincipalID string + TokenHash string + TokenPrefix string + type ProjectGrant struct + CreatedAt time.Time + GrantedByPrincipalID string + PrincipalID string + Project string + type ProjectSyncControl struct + PausedReason *string + Project string + SyncEnabled bool + UpdatedAt string + UpdatedBy *string + type PromptPairClaim struct + ClaimedAt time.Time + ClaimedBy string + PromptProject string + SessionID string + SourceInboxID string + SyncID string + type PromptSourceAttestation struct + ActorID string + AttestedAt time.Time + ID int64 + OwnerProject string + PromptProject string + SessionID string + SourceInboxID string + SyncID string + type RecoverStrandedAdminTokenParams struct + Name string + RevokeExisting bool + TokenHash string + TokenPrefix string + type SessionAuthority struct + OwnerProject string + RegisteredAt time.Time + RegisteredBy string + SessionID string + type StoredMutation struct + Entity string + EntityKey string + OccurredAt string + Op string + Payload json.RawMessage + Project string + Seq int64 + type UpdatePrincipalParams struct + Enabled bool + Role string + type User struct + Email string + ID string + PasswordHash string + Username string Other modules containing this package github.com/Gentleman-Programming/engram github.com/Gentleman-Programming/engram/v2