Documentation
¶
Index ¶
- type AddAgentMemberParams
- type Agent
- type AgentBuild
- type AgentConversation
- type AgentCron
- type AgentDirectory
- type AgentMcpServer
- type AgentMember
- type AgentMessage
- type AgentModelSlot
- type AgentRoute
- type AgentTool
- type AgentTopic
- type AgentWebhook
- type AttachmentUrlCache
- type AuthFailure
- type AuthLockout
- type Bridge
- type ClearAuthFailuresParams
- type ClearAuthLockoutParams
- type ClearConnectionCredentialsParams
- type ClearMCPServerCredentialsParams
- type ClearMCPServerOAuthAppParams
- type Connection
- type CountRecentFailuresParams
- type CreateAgentBuildParams
- type CreateAgentParams
- type CreateBridgeParams
- type CreateMessageParams
- type CreateOAuthStateParams
- type CreatePlatformIdentityParams
- type CreateProviderParams
- type CreateRunParams
- type CreateTenantParams
- type CreateUserParams
- type DBTX
- type DeleteCronsByAgentExceptParams
- type DeleteDirectoriesByAgentExceptParams
- type DeleteMCPServersByAgentExceptParams
- type DeletePlatformIdentityParams
- type DeleteRoutesByAgentExceptParams
- type DeleteStaleAgentModelSlotsParams
- type DeleteStaleAgentToolsParams
- type DeleteTopicsByAgentExceptParams
- type DeleteWebhooksByAgentExceptParams
- type GetActiveLockoutParams
- type GetActiveLockoutRow
- type GetAgentForUpgradeRow
- type GetAgentMemberParams
- type GetAgentModelSlotParams
- type GetCachedAttachmentURLParams
- type GetCachedAttachmentURLRow
- type GetConnectionBySlugParams
- type GetConnectionForOAuthParams
- type GetConnectionForOAuthRow
- type GetConnectionWithCredentialStatusParams
- type GetConnectionWithCredentialStatusRow
- type GetConversationByExternalParams
- type GetConversationBySourceParams
- type GetCronByAgentAndNameParams
- type GetDirectoryByPathParams
- type GetLockoutForUpdateParams
- type GetLockoutForUpdateRow
- type GetMCPServerBySlugParams
- type GetMCPServerForOAuthParams
- type GetMCPServerForOAuthRow
- type GetOrCreateConversationByExternalParams
- type GetOrCreateConversationByExternalRow
- type GetOrCreateConversationParams
- type GetOrCreateConversationRow
- type GetPlatformIdentityParams
- type GetTopicBySlugParams
- type GetWebhookByAgentAndPathParams
- type HasAgentAccessParams
- type ListAgentBuildsByAgentRow
- type ListAgentMembersRow
- type ListBridgesAccessibleRow
- type ListBridgesAdminRow
- type ListConnectionsWithStatusRow
- type ListConversationsByAgentParams
- type ListDirectoriesWithRetentionRow
- type ListExpiredPublicConversationsRow
- type ListExpiringConnectionsRow
- type ListExpiringMCPServersRow
- type ListMCPServersWithStatusRow
- type ListMessagesBackwardParams
- type ListMessagesForwardParams
- type ListOrphanToolCallsByRunRow
- type ListRoutesByAgentAndMethodParams
- type ListRunsByAgentParams
- type ListStuckRunsRow
- type ListSubscribedConversationsParams
- type ListTopicSubscriptionsParams
- type ListTopicSubscriptionsRow
- type ListWebhooksByAgentWithStatusRow
- type OauthState
- type PlatformIdentity
- type Provider
- type Queries
- func (q *Queries) AddAgentMember(ctx context.Context, arg AddAgentMemberParams) error
- func (q *Queries) CleanupExpiredOAuthStates(ctx context.Context) error
- func (q *Queries) ClearActivationCode(ctx context.Context) error
- func (q *Queries) ClearAuthFailures(ctx context.Context, arg ClearAuthFailuresParams) error
- func (q *Queries) ClearAuthFailuresByEmail(ctx context.Context, email string) (int64, error)
- func (q *Queries) ClearAuthLockout(ctx context.Context, arg ClearAuthLockoutParams) error
- func (q *Queries) ClearAuthLockoutsByEmail(ctx context.Context, email string) (int64, error)
- func (q *Queries) ClearConnectionCredentials(ctx context.Context, arg ClearConnectionCredentialsParams) error
- func (q *Queries) ClearMCPServerCredentials(ctx context.Context, arg ClearMCPServerCredentialsParams) error
- func (q *Queries) ClearMCPServerOAuthApp(ctx context.Context, arg ClearMCPServerOAuthAppParams) error
- func (q *Queries) CompactOldRuns(ctx context.Context, cutoff pgtype.Timestamptz) (int64, error)
- func (q *Queries) CountRecentFailures(ctx context.Context, arg CountRecentFailuresParams) (int32, error)
- func (q *Queries) CountRunsByAgent(ctx context.Context, agentID pgtype.UUID) (int64, error)
- func (q *Queries) CreateAgent(ctx context.Context, arg CreateAgentParams) (Agent, error)
- func (q *Queries) CreateAgentBuild(ctx context.Context, arg CreateAgentBuildParams) (AgentBuild, error)
- func (q *Queries) CreateBridge(ctx context.Context, arg CreateBridgeParams) (Bridge, error)
- func (q *Queries) CreateMessage(ctx context.Context, arg CreateMessageParams) (AgentMessage, error)
- func (q *Queries) CreateOAuthState(ctx context.Context, arg CreateOAuthStateParams) error
- func (q *Queries) CreatePlatformIdentity(ctx context.Context, arg CreatePlatformIdentityParams) (PlatformIdentity, error)
- func (q *Queries) CreateProvider(ctx context.Context, arg CreateProviderParams) (Provider, error)
- func (q *Queries) CreateRun(ctx context.Context, arg CreateRunParams) (Run, error)
- func (q *Queries) CreateTenant(ctx context.Context, arg CreateTenantParams) (Tenant, error)
- func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
- func (q *Queries) DeleteAgent(ctx context.Context, id pgtype.UUID) error
- func (q *Queries) DeleteBridge(ctx context.Context, id pgtype.UUID) error
- func (q *Queries) DeleteConversation(ctx context.Context, id pgtype.UUID) error
- func (q *Queries) DeleteCronsByAgentExcept(ctx context.Context, arg DeleteCronsByAgentExceptParams) error
- func (q *Queries) DeleteDirectoriesByAgentExcept(ctx context.Context, arg DeleteDirectoriesByAgentExceptParams) error
- func (q *Queries) DeleteMCPServersByAgentExcept(ctx context.Context, arg DeleteMCPServersByAgentExceptParams) error
- func (q *Queries) DeleteMessagesByConversation(ctx context.Context, conversationID pgtype.UUID) error
- func (q *Queries) DeleteOAuthState(ctx context.Context, state string) error
- func (q *Queries) DeletePlatformIdentity(ctx context.Context, arg DeletePlatformIdentityParams) error
- func (q *Queries) DeleteProvider(ctx context.Context, id pgtype.UUID) error
- func (q *Queries) DeleteRoutesByAgentExcept(ctx context.Context, arg DeleteRoutesByAgentExceptParams) error
- func (q *Queries) DeleteStaleAgentModelSlots(ctx context.Context, arg DeleteStaleAgentModelSlotsParams) error
- func (q *Queries) DeleteStaleAgentTools(ctx context.Context, arg DeleteStaleAgentToolsParams) error
- func (q *Queries) DeleteTopicsByAgentExcept(ctx context.Context, arg DeleteTopicsByAgentExceptParams) error
- func (q *Queries) DeleteUser(ctx context.Context, id pgtype.UUID) error
- func (q *Queries) DeleteWebhooksByAgentExcept(ctx context.Context, arg DeleteWebhooksByAgentExceptParams) error
- func (q *Queries) GetActiveLockout(ctx context.Context, arg GetActiveLockoutParams) (GetActiveLockoutRow, error)
- func (q *Queries) GetAgentBuild(ctx context.Context, id pgtype.UUID) (AgentBuild, error)
- func (q *Queries) GetAgentByID(ctx context.Context, id pgtype.UUID) (Agent, error)
- func (q *Queries) GetAgentBySlug(ctx context.Context, slug string) (Agent, error)
- func (q *Queries) GetAgentForUpgrade(ctx context.Context, id pgtype.UUID) (GetAgentForUpgradeRow, error)
- func (q *Queries) GetAgentMember(ctx context.Context, arg GetAgentMemberParams) (AgentMember, error)
- func (q *Queries) GetAgentModelSlot(ctx context.Context, arg GetAgentModelSlotParams) (AgentModelSlot, error)
- func (q *Queries) GetBridgeByAgentID(ctx context.Context, agentID pgtype.UUID) (Bridge, error)
- func (q *Queries) GetBridgeByID(ctx context.Context, id pgtype.UUID) (Bridge, error)
- func (q *Queries) GetCachedAttachmentURL(ctx context.Context, arg GetCachedAttachmentURLParams) (GetCachedAttachmentURLRow, error)
- func (q *Queries) GetConnectionBySlug(ctx context.Context, arg GetConnectionBySlugParams) (Connection, error)
- func (q *Queries) GetConnectionForOAuth(ctx context.Context, arg GetConnectionForOAuthParams) (GetConnectionForOAuthRow, error)
- func (q *Queries) GetConnectionWithCredentialStatus(ctx context.Context, arg GetConnectionWithCredentialStatusParams) (GetConnectionWithCredentialStatusRow, error)
- func (q *Queries) GetConversationByExternal(ctx context.Context, arg GetConversationByExternalParams) (AgentConversation, error)
- func (q *Queries) GetConversationByID(ctx context.Context, id pgtype.UUID) (AgentConversation, error)
- func (q *Queries) GetConversationBySource(ctx context.Context, arg GetConversationBySourceParams) (AgentConversation, error)
- func (q *Queries) GetConversationIDByRun(ctx context.Context, runID pgtype.UUID) (pgtype.UUID, error)
- func (q *Queries) GetCronByAgentAndName(ctx context.Context, arg GetCronByAgentAndNameParams) (AgentCron, error)
- func (q *Queries) GetDirectoryByPath(ctx context.Context, arg GetDirectoryByPathParams) (AgentDirectory, error)
- func (q *Queries) GetLatestSuspendedRun(ctx context.Context, agentID pgtype.UUID) (Run, error)
- func (q *Queries) GetLockoutForUpdate(ctx context.Context, arg GetLockoutForUpdateParams) (GetLockoutForUpdateRow, error)
- func (q *Queries) GetMCPServerBySlug(ctx context.Context, arg GetMCPServerBySlugParams) (AgentMcpServer, error)
- func (q *Queries) GetMCPServerForOAuth(ctx context.Context, arg GetMCPServerForOAuthParams) (GetMCPServerForOAuthRow, error)
- func (q *Queries) GetOAuthState(ctx context.Context, state string) (OauthState, error)
- func (q *Queries) GetOrCreateConversation(ctx context.Context, arg GetOrCreateConversationParams) (GetOrCreateConversationRow, error)
- func (q *Queries) GetOrCreateConversationByExternal(ctx context.Context, arg GetOrCreateConversationByExternalParams) (GetOrCreateConversationByExternalRow, error)
- func (q *Queries) GetPlatformIdentity(ctx context.Context, arg GetPlatformIdentityParams) (PlatformIdentity, error)
- func (q *Queries) GetProviderByID(ctx context.Context, id pgtype.UUID) (Provider, error)
- func (q *Queries) GetProviderByProviderID(ctx context.Context, providerID string) (Provider, error)
- func (q *Queries) GetRunByID(ctx context.Context, id pgtype.UUID) (Run, error)
- func (q *Queries) GetRunCheckpoint(ctx context.Context, id pgtype.UUID) ([]byte, error)
- func (q *Queries) GetSuspendedRunByID(ctx context.Context, id pgtype.UUID) (Run, error)
- func (q *Queries) GetSystemBridge(ctx context.Context) (Bridge, error)
- func (q *Queries) GetSystemSettings(ctx context.Context) (SystemSetting, error)
- func (q *Queries) GetTenantByID(ctx context.Context, id pgtype.UUID) (Tenant, error)
- func (q *Queries) GetTenantBySlug(ctx context.Context, slug string) (Tenant, error)
- func (q *Queries) GetTopicBySlug(ctx context.Context, arg GetTopicBySlugParams) (AgentTopic, error)
- func (q *Queries) GetUserByEmail(ctx context.Context, email string) (User, error)
- func (q *Queries) GetUserByID(ctx context.Context, id pgtype.UUID) (User, error)
- func (q *Queries) GetUserByOIDCSub(ctx context.Context, oidcSub string) (User, error)
- func (q *Queries) GetWebhookByAgentAndPath(ctx context.Context, arg GetWebhookByAgentAndPathParams) (AgentWebhook, error)
- func (q *Queries) HasAgentAccess(ctx context.Context, arg HasAgentAccessParams) (bool, error)
- func (q *Queries) HasDirtyMCPServers(ctx context.Context, agentID pgtype.UUID) (bool, error)
- func (q *Queries) ListActiveBridges(ctx context.Context) ([]Bridge, error)
- func (q *Queries) ListAgentBuildsByAgent(ctx context.Context, agentID pgtype.UUID) ([]ListAgentBuildsByAgentRow, error)
- func (q *Queries) ListAgentIDsByMember(ctx context.Context, userID pgtype.UUID) ([]pgtype.UUID, error)
- func (q *Queries) ListAgentMembers(ctx context.Context, agentID pgtype.UUID) ([]ListAgentMembersRow, error)
- func (q *Queries) ListAgentModelSlots(ctx context.Context, agentID pgtype.UUID) ([]AgentModelSlot, error)
- func (q *Queries) ListAgentTools(ctx context.Context, agentID pgtype.UUID) ([]AgentTool, error)
- func (q *Queries) ListAgents(ctx context.Context) ([]Agent, error)
- func (q *Queries) ListAgentsByUser(ctx context.Context, userID pgtype.UUID) ([]Agent, error)
- func (q *Queries) ListAgentsByUserID(ctx context.Context, userID pgtype.UUID) ([]Agent, error)
- func (q *Queries) ListAllEnabledCrons(ctx context.Context) ([]AgentCron, error)
- func (q *Queries) ListAllMessagesByConversation(ctx context.Context, conversationID pgtype.UUID) ([]AgentMessage, error)
- func (q *Queries) ListBridgesAccessible(ctx context.Context, userID pgtype.UUID) ([]ListBridgesAccessibleRow, error)
- func (q *Queries) ListBridgesAdmin(ctx context.Context) ([]ListBridgesAdminRow, error)
- func (q *Queries) ListBridgesByAgentID(ctx context.Context, agentID pgtype.UUID) ([]pgtype.UUID, error)
- func (q *Queries) ListBridgesForAgent(ctx context.Context, agentID pgtype.UUID) ([]Bridge, error)
- func (q *Queries) ListConnectionsByAgent(ctx context.Context, agentID pgtype.UUID) ([]Connection, error)
- func (q *Queries) ListConnectionsWithStatus(ctx context.Context, agentID pgtype.UUID) ([]ListConnectionsWithStatusRow, error)
- func (q *Queries) ListConversationsByAgent(ctx context.Context, arg ListConversationsByAgentParams) ([]AgentConversation, error)
- func (q *Queries) ListCronsByAgent(ctx context.Context, agentID pgtype.UUID) ([]AgentCron, error)
- func (q *Queries) ListDirectoriesByAgent(ctx context.Context, agentID pgtype.UUID) ([]AgentDirectory, error)
- func (q *Queries) ListDirectoriesWithRetention(ctx context.Context) ([]ListDirectoriesWithRetentionRow, error)
- func (q *Queries) ListExpiredPublicConversations(ctx context.Context) ([]ListExpiredPublicConversationsRow, error)
- func (q *Queries) ListExpiringConnections(ctx context.Context, expiryThreshold pgtype.Timestamptz) ([]ListExpiringConnectionsRow, error)
- func (q *Queries) ListExpiringMCPServers(ctx context.Context, expiryThreshold pgtype.Timestamptz) ([]ListExpiringMCPServersRow, error)
- func (q *Queries) ListMCPServersByAgent(ctx context.Context, agentID pgtype.UUID) ([]AgentMcpServer, error)
- func (q *Queries) ListMCPServersWithStatus(ctx context.Context, agentID pgtype.UUID) ([]ListMCPServersWithStatusRow, error)
- func (q *Queries) ListMessagesBackward(ctx context.Context, arg ListMessagesBackwardParams) ([]AgentMessage, error)
- func (q *Queries) ListMessagesByConversation(ctx context.Context, conversationID pgtype.UUID) ([]AgentMessage, error)
- func (q *Queries) ListMessagesByRun(ctx context.Context, runID pgtype.UUID) ([]AgentMessage, error)
- func (q *Queries) ListMessagesForward(ctx context.Context, arg ListMessagesForwardParams) ([]AgentMessage, error)
- func (q *Queries) ListOrphanToolCallsByRun(ctx context.Context, runID pgtype.UUID) ([]ListOrphanToolCallsByRunRow, error)
- func (q *Queries) ListPlatformIdentitiesByUser(ctx context.Context, userID pgtype.UUID) ([]PlatformIdentity, error)
- func (q *Queries) ListProviders(ctx context.Context) ([]Provider, error)
- func (q *Queries) ListRoutesByAgent(ctx context.Context, agentID pgtype.UUID) ([]AgentRoute, error)
- func (q *Queries) ListRoutesByAgentAndMethod(ctx context.Context, arg ListRoutesByAgentAndMethodParams) ([]AgentRoute, error)
- func (q *Queries) ListRunningByAgent(ctx context.Context, agentID pgtype.UUID) ([]Run, error)
- func (q *Queries) ListRunsByAgent(ctx context.Context, arg ListRunsByAgentParams) ([]Run, error)
- func (q *Queries) ListSessionMessagesByConversation(ctx context.Context, conversationID pgtype.UUID) ([]AgentMessage, error)
- func (q *Queries) ListStuckRuns(ctx context.Context, cutoff pgtype.Timestamptz) ([]ListStuckRunsRow, error)
- func (q *Queries) ListSubscribedConversations(ctx context.Context, arg ListSubscribedConversationsParams) ([]pgtype.UUID, error)
- func (q *Queries) ListTopicSubscriptions(ctx context.Context, arg ListTopicSubscriptionsParams) ([]ListTopicSubscriptionsRow, error)
- func (q *Queries) ListTopicsByAgent(ctx context.Context, agentID pgtype.UUID) ([]AgentTopic, error)
- func (q *Queries) ListUsers(ctx context.Context) ([]User, error)
- func (q *Queries) ListWebhooksByAgent(ctx context.Context, agentID pgtype.UUID) ([]AgentWebhook, error)
- func (q *Queries) ListWebhooksByAgentWithStatus(ctx context.Context, agentID pgtype.UUID) ([]ListWebhooksByAgentWithStatusRow, error)
- func (q *Queries) PruneAuthFailures(ctx context.Context) (int64, error)
- func (q *Queries) PruneExpiredAttachmentURLs(ctx context.Context) (int64, error)
- func (q *Queries) PruneStaleAuthLockouts(ctx context.Context) (int64, error)
- func (q *Queries) RecordAuthFailure(ctx context.Context, arg RecordAuthFailureParams) error
- func (q *Queries) RemoveAgentMember(ctx context.Context, arg RemoveAgentMemberParams) error
- func (q *Queries) ResetStuckAgentBuilds(ctx context.Context) error
- func (q *Queries) ResetStuckBuilds(ctx context.Context, errorMessage string) error
- func (q *Queries) ResetStuckRuns(ctx context.Context, errorMessage string) error
- func (q *Queries) ResetStuckUpgrades(ctx context.Context) error
- func (q *Queries) ResolveSuspendedRun(ctx context.Context, id pgtype.UUID) error
- func (q *Queries) SetActivationCode(ctx context.Context, activationCode pgtype.Text) (int64, error)
- func (q *Queries) SetAgentModelSlotAssignment(ctx context.Context, arg SetAgentModelSlotAssignmentParams) error
- func (q *Queries) SetConversationCheckpoint(ctx context.Context, arg SetConversationCheckpointParams) error
- func (q *Queries) SubscribeTopic(ctx context.Context, arg SubscribeTopicParams) error
- func (q *Queries) SumPreCheckpointTokens(ctx context.Context, conversationID pgtype.UUID) (int64, error)
- func (q *Queries) TenantExists(ctx context.Context) (bool, error)
- func (q *Queries) UnsubscribeTopic(ctx context.Context, arg UnsubscribeTopicParams) error
- func (q *Queries) UpdateAgentBuildComplete(ctx context.Context, arg UpdateAgentBuildCompleteParams) error
- func (q *Queries) UpdateAgentBuildLogs(ctx context.Context, arg UpdateAgentBuildLogsParams) error
- func (q *Queries) UpdateAgentConfig(ctx context.Context, arg UpdateAgentConfigParams) error
- func (q *Queries) UpdateAgentDescription(ctx context.Context, arg UpdateAgentDescriptionParams) error
- func (q *Queries) UpdateAgentErrorMessage(ctx context.Context, arg UpdateAgentErrorMessageParams) error
- func (q *Queries) UpdateAgentExtraPrompts(ctx context.Context, arg UpdateAgentExtraPromptsParams) error
- func (q *Queries) UpdateAgentFields(ctx context.Context, arg UpdateAgentFieldsParams) (Agent, error)
- func (q *Queries) UpdateAgentModels(ctx context.Context, arg UpdateAgentModelsParams) error
- func (q *Queries) UpdateAgentRefs(ctx context.Context, arg UpdateAgentRefsParams) error
- func (q *Queries) UpdateAgentSDKVersion(ctx context.Context, arg UpdateAgentSDKVersionParams) error
- func (q *Queries) UpdateAgentStatus(ctx context.Context, arg UpdateAgentStatusParams) error
- func (q *Queries) UpdateAgentUpgradeStatus(ctx context.Context, arg UpdateAgentUpgradeStatusParams) error
- func (q *Queries) UpdateBridgeAgentID(ctx context.Context, arg UpdateBridgeAgentIDParams) (Bridge, error)
- func (q *Queries) UpdateBridgeLastPolled(ctx context.Context, arg UpdateBridgeLastPolledParams) error
- func (q *Queries) UpdateBridgeSettings(ctx context.Context, arg UpdateBridgeSettingsParams) (Bridge, error)
- func (q *Queries) UpdateBridgeStatus(ctx context.Context, arg UpdateBridgeStatusParams) error
- func (q *Queries) UpdateConnectionCredentials(ctx context.Context, arg UpdateConnectionCredentialsParams) error
- func (q *Queries) UpdateConnectionOAuthApp(ctx context.Context, arg UpdateConnectionOAuthAppParams) error
- func (q *Queries) UpdateConversationSettings(ctx context.Context, arg UpdateConversationSettingsParams) error
- func (q *Queries) UpdateCronLastFired(ctx context.Context, id pgtype.UUID) error
- func (q *Queries) UpdateMCPServerCredentials(ctx context.Context, arg UpdateMCPServerCredentialsParams) error
- func (q *Queries) UpdateMCPServerDiscovery(ctx context.Context, arg UpdateMCPServerDiscoveryParams) error
- func (q *Queries) UpdateMCPServerOAuthApp(ctx context.Context, arg UpdateMCPServerOAuthAppParams) error
- func (q *Queries) UpdateMCPServerToolSchemas(ctx context.Context, arg UpdateMCPServerToolSchemasParams) error
- func (q *Queries) UpdateProvider(ctx context.Context, arg UpdateProviderParams) (Provider, error)
- func (q *Queries) UpdateRunCheckpoint(ctx context.Context, arg UpdateRunCheckpointParams) error
- func (q *Queries) UpdateRunComplete(ctx context.Context, arg UpdateRunCompleteParams) error
- func (q *Queries) UpdateRunLLMStats(ctx context.Context, arg UpdateRunLLMStatsParams) error
- func (q *Queries) UpdateRunStatus(ctx context.Context, arg UpdateRunStatusParams) error
- func (q *Queries) UpdateSystemSettings(ctx context.Context, arg UpdateSystemSettingsParams) (SystemSetting, error)
- func (q *Queries) UpdateUserNameEmail(ctx context.Context, arg UpdateUserNameEmailParams) error
- func (q *Queries) UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) error
- func (q *Queries) UpdateUserRole(ctx context.Context, arg UpdateUserRoleParams) error
- func (q *Queries) UpdateWebhookLastReceived(ctx context.Context, id pgtype.UUID) error
- func (q *Queries) UpdateWebhookSecret(ctx context.Context, arg UpdateWebhookSecretParams) error
- func (q *Queries) UpsertAgentModelSlot(ctx context.Context, arg UpsertAgentModelSlotParams) error
- func (q *Queries) UpsertAgentTool(ctx context.Context, arg UpsertAgentToolParams) error
- func (q *Queries) UpsertCachedAttachmentURL(ctx context.Context, arg UpsertCachedAttachmentURLParams) error
- func (q *Queries) UpsertConnection(ctx context.Context, arg UpsertConnectionParams) (Connection, error)
- func (q *Queries) UpsertCron(ctx context.Context, arg UpsertCronParams) error
- func (q *Queries) UpsertDirectory(ctx context.Context, arg UpsertDirectoryParams) error
- func (q *Queries) UpsertLockout(ctx context.Context, arg UpsertLockoutParams) error
- func (q *Queries) UpsertMCPServer(ctx context.Context, arg UpsertMCPServerParams) (AgentMcpServer, error)
- func (q *Queries) UpsertPlatformIdentity(ctx context.Context, arg UpsertPlatformIdentityParams) (PlatformIdentity, error)
- func (q *Queries) UpsertRoute(ctx context.Context, arg UpsertRouteParams) error
- func (q *Queries) UpsertRunComplete(ctx context.Context, arg UpsertRunCompleteParams) error
- func (q *Queries) UpsertTopic(ctx context.Context, arg UpsertTopicParams) error
- func (q *Queries) UpsertWebhook(ctx context.Context, arg UpsertWebhookParams) error
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type RecordAuthFailureParams
- type RemoveAgentMemberParams
- type Run
- type SetAgentModelSlotAssignmentParams
- type SetConversationCheckpointParams
- type SubscribeTopicParams
- type SystemSetting
- type Tenant
- type TopicSubscription
- type UnsubscribeTopicParams
- type UpdateAgentBuildCompleteParams
- type UpdateAgentBuildLogsParams
- type UpdateAgentConfigParams
- type UpdateAgentDescriptionParams
- type UpdateAgentErrorMessageParams
- type UpdateAgentExtraPromptsParams
- type UpdateAgentFieldsParams
- type UpdateAgentModelsParams
- type UpdateAgentRefsParams
- type UpdateAgentSDKVersionParams
- type UpdateAgentStatusParams
- type UpdateAgentUpgradeStatusParams
- type UpdateBridgeAgentIDParams
- type UpdateBridgeLastPolledParams
- type UpdateBridgeSettingsParams
- type UpdateBridgeStatusParams
- type UpdateConnectionCredentialsParams
- type UpdateConnectionOAuthAppParams
- type UpdateConversationSettingsParams
- type UpdateMCPServerCredentialsParams
- type UpdateMCPServerDiscoveryParams
- type UpdateMCPServerOAuthAppParams
- type UpdateMCPServerToolSchemasParams
- type UpdateProviderParams
- type UpdateRunCheckpointParams
- type UpdateRunCompleteParams
- type UpdateRunLLMStatsParams
- type UpdateRunStatusParams
- type UpdateSystemSettingsParams
- type UpdateUserNameEmailParams
- type UpdateUserPasswordParams
- type UpdateUserRoleParams
- type UpdateWebhookSecretParams
- type UpsertAgentModelSlotParams
- type UpsertAgentToolParams
- type UpsertCachedAttachmentURLParams
- type UpsertConnectionParams
- type UpsertCronParams
- type UpsertDirectoryParams
- type UpsertLockoutParams
- type UpsertMCPServerParams
- type UpsertPlatformIdentityParams
- type UpsertRouteParams
- type UpsertRunCompleteParams
- type UpsertTopicParams
- type UpsertWebhookParams
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddAgentMemberParams ¶
type Agent ¶
type Agent struct {
ID pgtype.UUID `json:"id"`
UserID pgtype.UUID `json:"user_id"`
Slug string `json:"slug"`
Name string `json:"name"`
Description string `json:"description"`
Status string `json:"status"`
UpgradeStatus string `json:"upgrade_status"`
AutoFix bool `json:"auto_fix"`
BuildModel string `json:"build_model"`
ExecModel string `json:"exec_model"`
SttModel string `json:"stt_model"`
VisionModel string `json:"vision_model"`
TtsModel string `json:"tts_model"`
ImageGenModel string `json:"image_gen_model"`
EmbeddingModel string `json:"embedding_model"`
SearchModel string `json:"search_model"`
SourceRef string `json:"source_ref"`
ImageRef string `json:"image_ref"`
DbSchema string `json:"db_schema"`
SdkVersion string `json:"sdk_version"`
Config []byte `json:"config"`
ExtraPrompts []byte `json:"extra_prompts"`
ErrorMessage string `json:"error_message"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type AgentBuild ¶
type AgentBuild struct {
ID pgtype.UUID `json:"id"`
AgentID pgtype.UUID `json:"agent_id"`
Type string `json:"type"`
Status string `json:"status"`
Instructions string `json:"instructions"`
SourceRef string `json:"source_ref"`
ImageRef string `json:"image_ref"`
SolLog string `json:"sol_log"`
DockerLog string `json:"docker_log"`
LogSeq int64 `json:"log_seq"`
ErrorMessage string `json:"error_message"`
StartedAt pgtype.Timestamptz `json:"started_at"`
FinishedAt pgtype.Timestamptz `json:"finished_at"`
}
type AgentConversation ¶
type AgentConversation struct {
ID pgtype.UUID `json:"id"`
AgentID pgtype.UUID `json:"agent_id"`
BridgeID pgtype.UUID `json:"bridge_id"`
UserID pgtype.UUID `json:"user_id"`
Source string `json:"source"`
ExternalID pgtype.Text `json:"external_id"`
Title string `json:"title"`
Metadata []byte `json:"metadata"`
Settings []byte `json:"settings"`
ContextCheckpointMessageID pgtype.UUID `json:"context_checkpoint_message_id"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type AgentCron ¶
type AgentCron struct {
ID pgtype.UUID `json:"id"`
AgentID pgtype.UUID `json:"agent_id"`
Name string `json:"name"`
Schedule string `json:"schedule"`
Enabled bool `json:"enabled"`
TimeoutMs int32 `json:"timeout_ms"`
Description string `json:"description"`
LastFiredAt pgtype.Timestamptz `json:"last_fired_at"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type AgentDirectory ¶ added in v0.2.0
type AgentDirectory struct {
ID pgtype.UUID `json:"id"`
AgentID pgtype.UUID `json:"agent_id"`
Path string `json:"path"`
ReadAccess string `json:"read_access"`
WriteAccess string `json:"write_access"`
ListAccess string `json:"list_access"`
Description string `json:"description"`
LlmHint string `json:"llm_hint"`
RetentionHours int32 `json:"retention_hours"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type AgentMcpServer ¶
type AgentMcpServer struct {
ID pgtype.UUID `json:"id"`
AgentID pgtype.UUID `json:"agent_id"`
Slug string `json:"slug"`
Name string `json:"name"`
Access string `json:"access"`
Url string `json:"url"`
AuthMode string `json:"auth_mode"`
AuthUrl string `json:"auth_url"`
TokenUrl string `json:"token_url"`
RegistrationEndpoint string `json:"registration_endpoint"`
Scopes string `json:"scopes"`
ToolSchemas []byte `json:"tool_schemas"`
ClientID string `json:"client_id"`
ClientSecret string `json:"client_secret"`
Credentials string `json:"credentials"`
RefreshToken string `json:"refresh_token"`
TokenExpiresAt pgtype.Timestamptz `json:"token_expires_at"`
LastSyncedAt pgtype.Timestamptz `json:"last_synced_at"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type AgentMember ¶
type AgentMessage ¶
type AgentMessage struct {
ID pgtype.UUID `json:"id"`
Seq int64 `json:"seq"`
ConversationID pgtype.UUID `json:"conversation_id"`
RunID pgtype.UUID `json:"run_id"`
Role string `json:"role"`
Source string `json:"source"`
Content string `json:"content"`
Parts []byte `json:"parts"`
FileKeys []string `json:"file_keys"`
TokensIn int32 `json:"tokens_in"`
TokensOut int32 `json:"tokens_out"`
CostEstimate pgtype.Numeric `json:"cost_estimate"`
Ephemeral bool `json:"ephemeral"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type AgentModelSlot ¶
type AgentRoute ¶
type AgentRoute struct {
ID pgtype.UUID `json:"id"`
AgentID pgtype.UUID `json:"agent_id"`
Path string `json:"path"`
Method string `json:"method"`
Access string `json:"access"`
Description string `json:"description"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type AgentTool ¶
type AgentTool struct {
ID pgtype.UUID `json:"id"`
AgentID pgtype.UUID `json:"agent_id"`
Name string `json:"name"`
Description string `json:"description"`
LlmHint string `json:"llm_hint"`
Access string `json:"access"`
InputSchema []byte `json:"input_schema"`
OutputSchema []byte `json:"output_schema"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type AgentTopic ¶
type AgentTopic struct {
ID pgtype.UUID `json:"id"`
AgentID pgtype.UUID `json:"agent_id"`
Slug string `json:"slug"`
Description string `json:"description"`
LlmHint string `json:"llm_hint"`
Access string `json:"access"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type AgentWebhook ¶
type AgentWebhook struct {
ID pgtype.UUID `json:"id"`
AgentID pgtype.UUID `json:"agent_id"`
Path string `json:"path"`
VerifyMode string `json:"verify_mode"`
VerifyHeader string `json:"verify_header"`
TimeoutMs int32 `json:"timeout_ms"`
Description string `json:"description"`
Secret string `json:"secret"`
LastReceivedAt pgtype.Timestamptz `json:"last_received_at"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type AttachmentUrlCache ¶
type AttachmentUrlCache struct {
CanonicalKey string `json:"canonical_key"`
Url string `json:"url"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
}
type AuthFailure ¶
type AuthFailure struct {
Email string `json:"email"`
Ip string `json:"ip"`
AttemptedAt pgtype.Timestamptz `json:"attempted_at"`
}
type AuthLockout ¶
type AuthLockout struct {
Email string `json:"email"`
Ip string `json:"ip"`
LockedUntil pgtype.Timestamptz `json:"locked_until"`
Tier int32 `json:"tier"`
LastLockedAt pgtype.Timestamptz `json:"last_locked_at"`
}
type Bridge ¶
type Bridge struct {
ID pgtype.UUID `json:"id"`
AgentID pgtype.UUID `json:"agent_id"`
CreatedBy pgtype.UUID `json:"created_by"`
Type string `json:"type"`
Name string `json:"name"`
BotUsername string `json:"bot_username"`
Status string `json:"status"`
IsSystem bool `json:"is_system"`
Config []byte `json:"config"`
Settings []byte `json:"settings"`
TokenEncrypted string `json:"token_encrypted"`
LastPolledAt pgtype.Timestamptz `json:"last_polled_at"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type ClearAuthFailuresParams ¶
type ClearAuthLockoutParams ¶
type ClearMCPServerOAuthAppParams ¶ added in v0.2.8
type Connection ¶
type Connection struct {
ID pgtype.UUID `json:"id"`
AgentID pgtype.UUID `json:"agent_id"`
Slug string `json:"slug"`
Name string `json:"name"`
Description string `json:"description"`
LlmHint string `json:"llm_hint"`
Access string `json:"access"`
AuthMode string `json:"auth_mode"`
AuthUrl string `json:"auth_url"`
TokenUrl string `json:"token_url"`
BaseUrl string `json:"base_url"`
Scopes string `json:"scopes"`
AuthInjection []byte `json:"auth_injection"`
TestPath string `json:"test_path"`
SetupInstructions string `json:"setup_instructions"`
Config []byte `json:"config"`
ClientID string `json:"client_id"`
ClientSecret string `json:"client_secret"`
Credentials string `json:"credentials"`
RefreshToken string `json:"refresh_token"`
TokenExpiresAt pgtype.Timestamptz `json:"token_expires_at"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type CreateAgentBuildParams ¶
type CreateAgentParams ¶
type CreateBridgeParams ¶
type CreateMessageParams ¶
type CreateMessageParams struct {
ConversationID pgtype.UUID `json:"conversation_id"`
Role string `json:"role"`
Content string `json:"content"`
Parts []byte `json:"parts"`
TokensIn int32 `json:"tokens_in"`
TokensOut int32 `json:"tokens_out"`
CostEstimate interface{} `json:"cost_estimate"`
RunID pgtype.UUID `json:"run_id"`
Source interface{} `json:"source"`
Ephemeral bool `json:"ephemeral"`
}
type CreateOAuthStateParams ¶
type CreateOAuthStateParams struct {
State string `json:"state"`
AgentID pgtype.UUID `json:"agent_id"`
Slug string `json:"slug"`
CodeVerifier string `json:"code_verifier"`
RedirectUri string `json:"redirect_uri"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
SourceType string `json:"source_type"`
}
type CreateProviderParams ¶
type CreateRunParams ¶
type CreateTenantParams ¶
type CreateUserParams ¶
type DeleteDirectoriesByAgentExceptParams ¶ added in v0.2.0
type GetActiveLockoutParams ¶
type GetActiveLockoutRow ¶
type GetActiveLockoutRow struct {
LockedUntil pgtype.Timestamptz `json:"locked_until"`
Tier int32 `json:"tier"`
}
type GetAgentForUpgradeRow ¶
type GetAgentMemberParams ¶
type GetAgentModelSlotParams ¶
type GetCachedAttachmentURLRow ¶
type GetCachedAttachmentURLRow struct {
Url string `json:"url"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
}
type GetConnectionForOAuthRow ¶
type GetConnectionForOAuthRow struct {
ID pgtype.UUID `json:"id"`
AgentID pgtype.UUID `json:"agent_id"`
Slug string `json:"slug"`
Name string `json:"name"`
AuthMode string `json:"auth_mode"`
AuthUrl string `json:"auth_url"`
TokenUrl string `json:"token_url"`
Scopes string `json:"scopes"`
ClientID string `json:"client_id"`
ClientSecret string `json:"client_secret"`
}
type GetConnectionWithCredentialStatusRow ¶
type GetConnectionWithCredentialStatusRow struct {
ID pgtype.UUID `json:"id"`
AgentID pgtype.UUID `json:"agent_id"`
Slug string `json:"slug"`
Name string `json:"name"`
Description string `json:"description"`
AuthMode string `json:"auth_mode"`
AuthUrl string `json:"auth_url"`
BaseUrl string `json:"base_url"`
Scopes string `json:"scopes"`
SetupInstructions string `json:"setup_instructions"`
TestPath string `json:"test_path"`
Authorized bool `json:"authorized"`
HasOauthApp bool `json:"has_oauth_app"`
TokenExpiresAt pgtype.Timestamptz `json:"token_expires_at"`
}
type GetConversationByExternalParams ¶ added in v0.2.8
type GetDirectoryByPathParams ¶ added in v0.2.0
type GetLockoutForUpdateRow ¶
type GetLockoutForUpdateRow struct {
Tier int32 `json:"tier"`
LastLockedAt pgtype.Timestamptz `json:"last_locked_at"`
}
type GetMCPServerForOAuthRow ¶
type GetMCPServerForOAuthRow struct {
ID pgtype.UUID `json:"id"`
AgentID pgtype.UUID `json:"agent_id"`
Slug string `json:"slug"`
Name string `json:"name"`
Url string `json:"url"`
AuthMode string `json:"auth_mode"`
AuthUrl string `json:"auth_url"`
TokenUrl string `json:"token_url"`
RegistrationEndpoint string `json:"registration_endpoint"`
Scopes string `json:"scopes"`
ClientID string `json:"client_id"`
ClientSecret string `json:"client_secret"`
}
type GetOrCreateConversationByExternalParams ¶ added in v0.2.8
type GetOrCreateConversationByExternalRow ¶ added in v0.2.8
type GetOrCreateConversationByExternalRow struct {
ID pgtype.UUID `json:"id"`
AgentID pgtype.UUID `json:"agent_id"`
BridgeID pgtype.UUID `json:"bridge_id"`
UserID pgtype.UUID `json:"user_id"`
Source string `json:"source"`
ExternalID pgtype.Text `json:"external_id"`
Title string `json:"title"`
Metadata []byte `json:"metadata"`
Settings []byte `json:"settings"`
ContextCheckpointMessageID pgtype.UUID `json:"context_checkpoint_message_id"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type GetOrCreateConversationRow ¶
type GetOrCreateConversationRow struct {
ID pgtype.UUID `json:"id"`
AgentID pgtype.UUID `json:"agent_id"`
BridgeID pgtype.UUID `json:"bridge_id"`
UserID pgtype.UUID `json:"user_id"`
Source string `json:"source"`
ExternalID pgtype.Text `json:"external_id"`
Title string `json:"title"`
Metadata []byte `json:"metadata"`
Settings []byte `json:"settings"`
ContextCheckpointMessageID pgtype.UUID `json:"context_checkpoint_message_id"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type GetTopicBySlugParams ¶
type HasAgentAccessParams ¶
type ListAgentBuildsByAgentRow ¶
type ListAgentBuildsByAgentRow struct {
ID pgtype.UUID `json:"id"`
AgentID pgtype.UUID `json:"agent_id"`
Type string `json:"type"`
Status string `json:"status"`
Instructions string `json:"instructions"`
ErrorMessage string `json:"error_message"`
SourceRef string `json:"source_ref"`
ImageRef string `json:"image_ref"`
StartedAt pgtype.Timestamptz `json:"started_at"`
FinishedAt pgtype.Timestamptz `json:"finished_at"`
}
type ListAgentMembersRow ¶
type ListBridgesAccessibleRow ¶
type ListBridgesAccessibleRow struct {
ID pgtype.UUID `json:"id"`
AgentID pgtype.UUID `json:"agent_id"`
CreatedBy pgtype.UUID `json:"created_by"`
Type string `json:"type"`
Name string `json:"name"`
BotUsername string `json:"bot_username"`
Status string `json:"status"`
IsSystem bool `json:"is_system"`
Config []byte `json:"config"`
Settings []byte `json:"settings"`
TokenEncrypted string `json:"token_encrypted"`
LastPolledAt pgtype.Timestamptz `json:"last_polled_at"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
OwnerEmail pgtype.Text `json:"owner_email"`
OwnerDisplayName pgtype.Text `json:"owner_display_name"`
}
type ListBridgesAdminRow ¶
type ListBridgesAdminRow struct {
ID pgtype.UUID `json:"id"`
AgentID pgtype.UUID `json:"agent_id"`
CreatedBy pgtype.UUID `json:"created_by"`
Type string `json:"type"`
Name string `json:"name"`
BotUsername string `json:"bot_username"`
Status string `json:"status"`
IsSystem bool `json:"is_system"`
Config []byte `json:"config"`
Settings []byte `json:"settings"`
TokenEncrypted string `json:"token_encrypted"`
LastPolledAt pgtype.Timestamptz `json:"last_polled_at"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
OwnerEmail pgtype.Text `json:"owner_email"`
OwnerDisplayName pgtype.Text `json:"owner_display_name"`
}
type ListConnectionsWithStatusRow ¶
type ListConnectionsWithStatusRow struct {
ID pgtype.UUID `json:"id"`
AgentID pgtype.UUID `json:"agent_id"`
Slug string `json:"slug"`
Name string `json:"name"`
Description string `json:"description"`
AuthMode string `json:"auth_mode"`
AuthUrl string `json:"auth_url"`
BaseUrl string `json:"base_url"`
Scopes string `json:"scopes"`
SetupInstructions string `json:"setup_instructions"`
TestPath string `json:"test_path"`
Authorized bool `json:"authorized"`
HasOauthApp bool `json:"has_oauth_app"`
TokenExpiresAt pgtype.Timestamptz `json:"token_expires_at"`
}
type ListDirectoriesWithRetentionRow ¶ added in v0.2.8
type ListExpiredPublicConversationsRow ¶ added in v0.2.8
type ListExpiringConnectionsRow ¶
type ListExpiringConnectionsRow struct {
ID pgtype.UUID `json:"id"`
AgentID pgtype.UUID `json:"agent_id"`
Slug string `json:"slug"`
Name string `json:"name"`
AuthMode string `json:"auth_mode"`
TokenUrl string `json:"token_url"`
ClientID string `json:"client_id"`
ClientSecret string `json:"client_secret"`
Credentials string `json:"credentials"`
RefreshToken string `json:"refresh_token"`
TokenExpiresAt pgtype.Timestamptz `json:"token_expires_at"`
Scopes string `json:"scopes"`
AgentSlug string `json:"agent_slug"`
}
type ListExpiringMCPServersRow ¶
type ListExpiringMCPServersRow struct {
ID pgtype.UUID `json:"id"`
AgentID pgtype.UUID `json:"agent_id"`
Slug string `json:"slug"`
Name string `json:"name"`
AuthMode string `json:"auth_mode"`
TokenUrl string `json:"token_url"`
ClientID string `json:"client_id"`
ClientSecret string `json:"client_secret"`
Credentials string `json:"credentials"`
RefreshToken string `json:"refresh_token"`
TokenExpiresAt pgtype.Timestamptz `json:"token_expires_at"`
Scopes string `json:"scopes"`
AgentSlug string `json:"agent_slug"`
}
type ListMCPServersWithStatusRow ¶
type ListMCPServersWithStatusRow struct {
ID pgtype.UUID `json:"id"`
AgentID pgtype.UUID `json:"agent_id"`
Slug string `json:"slug"`
Name string `json:"name"`
Url string `json:"url"`
AuthMode string `json:"auth_mode"`
AuthUrl string `json:"auth_url"`
Authorized bool `json:"authorized"`
HasOauthApp bool `json:"has_oauth_app"`
ToolSchemas []byte `json:"tool_schemas"`
TokenExpiresAt pgtype.Timestamptz `json:"token_expires_at"`
LastSyncedAt pgtype.Timestamptz `json:"last_synced_at"`
}
type ListOrphanToolCallsByRunRow ¶ added in v0.2.8
type ListRunsByAgentParams ¶
type ListRunsByAgentParams struct {
AgentID pgtype.UUID `json:"agent_id"`
Cursor pgtype.Timestamptz `json:"cursor"`
Lim int32 `json:"lim"`
}
type ListStuckRunsRow ¶ added in v0.2.8
type ListWebhooksByAgentWithStatusRow ¶
type ListWebhooksByAgentWithStatusRow struct {
ID pgtype.UUID `json:"id"`
AgentID pgtype.UUID `json:"agent_id"`
Path string `json:"path"`
VerifyMode string `json:"verify_mode"`
VerifyHeader string `json:"verify_header"`
Secret string `json:"secret"`
LastReceivedAt pgtype.Timestamptz `json:"last_received_at"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
Description string `json:"description"`
}
type OauthState ¶
type OauthState struct {
State string `json:"state"`
AgentID pgtype.UUID `json:"agent_id"`
Slug string `json:"slug"`
SourceType string `json:"source_type"`
CodeVerifier string `json:"code_verifier"`
RedirectUri string `json:"redirect_uri"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type PlatformIdentity ¶
type Provider ¶
type Provider struct {
ID pgtype.UUID `json:"id"`
ProviderID string `json:"provider_id"`
DisplayName string `json:"display_name"`
IsEnabled bool `json:"is_enabled"`
BaseUrl string `json:"base_url"`
ApiKey string `json:"api_key"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) AddAgentMember ¶
func (q *Queries) AddAgentMember(ctx context.Context, arg AddAgentMemberParams) error
func (*Queries) CleanupExpiredOAuthStates ¶
func (*Queries) ClearActivationCode ¶
func (*Queries) ClearAuthFailures ¶
func (q *Queries) ClearAuthFailures(ctx context.Context, arg ClearAuthFailuresParams) error
func (*Queries) ClearAuthFailuresByEmail ¶
Used by the `airlock auth unlock <email>` CLI when no --ip is passed.
func (*Queries) ClearAuthLockout ¶
func (q *Queries) ClearAuthLockout(ctx context.Context, arg ClearAuthLockoutParams) error
func (*Queries) ClearAuthLockoutsByEmail ¶
Used by the `airlock auth unlock <email>` CLI when no --ip is passed.
func (*Queries) ClearConnectionCredentials ¶
func (q *Queries) ClearConnectionCredentials(ctx context.Context, arg ClearConnectionCredentialsParams) error
Revoke: clear access_token, refresh_token, expiry
func (*Queries) ClearMCPServerCredentials ¶
func (q *Queries) ClearMCPServerCredentials(ctx context.Context, arg ClearMCPServerCredentialsParams) error
func (*Queries) ClearMCPServerOAuthApp ¶ added in v0.2.8
func (q *Queries) ClearMCPServerOAuthApp(ctx context.Context, arg ClearMCPServerOAuthAppParams) error
Wipe the OAuth app config (client_id/secret) AND the credentials that belong to it. Used by "Re-register client" (oauth_discovery, forces a fresh DCR on next authorize) and "Edit OAuth app" (oauth, paste new credentials). Existing tokens MUST go too — they're tied to the old client_id at the OAuth provider and would 401 the moment they're used.
func (*Queries) CompactOldRuns ¶
Nullify verbose fields on completed runs older than the cutoff. Aggregates (token counts, cost, duration, timestamps, status, error) are preserved.
func (*Queries) CountRecentFailures ¶
func (q *Queries) CountRecentFailures(ctx context.Context, arg CountRecentFailuresParams) (int32, error)
Counts failures for (email, ip) within the policy's sliding window. The window length is passed in minutes from the caller so the policy lives in Go, not duplicated in SQL.
func (*Queries) CountRunsByAgent ¶
func (*Queries) CreateAgent ¶
Initial-row INSERT. All "starts empty" string fields are passed explicitly as ” rather than relying on column defaults (per AGENTS.md "no fake defaults" rule). Status starts 'draft', upgrade_status 'idle', auto_fix true, extra_prompts empty array.
func (*Queries) CreateAgentBuild ¶
func (q *Queries) CreateAgentBuild(ctx context.Context, arg CreateAgentBuildParams) (AgentBuild, error)
Initial-row INSERT. Status starts 'building'; output fields start empty and are filled by UpdateAgentBuildComplete / UpdateAgentBuildLogs.
func (*Queries) CreateBridge ¶
func (*Queries) CreateMessage ¶
func (q *Queries) CreateMessage(ctx context.Context, arg CreateMessageParams) (AgentMessage, error)
file_keys starts as an empty text[]; the chat upload path that needs attached file keys uses a separate UPDATE (or could be added explicitly via a follow-up insert path).
func (*Queries) CreateOAuthState ¶
func (q *Queries) CreateOAuthState(ctx context.Context, arg CreateOAuthStateParams) error
func (*Queries) CreatePlatformIdentity ¶
func (q *Queries) CreatePlatformIdentity(ctx context.Context, arg CreatePlatformIdentityParams) (PlatformIdentity, error)
func (*Queries) CreateProvider ¶
func (*Queries) CreateRun ¶
All "starts at zero/empty" run fields passed explicitly per AGENTS.md "no fake defaults" rule. Counter fields start at 0 (no LLM calls / tokens / cost yet); buffered text fields start ”; actions starts [].
func (*Queries) CreateTenant ¶
func (*Queries) CreateUser ¶
func (*Queries) DeleteAgent ¶
func (*Queries) DeleteBridge ¶
func (*Queries) DeleteConversation ¶
func (*Queries) DeleteCronsByAgentExcept ¶
func (q *Queries) DeleteCronsByAgentExcept(ctx context.Context, arg DeleteCronsByAgentExceptParams) error
func (*Queries) DeleteDirectoriesByAgentExcept ¶ added in v0.2.0
func (q *Queries) DeleteDirectoriesByAgentExcept(ctx context.Context, arg DeleteDirectoriesByAgentExceptParams) error
func (*Queries) DeleteMCPServersByAgentExcept ¶
func (q *Queries) DeleteMCPServersByAgentExcept(ctx context.Context, arg DeleteMCPServersByAgentExceptParams) error
Delete MCP servers not in the current sync.
func (*Queries) DeleteMessagesByConversation ¶
func (*Queries) DeleteOAuthState ¶
func (*Queries) DeletePlatformIdentity ¶
func (q *Queries) DeletePlatformIdentity(ctx context.Context, arg DeletePlatformIdentityParams) error
func (*Queries) DeleteProvider ¶
func (*Queries) DeleteRoutesByAgentExcept ¶
func (q *Queries) DeleteRoutesByAgentExcept(ctx context.Context, arg DeleteRoutesByAgentExceptParams) error
func (*Queries) DeleteStaleAgentModelSlots ¶
func (q *Queries) DeleteStaleAgentModelSlots(ctx context.Context, arg DeleteStaleAgentModelSlotsParams) error
func (*Queries) DeleteStaleAgentTools ¶
func (q *Queries) DeleteStaleAgentTools(ctx context.Context, arg DeleteStaleAgentToolsParams) error
func (*Queries) DeleteTopicsByAgentExcept ¶
func (q *Queries) DeleteTopicsByAgentExcept(ctx context.Context, arg DeleteTopicsByAgentExceptParams) error
func (*Queries) DeleteUser ¶
func (*Queries) DeleteWebhooksByAgentExcept ¶
func (q *Queries) DeleteWebhooksByAgentExcept(ctx context.Context, arg DeleteWebhooksByAgentExceptParams) error
func (*Queries) GetActiveLockout ¶
func (q *Queries) GetActiveLockout(ctx context.Context, arg GetActiveLockoutParams) (GetActiveLockoutRow, error)
Returns the lockout row only if it is currently in effect (locked_until in the future). Caller treats "no rows" as "not locked".
func (*Queries) GetAgentBuild ¶
func (*Queries) GetAgentByID ¶
func (*Queries) GetAgentBySlug ¶
func (*Queries) GetAgentForUpgrade ¶
func (*Queries) GetAgentMember ¶
func (q *Queries) GetAgentMember(ctx context.Context, arg GetAgentMemberParams) (AgentMember, error)
func (*Queries) GetAgentModelSlot ¶
func (q *Queries) GetAgentModelSlot(ctx context.Context, arg GetAgentModelSlotParams) (AgentModelSlot, error)
func (*Queries) GetBridgeByAgentID ¶
Find the bridge bound to a specific agent
func (*Queries) GetBridgeByID ¶
func (*Queries) GetCachedAttachmentURL ¶
func (q *Queries) GetCachedAttachmentURL(ctx context.Context, arg GetCachedAttachmentURLParams) (GetCachedAttachmentURLRow, error)
Returns the cached presigned URL only if it has at least @min_remaining left before expiry. Caller treats "no rows" as cache miss → mint fresh.
func (*Queries) GetConnectionBySlug ¶
func (q *Queries) GetConnectionBySlug(ctx context.Context, arg GetConnectionBySlugParams) (Connection, error)
func (*Queries) GetConnectionForOAuth ¶
func (q *Queries) GetConnectionForOAuth(ctx context.Context, arg GetConnectionForOAuthParams) (GetConnectionForOAuthRow, error)
For OAuth flow: need auth_url, token_url, scopes, client_id, client_secret
func (*Queries) GetConnectionWithCredentialStatus ¶
func (q *Queries) GetConnectionWithCredentialStatus(ctx context.Context, arg GetConnectionWithCredentialStatusParams) (GetConnectionWithCredentialStatusRow, error)
Returns connection with enough info to determine if authorized
func (*Queries) GetConversationByExternal ¶ added in v0.2.8
func (q *Queries) GetConversationByExternal(ctx context.Context, arg GetConversationByExternalParams) (AgentConversation, error)
Non-creating lookup for public bridge conversations. Used by HandleCallback when a button tap arrives for an unauthenticated user.
func (*Queries) GetConversationByID ¶
func (*Queries) GetConversationBySource ¶
func (q *Queries) GetConversationBySource(ctx context.Context, arg GetConversationBySourceParams) (AgentConversation, error)
Non-creating lookup used by the bridge manager when it needs to read per-chat settings before any new conversation row would be created.
func (*Queries) GetConversationIDByRun ¶
func (q *Queries) GetConversationIDByRun(ctx context.Context, runID pgtype.UUID) (pgtype.UUID, error)
Resolves the conversation a run is attached to via any message's run_id. Cron- or webhook-triggered runs that never wrote a message return no rows.
func (*Queries) GetCronByAgentAndName ¶
func (*Queries) GetDirectoryByPath ¶ added in v0.2.0
func (q *Queries) GetDirectoryByPath(ctx context.Context, arg GetDirectoryByPathParams) (AgentDirectory, error)
Longest-prefix match for nested registrations. Returns the most-specific directory whose path is a prefix of the requested path.
func (*Queries) GetLatestSuspendedRun ¶
func (*Queries) GetLockoutForUpdate ¶
func (q *Queries) GetLockoutForUpdate(ctx context.Context, arg GetLockoutForUpdateParams) (GetLockoutForUpdateRow, error)
Locks the row for the duration of the surrounding transaction so two concurrent failure paths agree on the next tier. Returns no rows on first-ever lockout for this (email, ip).
func (*Queries) GetMCPServerBySlug ¶
func (q *Queries) GetMCPServerBySlug(ctx context.Context, arg GetMCPServerBySlugParams) (AgentMcpServer, error)
func (*Queries) GetMCPServerForOAuth ¶
func (q *Queries) GetMCPServerForOAuth(ctx context.Context, arg GetMCPServerForOAuthParams) (GetMCPServerForOAuthRow, error)
func (*Queries) GetOAuthState ¶
func (*Queries) GetOrCreateConversation ¶
func (q *Queries) GetOrCreateConversation(ctx context.Context, arg GetOrCreateConversationParams) (GetOrCreateConversationRow, error)
DM-only: one conversation per user per agent per source. Upserts on (agent_id, user_id, source). Targets the partial unique index `idx_conversations_dm` — the WHERE clause on conflict_target is required for Postgres to infer the partial index.
func (*Queries) GetOrCreateConversationByExternal ¶ added in v0.2.8
func (q *Queries) GetOrCreateConversationByExternal(ctx context.Context, arg GetOrCreateConversationByExternalParams) (GetOrCreateConversationByExternalRow, error)
Public bridge conversations: keyed on (agent_id, source, external_id) with user_id NULL. One conversation per platform DM channel. Targets the partial unique index `idx_conversations_external`.
func (*Queries) GetPlatformIdentity ¶
func (q *Queries) GetPlatformIdentity(ctx context.Context, arg GetPlatformIdentityParams) (PlatformIdentity, error)
Look up Airlock user by their platform identity
func (*Queries) GetProviderByID ¶
func (*Queries) GetProviderByProviderID ¶
func (*Queries) GetRunByID ¶
func (*Queries) GetRunCheckpoint ¶
func (*Queries) GetSuspendedRunByID ¶
func (*Queries) GetSystemBridge ¶
The system bridge — there should be at most one
func (*Queries) GetSystemSettings ¶
func (q *Queries) GetSystemSettings(ctx context.Context) (SystemSetting, error)
func (*Queries) GetTenantByID ¶
func (*Queries) GetTenantBySlug ¶
func (*Queries) GetTopicBySlug ¶
func (q *Queries) GetTopicBySlug(ctx context.Context, arg GetTopicBySlugParams) (AgentTopic, error)
func (*Queries) GetUserByEmail ¶
func (*Queries) GetUserByID ¶
func (*Queries) GetUserByOIDCSub ¶
func (*Queries) GetWebhookByAgentAndPath ¶
func (q *Queries) GetWebhookByAgentAndPath(ctx context.Context, arg GetWebhookByAgentAndPathParams) (AgentWebhook, error)
func (*Queries) HasAgentAccess ¶
func (*Queries) HasDirtyMCPServers ¶
Check if any MCP server has been updated since last sync (for dirty flag).
func (*Queries) ListActiveBridges ¶
All active bridges (for polling on startup)
func (*Queries) ListAgentBuildsByAgent ¶
func (*Queries) ListAgentIDsByMember ¶
func (q *Queries) ListAgentIDsByMember(ctx context.Context, userID pgtype.UUID) ([]pgtype.UUID, error)
Used by the WS upgrade handler to auto-subscribe a fresh connection to every agent the user has access to. The WS connection receives events for all these topics; the client filters by topic/conversation before rendering.
func (*Queries) ListAgentMembers ¶
func (*Queries) ListAgentModelSlots ¶
func (*Queries) ListAgentTools ¶
func (*Queries) ListAgentsByUser ¶
func (*Queries) ListAgentsByUserID ¶
func (*Queries) ListAllEnabledCrons ¶
func (*Queries) ListAllMessagesByConversation ¶
func (q *Queries) ListAllMessagesByConversation(ctx context.Context, conversationID pgtype.UUID) ([]AgentMessage, error)
UI loading — includes all messages. Run-grouped: rows that share a run_id stay together in the slot of the run's first message; tiebreak by ephemeral (non-ephemeral first) then seq.
func (*Queries) ListBridgesAccessible ¶
func (q *Queries) ListBridgesAccessible(ctx context.Context, userID pgtype.UUID) ([]ListBridgesAccessibleRow, error)
Non-admin variant: system bridges plus bridges bound to agents the user has access to via agent_members, plus bridges the user created that have since been orphaned (agent deleted but bridge preserved). The agent's creator is auto-added to agent_members at agent-create time, so the membership check also covers "agents I created."
func (*Queries) ListBridgesAdmin ¶
func (q *Queries) ListBridgesAdmin(ctx context.Context) ([]ListBridgesAdminRow, error)
Admin variant: every bridge in the tenant with the creator joined for the Owner column in the UI. created_by is NULL for system bridges, so LEFT JOIN keeps those rows.
func (*Queries) ListBridgesByAgentID ¶ added in v0.2.8
func (q *Queries) ListBridgesByAgentID(ctx context.Context, agentID pgtype.UUID) ([]pgtype.UUID, error)
All bridges bound to a specific agent. The schema doesn't unique-constrain bridges.agent_id, so use this to enumerate before tearing the agent down — the agent Delete handler must cancel each poller individually since CASCADE delete kills only the DB row, leaving the in-memory goroutine polling forever (and racing on the bot token if the bridge is re-added).
func (*Queries) ListBridgesForAgent ¶
Bridges relevant to a specific agent: its own bridge + system bridges.
func (*Queries) ListConnectionsByAgent ¶
func (*Queries) ListConnectionsWithStatus ¶
func (q *Queries) ListConnectionsWithStatus(ctx context.Context, agentID pgtype.UUID) ([]ListConnectionsWithStatusRow, error)
For GET /api/v1/agents/{agentID}/connections
func (*Queries) ListConversationsByAgent ¶
func (q *Queries) ListConversationsByAgent(ctx context.Context, arg ListConversationsByAgentParams) ([]AgentConversation, error)
Returns conversations for the given agent visible to the given user.
func (*Queries) ListCronsByAgent ¶
func (*Queries) ListDirectoriesByAgent ¶ added in v0.2.0
func (*Queries) ListDirectoriesWithRetention ¶ added in v0.2.8
func (q *Queries) ListDirectoriesWithRetention(ctx context.Context) ([]ListDirectoriesWithRetentionRow, error)
All directories opted into the storage sweep (retention_hours > 0). Per-agent so the sweeper can build "agents/{agent_id}{path}/" S3 prefixes to scan + delete from. Ordering is purely cosmetic for log readability.
func (*Queries) ListExpiredPublicConversations ¶ added in v0.2.8
func (q *Queries) ListExpiredPublicConversations(ctx context.Context) ([]ListExpiredPublicConversationsRow, error)
Sweeper input: public bridge conversations whose updated_at is older than the bridge's configured TTL. TTL is `bridges.settings.public_session_ttl_seconds` — 0 disables sweeping for that bridge, default is 10800s (3 hours).
func (*Queries) ListExpiringConnections ¶
func (q *Queries) ListExpiringConnections(ctx context.Context, expiryThreshold pgtype.Timestamptz) ([]ListExpiringConnectionsRow, error)
For refresh job: find tokens expiring within buffer window
func (*Queries) ListExpiringMCPServers ¶
func (q *Queries) ListExpiringMCPServers(ctx context.Context, expiryThreshold pgtype.Timestamptz) ([]ListExpiringMCPServersRow, error)
For refresh job: find tokens expiring within buffer window.
func (*Queries) ListMCPServersByAgent ¶
func (*Queries) ListMCPServersWithStatus ¶
func (q *Queries) ListMCPServersWithStatus(ctx context.Context, agentID pgtype.UUID) ([]ListMCPServersWithStatusRow, error)
For frontend: list with auth status
func (*Queries) ListMessagesBackward ¶
func (q *Queries) ListMessagesBackward(ctx context.Context, arg ListMessagesBackwardParams) ([]AgentMessage, error)
Older page for infinite-scroll-up. Returns up to @lim messages with seq strictly less than @before, back in chronological order for easy prepend.
func (*Queries) ListMessagesByConversation ¶
func (q *Queries) ListMessagesByConversation(ctx context.Context, conversationID pgtype.UUID) ([]AgentMessage, error)
Initial UI page: the 100 most recent messages, returned in chronological order. The handler overfetches by one (LIMIT 101) so it can report has_older_messages without a second COUNT query; the extra row is trimmed before the response is built. Ordering is by seq (monotonic insertion order) — created_at alone ties when multiple rows are inserted in one transaction (assistant + tool batch).
func (*Queries) ListMessagesByRun ¶
func (*Queries) ListMessagesForward ¶
func (q *Queries) ListMessagesForward(ctx context.Context, arg ListMessagesForwardParams) ([]AgentMessage, error)
Newer page for scroll-down after eviction. Returns up to @lim messages with seq strictly greater than @after, in chronological order.
func (*Queries) ListOrphanToolCallsByRun ¶ added in v0.2.8
func (q *Queries) ListOrphanToolCallsByRun(ctx context.Context, runID pgtype.UUID) ([]ListOrphanToolCallsByRunRow, error)
Returns tool-call parts emitted by this run that don't have a matching tool-result row in the same conversation. RunComplete and the sweeper iterate this and INSERT synthetic tool messages so the conversation's tool_use ↔ tool_result invariant holds for the next LLM turn (provider APIs 400 on unpaired tool_use). parts JSONB shape is the goai layout: {"type":"tool-call","toolCallId":...,"toolName":...,"args":...}.
func (*Queries) ListPlatformIdentitiesByUser ¶
func (*Queries) ListProviders ¶
func (*Queries) ListRoutesByAgent ¶
func (*Queries) ListRoutesByAgentAndMethod ¶
func (q *Queries) ListRoutesByAgentAndMethod(ctx context.Context, arg ListRoutesByAgentAndMethodParams) ([]AgentRoute, error)
func (*Queries) ListRunningByAgent ¶
func (*Queries) ListRunsByAgent ¶
func (*Queries) ListSessionMessagesByConversation ¶
func (q *Queries) ListSessionMessagesByConversation(ctx context.Context, conversationID pgtype.UUID) ([]AgentMessage, error)
Agent context loading — excludes ephemeral messages (printToUser output) and messages before the active context checkpoint. When no checkpoint is set, returns all non-ephemeral messages. Checkpoint-marker rows (source='checkpoint') are UI-only metadata and are never sent to the LLM.
func (*Queries) ListStuckRuns ¶ added in v0.2.8
func (q *Queries) ListStuckRuns(ctx context.Context, cutoff pgtype.Timestamptz) ([]ListStuckRunsRow, error)
Runs presumed dead because they haven't seen a terminal status update past the cutoff (started_at + outer dispatcher timeout + grace). The sweeper marks them error/agent-disconnected, synthesizes orphan tool-results, and publishes a synthetic run.complete WS event.
func (*Queries) ListSubscribedConversations ¶
func (*Queries) ListTopicSubscriptions ¶
func (q *Queries) ListTopicSubscriptions(ctx context.Context, arg ListTopicSubscriptionsParams) ([]ListTopicSubscriptionsRow, error)
func (*Queries) ListTopicsByAgent ¶
func (*Queries) ListWebhooksByAgent ¶
func (*Queries) ListWebhooksByAgentWithStatus ¶
func (*Queries) PruneAuthFailures ¶
Background pruner: drop failure rows older than 24h.
func (*Queries) PruneExpiredAttachmentURLs ¶
Background pruner: delete URL cache rows that expired more than 24h ago. Stale rows aren't harmful (just unused) but bounded growth is nice.
func (*Queries) PruneStaleAuthLockouts ¶
Background pruner: drop expired lockout rows that haven't been touched in 24h so a fresh lockout starts at tier 0 again.
func (*Queries) RecordAuthFailure ¶
func (q *Queries) RecordAuthFailure(ctx context.Context, arg RecordAuthFailureParams) error
func (*Queries) RemoveAgentMember ¶
func (q *Queries) RemoveAgentMember(ctx context.Context, arg RemoveAgentMemberParams) error
func (*Queries) ResetStuckAgentBuilds ¶
func (*Queries) ResetStuckBuilds ¶
func (*Queries) ResetStuckRuns ¶
func (*Queries) ResetStuckUpgrades ¶
func (*Queries) ResolveSuspendedRun ¶
func (*Queries) SetActivationCode ¶
Sets the activation code only if one hasn't been set yet. Returns rows affected: 0 means another writer already set it.
func (*Queries) SetAgentModelSlotAssignment ¶
func (q *Queries) SetAgentModelSlotAssignment(ctx context.Context, arg SetAgentModelSlotAssignmentParams) error
func (*Queries) SetConversationCheckpoint ¶
func (q *Queries) SetConversationCheckpoint(ctx context.Context, arg SetConversationCheckpointParams) error
func (*Queries) SubscribeTopic ¶
func (q *Queries) SubscribeTopic(ctx context.Context, arg SubscribeTopicParams) error
func (*Queries) SumPreCheckpointTokens ¶
func (q *Queries) SumPreCheckpointTokens(ctx context.Context, conversationID pgtype.UUID) (int64, error)
Sum of input+output tokens for messages before the current checkpoint (or all messages if no checkpoint is set). Used when a new checkpoint is being created to compute how many tokens are being freed.
func (*Queries) UnsubscribeTopic ¶
func (q *Queries) UnsubscribeTopic(ctx context.Context, arg UnsubscribeTopicParams) error
func (*Queries) UpdateAgentBuildComplete ¶
func (q *Queries) UpdateAgentBuildComplete(ctx context.Context, arg UpdateAgentBuildCompleteParams) error
func (*Queries) UpdateAgentBuildLogs ¶
func (q *Queries) UpdateAgentBuildLogs(ctx context.Context, arg UpdateAgentBuildLogsParams) error
func (*Queries) UpdateAgentConfig ¶
func (q *Queries) UpdateAgentConfig(ctx context.Context, arg UpdateAgentConfigParams) error
func (*Queries) UpdateAgentDescription ¶
func (q *Queries) UpdateAgentDescription(ctx context.Context, arg UpdateAgentDescriptionParams) error
func (*Queries) UpdateAgentErrorMessage ¶
func (q *Queries) UpdateAgentErrorMessage(ctx context.Context, arg UpdateAgentErrorMessageParams) error
func (*Queries) UpdateAgentExtraPrompts ¶
func (q *Queries) UpdateAgentExtraPrompts(ctx context.Context, arg UpdateAgentExtraPromptsParams) error
func (*Queries) UpdateAgentFields ¶
func (*Queries) UpdateAgentModels ¶
func (q *Queries) UpdateAgentModels(ctx context.Context, arg UpdateAgentModelsParams) error
Atomic replace of all eight per-agent model override columns. Empty strings mean "inherit the corresponding system default".
func (*Queries) UpdateAgentRefs ¶
func (q *Queries) UpdateAgentRefs(ctx context.Context, arg UpdateAgentRefsParams) error
func (*Queries) UpdateAgentSDKVersion ¶
func (q *Queries) UpdateAgentSDKVersion(ctx context.Context, arg UpdateAgentSDKVersionParams) error
func (*Queries) UpdateAgentStatus ¶
func (q *Queries) UpdateAgentStatus(ctx context.Context, arg UpdateAgentStatusParams) error
func (*Queries) UpdateAgentUpgradeStatus ¶
func (q *Queries) UpdateAgentUpgradeStatus(ctx context.Context, arg UpdateAgentUpgradeStatusParams) error
func (*Queries) UpdateBridgeAgentID ¶
func (q *Queries) UpdateBridgeAgentID(ctx context.Context, arg UpdateBridgeAgentIDParams) (Bridge, error)
Reassign a bridge to a different agent. An empty (NULL) agent_id makes it a system bridge. The running poller must be reloaded via BridgeManager.AddBridge after this update — it holds AgentID in memory.
func (*Queries) UpdateBridgeLastPolled ¶
func (q *Queries) UpdateBridgeLastPolled(ctx context.Context, arg UpdateBridgeLastPolledParams) error
func (*Queries) UpdateBridgeSettings ¶ added in v0.2.8
func (q *Queries) UpdateBridgeSettings(ctx context.Context, arg UpdateBridgeSettingsParams) (Bridge, error)
Replaces the whole settings JSON. Caller is responsible for merging if they want partial updates; v1 of the edit dialog sends the full payload.
func (*Queries) UpdateBridgeStatus ¶
func (q *Queries) UpdateBridgeStatus(ctx context.Context, arg UpdateBridgeStatusParams) error
func (*Queries) UpdateConnectionCredentials ¶
func (q *Queries) UpdateConnectionCredentials(ctx context.Context, arg UpdateConnectionCredentialsParams) error
func (*Queries) UpdateConnectionOAuthApp ¶
func (q *Queries) UpdateConnectionOAuthApp(ctx context.Context, arg UpdateConnectionOAuthAppParams) error
User enters OAuth client_id + client_secret
func (*Queries) UpdateConversationSettings ¶
func (q *Queries) UpdateConversationSettings(ctx context.Context, arg UpdateConversationSettingsParams) error
Merges a JSONB patch into agent_conversations.settings. Used by the /echo slash command and any future per-chat preferences.
func (*Queries) UpdateCronLastFired ¶
func (*Queries) UpdateMCPServerCredentials ¶
func (q *Queries) UpdateMCPServerCredentials(ctx context.Context, arg UpdateMCPServerCredentialsParams) error
func (*Queries) UpdateMCPServerDiscovery ¶ added in v0.2.8
func (q *Queries) UpdateMCPServerDiscovery(ctx context.Context, arg UpdateMCPServerDiscoveryParams) error
Lazy re-discovery: refresh auth_url / token_url / registration_endpoint after a fresh RFC 8414 fetch. Only used by oauth_discovery's MCPOAuthStart when registration_endpoint is missing (the only path forward for DCR). Does NOT touch credentials — re-discovery never invalidates auth state by itself; callers chain it with DCR + UpdateMCPServerOAuthApp when needed.
func (*Queries) UpdateMCPServerOAuthApp ¶
func (q *Queries) UpdateMCPServerOAuthApp(ctx context.Context, arg UpdateMCPServerOAuthAppParams) error
func (*Queries) UpdateMCPServerToolSchemas ¶
func (q *Queries) UpdateMCPServerToolSchemas(ctx context.Context, arg UpdateMCPServerToolSchemasParams) error
func (*Queries) UpdateProvider ¶
func (*Queries) UpdateRunCheckpoint ¶
func (q *Queries) UpdateRunCheckpoint(ctx context.Context, arg UpdateRunCheckpointParams) error
func (*Queries) UpdateRunComplete ¶
func (q *Queries) UpdateRunComplete(ctx context.Context, arg UpdateRunCompleteParams) error
func (*Queries) UpdateRunLLMStats ¶
func (q *Queries) UpdateRunLLMStats(ctx context.Context, arg UpdateRunLLMStatsParams) error
Aggregates per-message tokens / call count into the run's totals and multiplies tokens by per-million-token rates to produce a cost estimate. Idempotent — safe to invoke after the agent's RunComplete handler and again from the bg stream goroutine (timeout fallback). Source of truth for tokens is agent_messages, which the SessionStore populates per assistant turn. Cost rates come from sol's models.dev catalog ($ per million tokens) — pass 0/0 for models without pricing data and the estimate stays 0.
func (*Queries) UpdateRunStatus ¶
func (q *Queries) UpdateRunStatus(ctx context.Context, arg UpdateRunStatusParams) error
func (*Queries) UpdateSystemSettings ¶
func (q *Queries) UpdateSystemSettings(ctx context.Context, arg UpdateSystemSettingsParams) (SystemSetting, error)
func (*Queries) UpdateUserNameEmail ¶
func (q *Queries) UpdateUserNameEmail(ctx context.Context, arg UpdateUserNameEmailParams) error
func (*Queries) UpdateUserPassword ¶
func (q *Queries) UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) error
func (*Queries) UpdateUserRole ¶
func (q *Queries) UpdateUserRole(ctx context.Context, arg UpdateUserRoleParams) error
func (*Queries) UpdateWebhookLastReceived ¶
func (*Queries) UpdateWebhookSecret ¶
func (q *Queries) UpdateWebhookSecret(ctx context.Context, arg UpdateWebhookSecretParams) error
func (*Queries) UpsertAgentModelSlot ¶
func (q *Queries) UpsertAgentModelSlot(ctx context.Context, arg UpsertAgentModelSlotParams) error
Reconciles slot declaration on every sync. capability and description come from the agent code; assigned_model is admin-controlled and must survive re-syncs untouched.
func (*Queries) UpsertAgentTool ¶
func (q *Queries) UpsertAgentTool(ctx context.Context, arg UpsertAgentToolParams) error
func (*Queries) UpsertCachedAttachmentURL ¶
func (q *Queries) UpsertCachedAttachmentURL(ctx context.Context, arg UpsertCachedAttachmentURLParams) error
func (*Queries) UpsertConnection ¶
func (q *Queries) UpsertConnection(ctx context.Context, arg UpsertConnectionParams) (Connection, error)
When scopes change, clear credentials so the user must re-authorize with the new scopes. Credential fields (client_id, client_secret, credentials, refresh_token) are passed explicitly as ” on first insert; the ON CONFLICT clause preserves existing credentials unless scopes changed.
func (*Queries) UpsertCron ¶
func (q *Queries) UpsertCron(ctx context.Context, arg UpsertCronParams) error
enabled defaults to true on first insert; unchanged on conflict.
func (*Queries) UpsertDirectory ¶ added in v0.2.0
func (q *Queries) UpsertDirectory(ctx context.Context, arg UpsertDirectoryParams) error
func (*Queries) UpsertLockout ¶
func (q *Queries) UpsertLockout(ctx context.Context, arg UpsertLockoutParams) error
Set or update the lockout row with caller-computed tier + locked_until. The escalation policy is computed in Go (auth/lockout.Policy).
func (*Queries) UpsertMCPServer ¶
func (q *Queries) UpsertMCPServer(ctx context.Context, arg UpsertMCPServerParams) (AgentMcpServer, error)
When url or scopes change, clear credentials so the user must re-authorize. Discovery + credential fields are passed explicitly as empty on first insert; ON CONFLICT preserves existing credentials unless invalidated. registration_endpoint is taken from EXCLUDED only when newly populated — a fresh discovery run that turned up empty doesn't blow away a previously discovered endpoint.
func (*Queries) UpsertPlatformIdentity ¶
func (q *Queries) UpsertPlatformIdentity(ctx context.Context, arg UpsertPlatformIdentityParams) (PlatformIdentity, error)
func (*Queries) UpsertRoute ¶
func (q *Queries) UpsertRoute(ctx context.Context, arg UpsertRouteParams) error
func (*Queries) UpsertRunComplete ¶
func (q *Queries) UpsertRunComplete(ctx context.Context, arg UpsertRunCompleteParams) error
Recovery path: row may not exist if CreateRun never landed. All "starts empty" fields (logs, llm counters, compacted) passed explicitly. trigger_type/trigger_ref/source_ref placeholders apply only when the row is brand-new — the agent's r.Complete arrives without trigger context; the dispatcher's CreateRun would have set the real values.
func (*Queries) UpsertTopic ¶
func (q *Queries) UpsertTopic(ctx context.Context, arg UpsertTopicParams) error
func (*Queries) UpsertWebhook ¶
func (q *Queries) UpsertWebhook(ctx context.Context, arg UpsertWebhookParams) error
secret is initially ” — populated later by UpdateWebhookSecret when the user generates an HMAC verification secret.
type RecordAuthFailureParams ¶
type RemoveAgentMemberParams ¶
type Run ¶
type Run struct {
ID pgtype.UUID `json:"id"`
AgentID pgtype.UUID `json:"agent_id"`
BridgeID pgtype.UUID `json:"bridge_id"`
Status string `json:"status"`
TriggerType string `json:"trigger_type"`
TriggerRef string `json:"trigger_ref"`
SourceRef string `json:"source_ref"`
InputPayload []byte `json:"input_payload"`
Actions []byte `json:"actions"`
LlmCalls int32 `json:"llm_calls"`
LlmTokensIn int32 `json:"llm_tokens_in"`
LlmTokensOut int32 `json:"llm_tokens_out"`
LlmCostEstimate pgtype.Numeric `json:"llm_cost_estimate"`
DurationMs pgtype.Int4 `json:"duration_ms"`
Logs string `json:"logs"`
StdoutLog string `json:"stdout_log"`
ErrorMessage string `json:"error_message"`
ErrorKind string `json:"error_kind"`
ExitCode pgtype.Int4 `json:"exit_code"`
PanicTrace string `json:"panic_trace"`
Checkpoint []byte `json:"checkpoint"`
Compacted bool `json:"compacted"`
StartedAt pgtype.Timestamptz `json:"started_at"`
FinishedAt pgtype.Timestamptz `json:"finished_at"`
}
type SubscribeTopicParams ¶
type SystemSetting ¶
type SystemSetting struct {
ID bool `json:"id"`
PublicUrl string `json:"public_url"`
AgentDomain string `json:"agent_domain"`
DefaultBuildModel string `json:"default_build_model"`
DefaultExecModel string `json:"default_exec_model"`
DefaultSttModel string `json:"default_stt_model"`
DefaultVisionModel string `json:"default_vision_model"`
DefaultTtsModel string `json:"default_tts_model"`
DefaultImageGenModel string `json:"default_image_gen_model"`
DefaultEmbeddingModel string `json:"default_embedding_model"`
DefaultSearchModel string `json:"default_search_model"`
ActivationCode pgtype.Text `json:"activation_code"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type Tenant ¶
type Tenant struct {
ID pgtype.UUID `json:"id"`
Slug string `json:"slug"`
Name string `json:"name"`
Settings []byte `json:"settings"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
type TopicSubscription ¶
type UnsubscribeTopicParams ¶
type UpdateAgentConfigParams ¶
type UpdateAgentFieldsParams ¶
type UpdateAgentModelsParams ¶
type UpdateAgentModelsParams struct {
BuildModel string `json:"build_model"`
ExecModel string `json:"exec_model"`
SttModel string `json:"stt_model"`
VisionModel string `json:"vision_model"`
TtsModel string `json:"tts_model"`
ImageGenModel string `json:"image_gen_model"`
EmbeddingModel string `json:"embedding_model"`
SearchModel string `json:"search_model"`
ID pgtype.UUID `json:"id"`
}
type UpdateAgentRefsParams ¶
type UpdateAgentStatusParams ¶
type UpdateBridgeSettingsParams ¶ added in v0.2.8
type UpdateMCPServerDiscoveryParams ¶ added in v0.2.8
type UpdateProviderParams ¶
type UpdateRunCompleteParams ¶
type UpdateRunLLMStatsParams ¶
type UpdateRunStatusParams ¶
type UpdateSystemSettingsParams ¶
type UpdateSystemSettingsParams struct {
PublicUrl string `json:"public_url"`
AgentDomain string `json:"agent_domain"`
DefaultBuildModel string `json:"default_build_model"`
DefaultExecModel string `json:"default_exec_model"`
DefaultSttModel string `json:"default_stt_model"`
DefaultVisionModel string `json:"default_vision_model"`
DefaultTtsModel string `json:"default_tts_model"`
DefaultImageGenModel string `json:"default_image_gen_model"`
DefaultEmbeddingModel string `json:"default_embedding_model"`
DefaultSearchModel string `json:"default_search_model"`
}
type UpdateUserRoleParams ¶
type UpsertAgentToolParams ¶
type UpsertCachedAttachmentURLParams ¶
type UpsertCachedAttachmentURLParams struct {
CanonicalKey string `json:"canonical_key"`
Url string `json:"url"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
}
type UpsertConnectionParams ¶
type UpsertConnectionParams struct {
AgentID pgtype.UUID `json:"agent_id"`
Slug string `json:"slug"`
Name string `json:"name"`
Description string `json:"description"`
LlmHint string `json:"llm_hint"`
AuthMode string `json:"auth_mode"`
AuthUrl string `json:"auth_url"`
TokenUrl string `json:"token_url"`
BaseUrl string `json:"base_url"`
Scopes string `json:"scopes"`
AuthInjection []byte `json:"auth_injection"`
SetupInstructions string `json:"setup_instructions"`
TestPath string `json:"test_path"`
Config []byte `json:"config"`
Access string `json:"access"`
}
type UpsertCronParams ¶
type UpsertDirectoryParams ¶ added in v0.2.0
type UpsertDirectoryParams struct {
AgentID pgtype.UUID `json:"agent_id"`
Path string `json:"path"`
ReadAccess string `json:"read_access"`
WriteAccess string `json:"write_access"`
ListAccess string `json:"list_access"`
Description string `json:"description"`
LlmHint string `json:"llm_hint"`
RetentionHours int32 `json:"retention_hours"`
}
type UpsertLockoutParams ¶
type UpsertLockoutParams struct {
Email string `json:"email"`
Ip string `json:"ip"`
LockedUntil pgtype.Timestamptz `json:"locked_until"`
Tier int32 `json:"tier"`
}
type UpsertMCPServerParams ¶
type UpsertMCPServerParams struct {
AgentID pgtype.UUID `json:"agent_id"`
Slug string `json:"slug"`
Name string `json:"name"`
Url string `json:"url"`
AuthMode string `json:"auth_mode"`
AuthUrl string `json:"auth_url"`
TokenUrl string `json:"token_url"`
RegistrationEndpoint string `json:"registration_endpoint"`
Scopes string `json:"scopes"`
Access string `json:"access"`
}
type UpsertRouteParams ¶
type UpsertRunCompleteParams ¶
type UpsertRunCompleteParams struct {
ID pgtype.UUID `json:"id"`
AgentID pgtype.UUID `json:"agent_id"`
Status string `json:"status"`
ErrorMessage string `json:"error_message"`
ErrorKind string `json:"error_kind"`
Actions []byte `json:"actions"`
StdoutLog string `json:"stdout_log"`
PanicTrace string `json:"panic_trace"`
}
type UpsertTopicParams ¶
type UpsertWebhookParams ¶
type User ¶
type User struct {
ID pgtype.UUID `json:"id"`
Email string `json:"email"`
DisplayName string `json:"display_name"`
TenantRole string `json:"tenant_role"`
PasswordHash string `json:"password_hash"`
OidcSub string `json:"oidc_sub"`
MustChangePassword bool `json:"must_change_password"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}
Source Files
¶
- agent_builds.sql.go
- agent_crons.sql.go
- agent_members.sql.go
- agent_model_slots.sql.go
- agent_routes.sql.go
- agent_tools.sql.go
- agent_topics.sql.go
- agent_webhooks.sql.go
- agents.sql.go
- attachment_url_cache.sql.go
- auth_lockouts.sql.go
- bridges.sql.go
- connections.sql.go
- conversations.sql.go
- db.go
- directories.sql.go
- mcp_servers.sql.go
- messages.sql.go
- models.go
- oauth_states.sql.go
- platform_identities.sql.go
- providers.sql.go
- runs.sql.go
- system_settings.sql.go
- tenants.sql.go
- users.sql.go