dbq

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddAgentMemberParams

type AddAgentMemberParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	UserID  pgtype.UUID `json:"user_id"`
	Role    string      `json:"role"`
}

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"`
	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"`
	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 AgentMember struct {
	AgentID   pgtype.UUID        `json:"agent_id"`
	UserID    pgtype.UUID        `json:"user_id"`
	Role      string             `json:"role"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

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 AgentModelSlot struct {
	AgentID       pgtype.UUID `json:"agent_id"`
	Slug          string      `json:"slug"`
	Capability    string      `json:"capability"`
	Description   string      `json:"description"`
	AssignedModel string      `json:"assigned_model"`
}

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"`
	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"`
	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"`
	Config         []byte             `json:"config"`
	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 ClearAuthFailuresParams struct {
	Email string `json:"email"`
	Ip    string `json:"ip"`
}

type ClearAuthLockoutParams

type ClearAuthLockoutParams struct {
	Email string `json:"email"`
	Ip    string `json:"ip"`
}

type ClearConnectionCredentialsParams

type ClearConnectionCredentialsParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	Slug    string      `json:"slug"`
}

type ClearMCPServerCredentialsParams

type ClearMCPServerCredentialsParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	Slug    string      `json:"slug"`
}

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"`
	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 CountRecentFailuresParams

type CountRecentFailuresParams struct {
	Email         string `json:"email"`
	Ip            string `json:"ip"`
	WindowMinutes int32  `json:"window_minutes"`
}

type CreateAgentBuildParams

type CreateAgentBuildParams struct {
	AgentID      pgtype.UUID `json:"agent_id"`
	Type         string      `json:"type"`
	Instructions string      `json:"instructions"`
}

type CreateAgentParams

type CreateAgentParams struct {
	Name        string      `json:"name"`
	Slug        string      `json:"slug"`
	UserID      pgtype.UUID `json:"user_id"`
	Description string      `json:"description"`
	Config      []byte      `json:"config"`
}

type CreateBridgeParams

type CreateBridgeParams struct {
	Type           string      `json:"type"`
	Name           string      `json:"name"`
	TokenEncrypted string      `json:"token_encrypted"`
	BotUsername    string      `json:"bot_username"`
	AgentID        pgtype.UUID `json:"agent_id"`
	CreatedBy      pgtype.UUID `json:"created_by"`
}

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 CreatePlatformIdentityParams

type CreatePlatformIdentityParams struct {
	UserID         pgtype.UUID `json:"user_id"`
	Platform       string      `json:"platform"`
	PlatformUserID string      `json:"platform_user_id"`
}

type CreateProviderParams

type CreateProviderParams struct {
	ProviderID  string `json:"provider_id"`
	DisplayName string `json:"display_name"`
	ApiKey      string `json:"api_key"`
	BaseUrl     string `json:"base_url"`
	IsEnabled   bool   `json:"is_enabled"`
}

type CreateRunParams

type CreateRunParams struct {
	AgentID      pgtype.UUID `json:"agent_id"`
	BridgeID     pgtype.UUID `json:"bridge_id"`
	InputPayload []byte      `json:"input_payload"`
	SourceRef    string      `json:"source_ref"`
	TriggerType  string      `json:"trigger_type"`
	TriggerRef   string      `json:"trigger_ref"`
}

type CreateTenantParams

type CreateTenantParams struct {
	Name     string `json:"name"`
	Slug     string `json:"slug"`
	Settings []byte `json:"settings"`
}

type CreateUserParams

type CreateUserParams struct {
	Email              string `json:"email"`
	DisplayName        string `json:"display_name"`
	PasswordHash       string `json:"password_hash"`
	TenantRole         string `json:"tenant_role"`
	OidcSub            string `json:"oidc_sub"`
	MustChangePassword bool   `json:"must_change_password"`
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type DeleteCronsByAgentExceptParams

type DeleteCronsByAgentExceptParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	Names   []string    `json:"names"`
}

type DeleteDirectoriesByAgentExceptParams added in v0.2.0

type DeleteDirectoriesByAgentExceptParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	Paths   []string    `json:"paths"`
}

type DeleteMCPServersByAgentExceptParams

type DeleteMCPServersByAgentExceptParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	Slugs   []string    `json:"slugs"`
}

type DeletePlatformIdentityParams

type DeletePlatformIdentityParams struct {
	ID     pgtype.UUID `json:"id"`
	UserID pgtype.UUID `json:"user_id"`
}

type DeleteRoutesByAgentExceptParams

type DeleteRoutesByAgentExceptParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	Keys    []string    `json:"keys"`
}

type DeleteStaleAgentModelSlotsParams

type DeleteStaleAgentModelSlotsParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	Slugs   []string    `json:"slugs"`
}

type DeleteStaleAgentToolsParams

type DeleteStaleAgentToolsParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	Names   []string    `json:"names"`
}

type DeleteTopicsByAgentExceptParams

type DeleteTopicsByAgentExceptParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	Slugs   []string    `json:"slugs"`
}

type DeleteWebhooksByAgentExceptParams

type DeleteWebhooksByAgentExceptParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	Paths   []string    `json:"paths"`
}

type GetActiveLockoutParams

type GetActiveLockoutParams struct {
	Email string `json:"email"`
	Ip    string `json:"ip"`
}

type GetActiveLockoutRow

type GetActiveLockoutRow struct {
	LockedUntil pgtype.Timestamptz `json:"locked_until"`
	Tier        int32              `json:"tier"`
}

type GetAgentForUpgradeRow

type GetAgentForUpgradeRow struct {
	ID            pgtype.UUID `json:"id"`
	UpgradeStatus string      `json:"upgrade_status"`
}

type GetAgentMemberParams

type GetAgentMemberParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	UserID  pgtype.UUID `json:"user_id"`
}

type GetAgentModelSlotParams

type GetAgentModelSlotParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	Slug    string      `json:"slug"`
}

type GetCachedAttachmentURLParams

type GetCachedAttachmentURLParams struct {
	CanonicalKey string          `json:"canonical_key"`
	MinRemaining pgtype.Interval `json:"min_remaining"`
}

type GetCachedAttachmentURLRow

type GetCachedAttachmentURLRow struct {
	Url       string             `json:"url"`
	ExpiresAt pgtype.Timestamptz `json:"expires_at"`
}

type GetConnectionBySlugParams

type GetConnectionBySlugParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	Slug    string      `json:"slug"`
}

type GetConnectionForOAuthParams

type GetConnectionForOAuthParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	Slug    string      `json:"slug"`
}

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 GetConnectionWithCredentialStatusParams

type GetConnectionWithCredentialStatusParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	Slug    string      `json:"slug"`
}

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 GetConversationBySourceParams

type GetConversationBySourceParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	UserID  pgtype.UUID `json:"user_id"`
	Source  string      `json:"source"`
}

type GetCronByAgentAndNameParams

type GetCronByAgentAndNameParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	Name    string      `json:"name"`
}

type GetDirectoryByPathParams added in v0.2.0

type GetDirectoryByPathParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	Path    string      `json:"path"`
}

type GetLockoutForUpdateParams

type GetLockoutForUpdateParams struct {
	Email string `json:"email"`
	Ip    string `json:"ip"`
}

type GetLockoutForUpdateRow

type GetLockoutForUpdateRow struct {
	Tier         int32              `json:"tier"`
	LastLockedAt pgtype.Timestamptz `json:"last_locked_at"`
}

type GetMCPServerBySlugParams

type GetMCPServerBySlugParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	Slug    string      `json:"slug"`
}

type GetMCPServerForOAuthParams

type GetMCPServerForOAuthParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	Slug    string      `json:"slug"`
}

type GetMCPServerForOAuthRow

type GetMCPServerForOAuthRow 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 GetOrCreateConversationParams

type GetOrCreateConversationParams struct {
	AgentID    pgtype.UUID `json:"agent_id"`
	UserID     pgtype.UUID `json:"user_id"`
	Source     string      `json:"source"`
	Title      string      `json:"title"`
	BridgeID   pgtype.UUID `json:"bridge_id"`
	ExternalID pgtype.Text `json:"external_id"`
}

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 GetPlatformIdentityParams

type GetPlatformIdentityParams struct {
	Platform       string `json:"platform"`
	PlatformUserID string `json:"platform_user_id"`
}

type GetTopicBySlugParams

type GetTopicBySlugParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	Slug    string      `json:"slug"`
}

type GetWebhookByAgentAndPathParams

type GetWebhookByAgentAndPathParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	Path    string      `json:"path"`
}

type HasAgentAccessParams

type HasAgentAccessParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	UserID  pgtype.UUID `json:"user_id"`
}

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 ListAgentMembersRow struct {
	AgentID     pgtype.UUID        `json:"agent_id"`
	UserID      pgtype.UUID        `json:"user_id"`
	Role        string             `json:"role"`
	CreatedAt   pgtype.Timestamptz `json:"created_at"`
	Email       string             `json:"email"`
	DisplayName string             `json:"display_name"`
}

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"`
	Config           []byte             `json:"config"`
	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"`
	Config           []byte             `json:"config"`
	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 ListConversationsByAgentParams

type ListConversationsByAgentParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	UserID  pgtype.UUID `json:"user_id"`
}

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 ListMessagesBackwardParams

type ListMessagesBackwardParams struct {
	ConversationID pgtype.UUID `json:"conversation_id"`
	Before         int64       `json:"before"`
	Lim            int32       `json:"lim"`
}

type ListMessagesForwardParams

type ListMessagesForwardParams struct {
	ConversationID pgtype.UUID `json:"conversation_id"`
	After          int64       `json:"after"`
	Lim            int32       `json:"lim"`
}

type ListRoutesByAgentAndMethodParams

type ListRoutesByAgentAndMethodParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	Method  string      `json:"method"`
}

type ListRunsByAgentParams

type ListRunsByAgentParams struct {
	AgentID pgtype.UUID        `json:"agent_id"`
	Cursor  pgtype.Timestamptz `json:"cursor"`
	Lim     int32              `json:"lim"`
}

type ListSubscribedConversationsParams

type ListSubscribedConversationsParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	Slug    string      `json:"slug"`
}

type ListTopicSubscriptionsParams

type ListTopicSubscriptionsParams struct {
	AgentID        pgtype.UUID `json:"agent_id"`
	ConversationID pgtype.UUID `json:"conversation_id"`
}

type ListTopicSubscriptionsRow

type ListTopicSubscriptionsRow struct {
	ID               pgtype.UUID        `json:"id"`
	TopicID          pgtype.UUID        `json:"topic_id"`
	ConversationID   pgtype.UUID        `json:"conversation_id"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	TopicSlug        string             `json:"topic_slug"`
	TopicDescription string             `json:"topic_description"`
}

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 PlatformIdentity struct {
	ID             pgtype.UUID        `json:"id"`
	UserID         pgtype.UUID        `json:"user_id"`
	Platform       string             `json:"platform"`
	PlatformUserID string             `json:"platform_user_id"`
	CreatedAt      pgtype.Timestamptz `json:"created_at"`
}

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 New

func New(db DBTX) *Queries

func (*Queries) AddAgentMember

func (q *Queries) AddAgentMember(ctx context.Context, arg AddAgentMemberParams) error

func (*Queries) CleanupExpiredOAuthStates

func (q *Queries) CleanupExpiredOAuthStates(ctx context.Context) error

func (*Queries) ClearActivationCode

func (q *Queries) ClearActivationCode(ctx context.Context) error

func (*Queries) ClearAuthFailures

func (q *Queries) ClearAuthFailures(ctx context.Context, arg ClearAuthFailuresParams) error

func (*Queries) ClearAuthFailuresByEmail

func (q *Queries) ClearAuthFailuresByEmail(ctx context.Context, email string) (int64, error)

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

func (q *Queries) ClearAuthLockoutsByEmail(ctx context.Context, email string) (int64, error)

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) CompactOldRuns

func (q *Queries) CompactOldRuns(ctx context.Context, cutoff pgtype.Timestamptz) (int64, error)

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 (q *Queries) CountRunsByAgent(ctx context.Context, agentID pgtype.UUID) (int64, error)

func (*Queries) CreateAgent

func (q *Queries) CreateAgent(ctx context.Context, arg CreateAgentParams) (Agent, error)

func (*Queries) CreateAgentBuild

func (q *Queries) CreateAgentBuild(ctx context.Context, arg CreateAgentBuildParams) (AgentBuild, error)

func (*Queries) CreateBridge

func (q *Queries) CreateBridge(ctx context.Context, arg CreateBridgeParams) (Bridge, error)

func (*Queries) CreateMessage

func (q *Queries) CreateMessage(ctx context.Context, arg CreateMessageParams) (AgentMessage, error)

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 (q *Queries) CreateProvider(ctx context.Context, arg CreateProviderParams) (Provider, error)

func (*Queries) CreateRun

func (q *Queries) CreateRun(ctx context.Context, arg CreateRunParams) (Run, error)

func (*Queries) CreateTenant

func (q *Queries) CreateTenant(ctx context.Context, arg CreateTenantParams) (Tenant, error)

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)

func (*Queries) DeleteAgent

func (q *Queries) DeleteAgent(ctx context.Context, id pgtype.UUID) error

func (*Queries) DeleteBridge

func (q *Queries) DeleteBridge(ctx context.Context, id pgtype.UUID) error

func (*Queries) DeleteConversation

func (q *Queries) DeleteConversation(ctx context.Context, id pgtype.UUID) error

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 (q *Queries) DeleteMessagesByConversation(ctx context.Context, conversationID pgtype.UUID) error

func (*Queries) DeleteOAuthState

func (q *Queries) DeleteOAuthState(ctx context.Context, state string) error

func (*Queries) DeletePlatformIdentity

func (q *Queries) DeletePlatformIdentity(ctx context.Context, arg DeletePlatformIdentityParams) error

func (*Queries) DeleteProvider

func (q *Queries) DeleteProvider(ctx context.Context, id pgtype.UUID) error

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 (q *Queries) DeleteUser(ctx context.Context, id pgtype.UUID) error

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 (q *Queries) GetAgentBuild(ctx context.Context, id pgtype.UUID) (AgentBuild, error)

func (*Queries) GetAgentByID

func (q *Queries) GetAgentByID(ctx context.Context, id pgtype.UUID) (Agent, error)

func (*Queries) GetAgentBySlug

func (q *Queries) GetAgentBySlug(ctx context.Context, slug string) (Agent, error)

func (*Queries) GetAgentForUpgrade

func (q *Queries) GetAgentForUpgrade(ctx context.Context, id pgtype.UUID) (GetAgentForUpgradeRow, error)

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

func (q *Queries) GetBridgeByAgentID(ctx context.Context, agentID pgtype.UUID) (Bridge, error)

Find the bridge bound to a specific agent

func (*Queries) GetBridgeByID

func (q *Queries) GetBridgeByID(ctx context.Context, id pgtype.UUID) (Bridge, error)

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

Returns connection with enough info to determine if authorized

func (*Queries) GetConversationByID

func (q *Queries) GetConversationByID(ctx context.Context, id pgtype.UUID) (AgentConversation, error)

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 (q *Queries) GetCronByAgentAndName(ctx context.Context, arg GetCronByAgentAndNameParams) (AgentCron, error)

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 (q *Queries) GetLatestSuspendedRun(ctx context.Context, agentID pgtype.UUID) (Run, error)

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 (q *Queries) GetOAuthState(ctx context.Context, state string) (OauthState, error)

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).

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 (q *Queries) GetProviderByID(ctx context.Context, id pgtype.UUID) (Provider, error)

func (*Queries) GetProviderByProviderID

func (q *Queries) GetProviderByProviderID(ctx context.Context, providerID string) (Provider, error)

func (*Queries) GetRunByID

func (q *Queries) GetRunByID(ctx context.Context, id pgtype.UUID) (Run, error)

func (*Queries) GetRunCheckpoint

func (q *Queries) GetRunCheckpoint(ctx context.Context, id pgtype.UUID) ([]byte, error)

func (*Queries) GetSuspendedRunByID

func (q *Queries) GetSuspendedRunByID(ctx context.Context, id pgtype.UUID) (Run, error)

func (*Queries) GetSystemBridge

func (q *Queries) GetSystemBridge(ctx context.Context) (Bridge, error)

The system bridge (agent_id IS NULL) — there should be at most one

func (*Queries) GetSystemSettings

func (q *Queries) GetSystemSettings(ctx context.Context) (SystemSetting, error)

func (*Queries) GetTenantByID

func (q *Queries) GetTenantByID(ctx context.Context, id pgtype.UUID) (Tenant, error)

func (*Queries) GetTenantBySlug

func (q *Queries) GetTenantBySlug(ctx context.Context, slug string) (Tenant, error)

func (*Queries) GetTopicBySlug

func (q *Queries) GetTopicBySlug(ctx context.Context, arg GetTopicBySlugParams) (AgentTopic, error)

func (*Queries) GetUserByEmail

func (q *Queries) GetUserByEmail(ctx context.Context, email string) (User, error)

func (*Queries) GetUserByID

func (q *Queries) GetUserByID(ctx context.Context, id pgtype.UUID) (User, error)

func (*Queries) GetUserByOIDCSub

func (q *Queries) GetUserByOIDCSub(ctx context.Context, oidcSub string) (User, error)

func (*Queries) GetWebhookByAgentAndPath

func (q *Queries) GetWebhookByAgentAndPath(ctx context.Context, arg GetWebhookByAgentAndPathParams) (AgentWebhook, error)

func (*Queries) HasAgentAccess

func (q *Queries) HasAgentAccess(ctx context.Context, arg HasAgentAccessParams) (bool, error)

func (*Queries) HasDirtyMCPServers

func (q *Queries) HasDirtyMCPServers(ctx context.Context, agentID pgtype.UUID) (bool, error)

Check if any MCP server has been updated since last sync (for dirty flag).

func (*Queries) ListActiveBridges

func (q *Queries) ListActiveBridges(ctx context.Context) ([]Bridge, error)

All active bridges (for polling on startup)

func (*Queries) ListAgentBuildsByAgent

func (q *Queries) ListAgentBuildsByAgent(ctx context.Context, agentID pgtype.UUID) ([]ListAgentBuildsByAgentRow, error)

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 (q *Queries) ListAgentMembers(ctx context.Context, agentID pgtype.UUID) ([]ListAgentMembersRow, error)

func (*Queries) ListAgentModelSlots

func (q *Queries) ListAgentModelSlots(ctx context.Context, agentID pgtype.UUID) ([]AgentModelSlot, error)

func (*Queries) ListAgentTools

func (q *Queries) ListAgentTools(ctx context.Context, agentID pgtype.UUID) ([]AgentTool, error)

func (*Queries) ListAgents

func (q *Queries) ListAgents(ctx context.Context) ([]Agent, error)

func (*Queries) ListAgentsByUser

func (q *Queries) ListAgentsByUser(ctx context.Context, userID pgtype.UUID) ([]Agent, error)

func (*Queries) ListAgentsByUserID

func (q *Queries) ListAgentsByUserID(ctx context.Context, userID pgtype.UUID) ([]Agent, error)

func (*Queries) ListAllEnabledCrons

func (q *Queries) ListAllEnabledCrons(ctx context.Context) ([]AgentCron, error)

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 (agent_id IS NULL) plus bridges bound to agents the user has access to via agent_members. The agent's creator is auto-added to agent_members at agent-create time, so this 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) ListBridgesForAgent

func (q *Queries) ListBridgesForAgent(ctx context.Context, agentID pgtype.UUID) ([]Bridge, error)

Bridges relevant to a specific agent: its own bridge + system bridges.

func (*Queries) ListConnectionsByAgent

func (q *Queries) ListConnectionsByAgent(ctx context.Context, agentID pgtype.UUID) ([]Connection, error)

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 (q *Queries) ListCronsByAgent(ctx context.Context, agentID pgtype.UUID) ([]AgentCron, error)

func (*Queries) ListDirectoriesByAgent added in v0.2.0

func (q *Queries) ListDirectoriesByAgent(ctx context.Context, agentID pgtype.UUID) ([]AgentDirectory, error)

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 (q *Queries) ListMCPServersByAgent(ctx context.Context, agentID pgtype.UUID) ([]AgentMcpServer, error)

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 (q *Queries) ListMessagesByRun(ctx context.Context, runID pgtype.UUID) ([]AgentMessage, error)

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) ListPlatformIdentitiesByUser

func (q *Queries) ListPlatformIdentitiesByUser(ctx context.Context, userID pgtype.UUID) ([]PlatformIdentity, error)

func (*Queries) ListProviders

func (q *Queries) ListProviders(ctx context.Context) ([]Provider, error)

func (*Queries) ListRoutesByAgent

func (q *Queries) ListRoutesByAgent(ctx context.Context, agentID pgtype.UUID) ([]AgentRoute, error)

func (*Queries) ListRoutesByAgentAndMethod

func (q *Queries) ListRoutesByAgentAndMethod(ctx context.Context, arg ListRoutesByAgentAndMethodParams) ([]AgentRoute, error)

func (*Queries) ListRunningByAgent

func (q *Queries) ListRunningByAgent(ctx context.Context, agentID pgtype.UUID) ([]Run, error)

func (*Queries) ListRunsByAgent

func (q *Queries) ListRunsByAgent(ctx context.Context, arg ListRunsByAgentParams) ([]Run, error)

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) ListSubscribedConversations

func (q *Queries) ListSubscribedConversations(ctx context.Context, arg ListSubscribedConversationsParams) ([]pgtype.UUID, error)

func (*Queries) ListTopicSubscriptions

func (q *Queries) ListTopicSubscriptions(ctx context.Context, arg ListTopicSubscriptionsParams) ([]ListTopicSubscriptionsRow, error)

func (*Queries) ListTopicsByAgent

func (q *Queries) ListTopicsByAgent(ctx context.Context, agentID pgtype.UUID) ([]AgentTopic, error)

func (*Queries) ListUsers

func (q *Queries) ListUsers(ctx context.Context) ([]User, error)

func (*Queries) ListWebhooksByAgent

func (q *Queries) ListWebhooksByAgent(ctx context.Context, agentID pgtype.UUID) ([]AgentWebhook, error)

func (*Queries) ListWebhooksByAgentWithStatus

func (q *Queries) ListWebhooksByAgentWithStatus(ctx context.Context, agentID pgtype.UUID) ([]ListWebhooksByAgentWithStatusRow, error)

func (*Queries) PruneAuthFailures

func (q *Queries) PruneAuthFailures(ctx context.Context) (int64, error)

Background pruner: drop failure rows older than 24h.

func (*Queries) PruneExpiredAttachmentURLs

func (q *Queries) PruneExpiredAttachmentURLs(ctx context.Context) (int64, error)

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

func (q *Queries) PruneStaleAuthLockouts(ctx context.Context) (int64, error)

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 (q *Queries) ResetStuckAgentBuilds(ctx context.Context) error

func (*Queries) ResetStuckBuilds

func (q *Queries) ResetStuckBuilds(ctx context.Context, errorMessage string) error

func (*Queries) ResetStuckRuns

func (q *Queries) ResetStuckRuns(ctx context.Context, errorMessage string) error

func (*Queries) ResetStuckUpgrades

func (q *Queries) ResetStuckUpgrades(ctx context.Context) error

func (*Queries) ResolveSuspendedRun

func (q *Queries) ResolveSuspendedRun(ctx context.Context, id pgtype.UUID) error

func (*Queries) SetActivationCode

func (q *Queries) SetActivationCode(ctx context.Context, activationCode pgtype.Text) (int64, error)

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) TenantExists

func (q *Queries) TenantExists(ctx context.Context) (bool, error)

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 (q *Queries) UpdateAgentFields(ctx context.Context, arg UpdateAgentFieldsParams) (Agent, error)

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) 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 (q *Queries) UpdateCronLastFired(ctx context.Context, id pgtype.UUID) error

func (*Queries) UpdateMCPServerCredentials

func (q *Queries) UpdateMCPServerCredentials(ctx context.Context, arg UpdateMCPServerCredentialsParams) error

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 (q *Queries) UpdateProvider(ctx context.Context, arg UpdateProviderParams) (Provider, error)

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 (q *Queries) UpdateWebhookLastReceived(ctx context.Context, id pgtype.UUID) error

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.

func (*Queries) UpsertCron

func (q *Queries) UpsertCron(ctx context.Context, arg UpsertCronParams) error

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.

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

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

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type RecordAuthFailureParams

type RecordAuthFailureParams struct {
	Email string `json:"email"`
	Ip    string `json:"ip"`
}

type RemoveAgentMemberParams

type RemoveAgentMemberParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	UserID  pgtype.UUID `json:"user_id"`
}

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 SetAgentModelSlotAssignmentParams

type SetAgentModelSlotAssignmentParams struct {
	AssignedModel string      `json:"assigned_model"`
	AgentID       pgtype.UUID `json:"agent_id"`
	Slug          string      `json:"slug"`
}

type SetConversationCheckpointParams

type SetConversationCheckpointParams struct {
	CheckpointMessageID pgtype.UUID `json:"checkpoint_message_id"`
	ConversationID      pgtype.UUID `json:"conversation_id"`
}

type SubscribeTopicParams

type SubscribeTopicParams struct {
	TopicID        pgtype.UUID `json:"topic_id"`
	ConversationID pgtype.UUID `json:"conversation_id"`
}

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 TopicSubscription struct {
	ID             pgtype.UUID        `json:"id"`
	TopicID        pgtype.UUID        `json:"topic_id"`
	ConversationID pgtype.UUID        `json:"conversation_id"`
	CreatedAt      pgtype.Timestamptz `json:"created_at"`
}

type UnsubscribeTopicParams

type UnsubscribeTopicParams struct {
	TopicID        pgtype.UUID `json:"topic_id"`
	ConversationID pgtype.UUID `json:"conversation_id"`
}

type UpdateAgentBuildCompleteParams

type UpdateAgentBuildCompleteParams struct {
	Status       string      `json:"status"`
	ErrorMessage string      `json:"error_message"`
	SourceRef    string      `json:"source_ref"`
	ImageRef     string      `json:"image_ref"`
	ID           pgtype.UUID `json:"id"`
}

type UpdateAgentBuildLogsParams

type UpdateAgentBuildLogsParams struct {
	SolLog    string      `json:"sol_log"`
	DockerLog string      `json:"docker_log"`
	LogSeq    int64       `json:"log_seq"`
	ID        pgtype.UUID `json:"id"`
}

type UpdateAgentConfigParams

type UpdateAgentConfigParams struct {
	Config []byte      `json:"config"`
	ID     pgtype.UUID `json:"id"`
}

type UpdateAgentDescriptionParams

type UpdateAgentDescriptionParams struct {
	Description string      `json:"description"`
	ID          pgtype.UUID `json:"id"`
}

type UpdateAgentErrorMessageParams

type UpdateAgentErrorMessageParams struct {
	ErrorMessage string      `json:"error_message"`
	ID           pgtype.UUID `json:"id"`
}

type UpdateAgentExtraPromptsParams

type UpdateAgentExtraPromptsParams struct {
	ExtraPrompts []byte      `json:"extra_prompts"`
	ID           pgtype.UUID `json:"id"`
}

type UpdateAgentFieldsParams

type UpdateAgentFieldsParams struct {
	AutoFix bool        `json:"auto_fix"`
	ID      pgtype.UUID `json:"id"`
}

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 UpdateAgentRefsParams struct {
	SourceRef string      `json:"source_ref"`
	ImageRef  string      `json:"image_ref"`
	ID        pgtype.UUID `json:"id"`
}

type UpdateAgentSDKVersionParams

type UpdateAgentSDKVersionParams struct {
	SdkVersion string      `json:"sdk_version"`
	ID         pgtype.UUID `json:"id"`
}

type UpdateAgentStatusParams

type UpdateAgentStatusParams struct {
	Status       string      `json:"status"`
	ErrorMessage string      `json:"error_message"`
	ID           pgtype.UUID `json:"id"`
}

type UpdateAgentUpgradeStatusParams

type UpdateAgentUpgradeStatusParams struct {
	UpgradeStatus string      `json:"upgrade_status"`
	ErrorMessage  string      `json:"error_message"`
	ID            pgtype.UUID `json:"id"`
}

type UpdateBridgeAgentIDParams

type UpdateBridgeAgentIDParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	ID      pgtype.UUID `json:"id"`
}

type UpdateBridgeLastPolledParams

type UpdateBridgeLastPolledParams struct {
	Config []byte      `json:"config"`
	ID     pgtype.UUID `json:"id"`
}

type UpdateBridgeStatusParams

type UpdateBridgeStatusParams struct {
	Status string      `json:"status"`
	ID     pgtype.UUID `json:"id"`
}

type UpdateConnectionCredentialsParams

type UpdateConnectionCredentialsParams struct {
	Credentials    string             `json:"credentials"`
	TokenExpiresAt pgtype.Timestamptz `json:"token_expires_at"`
	RefreshToken   string             `json:"refresh_token"`
	AgentID        pgtype.UUID        `json:"agent_id"`
	Slug           string             `json:"slug"`
}

type UpdateConnectionOAuthAppParams

type UpdateConnectionOAuthAppParams struct {
	ClientID     string      `json:"client_id"`
	ClientSecret string      `json:"client_secret"`
	AgentID      pgtype.UUID `json:"agent_id"`
	Slug         string      `json:"slug"`
}

type UpdateConversationSettingsParams

type UpdateConversationSettingsParams struct {
	Patch []byte      `json:"patch"`
	ID    pgtype.UUID `json:"id"`
}

type UpdateMCPServerCredentialsParams

type UpdateMCPServerCredentialsParams struct {
	Credentials    string             `json:"credentials"`
	TokenExpiresAt pgtype.Timestamptz `json:"token_expires_at"`
	RefreshToken   string             `json:"refresh_token"`
	AgentID        pgtype.UUID        `json:"agent_id"`
	Slug           string             `json:"slug"`
}

type UpdateMCPServerOAuthAppParams

type UpdateMCPServerOAuthAppParams struct {
	ClientID     string      `json:"client_id"`
	ClientSecret string      `json:"client_secret"`
	AgentID      pgtype.UUID `json:"agent_id"`
	Slug         string      `json:"slug"`
}

type UpdateMCPServerToolSchemasParams

type UpdateMCPServerToolSchemasParams struct {
	ToolSchemas []byte      `json:"tool_schemas"`
	AgentID     pgtype.UUID `json:"agent_id"`
	Slug        string      `json:"slug"`
}

type UpdateProviderParams

type UpdateProviderParams struct {
	DisplayName     string      `json:"display_name"`
	UpdateApiKey    bool        `json:"update_api_key"`
	ApiKey          string      `json:"api_key"`
	BaseUrl         string      `json:"base_url"`
	UpdateIsEnabled bool        `json:"update_is_enabled"`
	IsEnabled       bool        `json:"is_enabled"`
	ID              pgtype.UUID `json:"id"`
}

type UpdateRunCheckpointParams

type UpdateRunCheckpointParams struct {
	Checkpoint []byte      `json:"checkpoint"`
	ID         pgtype.UUID `json:"id"`
}

type UpdateRunCompleteParams

type UpdateRunCompleteParams struct {
	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"`
	ID           pgtype.UUID `json:"id"`
}

type UpdateRunLLMStatsParams

type UpdateRunLLMStatsParams struct {
	CostInput  float64     `json:"cost_input"`
	CostOutput float64     `json:"cost_output"`
	RunID      pgtype.UUID `json:"run_id"`
}

type UpdateRunStatusParams

type UpdateRunStatusParams struct {
	Status string      `json:"status"`
	ID     pgtype.UUID `json:"id"`
}

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 UpdateUserNameEmailParams

type UpdateUserNameEmailParams struct {
	ID          pgtype.UUID `json:"id"`
	DisplayName string      `json:"display_name"`
	Email       string      `json:"email"`
}

type UpdateUserPasswordParams

type UpdateUserPasswordParams struct {
	PasswordHash string      `json:"password_hash"`
	ID           pgtype.UUID `json:"id"`
}

type UpdateUserRoleParams

type UpdateUserRoleParams struct {
	ID         pgtype.UUID `json:"id"`
	TenantRole string      `json:"tenant_role"`
}

type UpdateWebhookSecretParams

type UpdateWebhookSecretParams struct {
	Secret string      `json:"secret"`
	ID     pgtype.UUID `json:"id"`
}

type UpsertAgentModelSlotParams

type UpsertAgentModelSlotParams struct {
	AgentID     pgtype.UUID `json:"agent_id"`
	Slug        string      `json:"slug"`
	Capability  string      `json:"capability"`
	Description string      `json:"description"`
}

type UpsertAgentToolParams

type UpsertAgentToolParams struct {
	AgentID      pgtype.UUID `json:"agent_id"`
	Name         string      `json:"name"`
	Description  string      `json:"description"`
	Access       string      `json:"access"`
	InputSchema  []byte      `json:"input_schema"`
	OutputSchema []byte      `json:"output_schema"`
}

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"`
	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 UpsertCronParams struct {
	AgentID     pgtype.UUID `json:"agent_id"`
	Name        string      `json:"name"`
	Schedule    string      `json:"schedule"`
	TimeoutMs   int32       `json:"timeout_ms"`
	Description string      `json:"description"`
}

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"`
}

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"`
	Scopes   string      `json:"scopes"`
	Access   string      `json:"access"`
}

type UpsertPlatformIdentityParams

type UpsertPlatformIdentityParams struct {
	UserID         pgtype.UUID `json:"user_id"`
	Platform       string      `json:"platform"`
	PlatformUserID string      `json:"platform_user_id"`
}

type UpsertRouteParams

type UpsertRouteParams struct {
	AgentID     pgtype.UUID `json:"agent_id"`
	Path        string      `json:"path"`
	Method      string      `json:"method"`
	Access      string      `json:"access"`
	Description string      `json:"description"`
}

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 UpsertTopicParams struct {
	AgentID     pgtype.UUID `json:"agent_id"`
	Slug        string      `json:"slug"`
	Description string      `json:"description"`
	Access      string      `json:"access"`
}

type UpsertWebhookParams

type UpsertWebhookParams struct {
	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"`
}

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"`
}

Jump to

Keyboard shortcuts

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