store

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountRecord

type AccountRecord struct {
	ID                  string
	Username            string
	Email               string
	Role                string
	DisplayName         string
	AvatarURL           string
	Timezone            string
	PasswordHash        string
	HasPasswordHash     bool
	IsActive            bool
	PrincipalActive     bool
	MembershipActive    bool
	Metadata            string
	CreatedAt           time.Time
	UpdatedAt           time.Time
	JoinedAt            time.Time
	MembershipUpdatedAt time.Time
	LastLoginAt         time.Time
	TitleModelID        string
}

type AccountStore

type AccountStore interface {
	CountAccounts(ctx context.Context) (int64, error)
	GetByUserID(ctx context.Context, userID string) (AccountRecord, error)
	GetByIdentity(ctx context.Context, identity string) (AccountRecord, error)
	List(ctx context.Context) ([]AccountRecord, error)
	Search(ctx context.Context, query string, limit int32) ([]AccountRecord, error)
	CreateUser(ctx context.Context, input CreateUserInput) (AccountRecord, error)
	CreateAccount(ctx context.Context, input CreateAccountInput) (AccountRecord, error)
	UpdateLastLogin(ctx context.Context, accountID string) error
	UpdateAdmin(ctx context.Context, input UpdateAccountAdminInput) (AccountRecord, error)
	UpdateProfile(ctx context.Context, input UpdateAccountProfileInput) (AccountRecord, error)
	IsValidTitleModel(ctx context.Context, modelID string) (bool, error)
	UpdatePassword(ctx context.Context, input UpdateAccountPasswordInput) error
	RemoveMember(ctx context.Context, userID string) error
}

type AudioCatalogStore

type AudioCatalogStore interface {
	ListSpeechProviders(ctx context.Context) ([]Record, error)
	ListTranscriptionProviders(ctx context.Context) ([]Record, error)
	ListSpeechModels(ctx context.Context, filter Filter) ([]Record, error)
	ListTranscriptionModels(ctx context.Context, filter Filter) ([]Record, error)
	GetSpeechModelWithProvider(ctx context.Context, modelID ID) (Record, error)
	GetTranscriptionModelWithProvider(ctx context.Context, modelID ID) (Record, error)
	UpdateModel(ctx context.Context, modelID ID, input Patch) (Record, error)
}

type BotACLStore

type BotACLStore interface {
	Evaluate(ctx context.Context, input Input) (Record, error)
	GetDefaultEffect(ctx context.Context, botID ID) (string, error)
	SetDefaultEffect(ctx context.Context, botID ID, effect string) error
	ListRules(ctx context.Context, botID ID) ([]Record, error)
	CreateRule(ctx context.Context, input Input) (Record, error)
	UpdateRule(ctx context.Context, id ID, input Patch) (Record, error)
	DeleteRule(ctx context.Context, id ID) error
}

type BotReader

type BotReader interface {
	GetByID(ctx context.Context, botID ID) (Record, error)
}

type BotRemoteRuntimeBindingRecord

type BotRemoteRuntimeBindingRecord struct {
	ID             string
	BotID          string
	RuntimeID      string
	IsPrimary      bool
	ToolApproval   JSON
	RuntimeName    string
	RuntimeUserID  string
	BotOwnerUserID string
	RuntimeRevoked bool
	CreatedAt      time.Time
	UpdatedAt      time.Time
}

type BotRemoteRuntimeBindingStore

type BotRemoteRuntimeBindingStore interface {
	CreateOrUpdateMount(ctx context.Context, botID, runtimeID string) (BotRemoteRuntimeBindingRecord, error)
	ListMounts(ctx context.Context, botID string) ([]BotRemoteRuntimeBindingRecord, error)
	// ListGrantsByRuntimeOwner is the account-level reverse lookup: every live
	// mount held by the owner's bots. Records carry only ID/BotID/RuntimeID/
	// IsPrimary — the runtime/bot join fields stay zero.
	ListGrantsByRuntimeOwner(ctx context.Context, ownerUserID string) ([]BotRemoteRuntimeBindingRecord, error)
	GetMount(ctx context.Context, botID, targetID string) (BotRemoteRuntimeBindingRecord, error)
	GetPrimaryMount(ctx context.Context, botID string) (BotRemoteRuntimeBindingRecord, error)
	SetPrimary(ctx context.Context, botID, targetID string) error
	UpdateToolApproval(ctx context.Context, botID, targetID string, config JSON) error
	DeleteMount(ctx context.Context, botID, targetID string) error
}

type BotSettingsStore

type BotSettingsStore interface {
	GetByBotID(ctx context.Context, botID ID) (Record, error)
	Upsert(ctx context.Context, botID ID, input Input) (Record, error)
	DeleteByBotID(ctx context.Context, botID ID) error
}

type BotStore

type BotStore interface {
	Create(ctx context.Context, input Input) (Record, error)
	GetByID(ctx context.Context, botID ID) (Record, error)
	ListByOwner(ctx context.Context, ownerUserID ID) ([]Record, error)
	UpdateProfile(ctx context.Context, botID ID, input Patch) (Record, error)
	UpdateOwner(ctx context.Context, botID ID, ownerUserID ID) (Record, error)
	UpdateStatus(ctx context.Context, botID ID, status string) (Record, error)
	TouchActivity(ctx context.Context, botID ID) error
	Delete(ctx context.Context, botID ID) error
}

type BotWorkdirRecord

type BotWorkdirRecord struct {
	ID              string
	BotID           string
	Name            string
	TargetKind      string
	RemoteBindingID string
	Path            string
	CreatedByUserID string
	ArchivedAt      time.Time
	CreatedAt       time.Time
	UpdatedAt       time.Time
}

BotWorkdirRecord is a named per-bot working directory: a workspace target (native, or a remote runtime binding) plus an absolute directory path. RemoteBindingID is empty for native workdirs. ArchivedAt is zero while the workdir is live.

type BotWorkdirStore

type BotWorkdirStore interface {
	CreateWorkdir(ctx context.Context, input CreateBotWorkdirInput) (BotWorkdirRecord, error)
	ListWorkdirs(ctx context.Context, botID string, includeArchived bool) ([]BotWorkdirRecord, error)
	// GetWorkdir returns archived rows too: sessions bound to an archived
	// workdir keep resolving their working directory. Callers that must
	// refuse archived workdirs check ArchivedAt themselves.
	GetWorkdir(ctx context.Context, botID, workdirID string) (BotWorkdirRecord, error)
	RenameWorkdir(ctx context.Context, botID, workdirID, name string) (BotWorkdirRecord, error)
	ArchiveWorkdir(ctx context.Context, botID, workdirID string) error
}

type ChannelConfigRepository

type ChannelConfigRepository interface {
	UpsertBotChannelConfig(ctx context.Context, input Input) (Record, error)
	DeleteBotChannelConfig(ctx context.Context, id ID) error
	UpdateBotChannelConfigDisabled(ctx context.Context, id ID, disabled bool) (Record, error)
	GetBotChannelConfig(ctx context.Context, botID ID, channelType string) (Record, error)
	ListBotChannelConfigsByType(ctx context.Context, channelType string) ([]Record, error)
	SaveMatrixSyncSinceToken(ctx context.Context, botID ID, token string) error
	UpsertUserChannelBinding(ctx context.Context, input Input) (Record, error)
	GetUserChannelBinding(ctx context.Context, userID ID, channelType string) (Record, error)
}

type ChannelIdentityRepository

type ChannelIdentityRepository interface {
	Create(ctx context.Context, input Input) (Record, error)
	GetByID(ctx context.Context, id ID) (Record, error)
	UpsertByChannelSubject(ctx context.Context, input Input) (Record, error)
	Search(ctx context.Context, filter Filter) ([]Record, error)
	GetUserByID(ctx context.Context, userID ID) (Record, error)
}

type ChannelRouteRepository

type ChannelRouteRepository interface {
	Create(ctx context.Context, input Input) (Record, error)
	Find(ctx context.Context, botID ID, platform string, conversationID string, threadID string) (Record, error)
	ResolveConversation(ctx context.Context, input Input) (Record, error)
	GetByID(ctx context.Context, routeID ID) (Record, error)
	List(ctx context.Context, filter Filter) ([]Record, error)
	Delete(ctx context.Context, routeID ID) error
	UpdateReplyTarget(ctx context.Context, routeID ID, target string) (Record, error)
	UpdateMetadata(ctx context.Context, routeID ID, metadata JSON) (Record, error)
}

type ContainerReader

type ContainerReader interface {
	GetContainerByBotID(ctx context.Context, botID ID) (Record, error)
}

type CreateAccountInput

type CreateAccountInput struct {
	UserID       string
	Username     string
	Email        string
	PasswordHash string
	Role         string
	DisplayName  string
	AvatarURL    string
	IsActive     bool
	DataRoot     string
}

type CreateBotWorkdirInput

type CreateBotWorkdirInput struct {
	BotID           string
	Name            string
	TargetKind      string
	RemoteBindingID string
	Path            string
	CreatedByUserID string
}

type CreateUserInput

type CreateUserInput struct {
	IsActive bool
	Metadata []byte
}

type CreateUserRuntimeInput

type CreateUserRuntimeInput struct {
	UserID   string
	Name     string
	APIToken string //nolint:gosec // owner-readable Remote Runtime credential by product design
}

type Filter

type Filter map[string]any

type HistoryTurn

type HistoryTurn struct {
	ID                 pgtype.UUID        `json:"id"`
	BotID              pgtype.UUID        `json:"bot_id"`
	SessionID          pgtype.UUID        `json:"session_id"`
	Position           int64              `json:"position"`
	RequestMessageID   pgtype.UUID        `json:"request_message_id"`
	AssistantMessageID pgtype.UUID        `json:"assistant_message_id"`
	SupersededByTurnID pgtype.UUID        `json:"superseded_by_turn_id"`
	SupersededAt       pgtype.Timestamptz `json:"superseded_at"`
	SupersededReason   string             `json:"superseded_reason"`
	CreatedAt          pgtype.Timestamptz `json:"created_at"`
	UpdatedAt          pgtype.Timestamptz `json:"updated_at"`
}

type ID

type ID string

type Input

type Input map[string]any

type JSON

type JSON []byte

type MCPConnectionStore

type MCPConnectionStore interface {
	ListByBot(ctx context.Context, botID ID) ([]Record, error)
	GetByID(ctx context.Context, id ID) (Record, error)
	Create(ctx context.Context, input Input) (Record, error)
	Update(ctx context.Context, id ID, input Patch) (Record, error)
	UpsertByName(ctx context.Context, input Input) (Record, error)
	Delete(ctx context.Context, id ID) error
	UpdateProbeResult(ctx context.Context, id ID, input Patch) error
}

type MCPOAuthStore

type MCPOAuthStore interface {
	UpsertDiscovery(ctx context.Context, input Input) (Record, error)
	GetToken(ctx context.Context, connectionID ID) (Record, error)
	GetTokenByState(ctx context.Context, state string) (Record, error)
	UpdatePKCEState(ctx context.Context, connectionID ID, input Patch) error
	UpdateClientSecret(ctx context.Context, connectionID ID, secret string) error
	UpdateTokens(ctx context.Context, connectionID ID, input Patch) error
	UpdateConnectionAuthType(ctx context.Context, connectionID ID, authType string) error
	ClearTokens(ctx context.Context, connectionID ID) error
}

type MemoryProviderStore

type MemoryProviderStore interface {
	Create(ctx context.Context, input Input) (Record, error)
	GetByID(ctx context.Context, id ID) (Record, error)
	GetDefault(ctx context.Context) (Record, error)
	List(ctx context.Context) ([]Record, error)
	Update(ctx context.Context, id ID, input Patch) (Record, error)
	Delete(ctx context.Context, id ID) error
}

type MessageRepository

type MessageRepository interface {
	Create(ctx context.Context, input Input) (Record, error)
	CreateAsset(ctx context.Context, input Input) (Record, error)
	ListByBot(ctx context.Context, filter Filter) ([]Record, error)
	ListBySession(ctx context.Context, sessionID ID, filter Filter) ([]Record, error)
	ListLatestBySession(ctx context.Context, sessionID ID, limit int32) ([]Record, error)
	ListBefore(ctx context.Context, sessionID ID, before string, limit int32) ([]Record, error)
	Search(ctx context.Context, filter Filter) ([]Record, error)
	DeleteByBot(ctx context.Context, botID ID) error
	DeleteBySession(ctx context.Context, sessionID ID) error
	ListAssetsBatch(ctx context.Context, messageIDs []ID) ([]Record, error)
}

type MessageSearch

type MessageSearch interface {
	SearchMessages(ctx context.Context, filter Filter) ([]Record, error)
}

type ModelStore

type ModelStore interface {
	Create(ctx context.Context, input Input) (Record, error)
	GetByID(ctx context.Context, modelID ID) (Record, error)
	GetByModelID(ctx context.Context, providerModelID string) ([]Record, error)
	List(ctx context.Context, filter Filter) ([]Record, error)
	ListByType(ctx context.Context, modelType string) ([]Record, error)
	ListByProviderID(ctx context.Context, providerID ID) ([]Record, error)
	ListEnabled(ctx context.Context, filter Filter) ([]Record, error)
	Update(ctx context.Context, modelID ID, input Patch) (Record, error)
	Delete(ctx context.Context, modelID ID) error
	Count(ctx context.Context, filter Filter) (int64, error)
	DeleteByProviderAndType(ctx context.Context, providerID ID, modelType string) error
}

type ObservedConversationStore

type ObservedConversationStore interface {
	ListByChannelIdentity(ctx context.Context, identityID ID) ([]Record, error)
	ListByChannelType(ctx context.Context, channelType string) ([]Record, error)
}

type Page

type Page struct {
	Limit  int32
	Offset int32
}

type Patch

type Patch map[string]any

type PipelineSessionEventRepository

type PipelineSessionEventRepository interface {
	InsertIdempotent(ctx context.Context, input Input) (ID, error)
	ListBySession(ctx context.Context, sessionID ID, filter Filter) ([]Record, error)
	CountBySession(ctx context.Context, sessionID ID) (int64, error)
}

type ProviderCredentialsReader

type ProviderCredentialsReader interface {
	GetProviderCredentials(ctx context.Context, providerID ID) (Record, error)
}

type ProviderOAuthStore

type ProviderOAuthStore interface {
	GetTokenByProvider(ctx context.Context, providerID ID) (Record, error)
	GetTokenByState(ctx context.Context, state string) (Record, error)
	UpdateOAuthState(ctx context.Context, providerID ID, state string) error
	UpsertToken(ctx context.Context, input Input) (Record, error)
	DeleteToken(ctx context.Context, providerID ID) error
}

type ProviderStore

type ProviderStore interface {
	Create(ctx context.Context, input Input) (Record, error)
	GetByID(ctx context.Context, providerID ID) (Record, error)
	GetByName(ctx context.Context, name string) (Record, error)
	GetByClientType(ctx context.Context, clientType string) (Record, error)
	List(ctx context.Context) ([]Record, error)
	Update(ctx context.Context, providerID ID, input Patch) (Record, error)
	Delete(ctx context.Context, providerID ID) error
	Count(ctx context.Context) (int64, error)
}

type Queries

type Queries interface {
	SaveSessionRunResumeContext(context.Context, dbsqlc.SaveSessionRunResumeContextParams) (int64, error)
	AcceptSessionRunDecisionContinuation(context.Context, dbsqlc.AcceptSessionRunDecisionContinuationParams) (dbsqlc.SessionRun, error)
	MarkSessionRunDecisionExecuting(context.Context, dbsqlc.MarkSessionRunDecisionExecutingParams) (int64, error)
	ListInterruptedSessionRuns(context.Context, pgtype.UUID) ([]dbsqlc.SessionRun, error)
	ListActiveSessionRunsByBot(ctx context.Context, botID pgtype.UUID) ([]dbsqlc.SessionRun, error)
	RetireSupersededInterruptedSessionRuns(context.Context) (int64, error)
	RetireInterruptedSessionRun(context.Context, pgtype.UUID) (int64, error)

	CreateAgentAuthorization(context.Context, dbsqlc.CreateAgentAuthorizationParams) (dbsqlc.AgentAuthorization, error)
	GetAgentAuthorization(context.Context, dbsqlc.GetAgentAuthorizationParams) (dbsqlc.AgentAuthorization, error)
	UpdateAgentAuthorization(context.Context, dbsqlc.UpdateAgentAuthorizationParams) (dbsqlc.AgentAuthorization, error)
	DeleteAgentAuthorization(context.Context, dbsqlc.DeleteAgentAuthorizationParams) error
	PruneAgentAuthorizations(context.Context) error
	CountAgentAuthorizations(context.Context, pgtype.UUID) (int64, error)
	LockAgentAuthorizationOwner(context.Context, string) error

	ClaimBotDependencyOperation(ctx context.Context, arg dbsqlc.ClaimBotDependencyOperationParams) (dbsqlc.BotDependencyInstallation, error)
	CancelBotWorkspaceRemoval(ctx context.Context, arg dbsqlc.CancelBotWorkspaceRemovalParams) (dbsqlc.BotWorkspace, error)
	ClaimBotWorkspace(ctx context.Context, arg dbsqlc.ClaimBotWorkspaceParams) (dbsqlc.BotWorkspace, error)
	ClaimBotWorkspaces(ctx context.Context, arg dbsqlc.ClaimBotWorkspacesParams) ([]dbsqlc.BotWorkspace, error)
	CountBotWorkspacesByObservedState(ctx context.Context) ([]dbsqlc.CountBotWorkspacesByObservedStateRow, error)
	GetBotWorkspace(ctx context.Context, botID pgtype.UUID) (dbsqlc.BotWorkspace, error)
	ListBotWorkspacesByObservedState(ctx context.Context, arg dbsqlc.ListBotWorkspacesByObservedStateParams) ([]dbsqlc.BotWorkspace, error)
	ReleaseBotWorkspaceLease(ctx context.Context, arg dbsqlc.ReleaseBotWorkspaceLeaseParams) (int64, error)
	RenewBotWorkspaceLease(ctx context.Context, arg dbsqlc.RenewBotWorkspaceLeaseParams) (int64, error)
	UpdateBotWorkspaceObserved(ctx context.Context, arg dbsqlc.UpdateBotWorkspaceObservedParams) (dbsqlc.BotWorkspace, error)
	UpsertBotWorkspaceIntent(ctx context.Context, arg dbsqlc.UpsertBotWorkspaceIntentParams) (dbsqlc.BotWorkspace, error)
	FinishBotDependencyOperation(ctx context.Context, arg dbsqlc.FinishBotDependencyOperationParams) (dbsqlc.BotDependencyInstallation, error)
	DeleteBotDependencyOperation(ctx context.Context, arg dbsqlc.DeleteBotDependencyOperationParams) (dbsqlc.BotDependencyInstallation, error)
	PruneWorkspaceDependencyDefinitions(ctx context.Context, sourceURL string) (int64, error)
	CreateAgentCredential(ctx context.Context, arg dbsqlc.CreateAgentCredentialParams) (dbsqlc.AgentCredential, error)
	GetAgentCredential(ctx context.Context, id pgtype.UUID) (dbsqlc.AgentCredential, error)
	GetBotAgentCredential(ctx context.Context, arg dbsqlc.GetBotAgentCredentialParams) (dbsqlc.GetBotAgentCredentialRow, error)
	SetBotAgentCredential(ctx context.Context, arg dbsqlc.SetBotAgentCredentialParams) (pgtype.UUID, error)
	ClearBotAgentCredential(ctx context.Context, arg dbsqlc.ClearBotAgentCredentialParams) (pgtype.UUID, error)
	CountBotAgentCredentialRefs(ctx context.Context, agentCredentialID pgtype.UUID) (int64, error)
	GetBotAgentRuntime(ctx context.Context, arg dbsqlc.GetBotAgentRuntimeParams) (string, error)
	RevokeAgentCredentialByID(ctx context.Context, id pgtype.UUID) (dbsqlc.AgentCredential, error)
	RevokeAgentCredentialsForBot(ctx context.Context, botID pgtype.UUID) error
	FinalizeSessionRun(ctx context.Context, arg dbsqlc.FinalizeSessionRunParams) (dbsqlc.SessionRun, error)
	AcquireProviderTemplateSyncLock(ctx context.Context) error
	ApproveToolApprovalRequest(ctx context.Context, arg dbsqlc.ApproveToolApprovalRequestParams) (dbsqlc.ToolApprovalRequest, error)
	BumpBotRuntimeConfigEpoch(ctx context.Context, botID pgtype.UUID) (int64, error)
	CancelToolApprovalRequest(ctx context.Context, arg dbsqlc.CancelToolApprovalRequestParams) (dbsqlc.ToolApprovalRequest, error)
	CancelPendingToolApprovalsByRun(ctx context.Context, arg dbsqlc.CancelPendingToolApprovalsByRunParams) ([]dbsqlc.ToolApprovalRequest, error)
	CancelPendingToolApprovalsBySession(ctx context.Context, arg dbsqlc.CancelPendingToolApprovalsBySessionParams) ([]dbsqlc.ToolApprovalRequest, error)
	CancelPendingUserInputsBySession(ctx context.Context, arg dbsqlc.CancelPendingUserInputsBySessionParams) ([]dbsqlc.UserInputRequest, error)
	CancelPendingUserInputsByRun(ctx context.Context, arg dbsqlc.CancelPendingUserInputsByRunParams) ([]dbsqlc.UserInputRequest, error)
	CancelUserInputRequest(ctx context.Context, arg dbsqlc.CancelUserInputRequestParams) (dbsqlc.UserInputRequest, error)
	ClearBotRuntimeData(ctx context.Context, botID pgtype.UUID) error
	ClearMCPOAuthTokens(ctx context.Context, connectionID pgtype.UUID) error
	CompleteCompactionLog(ctx context.Context, arg dbsqlc.CompleteCompactionLogParams) (dbsqlc.BotHistoryMessageCompact, error)
	CompleteScheduleLog(ctx context.Context, arg dbsqlc.CompleteScheduleLogParams) (dbsqlc.ScheduleLog, error)
	CountAccounts(ctx context.Context) (int64, error)
	CountCompactionLogsByBot(ctx context.Context, botID pgtype.UUID) (int64, error)
	CopyCompactionSummary(ctx context.Context, arg dbsqlc.CopyCompactionSummaryParams) (pgtype.UUID, error)
	ReleasePendingCompactionLogsBySession(ctx context.Context, arg dbsqlc.ReleasePendingCompactionLogsBySessionParams) error

	ClassifyHistoryCheckpointMessages(ctx context.Context, arg dbsqlc.ClassifyHistoryCheckpointMessagesParams) ([]dbsqlc.ClassifyHistoryCheckpointMessagesRow, error)
	CreateHistoryCheckpoint(ctx context.Context, arg dbsqlc.CreateHistoryCheckpointParams) (dbsqlc.BotHistoryCheckpoint, error)
	GetActiveHistoryCheckpoint(ctx context.Context, sessionID pgtype.UUID) (dbsqlc.BotHistoryCheckpoint, error)
	GetForkHistoryPosition(ctx context.Context, arg dbsqlc.GetForkHistoryPositionParams) (dbsqlc.GetForkHistoryPositionRow, error)
	GetHistoryCheckpoint(ctx context.Context, id pgtype.UUID) (dbsqlc.BotHistoryCheckpoint, error)
	GetHistoryCheckpointKeptBeforeTurn(ctx context.Context, arg dbsqlc.GetHistoryCheckpointKeptBeforeTurnParams) (dbsqlc.GetHistoryCheckpointKeptBeforeTurnRow, error)
	GetHistoryCheckpointKeptThroughTurn(ctx context.Context, arg dbsqlc.GetHistoryCheckpointKeptThroughTurnParams) (dbsqlc.BotHistoryCheckpoint, error)
	ListHistoryCheckpointCandidatesWithinBytes(ctx context.Context, arg dbsqlc.ListHistoryCheckpointCandidatesWithinBytesParams) ([]dbsqlc.ListHistoryCheckpointCandidatesWithinBytesRow, error)
	ListHistoryCheckpointSpanRows(ctx context.Context, arg dbsqlc.ListHistoryCheckpointSpanRowsParams) ([]dbsqlc.ListHistoryCheckpointSpanRowsRow, error)
	ListHistoryCheckpointSummaries(ctx context.Context, arg dbsqlc.ListHistoryCheckpointSummariesParams) ([]dbsqlc.ListHistoryCheckpointSummariesRow, error)
	ListHistoryMessagesByIDs(ctx context.Context, arg dbsqlc.ListHistoryMessagesByIDsParams) ([]dbsqlc.ListHistoryMessagesByIDsRow, error)
	ListHistoryWindow(ctx context.Context, arg dbsqlc.ListHistoryWindowParams) ([]dbsqlc.ListHistoryWindowRow, error)
	ListHistoryRowsBySources(ctx context.Context, arg dbsqlc.ListHistoryRowsBySourcesParams) ([]dbsqlc.ListHistoryRowsBySourcesRow, error)
	ListTurnResponseSourcesByIDs(ctx context.Context, arg dbsqlc.ListTurnResponseSourcesByIDsParams) ([]dbsqlc.ListTurnResponseSourcesByIDsRow, error)
	CountHistoryCheckpointCandidates(ctx context.Context, arg dbsqlc.CountHistoryCheckpointCandidatesParams) (int64, error)
	RewindHistoryCheckpointBeforeTurn(ctx context.Context, arg dbsqlc.RewindHistoryCheckpointBeforeTurnParams) (bool, error)
	SetHistoryCheckpoint(ctx context.Context, arg dbsqlc.SetHistoryCheckpointParams) (int64, error)
	CountMemoryProvidersByDefault(ctx context.Context) (int64, error)
	CountMessageAssetsByBot(ctx context.Context, botID pgtype.UUID) (int64, error)
	CountMessagesByBot(ctx context.Context, botID pgtype.UUID) (int64, error)
	CountMessagesBySession(ctx context.Context, sessionID pgtype.UUID) (int64, error)
	CountModels(ctx context.Context) (int64, error)
	CountModelsByType(ctx context.Context, type_ string) (int64, error)
	CountProviders(ctx context.Context) (int64, error)
	CountScheduleLogsByBot(ctx context.Context, botID pgtype.UUID) (int64, error)
	CountScheduleLogsBySchedule(ctx context.Context, scheduleID pgtype.UUID) (int64, error)
	CountSessionEvents(ctx context.Context, sessionID pgtype.UUID) (int64, error)
	NextSessionEventCursor(ctx context.Context) (int64, error)
	CountTokenUsageRecords(ctx context.Context, arg dbsqlc.CountTokenUsageRecordsParams) (int64, error)
	CreateMemoryUsage(ctx context.Context, arg dbsqlc.CreateMemoryUsageParams) error
	CreateAccount(ctx context.Context, arg dbsqlc.CreateAccountParams) (dbsqlc.CreateAccountRow, error)
	CreateBotAgent(ctx context.Context, arg dbsqlc.CreateBotAgentParams) (dbsqlc.BotAgent, error)
	CreateBot(ctx context.Context, arg dbsqlc.CreateBotParams) (dbsqlc.CreateBotRow, error)
	CreateBotACLRule(ctx context.Context, arg dbsqlc.CreateBotACLRuleParams) (dbsqlc.BotAclRule, error)
	CreateBotUserGrant(ctx context.Context, arg dbsqlc.CreateBotUserGrantParams) (dbsqlc.BotUserGrant, error)
	CreateConnector(ctx context.Context, arg dbsqlc.CreateConnectorParams) (dbsqlc.Connector, error)
	DeleteBotUserGrantByID(ctx context.Context, id pgtype.UUID) error
	UpsertBotChannelAdmin(ctx context.Context, arg dbsqlc.UpsertBotChannelAdminParams) (dbsqlc.BotChannelAdmin, error)
	DeleteBotChannelAdmin(ctx context.Context, arg dbsqlc.DeleteBotChannelAdminParams) error
	GetBotChannelAdmin(ctx context.Context, arg dbsqlc.GetBotChannelAdminParams) (dbsqlc.BotChannelAdmin, error)
	ListBotChannelAdmins(ctx context.Context, botID pgtype.UUID) ([]dbsqlc.ListBotChannelAdminsRow, error)
	CreateChannelLinkCode(ctx context.Context, arg dbsqlc.CreateChannelLinkCodeParams) (dbsqlc.ChannelLinkCode, error)
	GetChannelLinkCodeByToken(ctx context.Context, token string) (dbsqlc.ChannelLinkCode, error)
	MarkChannelLinkCodeConsumed(ctx context.Context, arg dbsqlc.MarkChannelLinkCodeConsumedParams) (dbsqlc.ChannelLinkCode, error)
	UpsertUserChannelIdentityBinding(ctx context.Context, arg dbsqlc.UpsertUserChannelIdentityBindingParams) (dbsqlc.UserChannelIdentityBinding, error)
	ListChannelIdentityBindings(ctx context.Context) ([]dbsqlc.ListChannelIdentityBindingsRow, error)
	ListChannelIdentityBindingsForUser(ctx context.Context, userID pgtype.UUID) ([]dbsqlc.ListChannelIdentityBindingsForUserRow, error)
	ListChannelIdentityBindingsForBot(ctx context.Context, botID pgtype.UUID) ([]dbsqlc.ListChannelIdentityBindingsForBotRow, error)
	DeleteUserChannelIdentityBinding(ctx context.Context, arg dbsqlc.DeleteUserChannelIdentityBindingParams) error
	ListUserIDsByChannelIdentity(ctx context.Context, channelIdentityID pgtype.UUID) ([]pgtype.UUID, error)
	LockBotForRuntimeReset(ctx context.Context, botID pgtype.UUID) (pgtype.UUID, error)
	GetBotUserGrantByID(ctx context.Context, id pgtype.UUID) (dbsqlc.BotUserGrant, error)
	ListBotUserGrants(ctx context.Context, botID pgtype.UUID) ([]dbsqlc.ListBotUserGrantsRow, error)
	ListBotUserGrantsForUser(ctx context.Context, arg dbsqlc.ListBotUserGrantsForUserParams) ([]dbsqlc.ListBotUserGrantsForUserRow, error)
	UpdateBotUserGrantPermissions(ctx context.Context, arg dbsqlc.UpdateBotUserGrantPermissionsParams) (dbsqlc.BotUserGrant, error)
	ValidateLockedBotRuntimeReset(ctx context.Context, arg dbsqlc.ValidateLockedBotRuntimeResetParams) (pgtype.UUID, error)
	ValidateLockedBotSessionRuntimeReset(ctx context.Context, arg dbsqlc.ValidateLockedBotSessionRuntimeResetParams) (pgtype.UUID, error)
	RefreshLockedBotRuntimeReset(ctx context.Context, arg dbsqlc.RefreshLockedBotRuntimeResetParams) (pgtype.Timestamptz, error)
	RefreshLockedBotSessionRuntimeReset(ctx context.Context, arg dbsqlc.RefreshLockedBotSessionRuntimeResetParams) (pgtype.Timestamptz, error)
	ListAccessibleBots(ctx context.Context, ownerUserID pgtype.UUID) ([]dbsqlc.ListAccessibleBotsRow, error)
	CreateChannelIdentity(ctx context.Context, arg dbsqlc.CreateChannelIdentityParams) (dbsqlc.ChannelIdentity, error)
	CreateChatRoute(ctx context.Context, arg dbsqlc.CreateChatRouteParams) (dbsqlc.CreateChatRouteRow, error)
	CreateCompactionLog(ctx context.Context, arg dbsqlc.CreateCompactionLogParams) (dbsqlc.BotHistoryMessageCompact, error)
	CreateContextLifecycle(ctx context.Context, arg dbsqlc.CreateContextLifecycleParams) (dbsqlc.CreateContextLifecycleRow, error)
	CreateFetchProvider(ctx context.Context, arg dbsqlc.CreateFetchProviderParams) (dbsqlc.FetchProvider, error)
	CreateMCPConnection(ctx context.Context, arg dbsqlc.CreateMCPConnectionParams) (dbsqlc.McpConnection, error)
	CreateMemoryProvider(ctx context.Context, arg dbsqlc.CreateMemoryProviderParams) (dbsqlc.MemoryProvider, error)
	CreateHistoryTurn(ctx context.Context, arg dbsqlc.CreateHistoryTurnParams) (HistoryTurn, error)
	// AllocateSessionTurnPosition draws the next slot from the session counter
	// without writing a row, so a turn can be named before it is persisted.
	AllocateSessionTurnPosition(ctx context.Context, sessionID pgtype.UUID) (int64, error)
	CreateHistoryTurnWithIDAtPosition(ctx context.Context, arg dbsqlc.CreateHistoryTurnWithIDAtPositionParams) (HistoryTurn, error)
	CreateMessage(ctx context.Context, arg dbsqlc.CreateMessageParams) (dbsqlc.CreateMessageRow, error)
	CreateMessageAsset(ctx context.Context, arg dbsqlc.CreateMessageAssetParams) (dbsqlc.CreateMessageAssetRow, error)
	CreateModel(ctx context.Context, arg dbsqlc.CreateModelParams) (dbsqlc.Model, error)
	CreateModelVariant(ctx context.Context, arg dbsqlc.CreateModelVariantParams) (dbsqlc.ModelVariant, error)
	CreateProvider(ctx context.Context, arg dbsqlc.CreateProviderParams) (dbsqlc.Provider, error)
	CreateProviderFromTemplate(ctx context.Context, arg dbsqlc.CreateProviderFromTemplateParams) (dbsqlc.Provider, error)
	CreateSchedule(ctx context.Context, arg dbsqlc.CreateScheduleParams) (dbsqlc.Schedule, error)
	CreateScheduleLog(ctx context.Context, arg dbsqlc.CreateScheduleLogParams) (dbsqlc.CreateScheduleLogRow, error)
	CreateSearchProvider(ctx context.Context, arg dbsqlc.CreateSearchProviderParams) (dbsqlc.SearchProvider, error)
	CreateSession(ctx context.Context, arg dbsqlc.CreateSessionParams) (dbsqlc.BotSession, error)
	ForkSessionFromAssistantTurn(ctx context.Context, arg dbsqlc.ForkSessionFromAssistantTurnParams) (dbsqlc.ForkSessionFromAssistantTurnRow, error)
	LockSessionForFork(ctx context.Context, sessionID pgtype.UUID) error
	CreateSessionEvent(ctx context.Context, arg dbsqlc.CreateSessionEventParams) (pgtype.UUID, error)
	CreateStorageProvider(ctx context.Context, arg dbsqlc.CreateStorageProviderParams) (dbsqlc.StorageProvider, error)
	CreateSubagentConfig(ctx context.Context, arg dbsqlc.CreateSubagentConfigParams) (dbsqlc.SubagentConfig, error)
	CreateSubagentForkContext(ctx context.Context, arg dbsqlc.CreateSubagentForkContextParams) (dbsqlc.CreateSubagentForkContextRow, error)
	CreateToolApprovalRequest(ctx context.Context, arg dbsqlc.CreateToolApprovalRequestParams) (dbsqlc.ToolApprovalRequest, error)
	CreateUserInputRequest(ctx context.Context, arg dbsqlc.CreateUserInputRequestParams) (dbsqlc.UserInputRequest, error)
	CreateUser(ctx context.Context, arg dbsqlc.CreateUserParams) (dbsqlc.CreateUserRow, error)
	DeleteBotACLRuleByID(ctx context.Context, id pgtype.UUID) error
	DeleteBotByID(ctx context.Context, id pgtype.UUID) error
	DeleteBotChannelConfig(ctx context.Context, arg dbsqlc.DeleteBotChannelConfigParams) error
	DeleteBotDependencyInstallation(ctx context.Context, arg dbsqlc.DeleteBotDependencyInstallationParams) (int64, error)
	GetBotAppInstallation(ctx context.Context, arg dbsqlc.GetBotAppInstallationParams) (dbsqlc.BotAppInstallation, error)
	GetBotAppInstallationByID(ctx context.Context, arg dbsqlc.GetBotAppInstallationByIDParams) (dbsqlc.BotAppInstallation, error)
	ListBotAppInstallations(ctx context.Context, botID pgtype.UUID) ([]dbsqlc.BotAppInstallation, error)
	UpsertBotAppInstallation(ctx context.Context, arg dbsqlc.UpsertBotAppInstallationParams) (dbsqlc.BotAppInstallation, error)
	UpdateBotAppInstallationStatus(ctx context.Context, arg dbsqlc.UpdateBotAppInstallationStatusParams) (dbsqlc.BotAppInstallation, error)
	UpdateBotAppInstallationRelease(ctx context.Context, arg dbsqlc.UpdateBotAppInstallationReleaseParams) (dbsqlc.BotAppInstallation, error)
	UpdateBotAppInstallationCheck(ctx context.Context, arg dbsqlc.UpdateBotAppInstallationCheckParams) (dbsqlc.BotAppInstallation, error)
	DeleteBotAppInstallation(ctx context.Context, arg dbsqlc.DeleteBotAppInstallationParams) (dbsqlc.BotAppInstallation, error)
	ListAppDependencyRefs(ctx context.Context, installationID pgtype.UUID) ([]dbsqlc.BotAppDependencyRef, error)
	ListAppDependencyRefsForBot(ctx context.Context, botID pgtype.UUID) ([]dbsqlc.ListAppDependencyRefsForBotRow, error)
	UpsertAppDependencyRef(ctx context.Context, arg dbsqlc.UpsertAppDependencyRefParams) (dbsqlc.BotAppDependencyRef, error)
	DeleteAppDependencyRef(ctx context.Context, arg dbsqlc.DeleteAppDependencyRefParams) (int64, error)
	ListAppConnectorRefs(ctx context.Context, installationID pgtype.UUID) ([]dbsqlc.BotAppConnectorRef, error)
	ListAppConnectorRefsForBot(ctx context.Context, botID pgtype.UUID) ([]dbsqlc.ListAppConnectorRefsForBotRow, error)
	UpsertAppConnectorRef(ctx context.Context, arg dbsqlc.UpsertAppConnectorRefParams) (dbsqlc.BotAppConnectorRef, error)
	SetAppConnectorRefConnection(ctx context.Context, arg dbsqlc.SetAppConnectorRefConnectionParams) (dbsqlc.BotAppConnectorRef, error)
	ClearAppConnectorRefConnection(ctx context.Context, connectionID string) (int64, error)
	DeleteAppConnectorRef(ctx context.Context, arg dbsqlc.DeleteAppConnectorRefParams) (int64, error)
	DeleteChatRoute(ctx context.Context, id pgtype.UUID) error
	DeleteContainerByBotID(ctx context.Context, botID pgtype.UUID) error
	DeleteFetchProvider(ctx context.Context, id pgtype.UUID) error
	DeleteMCPConnection(ctx context.Context, arg dbsqlc.DeleteMCPConnectionParams) error
	DeleteConnector(ctx context.Context, arg dbsqlc.DeleteConnectorParams) error
	DeleteMCPOAuthToken(ctx context.Context, connectionID pgtype.UUID) error
	DeleteMessageAssets(ctx context.Context, messageID pgtype.UUID) error
	ClearHistoryByBot(ctx context.Context, botID pgtype.UUID) error
	DeleteMessagesByIDs(ctx context.Context, ids []pgtype.UUID) error
	ClearHistoryBySession(ctx context.Context, sessionID pgtype.UUID) error
	DeleteModel(ctx context.Context, id pgtype.UUID) error
	DeleteModelByModelID(ctx context.Context, modelID string) error
	DeleteSessionDiscussCursorsByBot(ctx context.Context, botID pgtype.UUID) error
	DeleteSessionEventsByBot(ctx context.Context, botID pgtype.UUID) error
	DeleteModelByProviderAndType(ctx context.Context, arg dbsqlc.DeleteModelByProviderAndTypeParams) error
	DeleteModelByProviderIDAndModelID(ctx context.Context, arg dbsqlc.DeleteModelByProviderIDAndModelIDParams) error
	DeleteProvider(ctx context.Context, id pgtype.UUID) error
	DeleteProviderOAuthToken(ctx context.Context, providerID pgtype.UUID) error
	DeleteSchedule(ctx context.Context, id pgtype.UUID) error
	DisableSchedule(ctx context.Context, id pgtype.UUID) (dbsqlc.Schedule, error)
	DeleteScheduleLogsByBot(ctx context.Context, botID pgtype.UUID) error
	DeleteScheduleLogsBySchedule(ctx context.Context, scheduleID pgtype.UUID) error
	DeleteSearchProvider(ctx context.Context, id pgtype.UUID) error
	DeleteSettingsByBotID(ctx context.Context, id pgtype.UUID) error
	DeleteUserProviderOAuthToken(ctx context.Context, arg dbsqlc.DeleteUserProviderOAuthTokenParams) error
	EvaluateBotACLRule(ctx context.Context, arg dbsqlc.EvaluateBotACLRuleParams) (string, error)
	FailUserInputRequest(ctx context.Context, arg dbsqlc.FailUserInputRequestParams) (dbsqlc.UserInputRequest, error)
	FindChatRoute(ctx context.Context, arg dbsqlc.FindChatRouteParams) (dbsqlc.FindChatRouteRow, error)
	GetAccountByIdentity(ctx context.Context, identity pgtype.Text) (dbsqlc.TeamAccount, error)
	GetAccountByUserID(ctx context.Context, userID pgtype.UUID) (dbsqlc.TeamAccount, error)
	GetRuntimeConfigEpoch(ctx context.Context, arg dbsqlc.GetRuntimeConfigEpochParams) (dbsqlc.GetRuntimeConfigEpochRow, error)
	GetBotRuntimeReset(ctx context.Context, botID pgtype.UUID) (dbsqlc.GetBotRuntimeResetRow, error)
	GetRuntimeRoundOutcome(ctx context.Context, arg dbsqlc.GetRuntimeRoundOutcomeParams) (string, error)
	GetRuntimeLeadingUserMessageID(ctx context.Context, arg dbsqlc.GetRuntimeLeadingUserMessageIDParams) (pgtype.UUID, error)
	DeleteRuntimeDecisionProjectionsByRun(ctx context.Context, arg dbsqlc.DeleteRuntimeDecisionProjectionsByRunParams) (int64, error)
	GetBotACLDefaultEffect(ctx context.Context, id pgtype.UUID) (string, error)
	GetBotByID(ctx context.Context, id pgtype.UUID) (dbsqlc.GetBotByIDRow, error)
	GetBotByName(ctx context.Context, name string) (dbsqlc.GetBotByNameRow, error)
	GetBotByCreateRequestKey(ctx context.Context, arg dbsqlc.GetBotByCreateRequestKeyParams) (dbsqlc.GetBotByCreateRequestKeyRow, error)
	GetBotAgentByID(ctx context.Context, arg dbsqlc.GetBotAgentByIDParams) (dbsqlc.BotAgent, error)
	FindActiveBotAgentByRuntimeProvider(ctx context.Context, arg dbsqlc.FindActiveBotAgentByRuntimeProviderParams) (dbsqlc.BotAgent, error)
	ListBotAgents(ctx context.Context, botID pgtype.UUID) ([]dbsqlc.BotAgent, error)
	LockBotForAgentMutation(ctx context.Context, botID pgtype.UUID) (pgtype.UUID, error)
	UpdateBotAgent(ctx context.Context, arg dbsqlc.UpdateBotAgentParams) (dbsqlc.BotAgent, error)
	SoftDeleteBotAgent(ctx context.Context, arg dbsqlc.SoftDeleteBotAgentParams) (dbsqlc.BotAgent, error)
	BotAgentIsDefault(ctx context.Context, arg dbsqlc.BotAgentIsDefaultParams) (bool, error)
	GetBotChannelConfig(ctx context.Context, arg dbsqlc.GetBotChannelConfigParams) (dbsqlc.BotChannelConfig, error)
	GetBotChannelConfigByExternalIdentity(ctx context.Context, arg dbsqlc.GetBotChannelConfigByExternalIdentityParams) (dbsqlc.BotChannelConfig, error)
	GetBotOverlayConfig(ctx context.Context, id pgtype.UUID) (dbsqlc.GetBotOverlayConfigRow, error)
	GetBotDependencyInstallation(ctx context.Context, arg dbsqlc.GetBotDependencyInstallationParams) (dbsqlc.BotDependencyInstallation, error)
	GetWorkspaceDependencyDefinition(ctx context.Context, arg dbsqlc.GetWorkspaceDependencyDefinitionParams) (dbsqlc.GetWorkspaceDependencyDefinitionRow, error)
	FindWorkspaceDependencyIcon(ctx context.Context, arg dbsqlc.FindWorkspaceDependencyIconParams) (dbsqlc.FindWorkspaceDependencyIconRow, error)
	CacheWorkspaceDependencyDefinition(ctx context.Context, arg dbsqlc.CacheWorkspaceDependencyDefinitionParams) (int64, error)
	GetWorkspaceDependencyCatalog(ctx context.Context, sourceURL string) (dbsqlc.WorkspaceDependencyCatalog, error)
	CacheWorkspaceDependencyCatalog(ctx context.Context, arg dbsqlc.CacheWorkspaceDependencyCatalogParams) (int64, error)
	GetBotStorageBinding(ctx context.Context, botID pgtype.UUID) (dbsqlc.BotStorageBinding, error)
	GetHistoryTurnByID(ctx context.Context, arg dbsqlc.GetHistoryTurnByIDParams) (HistoryTurn, error)
	GetVisibleHistoryTurnByMessage(ctx context.Context, arg dbsqlc.GetVisibleHistoryTurnByMessageParams) (HistoryTurn, error)
	GetChannelIdentityByChannelSubject(ctx context.Context, arg dbsqlc.GetChannelIdentityByChannelSubjectParams) (dbsqlc.ChannelIdentity, error)
	GetChannelIdentityByID(ctx context.Context, id pgtype.UUID) (dbsqlc.ChannelIdentity, error)
	GetChannelIdentityByIDForUpdate(ctx context.Context, id pgtype.UUID) (dbsqlc.ChannelIdentity, error)
	GetChatRouteByID(ctx context.Context, id pgtype.UUID) (dbsqlc.GetChatRouteByIDRow, error)
	GetContainerByBotID(ctx context.Context, botID pgtype.UUID) (dbsqlc.Container, error)
	GetBotWorkspaceResourceLimits(ctx context.Context, botID pgtype.UUID) (dbsqlc.BotWorkspaceResourceLimit, error)
	GetBuiltinMemoryProvider(ctx context.Context) (dbsqlc.MemoryProvider, error)
	GetFetchProviderByID(ctx context.Context, id pgtype.UUID) (dbsqlc.FetchProvider, error)
	GetFetchProviderByName(ctx context.Context, name string) (dbsqlc.FetchProvider, error)
	GetContextLifecycleByRunID(ctx context.Context, runID pgtype.UUID) (dbsqlc.GetContextLifecycleByRunIDRow, error)
	GetContextLifecycleSelectionDecisionsByRunID(ctx context.Context, runID pgtype.UUID) ([]byte, error)
	GetLatestAssistantContextLifecycleMetadataByRunID(ctx context.Context, runID pgtype.UUID) ([]byte, error)
	GetLatestContextLifecycleBySession(ctx context.Context, sessionID pgtype.UUID) ([]byte, error)
	GetLatestAssistantUsage(ctx context.Context, sessionID pgtype.UUID) (int64, error)
	GetLatestVisibleHistoryTurnBySession(ctx context.Context, sessionID pgtype.UUID) (HistoryTurn, error)
	GetLatestPendingToolApprovalBySession(ctx context.Context, arg dbsqlc.GetLatestPendingToolApprovalBySessionParams) (dbsqlc.ToolApprovalRequest, error)
	GetLatestPendingUserInputBySession(ctx context.Context, arg dbsqlc.GetLatestPendingUserInputBySessionParams) (dbsqlc.UserInputRequest, error)
	GetLatestSessionModelID(ctx context.Context, sessionID pgtype.UUID) (pgtype.UUID, error)
	GetMessageByIDBySession(ctx context.Context, arg dbsqlc.GetMessageByIDBySessionParams) (dbsqlc.GetMessageByIDBySessionRow, error)
	GetLatestSessionIDByBot(ctx context.Context, botID pgtype.UUID) (pgtype.UUID, error)
	GetSessionRun(ctx context.Context, runID pgtype.UUID) (dbsqlc.SessionRun, error)
	GetMCPConnectionByID(ctx context.Context, arg dbsqlc.GetMCPConnectionByIDParams) (dbsqlc.McpConnection, error)
	GetConnectorByConnectionID(ctx context.Context, arg dbsqlc.GetConnectorByConnectionIDParams) (dbsqlc.Connector, error)
	GetMCPOAuthToken(ctx context.Context, connectionID pgtype.UUID) (dbsqlc.McpOauthToken, error)
	GetMCPOAuthTokenByState(ctx context.Context, stateParam string) (dbsqlc.McpOauthToken, error)
	GetMemoryProviderByID(ctx context.Context, id pgtype.UUID) (dbsqlc.MemoryProvider, error)
	GetModelByID(ctx context.Context, id pgtype.UUID) (dbsqlc.Model, error)
	GetModelByModelID(ctx context.Context, modelID string) (dbsqlc.Model, error)
	GetModelByProviderAndModelID(ctx context.Context, arg dbsqlc.GetModelByProviderAndModelIDParams) (dbsqlc.Model, error)
	GetPendingToolApprovalByReplyMessage(ctx context.Context, arg dbsqlc.GetPendingToolApprovalByReplyMessageParams) (dbsqlc.ToolApprovalRequest, error)
	GetPendingToolApprovalBySessionShortID(ctx context.Context, arg dbsqlc.GetPendingToolApprovalBySessionShortIDParams) (dbsqlc.ToolApprovalRequest, error)
	GetPendingUserInputByReplyMessage(ctx context.Context, arg dbsqlc.GetPendingUserInputByReplyMessageParams) (dbsqlc.UserInputRequest, error)
	GetPendingUserInputBySessionShortID(ctx context.Context, arg dbsqlc.GetPendingUserInputBySessionShortIDParams) (dbsqlc.UserInputRequest, error)
	GetProviderByClientType(ctx context.Context, clientType string) (dbsqlc.Provider, error)
	GetProviderByID(ctx context.Context, id pgtype.UUID) (dbsqlc.Provider, error)
	GetProviderTemplateByID(ctx context.Context, id pgtype.UUID) (dbsqlc.TemplateProviderTemplate, error)
	GetProviderByName(ctx context.Context, name string) (dbsqlc.Provider, error)
	GetProviderOAuthTokenByProvider(ctx context.Context, providerID pgtype.UUID) (dbsqlc.ProviderOauthToken, error)
	GetProviderOAuthTokenByState(ctx context.Context, state string) (dbsqlc.ProviderOauthToken, error)
	GetScheduleByID(ctx context.Context, id pgtype.UUID) (dbsqlc.Schedule, error)
	GetSearchProviderByID(ctx context.Context, id pgtype.UUID) (dbsqlc.SearchProvider, error)
	GetSearchProviderByName(ctx context.Context, name string) (dbsqlc.SearchProvider, error)
	GetSessionByID(ctx context.Context, id pgtype.UUID) (dbsqlc.BotSession, error)
	GetTurnAgentTurnID(ctx context.Context, arg dbsqlc.GetTurnAgentTurnIDParams) (string, error)
	SetRoundAgentTurnID(ctx context.Context, arg dbsqlc.SetRoundAgentTurnIDParams) (int64, error)
	LockSessionForCommitReconciliation(ctx context.Context, arg dbsqlc.LockSessionForCommitReconciliationParams) (pgtype.UUID, error)
	GetSessionDiscussCursor(ctx context.Context, arg dbsqlc.GetSessionDiscussCursorParams) (dbsqlc.BotSessionDiscussCursor, error)
	GetSessionCacheStats(ctx context.Context, sessionID pgtype.UUID) (dbsqlc.GetSessionCacheStatsRow, error)
	GetSessionUsedSkills(ctx context.Context, sessionID pgtype.UUID) ([]string, error)
	GetSettingsByBotID(ctx context.Context, id pgtype.UUID) (dbsqlc.GetSettingsByBotIDRow, error)
	GetSnapshotByContainerAndRuntimeName(ctx context.Context, arg dbsqlc.GetSnapshotByContainerAndRuntimeNameParams) (dbsqlc.Snapshot, error)
	GetSpeechModelWithProvider(ctx context.Context, id pgtype.UUID) (dbsqlc.GetSpeechModelWithProviderRow, error)
	GetStorageProviderByID(ctx context.Context, id pgtype.UUID) (dbsqlc.StorageProvider, error)
	GetSubagentConfig(ctx context.Context, sessionID pgtype.UUID) (dbsqlc.SubagentConfig, error)
	GetStorageProviderByName(ctx context.Context, name string) (dbsqlc.StorageProvider, error)
	GetTokenUsageByDayAndType(ctx context.Context, arg dbsqlc.GetTokenUsageByDayAndTypeParams) ([]dbsqlc.GetTokenUsageByDayAndTypeRow, error)
	GetTokenUsageByModel(ctx context.Context, arg dbsqlc.GetTokenUsageByModelParams) ([]dbsqlc.GetTokenUsageByModelRow, error)
	GetMemoryTokenUsageByDay(ctx context.Context, arg dbsqlc.GetMemoryTokenUsageByDayParams) ([]dbsqlc.GetMemoryTokenUsageByDayRow, error)
	GetMemoryTokenUsageByModel(ctx context.Context, arg dbsqlc.GetMemoryTokenUsageByModelParams) ([]dbsqlc.GetMemoryTokenUsageByModelRow, error)
	GetToolApprovalRequest(ctx context.Context, id pgtype.UUID) (dbsqlc.ToolApprovalRequest, error)
	ListPendingToolApprovalsByRun(ctx context.Context, runID pgtype.UUID) ([]dbsqlc.ToolApprovalRequest, error)
	ListToolApprovalsByRun(ctx context.Context, runID pgtype.UUID) ([]dbsqlc.ToolApprovalRequest, error)
	GetUserInputRequest(ctx context.Context, id pgtype.UUID) (dbsqlc.UserInputRequest, error)
	GetInteractiveUserInputRequest(ctx context.Context, arg dbsqlc.GetInteractiveUserInputRequestParams) (dbsqlc.UserInputRequest, error)
	ListPendingUserInputsByRun(ctx context.Context, runID pgtype.UUID) ([]dbsqlc.UserInputRequest, error)
	ListUserInputsByRun(ctx context.Context, runID pgtype.UUID) ([]dbsqlc.UserInputRequest, error)
	ReclaimWaitingDecisionSessionRun(ctx context.Context, arg dbsqlc.ReclaimWaitingDecisionSessionRunParams) (dbsqlc.SessionRun, error)
	GetRespondableUserInputRequest(ctx context.Context, arg dbsqlc.GetRespondableUserInputRequestParams) (dbsqlc.UserInputRequest, error)
	GetUserInputRequestBySessionToolCall(ctx context.Context, arg dbsqlc.GetUserInputRequestBySessionToolCallParams) (dbsqlc.UserInputRequest, error)
	GetTranscriptionModelWithProvider(ctx context.Context, id pgtype.UUID) (dbsqlc.GetTranscriptionModelWithProviderRow, error)
	GetUserByID(ctx context.Context, id pgtype.UUID) (dbsqlc.User, error)
	GetVideoModelWithProvider(ctx context.Context, id pgtype.UUID) (dbsqlc.GetVideoModelWithProviderRow, error)
	GetUserChannelBinding(ctx context.Context, arg dbsqlc.GetUserChannelBindingParams) (dbsqlc.UserChannelBinding, error)
	GetUserProviderOAuthToken(ctx context.Context, arg dbsqlc.GetUserProviderOAuthTokenParams) (dbsqlc.UserProviderOauthToken, error)
	GetUserProviderOAuthTokenByState(ctx context.Context, state string) (dbsqlc.UserProviderOauthToken, error)
	GetVersionSnapshotRuntimeName(ctx context.Context, arg dbsqlc.GetVersionSnapshotRuntimeNameParams) (string, error)
	IncrementScheduleCalls(ctx context.Context, id pgtype.UUID) (dbsqlc.Schedule, error)
	InsertLifecycleEvent(ctx context.Context, arg dbsqlc.InsertLifecycleEventParams) error
	InsertVersion(ctx context.Context, arg dbsqlc.InsertVersionParams) (dbsqlc.ContainerVersion, error)
	ListAccounts(ctx context.Context) ([]dbsqlc.TeamAccount, error)
	ListAutoStartContainers(ctx context.Context) ([]dbsqlc.Container, error)
	ListBotACLRules(ctx context.Context, botID pgtype.UUID) ([]dbsqlc.ListBotACLRulesRow, error)
	ListBotChannelConfigsByType(ctx context.Context, channelType string) ([]dbsqlc.BotChannelConfig, error)
	ListBotsByOwner(ctx context.Context, ownerUserID pgtype.UUID) ([]dbsqlc.ListBotsByOwnerRow, error)
	ListChatRouteThreadProjectionsByIDs(ctx context.Context, arg dbsqlc.ListChatRouteThreadProjectionsByIDsParams) ([]dbsqlc.ListChatRouteThreadProjectionsByIDsRow, error)
	ListChatRoutes(ctx context.Context, chatID pgtype.UUID) ([]dbsqlc.ListChatRoutesRow, error)
	ListCompactionLogsByBot(ctx context.Context, arg dbsqlc.ListCompactionLogsByBotParams) ([]dbsqlc.BotHistoryMessageCompact, error)
	ListFetchProviders(ctx context.Context) ([]dbsqlc.FetchProvider, error)
	ListFetchProvidersByProvider(ctx context.Context, provider string) ([]dbsqlc.FetchProvider, error)
	ListEnabledModels(ctx context.Context) ([]dbsqlc.Model, error)
	ListEnabledModelsByProviderClientType(ctx context.Context, clientType string) ([]dbsqlc.Model, error)
	ListEnabledModelsByType(ctx context.Context, type_ string) ([]dbsqlc.Model, error)
	ListEnabledSchedules(ctx context.Context) ([]dbsqlc.Schedule, error)
	ListBotDependencyInstallations(ctx context.Context, botID pgtype.UUID) ([]dbsqlc.BotDependencyInstallation, error)
	ListBotDependencyInstallationsByStatus(ctx context.Context, status string) ([]dbsqlc.BotDependencyInstallation, error)
	ListStaleBotDependencyOperations(ctx context.Context, olderThanSeconds float64) ([]dbsqlc.BotDependencyInstallation, error)
	ListMCPConnectionsByBotID(ctx context.Context, botID pgtype.UUID) ([]dbsqlc.McpConnection, error)
	ListConnectorsByBotID(ctx context.Context, botID pgtype.UUID) ([]dbsqlc.Connector, error)
	ListMemoryProviders(ctx context.Context) ([]dbsqlc.MemoryProvider, error)
	ListMessageAssets(ctx context.Context, messageID pgtype.UUID) ([]dbsqlc.ListMessageAssetsRow, error)
	ListMessageAssetsBatch(ctx context.Context, messageIds []pgtype.UUID) ([]dbsqlc.ListMessageAssetsBatchRow, error)
	AppendMessageToHistoryTurnByRequest(ctx context.Context, arg dbsqlc.AppendMessageToHistoryTurnByRequestParams) (pgtype.UUID, error)
	AppendMessageToLatestHistoryTurn(ctx context.Context, arg dbsqlc.AppendMessageToLatestHistoryTurnParams) (pgtype.UUID, error)
	BindHistoryTurnAssistantByRequest(ctx context.Context, arg dbsqlc.BindHistoryTurnAssistantByRequestParams) (HistoryTurn, error)
	BindLatestHistoryTurnAssistant(ctx context.Context, arg dbsqlc.BindLatestHistoryTurnAssistantParams) (HistoryTurn, error)
	LinkMessageToHistoryTurn(ctx context.Context, arg dbsqlc.LinkMessageToHistoryTurnParams) (pgtype.UUID, error)
	LinkUnassignedMessagesAfterHistoryTurnAssistant(ctx context.Context, turnID pgtype.UUID) error
	HideMessagesByHistoryTurn(ctx context.Context, turnID pgtype.UUID) error
	ListAllMessagesForBackup(ctx context.Context, botID pgtype.UUID) ([]dbsqlc.ListAllMessagesForBackupRow, error)
	ListAllProviderTemplateModels(ctx context.Context, providerTemplateID pgtype.UUID) ([]dbsqlc.TemplateProviderTemplateModel, error)
	ListAllProviderTemplates(ctx context.Context) ([]dbsqlc.TemplateProviderTemplate, error)
	ListHistoryTurnsByBot(ctx context.Context, botID pgtype.UUID) ([]HistoryTurn, error)
	ListMessages(ctx context.Context, botID pgtype.UUID) ([]dbsqlc.ListMessagesRow, error)
	GetMessageByExternalIDBySession(ctx context.Context, arg dbsqlc.GetMessageByExternalIDBySessionParams) (dbsqlc.GetMessageByExternalIDBySessionRow, error)
	GetLocatedMessageByExternalIDBySession(ctx context.Context, arg dbsqlc.GetLocatedMessageByExternalIDBySessionParams) (dbsqlc.GetLocatedMessageByExternalIDBySessionRow, error)
	GetVisibleMessageCursorByExternalIDBySession(ctx context.Context, arg dbsqlc.GetVisibleMessageCursorByExternalIDBySessionParams) (dbsqlc.GetVisibleMessageCursorByExternalIDBySessionRow, error)
	GetVisibleMessageCursorByIDBySession(ctx context.Context, arg dbsqlc.GetVisibleMessageCursorByIDBySessionParams) (dbsqlc.GetVisibleMessageCursorByIDBySessionRow, error)
	LocateMessagesWindowByExternalIDBySession(ctx context.Context, arg dbsqlc.LocateMessagesWindowByExternalIDBySessionParams) ([]dbsqlc.LocateMessagesWindowByExternalIDBySessionRow, error)
	ListMessagesAfterBySession(ctx context.Context, arg dbsqlc.ListMessagesAfterBySessionParams) ([]dbsqlc.ListMessagesAfterBySessionRow, error)
	ListMessagesAfterCursorBySession(ctx context.Context, arg dbsqlc.ListMessagesAfterCursorBySessionParams) ([]dbsqlc.ListMessagesAfterCursorBySessionRow, error)
	ListMessagesAfterMessageBySession(ctx context.Context, arg dbsqlc.ListMessagesAfterMessageBySessionParams) ([]dbsqlc.ListMessagesAfterMessageBySessionRow, error)
	ListMessagesBeforeBySession(ctx context.Context, arg dbsqlc.ListMessagesBeforeBySessionParams) ([]dbsqlc.ListMessagesBeforeBySessionRow, error)
	ListMessagesBeforeCursorBySession(ctx context.Context, arg dbsqlc.ListMessagesBeforeCursorBySessionParams) ([]dbsqlc.ListMessagesBeforeCursorBySessionRow, error)
	ListRunHistoryTurnRequestMessageIDs(ctx context.Context, arg dbsqlc.ListRunHistoryTurnRequestMessageIDsParams) ([]pgtype.UUID, error)
	ListMessagesBySession(ctx context.Context, sessionID pgtype.UUID) ([]dbsqlc.ListMessagesBySessionRow, error)
	ListSubagentForkContext(ctx context.Context, sessionID pgtype.UUID) ([]dbsqlc.ListSubagentForkContextRow, error)
	ListMessagesLatest(ctx context.Context, arg dbsqlc.ListMessagesLatestParams) ([]dbsqlc.ListMessagesLatestRow, error)
	ListMessagesLatestBySession(ctx context.Context, arg dbsqlc.ListMessagesLatestBySessionParams) ([]dbsqlc.ListMessagesLatestBySessionRow, error)
	ListMessagesLatestUIBySession(ctx context.Context, arg dbsqlc.ListMessagesLatestUIBySessionParams) ([]dbsqlc.ListMessagesLatestUIBySessionRow, error)
	ListMessagesSinceBySession(ctx context.Context, arg dbsqlc.ListMessagesSinceBySessionParams) ([]dbsqlc.ListMessagesSinceBySessionRow, error)
	ListVisibleMessagesFromBySession(ctx context.Context, arg dbsqlc.ListVisibleMessagesFromBySessionParams) ([]dbsqlc.ListVisibleMessagesFromBySessionRow, error)
	ListModels(ctx context.Context) ([]dbsqlc.Model, error)
	ListModelsByModelID(ctx context.Context, modelID string) ([]dbsqlc.Model, error)
	ListModelsByProviderClientType(ctx context.Context, clientType string) ([]dbsqlc.Model, error)
	ListModelsByProviderID(ctx context.Context, providerID pgtype.UUID) ([]dbsqlc.Model, error)
	ListModelsByProviderIDAndType(ctx context.Context, arg dbsqlc.ListModelsByProviderIDAndTypeParams) ([]dbsqlc.Model, error)
	ListModelsByType(ctx context.Context, type_ string) ([]dbsqlc.Model, error)
	ListModelVariantsByModelUUID(ctx context.Context, modelUuid pgtype.UUID) ([]dbsqlc.ModelVariant, error)
	ListObservedConversationsByChannelIdentity(ctx context.Context, arg dbsqlc.ListObservedConversationsByChannelIdentityParams) ([]dbsqlc.ListObservedConversationsByChannelIdentityRow, error)
	ListObservedConversationsByChannelType(ctx context.Context, arg dbsqlc.ListObservedConversationsByChannelTypeParams) ([]dbsqlc.ListObservedConversationsByChannelTypeRow, error)
	ListPendingToolApprovalsBySession(ctx context.Context, arg dbsqlc.ListPendingToolApprovalsBySessionParams) ([]dbsqlc.ToolApprovalRequest, error)
	ListPendingUserInputsBySession(ctx context.Context, arg dbsqlc.ListPendingUserInputsBySessionParams) ([]dbsqlc.UserInputRequest, error)
	ListProviders(ctx context.Context) ([]dbsqlc.Provider, error)
	ListProviderTemplateModels(ctx context.Context, providerTemplateID pgtype.UUID) ([]dbsqlc.TemplateProviderTemplateModel, error)
	ListProviderTemplates(ctx context.Context, domain string) ([]dbsqlc.ListProviderTemplatesRow, error)
	ListRecentAssistantMessagesBySession(ctx context.Context, arg dbsqlc.ListRecentAssistantMessagesBySessionParams) ([]dbsqlc.ListRecentAssistantMessagesBySessionRow, error)
	HasUnmaterializedContextLifecycleMetadataBySession(ctx context.Context, sessionID pgtype.UUID) (bool, error)
	ListRecentContextLifecyclesBySession(ctx context.Context, arg dbsqlc.ListRecentContextLifecyclesBySessionParams) ([]dbsqlc.ListRecentContextLifecyclesBySessionRow, error)
	ListScheduleLogsByBot(ctx context.Context, arg dbsqlc.ListScheduleLogsByBotParams) ([]dbsqlc.ListScheduleLogsByBotRow, error)
	ListScheduleLogsBySchedule(ctx context.Context, arg dbsqlc.ListScheduleLogsByScheduleParams) ([]dbsqlc.ListScheduleLogsByScheduleRow, error)
	ListScheduleRunSessions(ctx context.Context, arg dbsqlc.ListScheduleRunSessionsParams) ([]dbsqlc.ListScheduleRunSessionsRow, error)
	ListSchedulesByBot(ctx context.Context, botID pgtype.UUID) ([]dbsqlc.Schedule, error)
	ListSearchProviders(ctx context.Context) ([]dbsqlc.SearchProvider, error)
	ListSearchProvidersByProvider(ctx context.Context, provider string) ([]dbsqlc.SearchProvider, error)
	ListSessionDiscussCursorsByBot(ctx context.Context, botID pgtype.UUID) ([]dbsqlc.BotSessionDiscussCursor, error)
	ListSessionEventsByBot(ctx context.Context, botID pgtype.UUID) ([]dbsqlc.BotSessionEvent, error)
	ListSessionEventsBySession(ctx context.Context, sessionID pgtype.UUID) ([]dbsqlc.BotSessionEvent, error)
	ListSessionEventsBySessionAfter(ctx context.Context, arg dbsqlc.ListSessionEventsBySessionAfterParams) ([]dbsqlc.BotSessionEvent, error)
	ListSessionsByBot(ctx context.Context, botID pgtype.UUID) ([]dbsqlc.ListSessionsByBotRow, error)
	ListSessionsByBotAndCreatedByUser(ctx context.Context, arg dbsqlc.ListSessionsByBotAndCreatedByUserParams) ([]dbsqlc.ListSessionsByBotAndCreatedByUserRow, error)
	ListSessionsByBotAndCreatedByUserPaged(ctx context.Context, arg dbsqlc.ListSessionsByBotAndCreatedByUserPagedParams) ([]dbsqlc.ListSessionsByBotAndCreatedByUserPagedRow, error)
	ListSessionsByBotPaged(ctx context.Context, arg dbsqlc.ListSessionsByBotPagedParams) ([]dbsqlc.ListSessionsByBotPagedRow, error)
	ListSessionsByRoute(ctx context.Context, routeID pgtype.UUID) ([]dbsqlc.BotSession, error)
	ListSnapshotsByContainerID(ctx context.Context, containerID string) ([]dbsqlc.Snapshot, error)
	ListSnapshotsWithVersionByContainerID(ctx context.Context, containerID string) ([]dbsqlc.ListSnapshotsWithVersionByContainerIDRow, error)
	ListSpeechModels(ctx context.Context) ([]dbsqlc.ListSpeechModelsRow, error)
	ListSpeechModelsByProviderID(ctx context.Context, providerID pgtype.UUID) ([]dbsqlc.Model, error)
	ListSpeechProviders(ctx context.Context) ([]dbsqlc.Provider, error)
	ListStorageProviders(ctx context.Context) ([]dbsqlc.StorageProvider, error)
	ListSessionEventsBySessionPageBeforeWithinBytes(ctx context.Context, arg dbsqlc.ListSessionEventsBySessionPageBeforeWithinBytesParams) ([]dbsqlc.ListSessionEventsBySessionPageBeforeWithinBytesRow, error)
	ListSubagentSessionsByParent(ctx context.Context, parentSessionID pgtype.UUID) ([]dbsqlc.BotSession, error)
	ListTerminalSessionRunsNeedingContextLifecycle(ctx context.Context, batchSize int32) ([]dbsqlc.ListTerminalSessionRunsNeedingContextLifecycleRow, error)
	ListTokenUsageRecords(ctx context.Context, arg dbsqlc.ListTokenUsageRecordsParams) ([]dbsqlc.ListTokenUsageRecordsRow, error)
	ListToolApprovalsBySession(ctx context.Context, arg dbsqlc.ListToolApprovalsBySessionParams) ([]dbsqlc.ToolApprovalRequest, error)
	ListToolApprovalsBySessionToolCalls(ctx context.Context, arg dbsqlc.ListToolApprovalsBySessionToolCallsParams) ([]dbsqlc.ToolApprovalRequest, error)
	ListToolApprovalsByBotIDs(ctx context.Context, arg dbsqlc.ListToolApprovalsByBotIDsParams) ([]dbsqlc.ToolApprovalRequest, error)
	ListUserInputsBySession(ctx context.Context, arg dbsqlc.ListUserInputsBySessionParams) ([]dbsqlc.UserInputRequest, error)
	ListUserInputsBySessionToolCalls(ctx context.Context, arg dbsqlc.ListUserInputsBySessionToolCallsParams) ([]dbsqlc.UserInputRequest, error)
	ListUserInputsByBotIDs(ctx context.Context, arg dbsqlc.ListUserInputsByBotIDsParams) ([]dbsqlc.UserInputRequest, error)
	ListTranscriptionModels(ctx context.Context) ([]dbsqlc.ListTranscriptionModelsRow, error)
	ListTranscriptionModelsByProviderID(ctx context.Context, providerID pgtype.UUID) ([]dbsqlc.Model, error)
	ListTranscriptionProviders(ctx context.Context) ([]dbsqlc.Provider, error)
	ListVideoModels(ctx context.Context) ([]dbsqlc.ListVideoModelsRow, error)
	ListVideoModelsByProviderID(ctx context.Context, providerID pgtype.UUID) ([]dbsqlc.Model, error)
	ListVideoProviders(ctx context.Context) ([]dbsqlc.Provider, error)
	ListUserChannelBindingsByPlatform(ctx context.Context, channelType string) ([]dbsqlc.UserChannelBinding, error)
	ListVersionsByContainerID(ctx context.Context, containerID string) ([]dbsqlc.ListVersionsByContainerIDRow, error)
	NextVersion(ctx context.Context, containerID string) (int32, error)
	RejectToolApprovalRequest(ctx context.Context, arg dbsqlc.RejectToolApprovalRequestParams) (dbsqlc.ToolApprovalRequest, error)
	RedeemChannelLinkCode(ctx context.Context, arg dbsqlc.RedeemChannelLinkCodeParams) (dbsqlc.UserChannelIdentityBinding, error)
	SaveMatrixSyncSinceToken(ctx context.Context, arg dbsqlc.SaveMatrixSyncSinceTokenParams) (int64, error)
	SearchAccounts(ctx context.Context, arg dbsqlc.SearchAccountsParams) ([]dbsqlc.TeamAccount, error)
	SearchChannelIdentities(ctx context.Context, arg dbsqlc.SearchChannelIdentitiesParams) ([]dbsqlc.ChannelIdentity, error)
	SearchMessages(ctx context.Context, arg dbsqlc.SearchMessagesParams) ([]dbsqlc.SearchMessagesRow, error)
	SetBotACLDefaultEffect(ctx context.Context, arg dbsqlc.SetBotACLDefaultEffectParams) error
	SetRouteActiveSession(ctx context.Context, arg dbsqlc.SetRouteActiveSessionParams) error
	SetSessionNextTurnPosition(ctx context.Context, arg dbsqlc.SetSessionNextTurnPositionParams) error
	SoftDeleteSession(ctx context.Context, id pgtype.UUID) error
	SoftDeleteSessionsByBot(ctx context.Context, botID pgtype.UUID) error
	SubmitUserInputRequest(ctx context.Context, arg dbsqlc.SubmitUserInputRequestParams) (dbsqlc.UserInputRequest, error)
	TouchBotActivity(ctx context.Context, botID pgtype.UUID) error
	TouchSession(ctx context.Context, id pgtype.UUID) error
	UpdateAccountAdmin(ctx context.Context, arg dbsqlc.UpdateAccountAdminParams) (dbsqlc.UpdateAccountAdminRow, error)
	UpdateAccountLastLogin(ctx context.Context, userID pgtype.UUID) (pgtype.UUID, error)
	UpdateAccountPassword(ctx context.Context, arg dbsqlc.UpdateAccountPasswordParams) (pgtype.UUID, error)
	UpdateAccountProfile(ctx context.Context, arg dbsqlc.UpdateAccountProfileParams) (dbsqlc.UpdateAccountProfileRow, error)
	UpdateBotACLRule(ctx context.Context, arg dbsqlc.UpdateBotACLRuleParams) (dbsqlc.BotAclRule, error)
	UpdateBotChannelConfigDisabled(ctx context.Context, arg dbsqlc.UpdateBotChannelConfigDisabledParams) (dbsqlc.BotChannelConfig, error)
	UpdateBotOwner(ctx context.Context, arg dbsqlc.UpdateBotOwnerParams) (dbsqlc.UpdateBotOwnerRow, error)
	UpdateBotProfile(ctx context.Context, arg dbsqlc.UpdateBotProfileParams) (dbsqlc.UpdateBotProfileRow, error)
	UpdateBotStatus(ctx context.Context, arg dbsqlc.UpdateBotStatusParams) error
	UpdateChatRouteMetadata(ctx context.Context, arg dbsqlc.UpdateChatRouteMetadataParams) error
	UpdateChatRouteReplyTarget(ctx context.Context, arg dbsqlc.UpdateChatRouteReplyTargetParams) error
	UpdateContainerStarted(ctx context.Context, botID pgtype.UUID) error
	UpdateContainerStatus(ctx context.Context, arg dbsqlc.UpdateContainerStatusParams) error
	UpdateContainerStopped(ctx context.Context, botID pgtype.UUID) error
	UpdateFetchProvider(ctx context.Context, arg dbsqlc.UpdateFetchProviderParams) (dbsqlc.FetchProvider, error)
	UpdateMCPConnection(ctx context.Context, arg dbsqlc.UpdateMCPConnectionParams) (dbsqlc.McpConnection, error)
	UpdateMCPConnectionActive(ctx context.Context, arg dbsqlc.UpdateMCPConnectionActiveParams) error
	UpdateMCPConnectionAuthType(ctx context.Context, arg dbsqlc.UpdateMCPConnectionAuthTypeParams) error
	UpdateMCPConnectionProbeResult(ctx context.Context, arg dbsqlc.UpdateMCPConnectionProbeResultParams) error
	UpdateConnectorEnabled(ctx context.Context, arg dbsqlc.UpdateConnectorEnabledParams) (int64, error)
	UpdateMCPOAuthClientSecret(ctx context.Context, arg dbsqlc.UpdateMCPOAuthClientSecretParams) error
	UpdateMCPOAuthPKCEState(ctx context.Context, arg dbsqlc.UpdateMCPOAuthPKCEStateParams) error
	UpdateMCPOAuthTokens(ctx context.Context, arg dbsqlc.UpdateMCPOAuthTokensParams) error
	UpdateMemoryProvider(ctx context.Context, arg dbsqlc.UpdateMemoryProviderParams) (dbsqlc.MemoryProvider, error)
	UpdateModel(ctx context.Context, arg dbsqlc.UpdateModelParams) (dbsqlc.Model, error)
	UpgradeModelConfig(ctx context.Context, arg dbsqlc.UpgradeModelConfigParams) (int64, error)
	UpdateProvider(ctx context.Context, arg dbsqlc.UpdateProviderParams) (dbsqlc.Provider, error)
	SetProviderTemplateActive(ctx context.Context, arg dbsqlc.SetProviderTemplateActiveParams) error
	SetProviderTemplateModelActive(ctx context.Context, arg dbsqlc.SetProviderTemplateModelActiveParams) error
	UpdateProviderOAuthState(ctx context.Context, arg dbsqlc.UpdateProviderOAuthStateParams) error
	UpdateSchedule(ctx context.Context, arg dbsqlc.UpdateScheduleParams) (dbsqlc.Schedule, error)
	UpdateSearchProvider(ctx context.Context, arg dbsqlc.UpdateSearchProviderParams) (dbsqlc.SearchProvider, error)
	UpdateSessionMetadata(ctx context.Context, arg dbsqlc.UpdateSessionMetadataParams) (dbsqlc.BotSession, error)
	UpdateSessionRuntimeMetadata(ctx context.Context, arg dbsqlc.UpdateSessionRuntimeMetadataParams) (dbsqlc.BotSession, error)
	UpdateSessionTitle(ctx context.Context, arg dbsqlc.UpdateSessionTitleParams) (dbsqlc.BotSession, error)
	CompareAndSetSessionModelPreference(ctx context.Context, arg dbsqlc.CompareAndSetSessionModelPreferenceParams) (int64, error)
	UpdateSessionModelPreference(ctx context.Context, arg dbsqlc.UpdateSessionModelPreferenceParams) error
	GetLatestSessionModelPreference(ctx context.Context, arg dbsqlc.GetLatestSessionModelPreferenceParams) (dbsqlc.GetLatestSessionModelPreferenceRow, error)
	UpdateSessionTypeAndMetadata(ctx context.Context, arg dbsqlc.UpdateSessionTypeAndMetadataParams) (dbsqlc.BotSession, error)
	UpdateAbortedContextLifecycleSnapshot(ctx context.Context, arg dbsqlc.UpdateAbortedContextLifecycleSnapshotParams) (dbsqlc.UpdateAbortedContextLifecycleSnapshotRow, error)
	UpdateToolApprovalPromptMessage(ctx context.Context, arg dbsqlc.UpdateToolApprovalPromptMessageParams) (dbsqlc.ToolApprovalRequest, error)
	UpdateUserInputAssistantMessage(ctx context.Context, arg dbsqlc.UpdateUserInputAssistantMessageParams) (dbsqlc.UserInputRequest, error)
	UpdateUserInputInteraction(ctx context.Context, arg dbsqlc.UpdateUserInputInteractionParams) (dbsqlc.UserInputRequest, error)
	UpdateUserInputPromptMessage(ctx context.Context, arg dbsqlc.UpdateUserInputPromptMessageParams) (dbsqlc.UserInputRequest, error)
	UpdateUserInputToolResultMessage(ctx context.Context, arg dbsqlc.UpdateUserInputToolResultMessageParams) (dbsqlc.UserInputRequest, error)
	ReplaceHistoryTurn(ctx context.Context, arg dbsqlc.ReplaceHistoryTurnParams) (dbsqlc.ReplaceHistoryTurnRow, error)
	SupersedeHistoryTurn(ctx context.Context, arg dbsqlc.SupersedeHistoryTurnParams) (HistoryTurn, error)
	UpdateUserProviderOAuthState(ctx context.Context, arg dbsqlc.UpdateUserProviderOAuthStateParams) error
	UpsertAccountByUsername(ctx context.Context, arg dbsqlc.UpsertAccountByUsernameParams) (dbsqlc.UpsertAccountByUsernameRow, error)
	UpsertAbortedContextLifecycle(ctx context.Context, arg dbsqlc.UpsertAbortedContextLifecycleParams) (dbsqlc.UpsertAbortedContextLifecycleRow, error)
	UpsertTerminalContextLifecycle(ctx context.Context, arg dbsqlc.UpsertTerminalContextLifecycleParams) (dbsqlc.UpsertTerminalContextLifecycleRow, error)
	UpsertBotChannelConfig(ctx context.Context, arg dbsqlc.UpsertBotChannelConfigParams) (dbsqlc.BotChannelConfig, error)
	UpsertBotSettings(ctx context.Context, arg dbsqlc.UpsertBotSettingsParams) (dbsqlc.UpsertBotSettingsRow, error)
	UpsertBotStorageBinding(ctx context.Context, arg dbsqlc.UpsertBotStorageBindingParams) (dbsqlc.BotStorageBinding, error)
	UpsertBotWorkspaceResourceLimits(ctx context.Context, arg dbsqlc.UpsertBotWorkspaceResourceLimitsParams) (dbsqlc.BotWorkspaceResourceLimit, error)
	UpsertChannelIdentityByChannelSubject(ctx context.Context, arg dbsqlc.UpsertChannelIdentityByChannelSubjectParams) (dbsqlc.ChannelIdentity, error)
	UpsertContainer(ctx context.Context, arg dbsqlc.UpsertContainerParams) error
	UpsertMCPConnectionByName(ctx context.Context, arg dbsqlc.UpsertMCPConnectionByNameParams) (dbsqlc.McpConnection, error)
	UpsertBotDependencyInstallationIntent(ctx context.Context, arg dbsqlc.UpsertBotDependencyInstallationIntentParams) (dbsqlc.BotDependencyInstallation, error)
	UpdateBotDependencyInstallationStatus(ctx context.Context, arg dbsqlc.UpdateBotDependencyInstallationStatusParams) (dbsqlc.BotDependencyInstallation, error)
	UpdateBotDependencyInstallationObserved(ctx context.Context, arg dbsqlc.UpdateBotDependencyInstallationObservedParams) (dbsqlc.BotDependencyInstallation, error)
	UpsertMCPOAuthDiscovery(ctx context.Context, arg dbsqlc.UpsertMCPOAuthDiscoveryParams) (dbsqlc.McpOauthToken, error)
	UpsertProviderOAuthToken(ctx context.Context, arg dbsqlc.UpsertProviderOAuthTokenParams) (dbsqlc.ProviderOauthToken, error)
	UpsertRegistryModel(ctx context.Context, arg dbsqlc.UpsertRegistryModelParams) (dbsqlc.Model, error)
	UpsertRegistryProvider(ctx context.Context, arg dbsqlc.UpsertRegistryProviderParams) (dbsqlc.Provider, error)
	UpsertProviderTemplate(ctx context.Context, arg dbsqlc.UpsertProviderTemplateParams) (dbsqlc.TemplateProviderTemplate, error)
	UpsertProviderTemplateModel(ctx context.Context, arg dbsqlc.UpsertProviderTemplateModelParams) (dbsqlc.TemplateProviderTemplateModel, error)
	UpsertSessionDiscussCursor(ctx context.Context, arg dbsqlc.UpsertSessionDiscussCursorParams) (dbsqlc.BotSessionDiscussCursor, error)
	UpsertSnapshot(ctx context.Context, arg dbsqlc.UpsertSnapshotParams) (dbsqlc.Snapshot, error)
	UpsertUserChannelBinding(ctx context.Context, arg dbsqlc.UpsertUserChannelBindingParams) (dbsqlc.UserChannelBinding, error)
	UpsertUserProviderOAuthToken(ctx context.Context, arg dbsqlc.UpsertUserProviderOAuthTokenParams) (dbsqlc.UserProviderOauthToken, error)
	WithTx(tx pgx.Tx) Queries
}

Queries is the transitional database interface implemented by sqlc-backed stores. Domain-specific stores should replace this broad interface module by module.

type Record

type Record map[string]any

type RegistryStore

type RegistryStore interface {
	UpsertProvider(ctx context.Context, definition Input) (Record, error)
	UpsertModel(ctx context.Context, providerID ID, definition Input) (Record, error)
}

type ScheduleStore

type ScheduleStore interface {
	ListEnabled(ctx context.Context) ([]Record, error)
	Create(ctx context.Context, input Input) (Record, error)
	GetByID(ctx context.Context, id ID) (Record, error)
	ListByBot(ctx context.Context, botID ID) ([]Record, error)
	Update(ctx context.Context, id ID, input Patch) (Record, error)
	Delete(ctx context.Context, id ID) error
	IncrementCalls(ctx context.Context, id ID) (Record, error)
	CreateLog(ctx context.Context, input Input) (Record, error)
	CompleteLog(ctx context.Context, id ID, input Patch) (Record, error)
	ListLogsByBot(ctx context.Context, botID ID, page Page) ([]Record, error)
	ListLogsBySchedule(ctx context.Context, scheduleID ID, page Page) ([]Record, error)
	CountLogsByBot(ctx context.Context, botID ID) (int64, error)
	CountLogsBySchedule(ctx context.Context, scheduleID ID) (int64, error)
	DeleteLogsByBot(ctx context.Context, botID ID) error
}

type SearchProviderStore

type SearchProviderStore interface {
	Create(ctx context.Context, input Input) (Record, error)
	GetByID(ctx context.Context, id ID) (Record, error)
	GetRawByID(ctx context.Context, id ID) (Record, error)
	List(ctx context.Context) ([]Record, error)
	ListByProvider(ctx context.Context, provider string) ([]Record, error)
	Update(ctx context.Context, id ID, input Patch) (Record, error)
	Delete(ctx context.Context, id ID) error
}

type SessionRepository

type SessionRepository interface {
	Create(ctx context.Context, input Input) (Record, error)
	GetByID(ctx context.Context, sessionID ID) (Record, error)
	ListByBot(ctx context.Context, botID ID) ([]Record, error)
	ListByRoute(ctx context.Context, routeID ID) ([]Record, error)
	UpdateTitle(ctx context.Context, sessionID ID, title string) (Record, error)
	UpdateMetadata(ctx context.Context, sessionID ID, metadata JSON) (Record, error)
	Touch(ctx context.Context, sessionID ID) error
	SoftDelete(ctx context.Context, sessionID ID) error
}

type TokenUsageRepository

type TokenUsageRepository interface {
	GetByDayAndType(ctx context.Context, filter Filter) ([]Record, error)
	GetByModel(ctx context.Context, filter Filter) ([]Record, error)
	ListDetail(ctx context.Context, filter Filter) ([]Record, error)
	CountDetail(ctx context.Context, filter Filter) (int64, error)
}

type UpdateAccountAdminInput

type UpdateAccountAdminInput struct {
	UserID   string
	Role     string
	IsActive *bool
}

type UpdateAccountPasswordInput

type UpdateAccountPasswordInput struct {
	UserID       string
	PasswordHash string
}

type UpdateAccountProfileInput

type UpdateAccountProfileInput struct {
	UserID       string
	DisplayName  string
	AvatarURL    string
	Timezone     string
	Metadata     string
	TitleModelID string
}

type UserProviderOAuthStore

type UserProviderOAuthStore interface {
	GetTokenByProvider(ctx context.Context, userID ID, providerID ID) (Record, error)
	GetTokenByState(ctx context.Context, state string) (Record, error)
	UpdateOAuthState(ctx context.Context, userID ID, providerID ID, state string) error
	UpsertToken(ctx context.Context, input Input) (Record, error)
	DeleteToken(ctx context.Context, userID ID, providerID ID) error
}

type UserRuntimeRecord

type UserRuntimeRecord struct {
	ID               string
	TeamID           string
	UserID           string
	Name             string
	APIToken         string //nolint:gosec // owner-readable Remote Runtime credential by product design
	ActivatedAt      time.Time
	PendingExpiresAt time.Time
	CreatedAt        time.Time
}

type UserRuntimeStore

type UserRuntimeStore interface {
	CreateUserRuntime(ctx context.Context, input CreateUserRuntimeInput) (UserRuntimeRecord, error)
	GetUserRuntimeByAPIToken(ctx context.Context, apiToken string) (UserRuntimeRecord, error)
	ActivateUserRuntime(ctx context.Context, runtimeID, apiToken string) (UserRuntimeRecord, error)
	ExpirePendingUserRuntimes(ctx context.Context, userID string) error
	ListUserRuntimes(ctx context.Context, userID string) ([]UserRuntimeRecord, error)
	RevokeUserRuntime(ctx context.Context, runtimeID, userID string) error
	// BackfillUserRuntimeName sets the display name only while the row still
	// carries its creation-time default (or an empty name), so a user-chosen
	// name is never overwritten by a later handshake. Returns false when the
	// name no longer defaults (already backfilled or user-renamed).
	BackfillUserRuntimeName(ctx context.Context, runtimeID, userID, name, defaultName string) (bool, error)
}

type WorkdirActivityStore added in v0.20.0

type WorkdirActivityStore interface {
	ActiveWorkdirs(context.Context, string) ([]BotWorkdirRecord, error)
	WithWorkdirMutation(context.Context, string, func([]BotWorkdirRecord) error) error
}

WorkdirActivityStore coordinates directory mutations with durable run admission. The callback holds the same bot lock used by admission and ownership claims; running agents remain concurrent, but no new run can cross the idle check.

type WorkspaceStore

type WorkspaceStore interface {
	GetBotByID(ctx context.Context, botID ID) (Record, error)
	UpdateBotProfile(ctx context.Context, botID ID, input Patch) (Record, error)
	UpsertContainer(ctx context.Context, input Input) (Record, error)
	GetContainerByBotID(ctx context.Context, botID ID) (Record, error)
	ListAutoStartContainers(ctx context.Context) ([]Record, error)
	DeleteContainerByBotID(ctx context.Context, botID ID) error
	UpdateContainerStarted(ctx context.Context, input Patch) (Record, error)
	UpdateContainerStopped(ctx context.Context, input Patch) (Record, error)
	UpdateContainerStatus(ctx context.Context, input Patch) (Record, error)
	ListSnapshotsWithVersionByContainerID(ctx context.Context, containerID string) ([]Record, error)
	ListVersionsByContainerID(ctx context.Context, containerID string) ([]Record, error)
	GetVersionSnapshotRuntimeName(ctx context.Context, versionID ID) (string, error)
	RecordSnapshotVersion(ctx context.Context, input Input) (Record, error)
	InsertLifecycleEvent(ctx context.Context, input Input) error
}

Jump to

Keyboard shortcuts

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