dbq

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 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 AcceptConnectorExportCompletionParams added in v0.6.1

type AcceptConnectorExportCompletionParams struct {
	ActualSize             pgtype.Int8        `json:"actual_size"`
	ActualSha256           pgtype.Text        `json:"actual_sha256"`
	MultipartParts         []byte             `json:"multipart_parts"`
	AttemptToken           pgtype.UUID        `json:"attempt_token"`
	FinalizationDeadlineAt pgtype.Timestamptz `json:"finalization_deadline_at"`
	JobID                  pgtype.UUID        `json:"job_id"`
	ConnectorID            pgtype.UUID        `json:"connector_id"`
}

type ActivateConnectionWithCredentialsParams added in v0.4.0

type ActivateConnectionWithCredentialsParams struct {
	AccessTokenRef        string             `json:"access_token_ref"`
	TokenExpiresAt        pgtype.Timestamptz `json:"token_expires_at"`
	RefreshToken          string             `json:"refresh_token"`
	GrantedScopes         string             `json:"granted_scopes"`
	UsesPendingClient     bool               `json:"uses_pending_client"`
	ID                    pgtype.UUID        `json:"id"`
	AuthorizationRevision int64              `json:"authorization_revision"`
}

type ActivateMCPActiveRequestParams added in v0.4.0

type ActivateMCPActiveRequestParams struct {
	RunID             pgtype.UUID `json:"run_id"`
	TargetAgentID     pgtype.UUID `json:"target_agent_id"`
	PrincipalIdentity string      `json:"principal_identity"`
	RequestID         []byte      `json:"request_id"`
}

type ActivateMCPServerWithCredentialsParams added in v0.4.0

type ActivateMCPServerWithCredentialsParams struct {
	AccessTokenRef        string             `json:"access_token_ref"`
	TokenExpiresAt        pgtype.Timestamptz `json:"token_expires_at"`
	RefreshToken          string             `json:"refresh_token"`
	GrantedScopes         string             `json:"granted_scopes"`
	UsesPendingClient     bool               `json:"uses_pending_client"`
	ID                    pgtype.UUID        `json:"id"`
	AuthorizationRevision int64              `json:"authorization_revision"`
}

type AddConnectorTargetGroupMemberParams added in v0.6.1

type AddConnectorTargetGroupMemberParams struct {
	GroupID     pgtype.UUID `json:"group_id"`
	ConnectorID pgtype.UUID `json:"connector_id"`
	Position    int32       `json:"position"`
}

type AddSiblingParams added in v0.4.0

type AddSiblingParams struct {
	ParentAgentID        pgtype.UUID `json:"parent_agent_id"`
	SiblingAgentID       pgtype.UUID `json:"sibling_agent_id"`
	MaxAccess            string      `json:"max_access"`
	AuthorizingGranteeID pgtype.UUID `json:"authorizing_grantee_id"`
}

type AdvanceAgentJobCronParams added in v0.5.0

type AdvanceAgentJobCronParams struct {
	NextFireAt      pgtype.Timestamptz `json:"next_fire_at"`
	OccurrenceAt    pgtype.Timestamptz `json:"occurrence_at"`
	CronID          pgtype.UUID        `json:"cron_id"`
	PriorNextFireAt pgtype.Timestamptz `json:"prior_next_fire_at"`
}

type AdvanceUserAuthEpochAndRevokeSessionsParams added in v0.4.0

type AdvanceUserAuthEpochAndRevokeSessionsParams struct {
	ID                pgtype.UUID `json:"id"`
	PreserveSessionID pgtype.UUID `json:"preserve_session_id"`
}

type Agent

type Agent struct {
	ID                       pgtype.UUID        `json:"id"`
	OwnerPrincipalID         pgtype.UUID        `json:"owner_principal_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"`
	BuildProviderID          pgtype.UUID        `json:"build_provider_id"`
	BuildModel               string             `json:"build_model"`
	ExecProviderID           pgtype.UUID        `json:"exec_provider_id"`
	ExecModel                string             `json:"exec_model"`
	SttProviderID            pgtype.UUID        `json:"stt_provider_id"`
	SttModel                 string             `json:"stt_model"`
	VisionProviderID         pgtype.UUID        `json:"vision_provider_id"`
	VisionModel              string             `json:"vision_model"`
	TtsProviderID            pgtype.UUID        `json:"tts_provider_id"`
	TtsModel                 string             `json:"tts_model"`
	ImageGenProviderID       pgtype.UUID        `json:"image_gen_provider_id"`
	ImageGenModel            string             `json:"image_gen_model"`
	EmbeddingProviderID      pgtype.UUID        `json:"embedding_provider_id"`
	EmbeddingModel           string             `json:"embedding_model"`
	SearchProviderID         pgtype.UUID        `json:"search_provider_id"`
	SearchModel              string             `json:"search_model"`
	SourceRef                string             `json:"source_ref"`
	ImageRef                 string             `json:"image_ref"`
	DbSchema                 string             `json:"db_schema"`
	DbPassword               string             `json:"db_password"`
	SdkVersion               string             `json:"sdk_version"`
	Config                   []byte             `json:"config"`
	Instructions             []byte             `json:"instructions"`
	ErrorMessage             string             `json:"error_message"`
	CreatedAt                pgtype.Timestamptz `json:"created_at"`
	UpdatedAt                pgtype.Timestamptz `json:"updated_at"`
	McpEnabled               bool               `json:"mcp_enabled"`
	AllowPublicMcp           bool               `json:"allow_public_mcp"`
	AllowPublicRoutes        bool               `json:"allow_public_routes"`
	ToolsHash                []byte             `json:"tools_hash"`
	Emoji                    string             `json:"emoji"`
	AllowOauthMcpPrompt      bool               `json:"allow_oauth_mcp_prompt"`
	AllowPublicMcpPrompt     bool               `json:"allow_public_mcp_prompt"`
	GitRemoteUrl             string             `json:"git_remote_url"`
	GitMode                  string             `json:"git_mode"`
	GitCredentialID          pgtype.UUID        `json:"git_credential_id"`
	GitDefaultBranch         string             `json:"git_default_branch"`
	GitWebhookSecret         string             `json:"git_webhook_secret"`
	GitLastSyncedRef         string             `json:"git_last_synced_ref"`
	AgentTokenVersion        int64              `json:"agent_token_version"`
	JobDispatchPausedBuildID pgtype.UUID        `json:"job_dispatch_paused_build_id"`
	JobDispatchPausedAt      pgtype.Timestamptz `json:"job_dispatch_paused_at"`
	JobDispatchPauseDeadline pgtype.Timestamptz `json:"job_dispatch_pause_deadline"`
}

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"`
	LlmCalls                  int32              `json:"llm_calls"`
	LlmTokensIn               int32              `json:"llm_tokens_in"`
	LlmTokensOut              int32              `json:"llm_tokens_out"`
	LlmTokensCached           int32              `json:"llm_tokens_cached"`
	LlmCostEstimate           float64            `json:"llm_cost_estimate"`
	RollbackTargetID          pgtype.UUID        `json:"rollback_target_id"`
	SdkVersion                string             `json:"sdk_version"`
	Todos                     []byte             `json:"todos"`
	ExitStatus                string             `json:"exit_status"`
	ExitMessage               string             `json:"exit_message"`
	FailureKind               string             `json:"failure_kind"`
	BuildModel                string             `json:"build_model"`
	IntegrationTokenHash      []byte             `json:"integration_token_hash"`
	IntegrationTokenExpiresAt pgtype.Timestamptz `json:"integration_token_expires_at"`
	DeploymentPhase           string             `json:"deployment_phase"`
	DeploymentTargetStatus    pgtype.Text        `json:"deployment_target_status"`
	DeploymentToken           pgtype.UUID        `json:"deployment_token"`
	JobManifestExtractedAt    pgtype.Timestamptz `json:"job_manifest_extracted_at"`
	JobManifestDigest         pgtype.Text        `json:"job_manifest_digest"`
	CancelRequestedAt         pgtype.Timestamptz `json:"cancel_requested_at"`
}

type AgentBuildCancellationRequestedParams added in v0.5.0

type AgentBuildCancellationRequestedParams struct {
	BuildID pgtype.UUID `json:"build_id"`
	AgentID pgtype.UUID `json:"agent_id"`
}

type AgentBuildIntegrationActiveParams added in v0.4.0

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

type AgentBuildJobHandler added in v0.5.0

type AgentBuildJobHandler struct {
	BuildID          pgtype.UUID `json:"build_id"`
	Name             string      `json:"name"`
	Version          int32       `json:"version"`
	Description      string      `json:"description"`
	TimeoutMs        int64       `json:"timeout_ms"`
	MaxAttempts      int32       `json:"max_attempts"`
	MaxConcurrency   int32       `json:"max_concurrency"`
	InputSchema      []byte      `json:"input_schema"`
	OutputSchema     []byte      `json:"output_schema"`
	InputSchemaHash  string      `json:"input_schema_hash"`
	OutputSchemaHash string      `json:"output_schema_hash"`
}

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 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"`
	Scope          string             `json:"scope"`
}

type AgentEnvVar added in v0.2.12

type AgentEnvVar struct {
	ID           pgtype.UUID        `json:"id"`
	AgentID      pgtype.UUID        `json:"agent_id"`
	Slug         string             `json:"slug"`
	Description  string             `json:"description"`
	IsSecret     bool               `json:"is_secret"`
	ValueRef     string             `json:"value_ref"`
	DefaultValue string             `json:"default_value"`
	Pattern      string             `json:"pattern"`
	CreatedAt    pgtype.Timestamptz `json:"created_at"`
	UpdatedAt    pgtype.Timestamptz `json:"updated_at"`
}

type AgentGrant added in v0.4.0

type AgentGrant struct {
	AgentID   pgtype.UUID        `json:"agent_id"`
	GranteeID pgtype.UUID        `json:"grantee_id"`
	Role      string             `json:"role"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type AgentJob added in v0.5.0

type AgentJob struct {
	ID                      pgtype.UUID        `json:"id"`
	AgentID                 pgtype.UUID        `json:"agent_id"`
	HandlerName             string             `json:"handler_name"`
	HandlerVersion          int32              `json:"handler_version"`
	InputSchemaHash         string             `json:"input_schema_hash"`
	OutputSchemaHash        string             `json:"output_schema_hash"`
	SourceRunID             pgtype.UUID        `json:"source_run_id"`
	CronID                  pgtype.UUID        `json:"cron_id"`
	CronSlug                pgtype.Text        `json:"cron_slug"`
	InitiatorKind           string             `json:"initiator_kind"`
	InitiatorUserID         pgtype.UUID        `json:"initiator_user_id"`
	InitiatorConversationID pgtype.UUID        `json:"initiator_conversation_id"`
	InitiatorAccess         string             `json:"initiator_access"`
	Status                  string             `json:"status"`
	TimeoutMs               int64              `json:"timeout_ms"`
	MaxAttempts             int32              `json:"max_attempts"`
	AttemptLimit            int32              `json:"attempt_limit"`
	AttemptCount            int32              `json:"attempt_count"`
	NextAttemptAt           pgtype.Timestamptz `json:"next_attempt_at"`
	ScheduledAt             pgtype.Timestamptz `json:"scheduled_at"`
	InputPayload            []byte             `json:"input_payload"`
	OutputPayload           []byte             `json:"output_payload"`
	ProgressPhase           pgtype.Text        `json:"progress_phase"`
	ProgressMessage         pgtype.Text        `json:"progress_message"`
	ProgressCompleted       pgtype.Int8        `json:"progress_completed"`
	ProgressTotal           pgtype.Int8        `json:"progress_total"`
	ProgressAttempt         pgtype.Int4        `json:"progress_attempt"`
	ProgressUpdatedAt       pgtype.Timestamptz `json:"progress_updated_at"`
	LastError               pgtype.Text        `json:"last_error"`
	CancelRequestedAt       pgtype.Timestamptz `json:"cancel_requested_at"`
	CancelledByUserID       pgtype.UUID        `json:"cancelled_by_user_id"`
	StartedAt               pgtype.Timestamptz `json:"started_at"`
	CompletedAt             pgtype.Timestamptz `json:"completed_at"`
	StateVersion            int64              `json:"state_version"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	UpdatedAt               pgtype.Timestamptz `json:"updated_at"`
}

type AgentJobAttempt added in v0.5.0

type AgentJobAttempt struct {
	JobID             pgtype.UUID        `json:"job_id"`
	AttemptNumber     int32              `json:"attempt_number"`
	Status            string             `json:"status"`
	RuntimeGeneration int64              `json:"runtime_generation"`
	LeaseOwner        pgtype.UUID        `json:"lease_owner"`
	LeaseToken        pgtype.UUID        `json:"lease_token"`
	LeaseExpiresAt    pgtype.Timestamptz `json:"lease_expires_at"`
	RunID             pgtype.UUID        `json:"run_id"`
	ErrorKind         pgtype.Text        `json:"error_kind"`
	ErrorMessage      pgtype.Text        `json:"error_message"`
	LeasedAt          pgtype.Timestamptz `json:"leased_at"`
	StartedAt         pgtype.Timestamptz `json:"started_at"`
	CompletedAt       pgtype.Timestamptz `json:"completed_at"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
}

type AgentJobCron added in v0.5.0

type AgentJobCron struct {
	ID                pgtype.UUID        `json:"id"`
	AgentID           pgtype.UUID        `json:"agent_id"`
	Slug              string             `json:"slug"`
	Schedule          string             `json:"schedule"`
	Description       string             `json:"description"`
	HandlerName       string             `json:"handler_name"`
	HandlerVersion    int32              `json:"handler_version"`
	InputSchemaHash   string             `json:"input_schema_hash"`
	OutputSchemaHash  string             `json:"output_schema_hash"`
	InputPayload      []byte             `json:"input_payload"`
	AgentTokenVersion int64              `json:"agent_token_version"`
	Enabled           bool               `json:"enabled"`
	NextFireAt        pgtype.Timestamptz `json:"next_fire_at"`
	LastFiredAt       pgtype.Timestamptz `json:"last_fired_at"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
}

type AgentJobHandler added in v0.5.0

type AgentJobHandler struct {
	AgentID           pgtype.UUID        `json:"agent_id"`
	Name              string             `json:"name"`
	Version           int32              `json:"version"`
	Description       string             `json:"description"`
	TimeoutMs         int64              `json:"timeout_ms"`
	MaxAttempts       int32              `json:"max_attempts"`
	MaxConcurrency    int32              `json:"max_concurrency"`
	InputSchema       []byte             `json:"input_schema"`
	OutputSchema      []byte             `json:"output_schema"`
	InputSchemaHash   string             `json:"input_schema_hash"`
	OutputSchemaHash  string             `json:"output_schema_hash"`
	AgentTokenVersion int64              `json:"agent_token_version"`
	Active            bool               `json:"active"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
}

type AgentMcpServer

type AgentMcpServer struct {
	ID                    pgtype.UUID        `json:"id"`
	Slug                  string             `json:"slug"`
	Name                  string             `json:"name"`
	DisplayName           string             `json:"display_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"`
	AuthInjection         []byte             `json:"auth_injection"`
	ToolSchemas           []byte             `json:"tool_schemas"`
	ClientID              string             `json:"client_id"`
	ClientSecret          string             `json:"client_secret"`
	AccessTokenRef        string             `json:"access_token_ref"`
	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"`
	ServerInstructions    string             `json:"server_instructions"`
	OwnerPrincipalID      pgtype.UUID        `json:"owner_principal_id"`
	Lifecycle             string             `json:"lifecycle"`
	GrantedScopes         string             `json:"granted_scopes"`
	ScopesVerified        bool               `json:"scopes_verified"`
	AuthorizationRevision int64              `json:"authorization_revision"`
	ProvisionalNeedID     pgtype.UUID        `json:"provisional_need_id"`
	PendingClientID       string             `json:"pending_client_id"`
	PendingClientSecret   string             `json:"pending_client_secret"`
}

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"`
	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"`
	AssignedProviderID pgtype.UUID `json:"assigned_provider_id"`
	AssignedModel      string      `json:"assigned_model"`
}

type AgentResourceNeed added in v0.4.0

type AgentResourceNeed struct {
	ID                    pgtype.UUID        `json:"id"`
	AgentID               pgtype.UUID        `json:"agent_id"`
	Type                  string             `json:"type"`
	Slug                  string             `json:"slug"`
	Description           string             `json:"description"`
	SetupInstructions     string             `json:"setup_instructions"`
	ExpectedUrl           string             `json:"expected_url"`
	ExpectedScopes        string             `json:"expected_scopes"`
	Spec                  []byte             `json:"spec"`
	Required              bool               `json:"required"`
	BoundConnectionID     pgtype.UUID        `json:"bound_connection_id"`
	BoundMcpID            pgtype.UUID        `json:"bound_mcp_id"`
	CreatedAt             pgtype.Timestamptz `json:"created_at"`
	BoundConnectorID      pgtype.UUID        `json:"bound_connector_id"`
	BoundConnectorGroupID pgtype.UUID        `json:"bound_connector_group_id"`
	DeletedAt             pgtype.Timestamptz `json:"deleted_at"`
}

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 AgentSetupStatusRow added in v0.2.12

type AgentSetupStatusRow struct {
	Connections int32 `json:"connections"`
	McpServers  int32 `json:"mcp_servers"`
	Connectors  int32 `json:"connectors"`
	EnvVars     int32 `json:"env_vars"`
}

type AgentSibling added in v0.4.0

type AgentSibling struct {
	ParentAgentID        pgtype.UUID        `json:"parent_agent_id"`
	SiblingAgentID       pgtype.UUID        `json:"sibling_agent_id"`
	MaxAccess            string             `json:"max_access"`
	AuthorizingGranteeID pgtype.UUID        `json:"authorizing_grantee_id"`
	CreatedAt            pgtype.Timestamptz `json:"created_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"`
	PerUser     bool               `json:"per_user"`
}

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 AppendConnectorJobEventParams added in v0.6.1

type AppendConnectorJobEventParams struct {
	JobID           pgtype.UUID `json:"job_id"`
	AttemptToken    pgtype.UUID `json:"attempt_token"`
	ConnectorID     pgtype.UUID `json:"connector_id"`
	AttemptSequence int64       `json:"attempt_sequence"`
	Payload         []byte      `json:"payload"`
	Kind            string      `json:"kind"`
}

type AppendConnectorJobEventRow added in v0.6.1

type AppendConnectorJobEventRow struct {
	JobID           pgtype.UUID        `json:"job_id"`
	Sequence        int64              `json:"sequence"`
	AttemptNumber   int32              `json:"attempt_number"`
	AttemptSequence int64              `json:"attempt_sequence"`
	Kind            string             `json:"kind"`
	Payload         []byte             `json:"payload"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
}

type AppendHostManagementEventParams added in v0.6.1

type AppendHostManagementEventParams struct {
	JobID           pgtype.UUID        `json:"job_id"`
	AttemptToken    pgtype.UUID        `json:"attempt_token"`
	HostID          pgtype.UUID        `json:"host_id"`
	AttemptSequence int64              `json:"attempt_sequence"`
	Phase           string             `json:"phase"`
	Message         string             `json:"message"`
	EventTime       pgtype.Timestamptz `json:"event_time"`
}

type AppendHostManagementEventRow added in v0.6.1

type AppendHostManagementEventRow struct {
	JobID           pgtype.UUID        `json:"job_id"`
	Sequence        int64              `json:"sequence"`
	AttemptNumber   int32              `json:"attempt_number"`
	AttemptSequence int64              `json:"attempt_sequence"`
	Phase           string             `json:"phase"`
	Message         string             `json:"message"`
	EventTime       pgtype.Timestamptz `json:"event_time"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
}

type AppendSystemMessageParams added in v0.4.0

type AppendSystemMessageParams struct {
	ConversationID pgtype.UUID    `json:"conversation_id"`
	Role           string         `json:"role"`
	Source         string         `json:"source"`
	Content        string         `json:"content"`
	Parts          []byte         `json:"parts"`
	RunID          pgtype.UUID    `json:"run_id"`
	TokensIn       int32          `json:"tokens_in"`
	TokensOut      int32          `json:"tokens_out"`
	CostEstimate   pgtype.Numeric `json:"cost_estimate"`
}

type ApproveDeviceLoginParams added in v0.4.0

type ApproveDeviceLoginParams struct {
	UserID       pgtype.UUID `json:"user_id"`
	UserCodeHash string      `json:"user_code_hash"`
}

type ApproveHostEnrollmentParams added in v0.6.1

type ApproveHostEnrollmentParams struct {
	ApprovedByUserID pgtype.UUID `json:"approved_by_user_id"`
	UserCodeHash     []byte      `json:"user_code_hash"`
}

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 BeginAgentDeploymentCutoverParams added in v0.5.0

type BeginAgentDeploymentCutoverParams struct {
	BuildID         pgtype.UUID `json:"build_id"`
	AgentID         pgtype.UUID `json:"agent_id"`
	DeploymentToken pgtype.UUID `json:"deployment_token"`
	ExpectedStatus  string      `json:"expected_status"`
}

type BindConnectionNeedParams added in v0.4.0

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

type BindConnectorGroupNeedParams added in v0.6.1

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

type BindConnectorNeedParams added in v0.6.1

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

type BindMCPServerNeedParams added in v0.4.0

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

type Bridge

type Bridge struct {
	ID                pgtype.UUID        `json:"id"`
	AgentID           pgtype.UUID        `json:"agent_id"`
	OwnerPrincipalID  pgtype.UUID        `json:"owner_principal_id"`
	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"`
	BotTokenRef       string             `json:"bot_token_ref"`
	LastPolledAt      pgtype.Timestamptz `json:"last_polled_at"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
	Managed           bool               `json:"managed"`
	TelegramBotUserID pgtype.Int8        `json:"telegram_bot_user_id"`
	IsManager         bool               `json:"is_manager"`
	ManagerError      string             `json:"manager_error"`
}

type CancelConnectorJobParams added in v0.6.1

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

type CancelConnectorJobRow added in v0.6.1

type CancelConnectorJobRow struct {
	ID                pgtype.UUID        `json:"id"`
	ConnectorID       pgtype.UUID        `json:"connector_id"`
	AgentID           pgtype.UUID        `json:"agent_id"`
	NeedID            pgtype.UUID        `json:"need_id"`
	RequestID         pgtype.UUID        `json:"request_id"`
	OrchestrationID   pgtype.UUID        `json:"orchestration_id"`
	TargetPosition    pgtype.Int4        `json:"target_position"`
	CanaryCohort      bool               `json:"canary_cohort"`
	OperationKind     string             `json:"operation_kind"`
	OperationName     string             `json:"operation_name"`
	OperationRevision int32              `json:"operation_revision"`
	Mode              string             `json:"mode"`
	InputSchemaHash   string             `json:"input_schema_hash"`
	OutputSchemaHash  string             `json:"output_schema_hash"`
	InputPayload      []byte             `json:"input_payload"`
	Status            string             `json:"status"`
	IdempotencyKey    pgtype.UUID        `json:"idempotency_key"`
	CancelRequestedAt pgtype.Timestamptz `json:"cancel_requested_at"`
	DeadlineAt        pgtype.Timestamptz `json:"deadline_at"`
	OutputPayload     []byte             `json:"output_payload"`
	ErrorCode         pgtype.Text        `json:"error_code"`
	ErrorMessage      pgtype.Text        `json:"error_message"`
	StartedAt         pgtype.Timestamptz `json:"started_at"`
	CompletedAt       pgtype.Timestamptz `json:"completed_at"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
	RequestHash       string             `json:"request_hash"`
}

type CancelQueuedAgentJobParams added in v0.5.0

type CancelQueuedAgentJobParams struct {
	CancelledByUserID pgtype.UUID `json:"cancelled_by_user_id"`
	ID                pgtype.UUID `json:"id"`
	AgentID           pgtype.UUID `json:"agent_id"`
}

type CancelRunningAgentJobParams added in v0.5.0

type CancelRunningAgentJobParams struct {
	CancelledByUserID pgtype.UUID `json:"cancelled_by_user_id"`
	ID                pgtype.UUID `json:"id"`
}

type CandidateAgentJobContractMatchesParams added in v0.5.0

type CandidateAgentJobContractMatchesParams struct {
	BuildID          pgtype.UUID `json:"build_id"`
	AgentID          pgtype.UUID `json:"agent_id"`
	HandlerName      string      `json:"handler_name"`
	HandlerVersion   int32       `json:"handler_version"`
	InputSchemaHash  string      `json:"input_schema_hash"`
	OutputSchemaHash string      `json:"output_schema_hash"`
}

type ClaimConnectorJobForHostParams added in v0.6.1

type ClaimConnectorJobForHostParams struct {
	HostID       pgtype.UUID `json:"host_id"`
	LeaseSeconds int32       `json:"lease_seconds"`
}

type ClaimConnectorJobForHostRow added in v0.6.1

type ClaimConnectorJobForHostRow struct {
	ID                pgtype.UUID        `json:"id"`
	ConnectorID       pgtype.UUID        `json:"connector_id"`
	AgentID           pgtype.UUID        `json:"agent_id"`
	NeedID            pgtype.UUID        `json:"need_id"`
	RequestID         pgtype.UUID        `json:"request_id"`
	OrchestrationID   pgtype.UUID        `json:"orchestration_id"`
	TargetPosition    pgtype.Int4        `json:"target_position"`
	CanaryCohort      bool               `json:"canary_cohort"`
	OperationKind     string             `json:"operation_kind"`
	OperationName     string             `json:"operation_name"`
	OperationRevision int32              `json:"operation_revision"`
	Mode              string             `json:"mode"`
	InputSchemaHash   string             `json:"input_schema_hash"`
	OutputSchemaHash  string             `json:"output_schema_hash"`
	InputPayload      []byte             `json:"input_payload"`
	Status            string             `json:"status"`
	IdempotencyKey    pgtype.UUID        `json:"idempotency_key"`
	CancelRequestedAt pgtype.Timestamptz `json:"cancel_requested_at"`
	DeadlineAt        pgtype.Timestamptz `json:"deadline_at"`
	OutputPayload     []byte             `json:"output_payload"`
	ErrorCode         pgtype.Text        `json:"error_code"`
	ErrorMessage      pgtype.Text        `json:"error_message"`
	StartedAt         pgtype.Timestamptz `json:"started_at"`
	CompletedAt       pgtype.Timestamptz `json:"completed_at"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
	RequestHash       string             `json:"request_hash"`
	AttemptNumber     int32              `json:"attempt_number"`
	AttemptNumber_2   int32              `json:"attempt_number_2"`
	AttemptToken      pgtype.UUID        `json:"attempt_token"`
	LeaseExpiresAt    pgtype.Timestamptz `json:"lease_expires_at"`
}

type ClaimConnectorJobParams added in v0.6.1

type ClaimConnectorJobParams struct {
	LeaseSeconds int32       `json:"lease_seconds"`
	ConnectorID  pgtype.UUID `json:"connector_id"`
}

type ClaimDueAgentJobParams added in v0.5.0

type ClaimDueAgentJobParams struct {
	LeaseOwner   pgtype.UUID `json:"lease_owner"`
	LeaseSeconds int32       `json:"lease_seconds"`
	AgentID      pgtype.UUID `json:"agent_id"`
	GlobalLimit  int64       `json:"global_limit"`
	AgentLimit   int64       `json:"agent_limit"`
}

type ClaimHostManagementJobParams added in v0.6.1

type ClaimHostManagementJobParams struct {
	HostID       pgtype.UUID `json:"host_id"`
	LeaseSeconds int32       `json:"lease_seconds"`
}

type ClaimHostManagementJobRow added in v0.6.1

type ClaimHostManagementJobRow struct {
	ID                pgtype.UUID        `json:"id"`
	HostID            pgtype.UUID        `json:"host_id"`
	ConnectorID       pgtype.UUID        `json:"connector_id"`
	RequestedByUserID pgtype.UUID        `json:"requested_by_user_id"`
	Kind              string             `json:"kind"`
	ArtifactFileID    pgtype.UUID        `json:"artifact_file_id"`
	InputPayload      []byte             `json:"input_payload"`
	SecretInput       string             `json:"secret_input"`
	Status            string             `json:"status"`
	OutputPayload     []byte             `json:"output_payload"`
	SecretOutput      pgtype.Text        `json:"secret_output"`
	ErrorMessage      pgtype.Text        `json:"error_message"`
	DeadlineAt        pgtype.Timestamptz `json:"deadline_at"`
	StartedAt         pgtype.Timestamptz `json:"started_at"`
	CompletedAt       pgtype.Timestamptz `json:"completed_at"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
	AttemptNumber     int32              `json:"attempt_number"`
	AttemptNumber_2   int32              `json:"attempt_number_2"`
	AttemptToken      pgtype.UUID        `json:"attempt_token"`
	LeaseExpiresAt    pgtype.Timestamptz `json:"lease_expires_at"`
}

type ClaimMCPTaskResumeParams added in v0.4.0

type ClaimMCPTaskResumeParams struct {
	ID         pgtype.UUID `json:"id"`
	AgentID    pgtype.UUID `json:"agent_id"`
	TriggerRef string      `json:"trigger_ref"`
}

type ClaimSystemConversationCheckpointParams added in v0.4.0

type ClaimSystemConversationCheckpointParams struct {
	ID             pgtype.UUID `json:"id"`
	SuspendedRunID pgtype.UUID `json:"suspended_run_id"`
}

type ClearAgentBuildModelParams added in v0.4.0

type ClearAgentBuildModelParams struct {
	CatalogID pgtype.UUID `json:"provider_id"`
	Model     string      `json:"model"`
}

type ClearAgentEmbeddingModelParams added in v0.4.0

type ClearAgentEmbeddingModelParams struct {
	CatalogID pgtype.UUID `json:"provider_id"`
	Model     string      `json:"model"`
}

type ClearAgentEnvVarValueParams added in v0.2.12

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

type ClearAgentExecModelParams added in v0.4.0

type ClearAgentExecModelParams struct {
	CatalogID pgtype.UUID `json:"provider_id"`
	Model     string      `json:"model"`
}

type ClearAgentImageGenModelParams added in v0.4.0

type ClearAgentImageGenModelParams struct {
	CatalogID pgtype.UUID `json:"provider_id"`
	Model     string      `json:"model"`
}

type ClearAgentModelSlotsForModelParams added in v0.4.0

type ClearAgentModelSlotsForModelParams struct {
	CatalogID pgtype.UUID `json:"provider_id"`
	Model     string      `json:"model"`
}

type ClearAgentSearchModelParams added in v0.4.0

type ClearAgentSearchModelParams struct {
	CatalogID pgtype.UUID `json:"provider_id"`
	Model     string      `json:"model"`
}

type ClearAgentSttModelParams added in v0.4.0

type ClearAgentSttModelParams struct {
	CatalogID pgtype.UUID `json:"provider_id"`
	Model     string      `json:"model"`
}

type ClearAgentTtsModelParams added in v0.4.0

type ClearAgentTtsModelParams struct {
	CatalogID pgtype.UUID `json:"provider_id"`
	Model     string      `json:"model"`
}

type ClearAgentVisionModelParams added in v0.4.0

type ClearAgentVisionModelParams struct {
	CatalogID pgtype.UUID `json:"provider_id"`
	Model     string      `json:"model"`
}

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 ClearPendingConnectionOAuthAppParams added in v0.4.0

type ClearPendingConnectionOAuthAppParams struct {
	ID                    pgtype.UUID `json:"id"`
	AuthorizationRevision int64       `json:"authorization_revision"`
}

type ClearPendingMCPServerOAuthAppParams added in v0.4.0

type ClearPendingMCPServerOAuthAppParams struct {
	ID                    pgtype.UUID `json:"id"`
	AuthorizationRevision int64       `json:"authorization_revision"`
}

type ClearUserPasswordAndRevokeSessionsParams added in v0.4.0

type ClearUserPasswordAndRevokeSessionsParams struct {
	ID                pgtype.UUID `json:"id"`
	PreserveSessionID pgtype.UUID `json:"preserve_session_id"`
}

type CompactOldRunsParams added in v0.5.0

type CompactOldRunsParams struct {
	Cutoff pgtype.Timestamptz `json:"cutoff"`
	Lim    int32              `json:"lim"`
}

type CompleteConnectorJobParams added in v0.6.1

type CompleteConnectorJobParams struct {
	Succeeded     bool        `json:"succeeded"`
	OutputPayload []byte      `json:"output_payload"`
	ErrorCode     string      `json:"error_code"`
	ErrorMessage  string      `json:"error_message"`
	JobID         pgtype.UUID `json:"job_id"`
	AttemptToken  pgtype.UUID `json:"attempt_token"`
	ConnectorID   pgtype.UUID `json:"connector_id"`
}

type CompleteHostManagementJobParams added in v0.6.1

type CompleteHostManagementJobParams struct {
	JobID            pgtype.UUID `json:"job_id"`
	AttemptToken     pgtype.UUID `json:"attempt_token"`
	HostID           pgtype.UUID `json:"host_id"`
	Succeeded        bool        `json:"succeeded"`
	ErrorMessage     string      `json:"error_message"`
	CompletionStatus string      `json:"completion_status"`
	SecretOutput     string      `json:"secret_output"`
}

type CompleteHostManagementJobRow added in v0.6.1

type CompleteHostManagementJobRow struct {
	ID                pgtype.UUID        `json:"id"`
	HostID            pgtype.UUID        `json:"host_id"`
	ConnectorID       pgtype.UUID        `json:"connector_id"`
	RequestedByUserID pgtype.UUID        `json:"requested_by_user_id"`
	Kind              string             `json:"kind"`
	ArtifactFileID    pgtype.UUID        `json:"artifact_file_id"`
	InputPayload      []byte             `json:"input_payload"`
	SecretInput       string             `json:"secret_input"`
	Status            string             `json:"status"`
	OutputPayload     []byte             `json:"output_payload"`
	SecretOutput      pgtype.Text        `json:"secret_output"`
	ErrorMessage      pgtype.Text        `json:"error_message"`
	DeadlineAt        pgtype.Timestamptz `json:"deadline_at"`
	StartedAt         pgtype.Timestamptz `json:"started_at"`
	CompletedAt       pgtype.Timestamptz `json:"completed_at"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
}

type CompleteRecoveredAgentBuildParams added in v0.5.0

type CompleteRecoveredAgentBuildParams struct {
	BuildID pgtype.UUID `json:"build_id"`
	AgentID pgtype.UUID `json:"agent_id"`
}

type ConnectAgentGitParams added in v0.4.0

type ConnectAgentGitParams struct {
	GitRemoteUrl     string      `json:"git_remote_url"`
	GitCredentialID  pgtype.UUID `json:"git_credential_id"`
	GitDefaultBranch string      `json:"git_default_branch"`
	GitWebhookSecret string      `json:"git_webhook_secret"`
	GitMode          string      `json:"git_mode"`
	ID               pgtype.UUID `json:"id"`
}

type Connection

type Connection struct {
	ID                    pgtype.UUID        `json:"id"`
	Slug                  string             `json:"slug"`
	Name                  string             `json:"name"`
	DisplayName           string             `json:"display_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"`
	AccessTokenRef        string             `json:"access_token_ref"`
	RefreshToken          string             `json:"refresh_token"`
	TokenExpiresAt        pgtype.Timestamptz `json:"token_expires_at"`
	CreatedAt             pgtype.Timestamptz `json:"created_at"`
	UpdatedAt             pgtype.Timestamptz `json:"updated_at"`
	AuthParams            []byte             `json:"auth_params"`
	Headers               []byte             `json:"headers"`
	OwnerPrincipalID      pgtype.UUID        `json:"owner_principal_id"`
	Lifecycle             string             `json:"lifecycle"`
	GrantedScopes         string             `json:"granted_scopes"`
	ScopesVerified        bool               `json:"scopes_verified"`
	AuthorizationRevision int64              `json:"authorization_revision"`
	ProvisionalNeedID     pgtype.UUID        `json:"provisional_need_id"`
	PendingClientID       string             `json:"pending_client_id"`
	PendingClientSecret   string             `json:"pending_client_secret"`
}

type ConnectorArtifactBlob added in v0.6.1

type ConnectorArtifactBlob struct {
	Digest                 string             `json:"digest"`
	ObjectKey              string             `json:"object_key"`
	SizeBytes              int64              `json:"size_bytes"`
	MediaType              string             `json:"media_type"`
	CreatedAt              pgtype.Timestamptz `json:"created_at"`
	DeletionState          string             `json:"deletion_state"`
	DeletionToken          pgtype.UUID        `json:"deletion_token"`
	DeletionLeaseExpiresAt pgtype.Timestamptz `json:"deletion_lease_expires_at"`
	DeletionError          pgtype.Text        `json:"deletion_error"`
	DeletionAttempts       int32              `json:"deletion_attempts"`
}

type ConnectorArtifactFile added in v0.6.1

type ConnectorArtifactFile struct {
	ID               pgtype.UUID        `json:"id"`
	ArtifactSetID    pgtype.UUID        `json:"artifact_set_id"`
	Platform         string             `json:"platform"`
	Filename         string             `json:"filename"`
	Digest           string             `json:"digest"`
	SizeBytes        int64              `json:"size_bytes"`
	NoticesDigest    string             `json:"notices_digest"`
	NoticesSizeBytes int64              `json:"notices_size_bytes"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
}

type ConnectorArtifactSet added in v0.6.1

type ConnectorArtifactSet struct {
	ID                  pgtype.UUID        `json:"id"`
	AgentID             pgtype.UUID        `json:"agent_id"`
	BuildID             pgtype.UUID        `json:"build_id"`
	ConnectorSlug       string             `json:"connector_slug"`
	SourceRef           string             `json:"source_ref"`
	Kind                string             `json:"kind"`
	ContractID          string             `json:"contract_id"`
	Name                string             `json:"name"`
	Description         string             `json:"description"`
	ArtifactVersion     string             `json:"artifact_version"`
	ArtifactDigest      string             `json:"artifact_digest"`
	ProtocolMajor       int32              `json:"protocol_major"`
	ProtocolMinor       int32              `json:"protocol_minor"`
	Features            []string           `json:"features"`
	InterfaceDescriptor []byte             `json:"interface_descriptor"`
	InterfaceHash       string             `json:"interface_hash"`
	SettingsSchema      []byte             `json:"settings_schema"`
	RetiredAt           pgtype.Timestamptz `json:"retired_at"`
	CreatedAt           pgtype.Timestamptz `json:"created_at"`
	ServiceMode         pgtype.Text        `json:"service_mode"`
}

type ConnectorJob added in v0.6.1

type ConnectorJob struct {
	ID                pgtype.UUID        `json:"id"`
	ConnectorID       pgtype.UUID        `json:"connector_id"`
	AgentID           pgtype.UUID        `json:"agent_id"`
	NeedID            pgtype.UUID        `json:"need_id"`
	RequestID         pgtype.UUID        `json:"request_id"`
	OrchestrationID   pgtype.UUID        `json:"orchestration_id"`
	TargetPosition    pgtype.Int4        `json:"target_position"`
	CanaryCohort      bool               `json:"canary_cohort"`
	OperationKind     string             `json:"operation_kind"`
	OperationName     string             `json:"operation_name"`
	OperationRevision int32              `json:"operation_revision"`
	Mode              string             `json:"mode"`
	InputSchemaHash   string             `json:"input_schema_hash"`
	OutputSchemaHash  string             `json:"output_schema_hash"`
	InputPayload      []byte             `json:"input_payload"`
	Status            string             `json:"status"`
	IdempotencyKey    pgtype.UUID        `json:"idempotency_key"`
	CancelRequestedAt pgtype.Timestamptz `json:"cancel_requested_at"`
	DeadlineAt        pgtype.Timestamptz `json:"deadline_at"`
	OutputPayload     []byte             `json:"output_payload"`
	ErrorCode         pgtype.Text        `json:"error_code"`
	ErrorMessage      pgtype.Text        `json:"error_message"`
	StartedAt         pgtype.Timestamptz `json:"started_at"`
	CompletedAt       pgtype.Timestamptz `json:"completed_at"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
	RequestHash       string             `json:"request_hash"`
}

type ConnectorJobAttempt added in v0.6.1

type ConnectorJobAttempt struct {
	JobID          pgtype.UUID        `json:"job_id"`
	AttemptNumber  int32              `json:"attempt_number"`
	AttemptToken   pgtype.UUID        `json:"attempt_token"`
	Status         string             `json:"status"`
	LeaseExpiresAt pgtype.Timestamptz `json:"lease_expires_at"`
	LeasedAt       pgtype.Timestamptz `json:"leased_at"`
	StartedAt      pgtype.Timestamptz `json:"started_at"`
	CompletedAt    pgtype.Timestamptz `json:"completed_at"`
	ErrorMessage   pgtype.Text        `json:"error_message"`
	CreatedAt      pgtype.Timestamptz `json:"created_at"`
	UpdatedAt      pgtype.Timestamptz `json:"updated_at"`
}

type ConnectorJobEvent added in v0.6.1

type ConnectorJobEvent struct {
	JobID           pgtype.UUID        `json:"job_id"`
	Sequence        int64              `json:"sequence"`
	AttemptNumber   int32              `json:"attempt_number"`
	AttemptSequence int64              `json:"attempt_sequence"`
	Kind            string             `json:"kind"`
	Payload         []byte             `json:"payload"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
}

type ConnectorOrchestration added in v0.6.1

type ConnectorOrchestration struct {
	ID                   pgtype.UUID        `json:"id"`
	AgentID              pgtype.UUID        `json:"agent_id"`
	NeedID               pgtype.UUID        `json:"need_id"`
	RequestID            pgtype.UUID        `json:"request_id"`
	TargetGroupID        pgtype.UUID        `json:"target_group_id"`
	InitiatorUserID      pgtype.UUID        `json:"initiator_user_id"`
	CommandName          string             `json:"command_name"`
	CommandRevision      int32              `json:"command_revision"`
	CommandMode          string             `json:"command_mode"`
	InputSchemaHash      string             `json:"input_schema_hash"`
	OutputSchemaHash     string             `json:"output_schema_hash"`
	InputPayload         []byte             `json:"input_payload"`
	Strategy             string             `json:"strategy"`
	OfflinePolicy        string             `json:"offline_policy"`
	MaxConcurrency       int32              `json:"max_concurrency"`
	BatchSize            int32              `json:"batch_size"`
	CanaryCount          int32              `json:"canary_count"`
	CanaryPhase          string             `json:"canary_phase"`
	CanarySucceededCount int32              `json:"canary_succeeded_count"`
	Quorum               int32              `json:"quorum"`
	Status               string             `json:"status"`
	CancelRequestedAt    pgtype.Timestamptz `json:"cancel_requested_at"`
	DeadlineAt           pgtype.Timestamptz `json:"deadline_at"`
	StartedAt            pgtype.Timestamptz `json:"started_at"`
	CompletedAt          pgtype.Timestamptz `json:"completed_at"`
	CreatedAt            pgtype.Timestamptz `json:"created_at"`
	UpdatedAt            pgtype.Timestamptz `json:"updated_at"`
	RequestHash          string             `json:"request_hash"`
}

type ConnectorReservation added in v0.6.1

type ConnectorReservation struct {
	ConnectorID            pgtype.UUID        `json:"connector_id"`
	NeedID                 pgtype.UUID        `json:"need_id"`
	ConnectorTargetGroupID pgtype.UUID        `json:"connector_target_group_id"`
	CreatedAt              pgtype.Timestamptz `json:"created_at"`
}

type ConnectorResource added in v0.6.1

type ConnectorResource struct {
	ID                           pgtype.UUID        `json:"id"`
	OwnerPrincipalID             pgtype.UUID        `json:"owner_principal_id"`
	Slug                         string             `json:"slug"`
	Kind                         pgtype.Text        `json:"kind"`
	ContractID                   pgtype.Text        `json:"contract_id"`
	Name                         pgtype.Text        `json:"name"`
	DisplayName                  string             `json:"display_name"`
	Description                  pgtype.Text        `json:"description"`
	ProtocolMajor                pgtype.Int4        `json:"protocol_major"`
	ProtocolMinor                pgtype.Int4        `json:"protocol_minor"`
	Features                     []string           `json:"features"`
	ArtifactVersion              pgtype.Text        `json:"artifact_version"`
	ArtifactDigest               pgtype.Text        `json:"artifact_digest"`
	InterfaceDescriptor          []byte             `json:"interface_descriptor"`
	InterfaceHash                pgtype.Text        `json:"interface_hash"`
	Readiness                    string             `json:"readiness"`
	ReadinessMessage             pgtype.Text        `json:"readiness_message"`
	Labels                       []byte             `json:"labels"`
	Lifecycle                    string             `json:"lifecycle"`
	LastSeenAt                   pgtype.Timestamptz `json:"last_seen_at"`
	LastReadyAt                  pgtype.Timestamptz `json:"last_ready_at"`
	CreatedAt                    pgtype.Timestamptz `json:"created_at"`
	UpdatedAt                    pgtype.Timestamptz `json:"updated_at"`
	StorageOrigins               []string           `json:"storage_origins"`
	ActivationManifest           []byte             `json:"activation_manifest"`
	ActivationManifestHash       pgtype.Text        `json:"activation_manifest_hash"`
	ServiceMode                  pgtype.Text        `json:"service_mode"`
	ArtifactSetID                pgtype.UUID        `json:"artifact_set_id"`
	HostID                       pgtype.UUID        `json:"host_id"`
	RollbackArtifactSetID        pgtype.UUID        `json:"rollback_artifact_set_id"`
	InventoryRevision            int64              `json:"inventory_revision"`
	InventoryMutationHash        pgtype.Text        `json:"inventory_mutation_hash"`
	ActiveProvenance             string             `json:"active_provenance"`
	RollbackProvenance           string             `json:"rollback_provenance"`
	ActiveObservationState       string             `json:"active_observation_state"`
	RollbackObservationState     string             `json:"rollback_observation_state"`
	ObservedActiveDigest         pgtype.Text        `json:"observed_active_digest"`
	ObservedActiveManifest       []byte             `json:"observed_active_manifest"`
	ObservedActiveManifestHash   pgtype.Text        `json:"observed_active_manifest_hash"`
	ObservedRollbackDigest       pgtype.Text        `json:"observed_rollback_digest"`
	ObservedRollbackManifest     []byte             `json:"observed_rollback_manifest"`
	ObservedRollbackManifestHash pgtype.Text        `json:"observed_rollback_manifest_hash"`
}

type ConnectorTargetGroup added in v0.6.1

type ConnectorTargetGroup struct {
	ID               pgtype.UUID        `json:"id"`
	OwnerPrincipalID pgtype.UUID        `json:"owner_principal_id"`
	Name             string             `json:"name"`
	Description      string             `json:"description"`
	ContractID       string             `json:"contract_id"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
}

type ConnectorTargetGroupMember added in v0.6.1

type ConnectorTargetGroupMember struct {
	GroupID     pgtype.UUID        `json:"group_id"`
	ConnectorID pgtype.UUID        `json:"connector_id"`
	Position    int32              `json:"position"`
	CreatedAt   pgtype.Timestamptz `json:"created_at"`
}

type ConnectorTransfer added in v0.6.1

type ConnectorTransfer struct {
	JobID                      pgtype.UUID        `json:"job_id"`
	RunID                      pgtype.UUID        `json:"run_id"`
	Direction                  string             `json:"direction"`
	SourcePath                 string             `json:"source_path"`
	DestinationPath            string             `json:"destination_path"`
	ObjectKey                  string             `json:"object_key"`
	TransferMarker             pgtype.UUID        `json:"transfer_marker"`
	StorageOrigin              string             `json:"storage_origin"`
	Overwrite                  bool               `json:"overwrite"`
	MaximumSize                int64              `json:"maximum_size"`
	ExpectedSize               int64              `json:"expected_size"`
	ExpectedSha256             pgtype.Text        `json:"expected_sha256"`
	ActualSize                 pgtype.Int8        `json:"actual_size"`
	ActualSha256               pgtype.Text        `json:"actual_sha256"`
	MultipartUploadID          pgtype.Text        `json:"multipart_upload_id"`
	MultipartPartSize          pgtype.Int8        `json:"multipart_part_size"`
	MultipartPartCount         pgtype.Int4        `json:"multipart_part_count"`
	MultipartParts             []byte             `json:"multipart_parts"`
	State                      string             `json:"state"`
	FinalizationAttemptToken   pgtype.UUID        `json:"finalization_attempt_token"`
	FinalizationToken          pgtype.UUID        `json:"finalization_token"`
	FinalizationLeaseExpiresAt pgtype.Timestamptz `json:"finalization_lease_expires_at"`
	FinalizationDeadlineAt     pgtype.Timestamptz `json:"finalization_deadline_at"`
	GrantExpiresAt             pgtype.Timestamptz `json:"grant_expires_at"`
	DeadlineAt                 pgtype.Timestamptz `json:"deadline_at"`
	ErrorMessage               pgtype.Text        `json:"error_message"`
	CleanupAfter               pgtype.Timestamptz `json:"cleanup_after"`
	CleanupToken               pgtype.UUID        `json:"cleanup_token"`
	CleanupLeaseExpiresAt      pgtype.Timestamptz `json:"cleanup_lease_expires_at"`
	CreatedAt                  pgtype.Timestamptz `json:"created_at"`
	UpdatedAt                  pgtype.Timestamptz `json:"updated_at"`
	DestinationObjectKey       string             `json:"destination_object_key"`
	DestinationExisted         bool               `json:"destination_existed"`
	DestinationEtag            pgtype.Text        `json:"destination_etag"`
	CleanupDestination         bool               `json:"cleanup_destination"`
}

type ConsumeHostEnrollmentParams added in v0.6.1

type ConsumeHostEnrollmentParams struct {
	HostID pgtype.UUID `json:"host_id"`
	ID     pgtype.UUID `json:"id"`
}

type ConsumeIdentityLinkChallengeParams added in v0.4.0

type ConsumeIdentityLinkChallengeParams struct {
	TokenHash      string      `json:"token_hash"`
	UserID         pgtype.UUID `json:"user_id"`
	Platform       string      `json:"platform"`
	BridgeID       pgtype.UUID `json:"bridge_id"`
	PlatformUserID string      `json:"platform_user_id"`
}

type ConsumeMCPActiveRequestParams added in v0.4.0

type ConsumeMCPActiveRequestParams struct {
	TargetAgentID     pgtype.UUID `json:"target_agent_id"`
	PrincipalIdentity string      `json:"principal_identity"`
	RequestID         []byte      `json:"request_id"`
}

type ConsumeOAuthConsentTransactionParams added in v0.4.0

type ConsumeOAuthConsentTransactionParams struct {
	TransactionID pgtype.UUID `json:"transaction_id"`
	BindingHash   []byte      `json:"binding_hash"`
	UserID        pgtype.UUID `json:"user_id"`
	ClientID      string      `json:"client_id"`
	AgentID       pgtype.UUID `json:"agent_id"`
}

type ConsumeRelayCodeRow added in v0.4.0

type ConsumeRelayCodeRow struct {
	CodeHash     []byte             `json:"code_hash"`
	NonceHash    []byte             `json:"nonce_hash"`
	UserID       pgtype.UUID        `json:"user_id"`
	Email        string             `json:"email"`
	TenantRole   string             `json:"tenant_role"`
	AuthEpoch    int64              `json:"auth_epoch"`
	AgentID      pgtype.UUID        `json:"agent_id"`
	TargetOrigin string             `json:"target_origin"`
	ReturnPath   string             `json:"return_path"`
	ExpiresAt    pgtype.Timestamptz `json:"expires_at"`
	CreatedAt    pgtype.Timestamptz `json:"created_at"`
	SessionID    pgtype.UUID        `json:"session_id"`
}

type ConversationHasToolCallParams added in v0.4.0

type ConversationHasToolCallParams struct {
	ConversationID pgtype.UUID `json:"conversation_id"`
	ToolCallID     string      `json:"tool_call_id"`
}

type CountAgentsUsingModelParams added in v0.4.0

type CountAgentsUsingModelParams struct {
	CatalogID pgtype.UUID `json:"provider_id"`
	Model     string      `json:"model"`
}

type CountMatchingModelGrantsParams added in v0.4.0

type CountMatchingModelGrantsParams struct {
	CatalogID  pgtype.UUID   `json:"provider_id"`
	Model      string        `json:"model"`
	GranteeIds []pgtype.UUID `json:"grantee_ids"`
}

type CountNonterminalConnectorJobsForNeedConnectorParams added in v0.6.1

type CountNonterminalConnectorJobsForNeedConnectorParams struct {
	NeedID      pgtype.UUID `json:"need_id"`
	ConnectorID pgtype.UUID `json:"connector_id"`
}

type CountRecentFailuresParams

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

type CreateA2AConversationParams added in v0.4.0

type CreateA2AConversationParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	UserID  pgtype.UUID `json:"user_id"`
	Title   string      `json:"title"`
}

type CreateAgentBuildParams

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

type CreateAgentParams

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

type CreateAuthzCodeParams added in v0.4.0

type CreateAuthzCodeParams struct {
	Code          string             `json:"code"`
	UserID        pgtype.UUID        `json:"user_id"`
	ClientID      string             `json:"client_id"`
	AgentID       pgtype.UUID        `json:"agent_id"`
	RedirectUri   string             `json:"redirect_uri"`
	CodeChallenge string             `json:"code_challenge"`
	Scope         string             `json:"scope"`
	Resource      string             `json:"resource"`
	ExpiresAt     pgtype.Timestamptz `json:"expires_at"`
}

type CreateBridgeParams

type CreateBridgeParams struct {
	ID                pgtype.UUID `json:"id"`
	Type              string      `json:"type"`
	Name              string      `json:"name"`
	BotTokenRef       string      `json:"bot_token_ref"`
	BotUsername       string      `json:"bot_username"`
	AgentID           pgtype.UUID `json:"agent_id"`
	OwnerPrincipalID  pgtype.UUID `json:"owner_principal_id"`
	IsSystem          bool        `json:"is_system"`
	IsManager         bool        `json:"is_manager"`
	Managed           bool        `json:"managed"`
	TelegramBotUserID pgtype.Int8 `json:"telegram_bot_user_id"`
}

type CreateCeremonyParams added in v0.4.0

type CreateCeremonyParams struct {
	UserID      pgtype.UUID `json:"user_id"`
	Kind        string      `json:"kind"`
	SessionData []byte      `json:"session_data"`
}

type CreateConnectionParams added in v0.4.0

type CreateConnectionParams struct {
	ID                pgtype.UUID `json:"id"`
	OwnerPrincipalID  pgtype.UUID `json:"owner_principal_id"`
	Slug              string      `json:"slug"`
	Name              string      `json:"name"`
	DisplayName       string      `json:"display_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"`
	AuthParams        []byte      `json:"auth_params"`
	Headers           []byte      `json:"headers"`
	Access            string      `json:"access"`
	Lifecycle         string      `json:"lifecycle"`
	ProvisionalNeedID pgtype.UUID `json:"provisional_need_id"`
}

type CreateConnectorArtifactFileParams added in v0.6.1

type CreateConnectorArtifactFileParams struct {
	ArtifactSetID    pgtype.UUID `json:"artifact_set_id"`
	Platform         string      `json:"platform"`
	Filename         string      `json:"filename"`
	Digest           string      `json:"digest"`
	SizeBytes        int64       `json:"size_bytes"`
	NoticesDigest    string      `json:"notices_digest"`
	NoticesSizeBytes int64       `json:"notices_size_bytes"`
}

type CreateConnectorArtifactSetParams added in v0.6.1

type CreateConnectorArtifactSetParams struct {
	AgentID             pgtype.UUID `json:"agent_id"`
	BuildID             pgtype.UUID `json:"build_id"`
	ConnectorSlug       string      `json:"connector_slug"`
	SourceRef           string      `json:"source_ref"`
	Kind                string      `json:"kind"`
	ContractID          string      `json:"contract_id"`
	Name                string      `json:"name"`
	Description         string      `json:"description"`
	ArtifactVersion     string      `json:"artifact_version"`
	ArtifactDigest      string      `json:"artifact_digest"`
	ProtocolMajor       int32       `json:"protocol_major"`
	ProtocolMinor       int32       `json:"protocol_minor"`
	Features            []string    `json:"features"`
	ServiceMode         pgtype.Text `json:"service_mode"`
	InterfaceDescriptor []byte      `json:"interface_descriptor"`
	InterfaceHash       string      `json:"interface_hash"`
	SettingsSchema      []byte      `json:"settings_schema"`
}

type CreateConnectorOrchestrationParams added in v0.6.1

type CreateConnectorOrchestrationParams struct {
	ID               pgtype.UUID        `json:"id"`
	AgentID          pgtype.UUID        `json:"agent_id"`
	NeedID           pgtype.UUID        `json:"need_id"`
	RequestID        pgtype.UUID        `json:"request_id"`
	TargetGroupID    pgtype.UUID        `json:"target_group_id"`
	InitiatorUserID  pgtype.UUID        `json:"initiator_user_id"`
	CommandName      string             `json:"command_name"`
	CommandRevision  int32              `json:"command_revision"`
	CommandMode      string             `json:"command_mode"`
	InputSchemaHash  string             `json:"input_schema_hash"`
	OutputSchemaHash string             `json:"output_schema_hash"`
	InputPayload     []byte             `json:"input_payload"`
	RequestHash      string             `json:"request_hash"`
	Strategy         string             `json:"strategy"`
	OfflinePolicy    string             `json:"offline_policy"`
	MaxConcurrency   int32              `json:"max_concurrency"`
	BatchSize        int32              `json:"batch_size"`
	CanaryCount      int32              `json:"canary_count"`
	CanaryPhase      string             `json:"canary_phase"`
	Quorum           int32              `json:"quorum"`
	DeadlineAt       pgtype.Timestamptz `json:"deadline_at"`
}

type CreateConnectorResourceParams added in v0.6.1

type CreateConnectorResourceParams struct {
	ID                     pgtype.UUID `json:"id"`
	HostID                 pgtype.UUID `json:"host_id"`
	OwnerPrincipalID       pgtype.UUID `json:"owner_principal_id"`
	Slug                   string      `json:"slug"`
	DisplayName            string      `json:"display_name"`
	StorageOrigins         []string    `json:"storage_origins"`
	ActivationManifest     []byte      `json:"activation_manifest"`
	ActivationManifestHash pgtype.Text `json:"activation_manifest_hash"`
}

type CreateConnectorTargetGroupParams added in v0.6.1

type CreateConnectorTargetGroupParams struct {
	OwnerPrincipalID pgtype.UUID `json:"owner_principal_id"`
	Name             string      `json:"name"`
	Description      string      `json:"description"`
	ContractID       string      `json:"contract_id"`
}

type CreateCredentialParams added in v0.4.0

type CreateCredentialParams struct {
	UserID          pgtype.UUID `json:"user_id"`
	CredentialID    []byte      `json:"credential_id"`
	PublicKey       []byte      `json:"public_key"`
	AttestationType string      `json:"attestation_type"`
	Aaguid          []byte      `json:"aaguid"`
	SignCount       int64       `json:"sign_count"`
	Transports      []string    `json:"transports"`
	BackupEligible  bool        `json:"backup_eligible"`
	BackupState     bool        `json:"backup_state"`
	CloneWarning    bool        `json:"clone_warning"`
	FriendlyName    string      `json:"friendly_name"`
}

type CreateDeviceLoginSessionParams added in v0.4.0

type CreateDeviceLoginSessionParams struct {
	DeviceCodeHash      string             `json:"device_code_hash"`
	UserCodeHash        string             `json:"user_code_hash"`
	UserCodeDisplay     string             `json:"user_code_display"`
	ClientName          string             `json:"client_name"`
	DeviceName          string             `json:"device_name"`
	ExpiresAt           pgtype.Timestamptz `json:"expires_at"`
	PollIntervalSeconds int32              `json:"poll_interval_seconds"`
}

type CreateGitCredentialParams added in v0.4.0

type CreateGitCredentialParams struct {
	ID              pgtype.UUID `json:"id"`
	UserID          pgtype.UUID `json:"user_id"`
	Type            string      `json:"type"`
	Name            string      `json:"name"`
	TokenRef        string      `json:"token_ref"`
	GithubInstallID string      `json:"github_install_id"`
}

type CreateHostCredentialParams added in v0.6.1

type CreateHostCredentialParams struct {
	HostID    pgtype.UUID `json:"host_id"`
	Selector  pgtype.UUID `json:"selector"`
	TokenHash []byte      `json:"token_hash"`
}

type CreateHostEnrollmentParams added in v0.6.1

type CreateHostEnrollmentParams struct {
	DeviceCodeHash      []byte             `json:"device_code_hash"`
	UserCodeHash        []byte             `json:"user_code_hash"`
	UserCodeDisplay     string             `json:"user_code_display"`
	HostInfo            []byte             `json:"host_info"`
	PollIntervalSeconds int32              `json:"poll_interval_seconds"`
	ExpiresAt           pgtype.Timestamptz `json:"expires_at"`
}

type CreateHostParams added in v0.6.1

type CreateHostParams struct {
	OwnerPrincipalID pgtype.UUID `json:"owner_principal_id"`
	Name             string      `json:"name"`
	Platform         string      `json:"platform"`
	Architecture     string      `json:"architecture"`
	AccessMode       string      `json:"access_mode"`
	Version          string      `json:"version"`
	ProtocolVersion  int32       `json:"protocol_version"`
	EnrolledByUserID pgtype.UUID `json:"enrolled_by_user_id"`
}

type CreateHostedConnectorParams added in v0.6.1

type CreateHostedConnectorParams struct {
	ID                     pgtype.UUID `json:"id"`
	HostID                 pgtype.UUID `json:"host_id"`
	OwnerPrincipalID       pgtype.UUID `json:"owner_principal_id"`
	DisplayName            string      `json:"display_name"`
	StorageOrigins         []string    `json:"storage_origins"`
	ActivationManifest     []byte      `json:"activation_manifest"`
	ActivationManifestHash pgtype.Text `json:"activation_manifest_hash"`
	NeedSlug               string      `json:"need_slug"`
	ArtifactFileID         pgtype.UUID `json:"artifact_file_id"`
	AgentID                pgtype.UUID `json:"agent_id"`
}

type CreateIdentityLinkChallengeParams added in v0.4.0

type CreateIdentityLinkChallengeParams struct {
	TokenHash      string             `json:"token_hash"`
	UserID         pgtype.UUID        `json:"user_id"`
	Platform       string             `json:"platform"`
	BridgeID       pgtype.UUID        `json:"bridge_id"`
	PlatformUserID string             `json:"platform_user_id"`
	ExpiresAt      pgtype.Timestamptz `json:"expires_at"`
}

type CreateMCPA2AConversationParams added in v0.4.0

type CreateMCPA2AConversationParams struct {
	AgentID  pgtype.UUID `json:"agent_id"`
	UserID   pgtype.UUID `json:"user_id"`
	Title    string      `json:"title"`
	Metadata []byte      `json:"metadata"`
}

type CreateMCPServerParams added in v0.4.0

type CreateMCPServerParams struct {
	ID                   pgtype.UUID `json:"id"`
	OwnerPrincipalID     pgtype.UUID `json:"owner_principal_id"`
	Slug                 string      `json:"slug"`
	Name                 string      `json:"name"`
	DisplayName          string      `json:"display_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"`
	AuthInjection        []byte      `json:"auth_injection"`
	Lifecycle            string      `json:"lifecycle"`
	ProvisionalNeedID    pgtype.UUID `json:"provisional_need_id"`
}

type CreateManagedBotSessionParams added in v0.4.0

type CreateManagedBotSessionParams struct {
	OwnerID              pgtype.UUID        `json:"owner_id"`
	AgentID              pgtype.UUID        `json:"agent_id"`
	IsSystem             bool               `json:"is_system"`
	Nonce                string             `json:"nonce"`
	BridgeName           string             `json:"bridge_name"`
	ExpiresAt            pgtype.Timestamptz `json:"expires_at"`
	SystemConversationID pgtype.UUID        `json:"system_conversation_id"`
}

type CreateMessageParams

type CreateMessageParams struct {
	ConversationID pgtype.UUID `json:"conversation_id"`
	Role           string      `json:"role"`
	Content        string      `json:"content"`
	Parts          []byte      `json:"parts"`
	CostEstimate   interface{} `json:"cost_estimate"`
	RunID          pgtype.UUID `json:"run_id"`
	Source         interface{} `json:"source"`
	Ephemeral      bool        `json:"ephemeral"`
}

type CreateModelGrantParams added in v0.4.0

type CreateModelGrantParams struct {
	CatalogID pgtype.UUID `json:"provider_id"`
	Model     string      `json:"model"`
	GranteeID pgtype.UUID `json:"grantee_id"`
}

type CreateOAuthClientParams added in v0.4.0

type CreateOAuthClientParams struct {
	ClientID                string   `json:"client_id"`
	ClientName              string   `json:"client_name"`
	RedirectUris            []string `json:"redirect_uris"`
	GrantTypes              []string `json:"grant_types"`
	ResponseTypes           []string `json:"response_types"`
	TokenEndpointAuthMethod string   `json:"token_endpoint_auth_method"`
	Scope                   string   `json:"scope"`
}

type CreateOAuthConsentTransactionParams added in v0.4.0

type CreateOAuthConsentTransactionParams struct {
	TransactionID pgtype.UUID        `json:"transaction_id"`
	BindingHash   []byte             `json:"binding_hash"`
	UserID        pgtype.UUID        `json:"user_id"`
	ClientID      string             `json:"client_id"`
	AgentID       pgtype.UUID        `json:"agent_id"`
	ExpiresAt     pgtype.Timestamptz `json:"expires_at"`
}

type CreateOAuthStateParams

type CreateOAuthStateParams struct {
	State                   string             `json:"state"`
	AgentID                 pgtype.UUID        `json:"agent_id"`
	UserID                  pgtype.UUID        `json:"user_id"`
	ResourceID              pgtype.UUID        `json:"resource_id"`
	NeedID                  pgtype.UUID        `json:"need_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"`
	RequestedScopes         string             `json:"requested_scopes"`
	AuthorizationRevision   int64              `json:"authorization_revision"`
	ExpectedPriorResourceID pgtype.UUID        `json:"expected_prior_resource_id"`
	UsesPendingClient       bool               `json:"uses_pending_client"`
}

type CreateObservedConnectorInventoryParams added in v0.6.1

type CreateObservedConnectorInventoryParams struct {
	ID                       pgtype.UUID `json:"id"`
	HostID                   pgtype.UUID `json:"host_id"`
	OwnerPrincipalID         pgtype.UUID `json:"owner_principal_id"`
	Kind                     pgtype.Text `json:"kind"`
	ContractID               pgtype.Text `json:"contract_id"`
	Name                     pgtype.Text `json:"name"`
	DisplayName              string      `json:"display_name"`
	Description              pgtype.Text `json:"description"`
	ProtocolMajor            pgtype.Int4 `json:"protocol_major"`
	ProtocolMinor            pgtype.Int4 `json:"protocol_minor"`
	Features                 []string    `json:"features"`
	ArtifactVersion          pgtype.Text `json:"artifact_version"`
	ActiveDigest             pgtype.Text `json:"active_digest"`
	InterfaceDescriptor      []byte      `json:"interface_descriptor"`
	InterfaceHash            pgtype.Text `json:"interface_hash"`
	Readiness                string      `json:"readiness"`
	ReadinessMessage         pgtype.Text `json:"readiness_message"`
	StorageOrigins           []string    `json:"storage_origins"`
	ServiceMode              pgtype.Text `json:"service_mode"`
	ActiveArtifactSetID      pgtype.UUID `json:"active_artifact_set_id"`
	RollbackArtifactSetID    pgtype.UUID `json:"rollback_artifact_set_id"`
	InventoryRevision        int64       `json:"inventory_revision"`
	InventoryMutationHash    pgtype.Text `json:"inventory_mutation_hash"`
	ActiveProvenance         string      `json:"active_provenance"`
	RollbackProvenance       string      `json:"rollback_provenance"`
	ActiveObservationState   string      `json:"active_observation_state"`
	RollbackObservationState string      `json:"rollback_observation_state"`
	ActiveManifest           []byte      `json:"active_manifest"`
	ActiveManifestHash       pgtype.Text `json:"active_manifest_hash"`
	RollbackDigest           pgtype.Text `json:"rollback_digest"`
	RollbackManifest         []byte      `json:"rollback_manifest"`
	RollbackManifestHash     pgtype.Text `json:"rollback_manifest_hash"`
}

type CreatePlatformIdentityIfUnlinkedParams added in v0.4.0

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

type CreatePlatformIdentityParams

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

type CreateProviderModelParams added in v0.4.1

type CreateProviderModelParams struct {
	ConfiguredProviderID pgtype.UUID `json:"configured_provider_id"`
	ModelID              string      `json:"model_id"`
	DisplayName          string      `json:"display_name"`
	ToolCall             bool        `json:"tool_call"`
	Reasoning            bool        `json:"reasoning"`
	Vision               bool        `json:"vision"`
	ContextLimit         int32       `json:"context_limit"`
	OutputLimit          int32       `json:"output_limit"`
	StructuredOutputs    bool        `json:"structured_outputs"`
	IncludeUsage         bool        `json:"include_usage"`
}

type CreateProviderParams

type CreateProviderParams struct {
	ID          pgtype.UUID `json:"id"`
	CatalogID   string      `json:"provider_id"`
	Slug        string      `json:"slug"`
	DisplayName string      `json:"display_name"`
	ApiKey      string      `json:"api_key"`
	BaseUrl     string      `json:"base_url"`
	IsEnabled   bool        `json:"is_enabled"`
}

type CreateRefreshTokenParams added in v0.4.0

type CreateRefreshTokenParams struct {
	TokenHash       []byte             `json:"token_hash"`
	UserID          pgtype.UUID        `json:"user_id"`
	ClientID        string             `json:"client_id"`
	AgentID         pgtype.UUID        `json:"agent_id"`
	Scope           string             `json:"scope"`
	FamilyID        pgtype.UUID        `json:"family_id"`
	ParentTokenHash []byte             `json:"parent_token_hash"`
	ExpiresAt       pgtype.Timestamptz `json:"expires_at"`
}

type CreateRelayCodeParams added in v0.4.0

type CreateRelayCodeParams struct {
	CodeHash     []byte             `json:"code_hash"`
	NonceHash    []byte             `json:"nonce_hash"`
	UserID       pgtype.UUID        `json:"user_id"`
	SessionID    pgtype.UUID        `json:"session_id"`
	Email        string             `json:"email"`
	TenantRole   string             `json:"tenant_role"`
	AuthEpoch    int64              `json:"auth_epoch"`
	AgentID      pgtype.UUID        `json:"agent_id"`
	TargetOrigin string             `json:"target_origin"`
	ReturnPath   string             `json:"return_path"`
	ExpiresAt    pgtype.Timestamptz `json:"expires_at"`
}

type CreateRunParams

type CreateRunParams struct {
	AgentID              pgtype.UUID `json:"agent_id"`
	BridgeID             pgtype.UUID `json:"bridge_id"`
	ParentRunID          pgtype.UUID `json:"parent_run_id"`
	InputPayload         []byte      `json:"input_payload"`
	SourceRef            string      `json:"source_ref"`
	TriggerType          string      `json:"trigger_type"`
	TriggerRef           string      `json:"trigger_ref"`
	CallerUserID         pgtype.UUID `json:"caller_user_id"`
	CallerConversationID pgtype.UUID `json:"caller_conversation_id"`
	CallerAccess         string      `json:"caller_access"`
}

type CreateSystemConversationParams added in v0.4.0

type CreateSystemConversationParams struct {
	UserID pgtype.UUID `json:"user_id"`
	Title  string      `json:"title"`
}

type CreateSystemRunParams added in v0.4.0

type CreateSystemRunParams struct {
	ConversationID pgtype.UUID `json:"conversation_id"`
	UserID         pgtype.UUID `json:"user_id"`
	TriggerType    string      `json:"trigger_type"`
}

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       pgtype.Text `json:"password_hash"`
	TenantRole         string      `json:"tenant_role"`
	OidcSub            string      `json:"oidc_sub"`
	MustChangePassword bool        `json:"must_change_password"`
}

type CreateUserSessionParams added in v0.4.0

type CreateUserSessionParams struct {
	UserID           pgtype.UUID        `json:"user_id"`
	Kind             string             `json:"kind"`
	ClientName       string             `json:"client_name"`
	DeviceName       string             `json:"device_name"`
	RefreshTokenHash []byte             `json:"refresh_token_hash"`
	AuthenticatedAt  pgtype.Timestamptz `json:"authenticated_at"`
	ExpiresAt        pgtype.Timestamptz `json:"expires_at"`
}

type CreateWebConversationParams added in v0.4.0

type CreateWebConversationParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	UserID  pgtype.UUID `json:"user_id"`
	Title   string      `json:"title"`
}

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 DeferConnectorExportFinalizationParams added in v0.6.1

type DeferConnectorExportFinalizationParams struct {
	RetrySeconds      int32       `json:"retry_seconds"`
	ErrorMessage      pgtype.Text `json:"error_message"`
	JobID             pgtype.UUID `json:"job_id"`
	FinalizationToken pgtype.UUID `json:"finalization_token"`
}

type DeleteAgentGrantParams added in v0.4.0

type DeleteAgentGrantParams struct {
	AgentID   pgtype.UUID `json:"agent_id"`
	GranteeID pgtype.UUID `json:"grantee_id"`
}

type DeleteAgentJobCronsByAgentExceptParams added in v0.5.0

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

type DeleteClaimedConnectorTransferParams added in v0.6.1

type DeleteClaimedConnectorTransferParams struct {
	JobID        pgtype.UUID `json:"job_id"`
	CleanupToken pgtype.UUID `json:"cleanup_token"`
}

type DeleteCredentialParams added in v0.4.0

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

type DeleteDirectoriesByAgentExceptParams added in v0.2.0

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

type DeleteGitCredentialParams added in v0.4.0

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

type DeleteMCPActiveRequestParams added in v0.4.0

type DeleteMCPActiveRequestParams struct {
	TargetAgentID     pgtype.UUID `json:"target_agent_id"`
	PrincipalIdentity string      `json:"principal_identity"`
	RequestID         []byte      `json:"request_id"`
	RunID             pgtype.UUID `json:"run_id"`
}

type DeleteOAuthConsentTransactionsForGrantParams added in v0.4.0

type DeleteOAuthConsentTransactionsForGrantParams struct {
	UserID   pgtype.UUID `json:"user_id"`
	ClientID string      `json:"client_id"`
	AgentID  pgtype.UUID `json:"agent_id"`
}

type DeleteProvisionalConnectionParams added in v0.4.0

type DeleteProvisionalConnectionParams struct {
	ID                    pgtype.UUID `json:"id"`
	AuthorizationRevision int64       `json:"authorization_revision"`
}

type DeleteProvisionalMCPServerParams added in v0.4.0

type DeleteProvisionalMCPServerParams struct {
	ID                    pgtype.UUID `json:"id"`
	AuthorizationRevision int64       `json:"authorization_revision"`
}

type DeleteResourceGrantParams added in v0.6.1

type DeleteResourceGrantParams struct {
	GranteeID    pgtype.UUID `json:"grantee_id"`
	ResourceType string      `json:"resource_type"`
	ResourceID   pgtype.UUID `json:"resource_id"`
}

type DeleteResourceNeedsByAgentTypeExceptParams added in v0.4.0

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

type DeleteRoutesByAgentExceptParams

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

type DeleteStaleAgentEnvVarsParams added in v0.6.3

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

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 DeleteSystemConversationParams added in v0.4.0

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

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 DeviceLoginSession added in v0.4.0

type DeviceLoginSession struct {
	ID                  pgtype.UUID        `json:"id"`
	DeviceCodeHash      string             `json:"device_code_hash"`
	UserCodeHash        string             `json:"user_code_hash"`
	UserCodeDisplay     string             `json:"user_code_display"`
	ClientName          string             `json:"client_name"`
	DeviceName          string             `json:"device_name"`
	Status              string             `json:"status"`
	UserID              pgtype.UUID        `json:"user_id"`
	CreatedAt           pgtype.Timestamptz `json:"created_at"`
	ExpiresAt           pgtype.Timestamptz `json:"expires_at"`
	ApprovedAt          pgtype.Timestamptz `json:"approved_at"`
	DeniedAt            pgtype.Timestamptz `json:"denied_at"`
	ConsumedAt          pgtype.Timestamptz `json:"consumed_at"`
	LastPolledAt        pgtype.Timestamptz `json:"last_polled_at"`
	PollIntervalSeconds int32              `json:"poll_interval_seconds"`
	ApprovedAuthEpoch   pgtype.Int8        `json:"approved_auth_epoch"`
}

type EnsureSystemConversationForBridgeParams added in v0.4.0

type EnsureSystemConversationForBridgeParams struct {
	UserID     pgtype.UUID `json:"user_id"`
	BridgeID   pgtype.UUID `json:"bridge_id"`
	Title      string      `json:"title"`
	ExternalID pgtype.Text `json:"external_id"`
}

type FailAgentJobAttemptParams added in v0.5.0

type FailAgentJobAttemptParams struct {
	ErrorKind     pgtype.Text `json:"error_kind"`
	ErrorMessage  pgtype.Text `json:"error_message"`
	JobID         pgtype.UUID `json:"job_id"`
	AttemptNumber int32       `json:"attempt_number"`
	LeaseOwner    pgtype.UUID `json:"lease_owner"`
	LeaseToken    pgtype.UUID `json:"lease_token"`
}

type FailAgentJobParams added in v0.5.0

type FailAgentJobParams struct {
	LastError pgtype.Text `json:"last_error"`
	ID        pgtype.UUID `json:"id"`
}

type FailConnectorExportFinalizationParams added in v0.6.1

type FailConnectorExportFinalizationParams struct {
	ErrorCode         pgtype.Text `json:"error_code"`
	ErrorMessage      pgtype.Text `json:"error_message"`
	JobID             pgtype.UUID `json:"job_id"`
	FinalizationToken pgtype.UUID `json:"finalization_token"`
	AttemptToken      pgtype.UUID `json:"attempt_token"`
}

type FailExpiredConnectorJobsRow added in v0.6.1

type FailExpiredConnectorJobsRow struct {
	ID                pgtype.UUID        `json:"id"`
	ConnectorID       pgtype.UUID        `json:"connector_id"`
	AgentID           pgtype.UUID        `json:"agent_id"`
	NeedID            pgtype.UUID        `json:"need_id"`
	RequestID         pgtype.UUID        `json:"request_id"`
	OrchestrationID   pgtype.UUID        `json:"orchestration_id"`
	TargetPosition    pgtype.Int4        `json:"target_position"`
	CanaryCohort      bool               `json:"canary_cohort"`
	OperationKind     string             `json:"operation_kind"`
	OperationName     string             `json:"operation_name"`
	OperationRevision int32              `json:"operation_revision"`
	Mode              string             `json:"mode"`
	InputSchemaHash   string             `json:"input_schema_hash"`
	OutputSchemaHash  string             `json:"output_schema_hash"`
	InputPayload      []byte             `json:"input_payload"`
	Status            string             `json:"status"`
	IdempotencyKey    pgtype.UUID        `json:"idempotency_key"`
	CancelRequestedAt pgtype.Timestamptz `json:"cancel_requested_at"`
	DeadlineAt        pgtype.Timestamptz `json:"deadline_at"`
	OutputPayload     []byte             `json:"output_payload"`
	ErrorCode         pgtype.Text        `json:"error_code"`
	ErrorMessage      pgtype.Text        `json:"error_message"`
	StartedAt         pgtype.Timestamptz `json:"started_at"`
	CompletedAt       pgtype.Timestamptz `json:"completed_at"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
	RequestHash       string             `json:"request_hash"`
}

type FailInitialAgentBuildParams added in v0.4.0

type FailInitialAgentBuildParams struct {
	ErrorMessage      string      `json:"error_message"`
	ID                pgtype.UUID `json:"id"`
	AgentTokenVersion int64       `json:"agent_token_version"`
}

type FailPausedAgentDeploymentParams added in v0.5.0

type FailPausedAgentDeploymentParams struct {
	BuildID         pgtype.UUID `json:"build_id"`
	AgentID         pgtype.UUID `json:"agent_id"`
	DeploymentToken pgtype.UUID `json:"deployment_token"`
	RollbackStatus  string      `json:"rollback_status"`
}

type FailRecoveredAgentBuildParams added in v0.5.0

type FailRecoveredAgentBuildParams struct {
	ErrorMessage string      `json:"error_message"`
	BuildID      pgtype.UUID `json:"build_id"`
	AgentID      pgtype.UUID `json:"agent_id"`
}

type FailRecoveredAgentLifecycleParams added in v0.5.0

type FailRecoveredAgentLifecycleParams struct {
	ErrorMessage string      `json:"error_message"`
	AgentID      pgtype.UUID `json:"agent_id"`
	BuildID      pgtype.UUID `json:"build_id"`
}

type FailRunDispatchParams added in v0.5.0

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

type FinalizeAgentDeploymentParams added in v0.4.0

type FinalizeAgentDeploymentParams struct {
	SourceRef         string      `json:"source_ref"`
	ImageRef          string      `json:"image_ref"`
	NextStatus        string      `json:"next_status"`
	ID                pgtype.UUID `json:"id"`
	AgentTokenVersion int64       `json:"agent_token_version"`
	ExpectedStatus    string      `json:"expected_status"`
}

type FinalizeCancelledConnectorJobsRow added in v0.6.1

type FinalizeCancelledConnectorJobsRow struct {
	ID                pgtype.UUID        `json:"id"`
	ConnectorID       pgtype.UUID        `json:"connector_id"`
	AgentID           pgtype.UUID        `json:"agent_id"`
	NeedID            pgtype.UUID        `json:"need_id"`
	RequestID         pgtype.UUID        `json:"request_id"`
	OrchestrationID   pgtype.UUID        `json:"orchestration_id"`
	TargetPosition    pgtype.Int4        `json:"target_position"`
	CanaryCohort      bool               `json:"canary_cohort"`
	OperationKind     string             `json:"operation_kind"`
	OperationName     string             `json:"operation_name"`
	OperationRevision int32              `json:"operation_revision"`
	Mode              string             `json:"mode"`
	InputSchemaHash   string             `json:"input_schema_hash"`
	OutputSchemaHash  string             `json:"output_schema_hash"`
	InputPayload      []byte             `json:"input_payload"`
	Status            string             `json:"status"`
	IdempotencyKey    pgtype.UUID        `json:"idempotency_key"`
	CancelRequestedAt pgtype.Timestamptz `json:"cancel_requested_at"`
	DeadlineAt        pgtype.Timestamptz `json:"deadline_at"`
	OutputPayload     []byte             `json:"output_payload"`
	ErrorCode         pgtype.Text        `json:"error_code"`
	ErrorMessage      pgtype.Text        `json:"error_message"`
	StartedAt         pgtype.Timestamptz `json:"started_at"`
	CompletedAt       pgtype.Timestamptz `json:"completed_at"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
	RequestHash       string             `json:"request_hash"`
}

type FinalizePausedAgentDeploymentParams added in v0.5.0

type FinalizePausedAgentDeploymentParams struct {
	SourceRef         string      `json:"source_ref"`
	ImageRef          string      `json:"image_ref"`
	SdkVersion        string      `json:"sdk_version"`
	ExitStatus        string      `json:"exit_status"`
	ExitMessage       string      `json:"exit_message"`
	BuildID           pgtype.UUID `json:"build_id"`
	AgentID           pgtype.UUID `json:"agent_id"`
	DeploymentToken   pgtype.UUID `json:"deployment_token"`
	NextStatus        string      `json:"next_status"`
	AgentTokenVersion int64       `json:"agent_token_version"`
}

type FinalizeStoppedAgentDeploymentParams added in v0.5.0

type FinalizeStoppedAgentDeploymentParams struct {
	SourceRef       string      `json:"source_ref"`
	ImageRef        string      `json:"image_ref"`
	AgentID         pgtype.UUID `json:"agent_id"`
	BuildID         pgtype.UUID `json:"build_id"`
	DeploymentToken pgtype.UUID `json:"deployment_token"`
	SdkVersion      string      `json:"sdk_version"`
	ExitStatus      string      `json:"exit_status"`
	ExitMessage     string      `json:"exit_message"`
}

type FindConnectorArtifactPublicationParams added in v0.6.1

type FindConnectorArtifactPublicationParams struct {
	ArtifactDigest      string      `json:"artifact_digest"`
	Kind                string      `json:"kind"`
	ContractID          string      `json:"contract_id"`
	ArtifactVersion     string      `json:"artifact_version"`
	ProtocolMajor       int32       `json:"protocol_major"`
	ProtocolMinor       int32       `json:"protocol_minor"`
	Features            []string    `json:"features"`
	ServiceMode         pgtype.Text `json:"service_mode"`
	InterfaceHash       string      `json:"interface_hash"`
	InterfaceDescriptor []byte      `json:"interface_descriptor"`
}

type FinishConnectorArtifactBlobDeletionParams added in v0.6.1

type FinishConnectorArtifactBlobDeletionParams struct {
	Digest        string      `json:"digest"`
	DeletionToken pgtype.UUID `json:"deletion_token"`
}

type FinishConnectorExportFinalizationParams added in v0.6.1

type FinishConnectorExportFinalizationParams struct {
	OutputPayload     []byte      `json:"output_payload"`
	JobID             pgtype.UUID `json:"job_id"`
	FinalizationToken pgtype.UUID `json:"finalization_token"`
	AttemptToken      pgtype.UUID `json:"attempt_token"`
}

type ForceInterruptAgentJobAttemptForDeploymentParams added in v0.5.0

type ForceInterruptAgentJobAttemptForDeploymentParams struct {
	ErrorMessage    pgtype.Text `json:"error_message"`
	AgentID         pgtype.UUID `json:"agent_id"`
	BuildID         pgtype.UUID `json:"build_id"`
	DeploymentToken pgtype.UUID `json:"deployment_token"`
	JobID           pgtype.UUID `json:"job_id"`
	AttemptNumber   int32       `json:"attempt_number"`
	LeaseToken      pgtype.UUID `json:"lease_token"`
}

type GetActiveGrantParams added in v0.4.0

type GetActiveGrantParams struct {
	UserID   pgtype.UUID `json:"user_id"`
	ClientID string      `json:"client_id"`
	AgentID  pgtype.UUID `json:"agent_id"`
}

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 GetAgentArtifactDeletionBlockersRow added in v0.6.1

type GetAgentArtifactDeletionBlockersRow struct {
	ConnectorCount     int64 `json:"connector_count"`
	ManagementJobCount int64 `json:"management_job_count"`
}

type GetAgentBuildByIntegrationTokenRow added in v0.4.0

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

type GetAgentBuildForDeploymentParams added in v0.5.0

type GetAgentBuildForDeploymentParams struct {
	BuildID pgtype.UUID `json:"build_id"`
	AgentID pgtype.UUID `json:"agent_id"`
}

type GetAgentEnvVarBySlugParams added in v0.2.12

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

type GetAgentForUpgradeRow

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

type GetAgentGitConfigRow added in v0.4.0

type GetAgentGitConfigRow struct {
	ID               pgtype.UUID `json:"id"`
	GitRemoteUrl     string      `json:"git_remote_url"`
	GitCredentialID  pgtype.UUID `json:"git_credential_id"`
	GitDefaultBranch string      `json:"git_default_branch"`
	GitWebhookSecret string      `json:"git_webhook_secret"`
	GitLastSyncedRef string      `json:"git_last_synced_ref"`
	GitMode          string      `json:"git_mode"`
	CredentialName   pgtype.Text `json:"credential_name"`
}

type GetAgentGrantParams added in v0.4.0

type GetAgentGrantParams struct {
	AgentID   pgtype.UUID `json:"agent_id"`
	GranteeID pgtype.UUID `json:"grantee_id"`
}

type GetAgentJobByIDAndAgentForUpdateParams added in v0.5.0

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

type GetAgentJobByIDAndAgentParams added in v0.5.0

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

type GetAgentJobCronParams added in v0.5.0

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

type GetAgentJobHandlerForEnqueueParams added in v0.5.0

type GetAgentJobHandlerForEnqueueParams struct {
	AgentID        pgtype.UUID `json:"agent_id"`
	HandlerName    string      `json:"handler_name"`
	HandlerVersion int32       `json:"handler_version"`
}

type GetAgentModelSlotParams

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

type GetAgentTokenAuthRow added in v0.4.0

type GetAgentTokenAuthRow struct {
	Status            string `json:"status"`
	AgentTokenVersion int64  `json:"agent_token_version"`
}

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 GetClaimedConnectorJobParams added in v0.6.1

type GetClaimedConnectorJobParams struct {
	JobID         pgtype.UUID `json:"job_id"`
	AttemptNumber int32       `json:"attempt_number"`
}

type GetClaimedConnectorJobRow added in v0.6.1

type GetClaimedConnectorJobRow struct {
	ID                pgtype.UUID        `json:"id"`
	ConnectorID       pgtype.UUID        `json:"connector_id"`
	AgentID           pgtype.UUID        `json:"agent_id"`
	NeedID            pgtype.UUID        `json:"need_id"`
	RequestID         pgtype.UUID        `json:"request_id"`
	OrchestrationID   pgtype.UUID        `json:"orchestration_id"`
	TargetPosition    pgtype.Int4        `json:"target_position"`
	CanaryCohort      bool               `json:"canary_cohort"`
	OperationKind     string             `json:"operation_kind"`
	OperationName     string             `json:"operation_name"`
	OperationRevision int32              `json:"operation_revision"`
	Mode              string             `json:"mode"`
	InputSchemaHash   string             `json:"input_schema_hash"`
	OutputSchemaHash  string             `json:"output_schema_hash"`
	InputPayload      []byte             `json:"input_payload"`
	Status            string             `json:"status"`
	IdempotencyKey    pgtype.UUID        `json:"idempotency_key"`
	CancelRequestedAt pgtype.Timestamptz `json:"cancel_requested_at"`
	DeadlineAt        pgtype.Timestamptz `json:"deadline_at"`
	OutputPayload     []byte             `json:"output_payload"`
	ErrorCode         pgtype.Text        `json:"error_code"`
	ErrorMessage      pgtype.Text        `json:"error_message"`
	StartedAt         pgtype.Timestamptz `json:"started_at"`
	CompletedAt       pgtype.Timestamptz `json:"completed_at"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
	RequestHash       string             `json:"request_hash"`
	AttemptNumber     int32              `json:"attempt_number"`
	AttemptToken      pgtype.UUID        `json:"attempt_token"`
	LeaseExpiresAt    pgtype.Timestamptz `json:"lease_expires_at"`
}

type GetCompatibleConnectorArtifactDownloadParams added in v0.6.1

type GetCompatibleConnectorArtifactDownloadParams struct {
	AgentID        pgtype.UUID `json:"agent_id"`
	NeedSlug       string      `json:"need_slug"`
	ArtifactFileID pgtype.UUID `json:"artifact_file_id"`
}

type GetCompatibleConnectorArtifactDownloadRow added in v0.6.1

type GetCompatibleConnectorArtifactDownloadRow struct {
	AgentID          pgtype.UUID        `json:"agent_id"`
	ConnectorSlug    string             `json:"connector_slug"`
	SourceRef        string             `json:"source_ref"`
	ArtifactVersion  string             `json:"artifact_version"`
	ID               pgtype.UUID        `json:"id"`
	ArtifactSetID    pgtype.UUID        `json:"artifact_set_id"`
	Platform         string             `json:"platform"`
	Filename         string             `json:"filename"`
	Digest           string             `json:"digest"`
	SizeBytes        int64              `json:"size_bytes"`
	NoticesDigest    string             `json:"notices_digest"`
	NoticesSizeBytes int64              `json:"notices_size_bytes"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	ObjectKey        string             `json:"object_key"`
	NoticesObjectKey string             `json:"notices_object_key"`
}

type GetCompatibleHostUpdateArtifactParams added in v0.6.1

type GetCompatibleHostUpdateArtifactParams struct {
	ArtifactFileID pgtype.UUID `json:"artifact_file_id"`
	ConnectorID    pgtype.UUID `json:"connector_id"`
	HostID         pgtype.UUID `json:"host_id"`
	Platform       string      `json:"platform"`
}

type GetCompatibleHostUpdateArtifactRow added in v0.6.1

type GetCompatibleHostUpdateArtifactRow struct {
	ID                  pgtype.UUID        `json:"id"`
	ArtifactSetID       pgtype.UUID        `json:"artifact_set_id"`
	Platform            string             `json:"platform"`
	Filename            string             `json:"filename"`
	Digest              string             `json:"digest"`
	SizeBytes           int64              `json:"size_bytes"`
	NoticesDigest       string             `json:"notices_digest"`
	NoticesSizeBytes    int64              `json:"notices_size_bytes"`
	CreatedAt           pgtype.Timestamptz `json:"created_at"`
	ArtifactSetID_2     pgtype.UUID        `json:"artifact_set_id_2"`
	AgentID             pgtype.UUID        `json:"agent_id"`
	ConnectorSlug       string             `json:"connector_slug"`
	Kind                string             `json:"kind"`
	ContractID          string             `json:"contract_id"`
	ArtifactVersion     string             `json:"artifact_version"`
	InterfaceDescriptor []byte             `json:"interface_descriptor"`
	InterfaceHash       string             `json:"interface_hash"`
	ProtocolMajor       int32              `json:"protocol_major"`
	ProtocolMinor       int32              `json:"protocol_minor"`
	Features            []string           `json:"features"`
	ServiceMode         pgtype.Text        `json:"service_mode"`
	ObjectKey           string             `json:"object_key"`
}

type GetCompletedHostManagementJobForAttemptParams added in v0.6.1

type GetCompletedHostManagementJobForAttemptParams struct {
	JobID        pgtype.UUID `json:"job_id"`
	HostID       pgtype.UUID `json:"host_id"`
	AttemptToken pgtype.UUID `json:"attempt_token"`
}

type GetConnectorArtifactLineageRow added in v0.6.1

type GetConnectorArtifactLineageRow struct {
	AgentID       pgtype.UUID `json:"agent_id"`
	ConnectorSlug string      `json:"connector_slug"`
}

type GetConnectorArtifactStatusRow added in v0.6.1

type GetConnectorArtifactStatusRow struct {
	ID                     pgtype.UUID        `json:"id"`
	ArtifactVersion        string             `json:"artifact_version"`
	ArtifactDigest         string             `json:"artifact_digest"`
	ProtocolMajor          int32              `json:"protocol_major"`
	ProtocolMinor          int32              `json:"protocol_minor"`
	InterfaceDescriptor    []byte             `json:"interface_descriptor"`
	InterfaceHash          string             `json:"interface_hash"`
	CreatedAt              pgtype.Timestamptz `json:"created_at"`
	Platform               pgtype.Text        `json:"platform"`
	InstalledArtifactSetID pgtype.UUID        `json:"installed_artifact_set_id"`
	LatestFileDigest       pgtype.Text        `json:"latest_file_digest"`
	InterfaceCompatible    bool               `json:"interface_compatible"`
}

type GetConnectorJobByAgentForUpdateParams added in v0.6.1

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

type GetConnectorJobByAgentParams added in v0.6.1

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

type GetConnectorJobByRequestParams added in v0.6.1

type GetConnectorJobByRequestParams struct {
	AgentID   pgtype.UUID `json:"agent_id"`
	NeedSlug  string      `json:"need_slug"`
	RequestID pgtype.UUID `json:"request_id"`
}

type GetConnectorOrchestrationByRequestParams added in v0.6.1

type GetConnectorOrchestrationByRequestParams struct {
	AgentID   pgtype.UUID `json:"agent_id"`
	NeedID    pgtype.UUID `json:"need_id"`
	RequestID pgtype.UUID `json:"request_id"`
}

type GetConnectorTargetGroupMemberParams added in v0.6.1

type GetConnectorTargetGroupMemberParams struct {
	GroupID     pgtype.UUID `json:"group_id"`
	ConnectorID pgtype.UUID `json:"connector_id"`
}

type GetConversationByIDAndAgentForUpdateParams added in v0.4.0

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

type GetConversationByIDAndAgentParams added in v0.4.0

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

type GetConversationBySourceParams

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

type GetDescendantRunsRow added in v0.4.0

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

type GetDirectoryByPathParams added in v0.2.0

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

type GetHostArtifactFileRow added in v0.6.1

type GetHostArtifactFileRow struct {
	ID                  pgtype.UUID        `json:"id"`
	ArtifactSetID       pgtype.UUID        `json:"artifact_set_id"`
	Platform            string             `json:"platform"`
	Filename            string             `json:"filename"`
	Digest              string             `json:"digest"`
	SizeBytes           int64              `json:"size_bytes"`
	NoticesDigest       string             `json:"notices_digest"`
	NoticesSizeBytes    int64              `json:"notices_size_bytes"`
	CreatedAt           pgtype.Timestamptz `json:"created_at"`
	ArtifactSetID_2     pgtype.UUID        `json:"artifact_set_id_2"`
	AgentID             pgtype.UUID        `json:"agent_id"`
	ConnectorSlug       string             `json:"connector_slug"`
	Kind                string             `json:"kind"`
	ContractID          string             `json:"contract_id"`
	ArtifactVersion     string             `json:"artifact_version"`
	InterfaceDescriptor []byte             `json:"interface_descriptor"`
	InterfaceHash       string             `json:"interface_hash"`
	ProtocolMajor       int32              `json:"protocol_major"`
	ProtocolMinor       int32              `json:"protocol_minor"`
	Features            []string           `json:"features"`
	ServiceMode         pgtype.Text        `json:"service_mode"`
	ObjectKey           string             `json:"object_key"`
}

type GetHostCredentialBySelectorRow added in v0.6.1

type GetHostCredentialBySelectorRow struct {
	ID            pgtype.UUID        `json:"id"`
	HostID        pgtype.UUID        `json:"host_id"`
	Selector      pgtype.UUID        `json:"selector"`
	TokenHash     []byte             `json:"token_hash"`
	CreatedAt     pgtype.Timestamptz `json:"created_at"`
	LastUsedAt    pgtype.Timestamptz `json:"last_used_at"`
	RevokedAt     pgtype.Timestamptz `json:"revoked_at"`
	HostLifecycle string             `json:"host_lifecycle"`
}

type GetHostedConnectorAnyLifecycleParams added in v0.6.1

type GetHostedConnectorAnyLifecycleParams struct {
	ID     pgtype.UUID `json:"id"`
	HostID pgtype.UUID `json:"host_id"`
}

type GetHostedConnectorParams added in v0.6.1

type GetHostedConnectorParams struct {
	ID     pgtype.UUID `json:"id"`
	HostID pgtype.UUID `json:"host_id"`
}

type GetLiveUserForSessionParams added in v0.4.0

type GetLiveUserForSessionParams struct {
	SessionID pgtype.UUID `json:"session_id"`
	UserID    pgtype.UUID `json:"user_id"`
}

type GetLiveUserForSessionRow added in v0.4.0

type GetLiveUserForSessionRow struct {
	User User `json:"user"`
}

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 GetMCPActiveRequestParams added in v0.4.0

type GetMCPActiveRequestParams struct {
	TargetAgentID     pgtype.UUID `json:"target_agent_id"`
	PrincipalIdentity string      `json:"principal_identity"`
	RequestID         []byte      `json:"request_id"`
	RunID             pgtype.UUID `json:"run_id"`
}

type GetModelGrantRow added in v0.4.0

type GetModelGrantRow struct {
	CatalogID pgtype.UUID `json:"provider_id"`
	Model     string      `json:"model"`
}

type GetOrCreateBridgeAuthedConversationParams added in v0.4.0

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

type GetPlatformIdentityParams

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

type GetProviderModelParams added in v0.4.1

type GetProviderModelParams struct {
	ConfiguredProviderID pgtype.UUID `json:"configured_provider_id"`
	ModelID              string      `json:"model_id"`
}

type GetProvisionalConnectionForNeedOwnerParams added in v0.4.0

type GetProvisionalConnectionForNeedOwnerParams struct {
	NeedID           pgtype.UUID `json:"need_id"`
	OwnerPrincipalID pgtype.UUID `json:"owner_principal_id"`
}

type GetProvisionalMCPServerForNeedOwnerParams added in v0.4.0

type GetProvisionalMCPServerForNeedOwnerParams struct {
	NeedID           pgtype.UUID `json:"need_id"`
	OwnerPrincipalID pgtype.UUID `json:"owner_principal_id"`
}

type GetPublicSystemStatusRow added in v0.6.1

type GetPublicSystemStatusRow struct {
	UiLocale  string `json:"ui_locale"`
	Activated bool   `json:"activated"`
}

type GetResourceNeedForUpdateParams added in v0.4.0

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

type GetResourceNeedParams added in v0.4.0

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

type GetRunByIDAndAgentParams added in v0.4.0

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

type GetRunCheckpointParams added in v0.4.0

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

type GetRunningRunForJobEnqueueParams added in v0.5.0

type GetRunningRunForJobEnqueueParams struct {
	SourceRunID pgtype.UUID `json:"source_run_id"`
	AgentID     pgtype.UUID `json:"agent_id"`
}

type GetSiblingMaxAccessParams added in v0.4.0

type GetSiblingMaxAccessParams struct {
	ParentAgentID  pgtype.UUID `json:"parent_agent_id"`
	SiblingAgentID pgtype.UUID `json:"sibling_agent_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 GitCredential added in v0.4.0

type GitCredential struct {
	ID              pgtype.UUID        `json:"id"`
	UserID          pgtype.UUID        `json:"user_id"`
	Type            string             `json:"type"`
	Name            string             `json:"name"`
	TokenRef        string             `json:"token_ref"`
	GithubInstallID string             `json:"github_install_id"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
	LastUsedAt      pgtype.Timestamptz `json:"last_used_at"`
}

type Group added in v0.4.0

type Group struct {
	ID          pgtype.UUID `json:"id"`
	Name        string      `json:"name"`
	Description string      `json:"description"`
	Builtin     bool        `json:"builtin"`
}

type HasUserAgentGrantParams added in v0.4.0

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

type HeartbeatConnectorParams added in v0.6.1

type HeartbeatConnectorParams struct {
	ReportedInterfaceHash pgtype.Text `json:"reported_interface_hash"`
	ArtifactDigest        pgtype.Text `json:"artifact_digest"`
	Readiness             string      `json:"readiness"`
	ReadinessMessage      pgtype.Text `json:"readiness_message"`
	ID                    pgtype.UUID `json:"id"`
}

type Host added in v0.6.1

type Host struct {
	ID               pgtype.UUID        `json:"id"`
	OwnerPrincipalID pgtype.UUID        `json:"owner_principal_id"`
	Name             string             `json:"name"`
	Platform         string             `json:"platform"`
	Architecture     string             `json:"architecture"`
	AccessMode       string             `json:"access_mode"`
	Version          string             `json:"version"`
	ProtocolVersion  int32              `json:"protocol_version"`
	Lifecycle        string             `json:"lifecycle"`
	EnrolledByUserID pgtype.UUID        `json:"enrolled_by_user_id"`
	LastSeenAt       pgtype.Timestamptz `json:"last_seen_at"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
}

type HostCredential added in v0.6.1

type HostCredential struct {
	ID         pgtype.UUID        `json:"id"`
	HostID     pgtype.UUID        `json:"host_id"`
	Selector   pgtype.UUID        `json:"selector"`
	TokenHash  []byte             `json:"token_hash"`
	CreatedAt  pgtype.Timestamptz `json:"created_at"`
	LastUsedAt pgtype.Timestamptz `json:"last_used_at"`
	RevokedAt  pgtype.Timestamptz `json:"revoked_at"`
}

type HostEnrollmentAttempt added in v0.6.1

type HostEnrollmentAttempt struct {
	IpAddress string             `json:"ip_address"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type HostEnrollmentSession added in v0.6.1

type HostEnrollmentSession struct {
	ID                  pgtype.UUID        `json:"id"`
	DeviceCodeHash      []byte             `json:"device_code_hash"`
	UserCodeHash        []byte             `json:"user_code_hash"`
	UserCodeDisplay     string             `json:"user_code_display"`
	HostInfo            []byte             `json:"host_info"`
	Status              string             `json:"status"`
	PollIntervalSeconds int32              `json:"poll_interval_seconds"`
	ExpiresAt           pgtype.Timestamptz `json:"expires_at"`
	LastPolledAt        pgtype.Timestamptz `json:"last_polled_at"`
	ApprovedByUserID    pgtype.UUID        `json:"approved_by_user_id"`
	HostID              pgtype.UUID        `json:"host_id"`
	ApprovedAt          pgtype.Timestamptz `json:"approved_at"`
	DeniedAt            pgtype.Timestamptz `json:"denied_at"`
	ConsumedAt          pgtype.Timestamptz `json:"consumed_at"`
	CreatedAt           pgtype.Timestamptz `json:"created_at"`
}

type HostManagementAttempt added in v0.6.1

type HostManagementAttempt struct {
	JobID          pgtype.UUID        `json:"job_id"`
	AttemptNumber  int32              `json:"attempt_number"`
	AttemptToken   pgtype.UUID        `json:"attempt_token"`
	Status         string             `json:"status"`
	LeaseExpiresAt pgtype.Timestamptz `json:"lease_expires_at"`
	LeasedAt       pgtype.Timestamptz `json:"leased_at"`
	StartedAt      pgtype.Timestamptz `json:"started_at"`
	CompletedAt    pgtype.Timestamptz `json:"completed_at"`
	ErrorMessage   pgtype.Text        `json:"error_message"`
	CreatedAt      pgtype.Timestamptz `json:"created_at"`
	UpdatedAt      pgtype.Timestamptz `json:"updated_at"`
}

type HostManagementEvent added in v0.6.1

type HostManagementEvent struct {
	JobID           pgtype.UUID        `json:"job_id"`
	Sequence        int64              `json:"sequence"`
	AttemptNumber   int32              `json:"attempt_number"`
	AttemptSequence int64              `json:"attempt_sequence"`
	Phase           string             `json:"phase"`
	Message         string             `json:"message"`
	EventTime       pgtype.Timestamptz `json:"event_time"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
}

type HostManagementJob added in v0.6.1

type HostManagementJob struct {
	ID                pgtype.UUID        `json:"id"`
	HostID            pgtype.UUID        `json:"host_id"`
	ConnectorID       pgtype.UUID        `json:"connector_id"`
	RequestedByUserID pgtype.UUID        `json:"requested_by_user_id"`
	Kind              string             `json:"kind"`
	ArtifactFileID    pgtype.UUID        `json:"artifact_file_id"`
	InputPayload      []byte             `json:"input_payload"`
	SecretInput       string             `json:"secret_input"`
	Status            string             `json:"status"`
	OutputPayload     []byte             `json:"output_payload"`
	SecretOutput      pgtype.Text        `json:"secret_output"`
	ErrorMessage      pgtype.Text        `json:"error_message"`
	DeadlineAt        pgtype.Timestamptz `json:"deadline_at"`
	StartedAt         pgtype.Timestamptz `json:"started_at"`
	CompletedAt       pgtype.Timestamptz `json:"completed_at"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
}

type IdentityLinkChallenge added in v0.4.0

type IdentityLinkChallenge struct {
	TokenHash      string             `json:"token_hash"`
	UserID         pgtype.UUID        `json:"user_id"`
	Platform       string             `json:"platform"`
	BridgeID       pgtype.UUID        `json:"bridge_id"`
	PlatformUserID string             `json:"platform_user_id"`
	ExpiresAt      pgtype.Timestamptz `json:"expires_at"`
	ConsumedAt     pgtype.Timestamptz `json:"consumed_at"`
	CreatedAt      pgtype.Timestamptz `json:"created_at"`
}

type InsertAgentBuildJobHandlerParams added in v0.5.0

type InsertAgentBuildJobHandlerParams struct {
	BuildID          pgtype.UUID `json:"build_id"`
	Name             string      `json:"name"`
	Version          int32       `json:"version"`
	Description      string      `json:"description"`
	TimeoutMs        int64       `json:"timeout_ms"`
	MaxAttempts      int32       `json:"max_attempts"`
	MaxConcurrency   int32       `json:"max_concurrency"`
	InputSchema      []byte      `json:"input_schema"`
	OutputSchema     []byte      `json:"output_schema"`
	InputSchemaHash  string      `json:"input_schema_hash"`
	OutputSchemaHash string      `json:"output_schema_hash"`
}

type InsertAgentJobFromCronParams added in v0.5.0

type InsertAgentJobFromCronParams struct {
	JobID                   pgtype.UUID        `json:"job_id"`
	ScheduledAt             pgtype.Timestamptz `json:"scheduled_at"`
	InitiatorKind           string             `json:"initiator_kind"`
	InitiatorUserID         pgtype.UUID        `json:"initiator_user_id"`
	InitiatorConversationID pgtype.UUID        `json:"initiator_conversation_id"`
	InitiatorAccess         string             `json:"initiator_access"`
	CronID                  pgtype.UUID        `json:"cron_id"`
}

type InsertAgentJobParams added in v0.5.0

type InsertAgentJobParams struct {
	ID                      pgtype.UUID        `json:"id"`
	AgentID                 pgtype.UUID        `json:"agent_id"`
	HandlerName             string             `json:"handler_name"`
	HandlerVersion          int32              `json:"handler_version"`
	InputSchemaHash         string             `json:"input_schema_hash"`
	OutputSchemaHash        string             `json:"output_schema_hash"`
	SourceRunID             pgtype.UUID        `json:"source_run_id"`
	InitiatorKind           string             `json:"initiator_kind"`
	InitiatorUserID         pgtype.UUID        `json:"initiator_user_id"`
	InitiatorConversationID pgtype.UUID        `json:"initiator_conversation_id"`
	InitiatorAccess         string             `json:"initiator_access"`
	TimeoutMs               int64              `json:"timeout_ms"`
	MaxAttempts             int32              `json:"max_attempts"`
	ScheduledAt             pgtype.Timestamptz `json:"scheduled_at"`
	InputPayload            []byte             `json:"input_payload"`
}

type InsertConnectorJobParams added in v0.6.1

type InsertConnectorJobParams struct {
	ID                pgtype.UUID        `json:"id"`
	ConnectorID       pgtype.UUID        `json:"connector_id"`
	AgentID           pgtype.UUID        `json:"agent_id"`
	NeedID            pgtype.UUID        `json:"need_id"`
	RequestID         pgtype.UUID        `json:"request_id"`
	OrchestrationID   pgtype.UUID        `json:"orchestration_id"`
	TargetPosition    pgtype.Int4        `json:"target_position"`
	CanaryCohort      bool               `json:"canary_cohort"`
	OperationKind     string             `json:"operation_kind"`
	OperationName     string             `json:"operation_name"`
	OperationRevision int32              `json:"operation_revision"`
	Mode              string             `json:"mode"`
	InputSchemaHash   string             `json:"input_schema_hash"`
	OutputSchemaHash  string             `json:"output_schema_hash"`
	InputPayload      []byte             `json:"input_payload"`
	RequestHash       string             `json:"request_hash"`
	Status            string             `json:"status"`
	IdempotencyKey    pgtype.UUID        `json:"idempotency_key"`
	DeadlineAt        pgtype.Timestamptz `json:"deadline_at"`
}

type InsertConnectorTransferParams added in v0.6.1

type InsertConnectorTransferParams struct {
	JobID                pgtype.UUID        `json:"job_id"`
	RunID                pgtype.UUID        `json:"run_id"`
	Direction            string             `json:"direction"`
	SourcePath           string             `json:"source_path"`
	DestinationPath      string             `json:"destination_path"`
	ObjectKey            string             `json:"object_key"`
	DestinationObjectKey string             `json:"destination_object_key"`
	DestinationExisted   bool               `json:"destination_existed"`
	DestinationEtag      pgtype.Text        `json:"destination_etag"`
	TransferMarker       pgtype.UUID        `json:"transfer_marker"`
	StorageOrigin        string             `json:"storage_origin"`
	Overwrite            bool               `json:"overwrite"`
	MaximumSize          int64              `json:"maximum_size"`
	ExpectedSize         int64              `json:"expected_size"`
	ExpectedSha256       pgtype.Text        `json:"expected_sha256"`
	MultipartUploadID    pgtype.Text        `json:"multipart_upload_id"`
	MultipartPartSize    pgtype.Int8        `json:"multipart_part_size"`
	MultipartPartCount   pgtype.Int4        `json:"multipart_part_count"`
	MultipartParts       []byte             `json:"multipart_parts"`
	GrantExpiresAt       pgtype.Timestamptz `json:"grant_expires_at"`
	DeadlineAt           pgtype.Timestamptz `json:"deadline_at"`
	CleanupAfter         pgtype.Timestamptz `json:"cleanup_after"`
}

type InsertHostManagementJobParams added in v0.6.1

type InsertHostManagementJobParams struct {
	ID                pgtype.UUID        `json:"id"`
	HostID            pgtype.UUID        `json:"host_id"`
	ConnectorID       pgtype.UUID        `json:"connector_id"`
	RequestedByUserID pgtype.UUID        `json:"requested_by_user_id"`
	Kind              string             `json:"kind"`
	ArtifactFileID    pgtype.UUID        `json:"artifact_file_id"`
	SecretInput       string             `json:"secret_input"`
	DeadlineAt        pgtype.Timestamptz `json:"deadline_at"`
}

type InsertLLMUsageParams added in v0.4.0

type InsertLLMUsageParams struct {
	AgentID           pgtype.UUID `json:"agent_id"`
	RunID             pgtype.UUID `json:"run_id"`
	BuildID           pgtype.UUID `json:"build_id"`
	SystemRunID       pgtype.UUID `json:"system_run_id"`
	UserID            pgtype.UUID `json:"user_id"`
	ConversationID    pgtype.UUID `json:"conversation_id"`
	ProviderCatalogID string      `json:"provider_catalog_id"`
	ProviderSlug      string      `json:"provider_slug"`
	Model             string      `json:"model"`
	Capability        string      `json:"capability"`
	CallKind          string      `json:"call_kind"`
	Slug              string      `json:"slug"`
	TokensIn          int64       `json:"tokens_in"`
	TokensOut         int64       `json:"tokens_out"`
	TokensCached      int64       `json:"tokens_cached"`
	TokensReasoning   int64       `json:"tokens_reasoning"`
	Units             float64     `json:"units"`
	UnitKind          string      `json:"unit_kind"`
	CostInput         float64     `json:"cost_input"`
	CostOutput        float64     `json:"cost_output"`
	CostTotal         float64     `json:"cost_total"`
	FinishReason      string      `json:"finish_reason"`
	Errored           bool        `json:"errored"`
	LatencyMs         int32       `json:"latency_ms"`
}

type InsertManualAgentJobFromCronParams added in v0.5.0

type InsertManualAgentJobFromCronParams struct {
	JobID           pgtype.UUID        `json:"job_id"`
	ScheduledAt     pgtype.Timestamptz `json:"scheduled_at"`
	InitiatorUserID pgtype.UUID        `json:"initiator_user_id"`
	CronID          pgtype.UUID        `json:"cron_id"`
}

type InsertResourceOwnershipTransferParams added in v0.6.1

type InsertResourceOwnershipTransferParams struct {
	ResourceType             string      `json:"resource_type"`
	ResourceID               pgtype.UUID `json:"resource_id"`
	ActorUserID              pgtype.UUID `json:"actor_user_id"`
	PreviousOwnerPrincipalID pgtype.UUID `json:"previous_owner_principal_id"`
	NewOwnerUserID           pgtype.UUID `json:"new_owner_user_id"`
}

type InsertSystemAuditPendingParams added in v0.4.0

type InsertSystemAuditPendingParams struct {
	UserID         pgtype.UUID `json:"user_id"`
	ConversationID pgtype.UUID `json:"conversation_id"`
	Tool           string      `json:"tool"`
	Args           []byte      `json:"args"`
}

type InterruptAgentJobAttemptParams added in v0.5.0

type InterruptAgentJobAttemptParams struct {
	ErrorMessage  pgtype.Text `json:"error_message"`
	JobID         pgtype.UUID `json:"job_id"`
	AttemptNumber int32       `json:"attempt_number"`
	LeaseOwner    pgtype.UUID `json:"lease_owner"`
	LeaseToken    pgtype.UUID `json:"lease_token"`
}

type InterruptExpiredAgentJobAttemptParams added in v0.5.0

type InterruptExpiredAgentJobAttemptParams struct {
	ErrorMessage  pgtype.Text `json:"error_message"`
	JobID         pgtype.UUID `json:"job_id"`
	AttemptNumber int32       `json:"attempt_number"`
	LeaseToken    pgtype.UUID `json:"lease_token"`
}

type IsProviderModelReferencedParams added in v0.4.1

type IsProviderModelReferencedParams struct {
	CatalogID pgtype.UUID `json:"provider_id"`
	Model     string      `json:"model"`
}

type IsSystemDefaultModelParams added in v0.4.0

type IsSystemDefaultModelParams struct {
	CatalogID pgtype.UUID `json:"provider_id"`
	Model     string      `json:"model"`
}

type ListActiveAgentJobAttemptsParams added in v0.5.0

type ListActiveAgentJobAttemptsParams struct {
	AgentID pgtype.UUID `json:"agent_id"`
	Lim     int32       `json:"lim"`
}

type ListAddableSiblingsParams added in v0.4.0

type ListAddableSiblingsParams struct {
	ParentAgentID   pgtype.UUID   `json:"parent_agent_id"`
	OwnerGranteeIds []pgtype.UUID `json:"owner_grantee_ids"`
}

type ListAddableSiblingsRow added in v0.4.0

type ListAddableSiblingsRow struct {
	ID          pgtype.UUID `json:"id"`
	Slug        string      `json:"slug"`
	Name        string      `json:"name"`
	Description string      `json:"description"`
	OwnerName   string      `json:"owner_name"`
}

type ListAgentBuildBlockingJobsParams added in v0.5.0

type ListAgentBuildBlockingJobsParams struct {
	BuildID         pgtype.UUID        `json:"build_id"`
	AgentID         pgtype.UUID        `json:"agent_id"`
	CursorCreatedAt pgtype.Timestamptz `json:"cursor_created_at"`
	CursorID        pgtype.UUID        `json:"cursor_id"`
	Lim             int32              `json:"lim"`
}

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"`
	LlmCalls         int32              `json:"llm_calls"`
	LlmTokensIn      int32              `json:"llm_tokens_in"`
	LlmTokensOut     int32              `json:"llm_tokens_out"`
	LlmTokensCached  int32              `json:"llm_tokens_cached"`
	LlmCostEstimate  float64            `json:"llm_cost_estimate"`
	RollbackTargetID pgtype.UUID        `json:"rollback_target_id"`
	SdkVersion       string             `json:"sdk_version"`
	ExitStatus       string             `json:"exit_status"`
	ExitMessage      string             `json:"exit_message"`
	FailureKind      string             `json:"failure_kind"`
	BuildModel       string             `json:"build_model"`
	DeploymentPhase  string             `json:"deployment_phase"`
}

type ListAgentEnvVarsRow added in v0.2.12

type ListAgentEnvVarsRow struct {
	ID           pgtype.UUID        `json:"id"`
	AgentID      pgtype.UUID        `json:"agent_id"`
	Slug         string             `json:"slug"`
	Description  string             `json:"description"`
	IsSecret     bool               `json:"is_secret"`
	DefaultValue string             `json:"default_value"`
	Pattern      string             `json:"pattern"`
	Configured   bool               `json:"configured"`
	CreatedAt    pgtype.Timestamptz `json:"created_at"`
	UpdatedAt    pgtype.Timestamptz `json:"updated_at"`
}

type ListAgentGrantRowsForGranteesParams added in v0.4.0

type ListAgentGrantRowsForGranteesParams struct {
	AgentID    pgtype.UUID   `json:"agent_id"`
	GranteeIds []pgtype.UUID `json:"grantee_ids"`
}

type ListAgentGrantRowsForGranteesRow added in v0.4.0

type ListAgentGrantRowsForGranteesRow struct {
	GranteeID pgtype.UUID `json:"grantee_id"`
	Role      string      `json:"role"`
}

type ListAgentGrantsForGranteesParams added in v0.4.0

type ListAgentGrantsForGranteesParams struct {
	AgentID    pgtype.UUID   `json:"agent_id"`
	GranteeIds []pgtype.UUID `json:"grantee_ids"`
}

type ListAgentGrantsRow added in v0.4.0

type ListAgentGrantsRow struct {
	AgentID     pgtype.UUID        `json:"agent_id"`
	GranteeID   pgtype.UUID        `json:"grantee_id"`
	Role        string             `json:"role"`
	CreatedAt   pgtype.Timestamptz `json:"created_at"`
	Kind        string             `json:"kind"`
	Email       string             `json:"email"`
	DisplayName string             `json:"display_name"`
}

type ListAgentIDsUsingModelParams added in v0.4.1

type ListAgentIDsUsingModelParams struct {
	CatalogID pgtype.UUID `json:"provider_id"`
	Model     string      `json:"model"`
}

type ListAgentJobsByAgentParams added in v0.5.0

type ListAgentJobsByAgentParams struct {
	AgentID         pgtype.UUID        `json:"agent_id"`
	CursorCreatedAt pgtype.Timestamptz `json:"cursor_created_at"`
	CursorID        pgtype.UUID        `json:"cursor_id"`
	Lim             int32              `json:"lim"`
}

type ListAgentsForGitPollingRow added in v0.4.0

type ListAgentsForGitPollingRow struct {
	ID               pgtype.UUID `json:"id"`
	GitRemoteUrl     string      `json:"git_remote_url"`
	GitDefaultBranch string      `json:"git_default_branch"`
	GitLastSyncedRef string      `json:"git_last_synced_ref"`
	GitCredentialID  pgtype.UUID `json:"git_credential_id"`
	GitMode          string      `json:"git_mode"`
}

type ListAvailableConnectionsParams added in v0.6.1

type ListAvailableConnectionsParams struct {
	PrincipalIds   []pgtype.UUID `json:"principal_ids"`
	GovernanceView bool          `json:"governance_view"`
}

type ListAvailableConnectionsRow added in v0.4.0

type ListAvailableConnectionsRow struct {
	ID               pgtype.UUID        `json:"id"`
	OwnerPrincipalID pgtype.UUID        `json:"owner_principal_id"`
	Slug             string             `json:"slug"`
	Name             string             `json:"name"`
	DisplayName      string             `json:"display_name"`
	AuthMode         string             `json:"auth_mode"`
	Authorized       bool               `json:"authorized"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	AgentCount       int32              `json:"agent_count"`
	Capabilities     []string           `json:"capabilities"`
}

type ListAvailableConnectorTargetGroupsParams added in v0.6.1

type ListAvailableConnectorTargetGroupsParams struct {
	PrincipalIds   []pgtype.UUID `json:"principal_ids"`
	GovernanceView bool          `json:"governance_view"`
}

type ListAvailableConnectorTargetGroupsRow added in v0.6.1

type ListAvailableConnectorTargetGroupsRow struct {
	ID               pgtype.UUID        `json:"id"`
	OwnerPrincipalID pgtype.UUID        `json:"owner_principal_id"`
	Name             string             `json:"name"`
	Description      string             `json:"description"`
	ContractID       string             `json:"contract_id"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
	MemberCount      int32              `json:"member_count"`
	Capabilities     []string           `json:"capabilities"`
}

type ListAvailableConnectorsParams added in v0.6.1

type ListAvailableConnectorsParams struct {
	PrincipalIds   []pgtype.UUID `json:"principal_ids"`
	GovernanceView bool          `json:"governance_view"`
}

type ListAvailableConnectorsRow added in v0.6.1

type ListAvailableConnectorsRow struct {
	ID               pgtype.UUID        `json:"id"`
	OwnerPrincipalID pgtype.UUID        `json:"owner_principal_id"`
	Slug             string             `json:"slug"`
	Name             pgtype.Text        `json:"name"`
	DisplayName      string             `json:"display_name"`
	Readiness        string             `json:"readiness"`
	ReadinessMessage pgtype.Text        `json:"readiness_message"`
	Lifecycle        string             `json:"lifecycle"`
	ContractID       pgtype.Text        `json:"contract_id"`
	ProtocolMajor    pgtype.Int4        `json:"protocol_major"`
	ProtocolMinor    pgtype.Int4        `json:"protocol_minor"`
	ArtifactVersion  pgtype.Text        `json:"artifact_version"`
	ArtifactDigest   pgtype.Text        `json:"artifact_digest"`
	InterfaceHash    pgtype.Text        `json:"interface_hash"`
	LastSeenAt       pgtype.Timestamptz `json:"last_seen_at"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	Authorized       bool               `json:"authorized"`
	AgentCount       int32              `json:"agent_count"`
	Capabilities     []string           `json:"capabilities"`
}

type ListAvailableGitCredentialsParams added in v0.6.1

type ListAvailableGitCredentialsParams struct {
	PrincipalIds   []pgtype.UUID `json:"principal_ids"`
	GovernanceView bool          `json:"governance_view"`
}

type ListAvailableGitCredentialsRow added in v0.6.1

type ListAvailableGitCredentialsRow struct {
	ID               pgtype.UUID        `json:"id"`
	OwnerPrincipalID pgtype.UUID        `json:"owner_principal_id"`
	Type             string             `json:"type"`
	Name             string             `json:"name"`
	GithubInstallID  string             `json:"github_install_id"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	LastUsedAt       pgtype.Timestamptz `json:"last_used_at"`
	Capabilities     []string           `json:"capabilities"`
}

type ListAvailableMCPServersParams added in v0.6.1

type ListAvailableMCPServersParams struct {
	PrincipalIds   []pgtype.UUID `json:"principal_ids"`
	GovernanceView bool          `json:"governance_view"`
}

type ListAvailableMCPServersRow added in v0.4.0

type ListAvailableMCPServersRow struct {
	ID               pgtype.UUID        `json:"id"`
	OwnerPrincipalID pgtype.UUID        `json:"owner_principal_id"`
	Slug             string             `json:"slug"`
	Name             string             `json:"name"`
	DisplayName      string             `json:"display_name"`
	AuthMode         string             `json:"auth_mode"`
	Authorized       bool               `json:"authorized"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	AgentCount       int32              `json:"agent_count"`
	Capabilities     []string           `json:"capabilities"`
}

type ListBoundMCPServersByAgentRow added in v0.4.0

type ListBoundMCPServersByAgentRow struct {
	Slug           string      `json:"slug"`
	ID             pgtype.UUID `json:"id"`
	Name           string      `json:"name"`
	Url            string      `json:"url"`
	AuthMode       string      `json:"auth_mode"`
	AuthInjection  []byte      `json:"auth_injection"`
	AccessTokenRef string      `json:"access_token_ref"`
	ToolSchemas    []byte      `json:"tool_schemas"`
}

type ListBridgesAccessibleRow

type ListBridgesAccessibleRow struct {
	ID                pgtype.UUID        `json:"id"`
	AgentID           pgtype.UUID        `json:"agent_id"`
	OwnerPrincipalID  pgtype.UUID        `json:"owner_principal_id"`
	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"`
	BotTokenRef       string             `json:"bot_token_ref"`
	LastPolledAt      pgtype.Timestamptz `json:"last_polled_at"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
	Managed           bool               `json:"managed"`
	TelegramBotUserID pgtype.Int8        `json:"telegram_bot_user_id"`
	IsManager         bool               `json:"is_manager"`
	ManagerError      string             `json:"manager_error"`
	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"`
	OwnerPrincipalID  pgtype.UUID        `json:"owner_principal_id"`
	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"`
	BotTokenRef       string             `json:"bot_token_ref"`
	LastPolledAt      pgtype.Timestamptz `json:"last_polled_at"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
	Managed           bool               `json:"managed"`
	TelegramBotUserID pgtype.Int8        `json:"telegram_bot_user_id"`
	IsManager         bool               `json:"is_manager"`
	ManagerError      string             `json:"manager_error"`
	OwnerEmail        pgtype.Text        `json:"owner_email"`
	OwnerDisplayName  pgtype.Text        `json:"owner_display_name"`
}

type ListBuildingAgentBuildsRow added in v0.5.0

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

type ListCompatibleConnectorArtifactFilesParams added in v0.6.1

type ListCompatibleConnectorArtifactFilesParams struct {
	AgentID  pgtype.UUID `json:"agent_id"`
	NeedSlug string      `json:"need_slug"`
}

type ListCompatibleConnectorArtifactFilesRow added in v0.6.1

type ListCompatibleConnectorArtifactFilesRow struct {
	ID                  pgtype.UUID        `json:"id"`
	AgentID             pgtype.UUID        `json:"agent_id"`
	BuildID             pgtype.UUID        `json:"build_id"`
	ConnectorSlug       string             `json:"connector_slug"`
	SourceRef           string             `json:"source_ref"`
	Kind                string             `json:"kind"`
	ContractID          string             `json:"contract_id"`
	Name                string             `json:"name"`
	Description         string             `json:"description"`
	ArtifactVersion     string             `json:"artifact_version"`
	ArtifactDigest      string             `json:"artifact_digest"`
	ProtocolMajor       int32              `json:"protocol_major"`
	ProtocolMinor       int32              `json:"protocol_minor"`
	Features            []string           `json:"features"`
	InterfaceDescriptor []byte             `json:"interface_descriptor"`
	InterfaceHash       string             `json:"interface_hash"`
	SettingsSchema      []byte             `json:"settings_schema"`
	RetiredAt           pgtype.Timestamptz `json:"retired_at"`
	CreatedAt           pgtype.Timestamptz `json:"created_at"`
	ServiceMode         pgtype.Text        `json:"service_mode"`
	FileID              pgtype.UUID        `json:"file_id"`
	Platform            string             `json:"platform"`
	Filename            string             `json:"filename"`
	Digest              string             `json:"digest"`
	SizeBytes           int64              `json:"size_bytes"`
	NoticesDigest       string             `json:"notices_digest"`
	NoticesSizeBytes    int64              `json:"notices_size_bytes"`
}

type ListConnectionConsumersRow added in v0.4.0

type ListConnectionConsumersRow struct {
	AgentID   pgtype.UUID `json:"agent_id"`
	AgentName string      `json:"agent_name"`
	AgentSlug string      `json:"agent_slug"`
	NeedType  string      `json:"need_type"`
	NeedSlug  string      `json:"need_slug"`
}

type ListConnectionGrantsRow added in v0.4.0

type ListConnectionGrantsRow struct {
	ID           pgtype.UUID `json:"id"`
	GranteeID    pgtype.UUID `json:"grantee_id"`
	Capabilities []string    `json:"capabilities"`
}

type ListConnectionNeedsByAgentRow added in v0.4.0

type ListConnectionNeedsByAgentRow struct {
	Slug              string             `json:"slug"`
	Description       string             `json:"description"`
	ConnectionID      pgtype.UUID        `json:"connection_id"`
	Name              string             `json:"name"`
	AuthMode          string             `json:"auth_mode"`
	AuthUrl           string             `json:"auth_url"`
	BaseUrl           string             `json:"base_url"`
	Scopes            string             `json:"scopes"`
	SetupInstructions string             `json:"setup_instructions"`
	Authorized        bool               `json:"authorized"`
	HasOauthApp       bool               `json:"has_oauth_app"`
	HasRefreshToken   bool               `json:"has_refresh_token"`
	Bound             bool               `json:"bound"`
	TokenExpiresAt    pgtype.Timestamptz `json:"token_expires_at"`
}

type ListConnectorCancellationNoticesRow added in v0.6.1

type ListConnectorCancellationNoticesRow struct {
	JobID        pgtype.UUID `json:"job_id"`
	AttemptToken pgtype.UUID `json:"attempt_token"`
}

type ListConnectorCancellationsForHostRow added in v0.6.1

type ListConnectorCancellationsForHostRow struct {
	JobID        pgtype.UUID `json:"job_id"`
	ConnectorID  pgtype.UUID `json:"connector_id"`
	AttemptToken pgtype.UUID `json:"attempt_token"`
}

type ListConnectorConsumersRow added in v0.6.1

type ListConnectorConsumersRow struct {
	AgentID   pgtype.UUID `json:"agent_id"`
	AgentName string      `json:"agent_name"`
	AgentSlug string      `json:"agent_slug"`
	NeedType  string      `json:"need_type"`
	NeedSlug  string      `json:"need_slug"`
}

type ListConnectorGrantDetailsRow added in v0.6.1

type ListConnectorGrantDetailsRow struct {
	ID           pgtype.UUID `json:"id"`
	GranteeID    pgtype.UUID `json:"grantee_id"`
	GranteeName  string      `json:"grantee_name"`
	GranteeKind  string      `json:"grantee_kind"`
	Capabilities []string    `json:"capabilities"`
}

type ListConnectorGrantsRow added in v0.6.1

type ListConnectorGrantsRow struct {
	ID           pgtype.UUID `json:"id"`
	GranteeID    pgtype.UUID `json:"grantee_id"`
	Capabilities []string    `json:"capabilities"`
}

type ListConnectorJobEventsParams added in v0.6.1

type ListConnectorJobEventsParams struct {
	JobID         pgtype.UUID `json:"job_id"`
	AfterSequence int64       `json:"after_sequence"`
	Lim           int32       `json:"lim"`
}

type ListConnectorOrchestrationReadinessRow added in v0.6.1

type ListConnectorOrchestrationReadinessRow struct {
	ID           pgtype.UUID `json:"id"`
	Status       string      `json:"status"`
	CanaryCohort bool        `json:"canary_cohort"`
	Ready        pgtype.Bool `json:"ready"`
}

type ListConnectorTargetGroupGrantsRow added in v0.6.1

type ListConnectorTargetGroupGrantsRow struct {
	ID           pgtype.UUID `json:"id"`
	GranteeID    pgtype.UUID `json:"grantee_id"`
	Capabilities []string    `json:"capabilities"`
}

type ListConnectorTargetGroupMembersRow added in v0.6.1

type ListConnectorTargetGroupMembersRow struct {
	ID                           pgtype.UUID        `json:"id"`
	OwnerPrincipalID             pgtype.UUID        `json:"owner_principal_id"`
	Slug                         string             `json:"slug"`
	Kind                         pgtype.Text        `json:"kind"`
	ContractID                   pgtype.Text        `json:"contract_id"`
	Name                         pgtype.Text        `json:"name"`
	DisplayName                  string             `json:"display_name"`
	Description                  pgtype.Text        `json:"description"`
	ProtocolMajor                pgtype.Int4        `json:"protocol_major"`
	ProtocolMinor                pgtype.Int4        `json:"protocol_minor"`
	Features                     []string           `json:"features"`
	ArtifactVersion              pgtype.Text        `json:"artifact_version"`
	ArtifactDigest               pgtype.Text        `json:"artifact_digest"`
	InterfaceDescriptor          []byte             `json:"interface_descriptor"`
	InterfaceHash                pgtype.Text        `json:"interface_hash"`
	Readiness                    string             `json:"readiness"`
	ReadinessMessage             pgtype.Text        `json:"readiness_message"`
	Labels                       []byte             `json:"labels"`
	Lifecycle                    string             `json:"lifecycle"`
	LastSeenAt                   pgtype.Timestamptz `json:"last_seen_at"`
	LastReadyAt                  pgtype.Timestamptz `json:"last_ready_at"`
	CreatedAt                    pgtype.Timestamptz `json:"created_at"`
	UpdatedAt                    pgtype.Timestamptz `json:"updated_at"`
	StorageOrigins               []string           `json:"storage_origins"`
	ActivationManifest           []byte             `json:"activation_manifest"`
	ActivationManifestHash       pgtype.Text        `json:"activation_manifest_hash"`
	ServiceMode                  pgtype.Text        `json:"service_mode"`
	ArtifactSetID                pgtype.UUID        `json:"artifact_set_id"`
	HostID                       pgtype.UUID        `json:"host_id"`
	RollbackArtifactSetID        pgtype.UUID        `json:"rollback_artifact_set_id"`
	InventoryRevision            int64              `json:"inventory_revision"`
	InventoryMutationHash        pgtype.Text        `json:"inventory_mutation_hash"`
	ActiveProvenance             string             `json:"active_provenance"`
	RollbackProvenance           string             `json:"rollback_provenance"`
	ActiveObservationState       string             `json:"active_observation_state"`
	RollbackObservationState     string             `json:"rollback_observation_state"`
	ObservedActiveDigest         pgtype.Text        `json:"observed_active_digest"`
	ObservedActiveManifest       []byte             `json:"observed_active_manifest"`
	ObservedActiveManifestHash   pgtype.Text        `json:"observed_active_manifest_hash"`
	ObservedRollbackDigest       pgtype.Text        `json:"observed_rollback_digest"`
	ObservedRollbackManifest     []byte             `json:"observed_rollback_manifest"`
	ObservedRollbackManifestHash pgtype.Text        `json:"observed_rollback_manifest_hash"`
	Position                     int32              `json:"position"`
}

type ListConnectorTargetGroupsParams added in v0.6.1

type ListConnectorTargetGroupsParams struct {
	PrincipalIds   []pgtype.UUID `json:"principal_ids"`
	GovernanceView bool          `json:"governance_view"`
}

type ListConnectorTargetGroupsRow added in v0.6.1

type ListConnectorTargetGroupsRow struct {
	ID               pgtype.UUID        `json:"id"`
	OwnerPrincipalID pgtype.UUID        `json:"owner_principal_id"`
	Name             string             `json:"name"`
	Description      string             `json:"description"`
	ContractID       string             `json:"contract_id"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
	MemberCount      int32              `json:"member_count"`
	ReadyMemberCount int32              `json:"ready_member_count"`
	Capabilities     []string           `json:"capabilities"`
}

type ListConversationFeedParams added in v0.4.0

type ListConversationFeedParams struct {
	UserID        pgtype.UUID        `json:"user_id"`
	CursorUpdated pgtype.Timestamptz `json:"cursor_updated"`
	CursorID      pgtype.UUID        `json:"cursor_id"`
	Lim           int32              `json:"lim"`
}

type ListConversationFeedRow added in v0.4.0

type ListConversationFeedRow struct {
	Kind      string             `json:"kind"`
	ID        pgtype.UUID        `json:"id"`
	AgentID   pgtype.UUID        `json:"agent_id"`
	Title     string             `json:"title"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
	Status    string             `json:"status"`
}

type ListConversationsByAgentParams

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

type ListDirectoriesWithRetentionRow added in v0.2.8

type ListDirectoriesWithRetentionRow struct {
	AgentID        pgtype.UUID `json:"agent_id"`
	Path           string      `json:"path"`
	RetentionHours int32       `json:"retention_hours"`
}

type ListEnabledProviderModelsRow added in v0.4.1

type ListEnabledProviderModelsRow struct {
	ConfiguredProviderID pgtype.UUID        `json:"configured_provider_id"`
	ModelID              string             `json:"model_id"`
	DisplayName          string             `json:"display_name"`
	ToolCall             bool               `json:"tool_call"`
	Reasoning            bool               `json:"reasoning"`
	Vision               bool               `json:"vision"`
	ContextLimit         int32              `json:"context_limit"`
	OutputLimit          int32              `json:"output_limit"`
	StructuredOutputs    bool               `json:"structured_outputs"`
	IncludeUsage         bool               `json:"include_usage"`
	CreatedAt            pgtype.Timestamptz `json:"created_at"`
	UpdatedAt            pgtype.Timestamptz `json:"updated_at"`
	ProviderCatalogID    string             `json:"provider_catalog_id"`
}

type ListExpiringConnectionsRow

type ListExpiringConnectionsRow struct {
	ID             pgtype.UUID        `json:"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"`
	AccessTokenRef string             `json:"access_token_ref"`
	RefreshToken   string             `json:"refresh_token"`
	TokenExpiresAt pgtype.Timestamptz `json:"token_expires_at"`
	Scopes         string             `json:"scopes"`
	GrantedScopes  string             `json:"granted_scopes"`
	ScopesVerified bool               `json:"scopes_verified"`
}

type ListExpiringMCPServersRow

type ListExpiringMCPServersRow struct {
	ID             pgtype.UUID        `json:"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"`
	AccessTokenRef string             `json:"access_token_ref"`
	RefreshToken   string             `json:"refresh_token"`
	TokenExpiresAt pgtype.Timestamptz `json:"token_expires_at"`
	Scopes         string             `json:"scopes"`
	GrantedScopes  string             `json:"granted_scopes"`
	ScopesVerified bool               `json:"scopes_verified"`
}

type ListGitCredentialGrantsRow added in v0.4.0

type ListGitCredentialGrantsRow struct {
	ID           pgtype.UUID `json:"id"`
	GranteeID    pgtype.UUID `json:"grantee_id"`
	Capabilities []string    `json:"capabilities"`
}

type ListGitCredentialsByUserRow added in v0.4.0

type ListGitCredentialsByUserRow struct {
	ID              pgtype.UUID        `json:"id"`
	UserID          pgtype.UUID        `json:"user_id"`
	Type            string             `json:"type"`
	Name            string             `json:"name"`
	GithubInstallID string             `json:"github_install_id"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
	LastUsedAt      pgtype.Timestamptz `json:"last_used_at"`
}

type ListGrantsForUserRow added in v0.4.0

type ListGrantsForUserRow struct {
	UserID     pgtype.UUID        `json:"user_id"`
	ClientID   string             `json:"client_id"`
	AgentID    pgtype.UUID        `json:"agent_id"`
	Scope      string             `json:"scope"`
	GrantedAt  pgtype.Timestamptz `json:"granted_at"`
	ExpiresAt  pgtype.Timestamptz `json:"expires_at"`
	RevokedAt  pgtype.Timestamptz `json:"revoked_at"`
	ClientName string             `json:"client_name"`
	AgentSlug  string             `json:"agent_slug"`
	AgentName  string             `json:"agent_name"`
}

type ListHostGrantsRow added in v0.6.1

type ListHostGrantsRow struct {
	ID           pgtype.UUID `json:"id"`
	GranteeID    pgtype.UUID `json:"grantee_id"`
	Capabilities []string    `json:"capabilities"`
}

type ListHostManagementJobsParams added in v0.6.1

type ListHostManagementJobsParams struct {
	HostID pgtype.UUID `json:"host_id"`
	Lim    int32       `json:"lim"`
}

type ListHostsParams added in v0.6.1

type ListHostsParams struct {
	PrincipalIds   []pgtype.UUID `json:"principal_ids"`
	GovernanceView bool          `json:"governance_view"`
}

type ListHostsRow added in v0.6.1

type ListHostsRow struct {
	ID               pgtype.UUID        `json:"id"`
	OwnerPrincipalID pgtype.UUID        `json:"owner_principal_id"`
	Name             string             `json:"name"`
	Platform         string             `json:"platform"`
	Architecture     string             `json:"architecture"`
	AccessMode       string             `json:"access_mode"`
	Version          string             `json:"version"`
	ProtocolVersion  int32              `json:"protocol_version"`
	Lifecycle        string             `json:"lifecycle"`
	EnrolledByUserID pgtype.UUID        `json:"enrolled_by_user_id"`
	LastSeenAt       pgtype.Timestamptz `json:"last_seen_at"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
	ConnectorCount   int32              `json:"connector_count"`
	ActiveJobCount   int32              `json:"active_job_count"`
	Capabilities     []string           `json:"capabilities"`
}

type ListInboundSiblingsRow added in v0.4.0

type ListInboundSiblingsRow struct {
	ID              pgtype.UUID        `json:"id"`
	Slug            string             `json:"slug"`
	Name            string             `json:"name"`
	Description     string             `json:"description"`
	MaxAccess       string             `json:"max_access"`
	AuthorizingRole string             `json:"authorizing_role"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
	OwnerName       string             `json:"owner_name"`
}

type ListMCPNeedsByAgentRow added in v0.4.0

type ListMCPNeedsByAgentRow struct {
	Slug           string             `json:"slug"`
	McpID          pgtype.UUID        `json:"mcp_id"`
	Name           string             `json:"name"`
	Url            string             `json:"url"`
	AuthMode       string             `json:"auth_mode"`
	ToolSchemas    []byte             `json:"tool_schemas"`
	Authorized     bool               `json:"authorized"`
	HasOauthApp    bool               `json:"has_oauth_app"`
	Bound          bool               `json:"bound"`
	TokenExpiresAt pgtype.Timestamptz `json:"token_expires_at"`
	LastSyncedAt   pgtype.Timestamptz `json:"last_synced_at"`
}

type ListMCPServerConsumersRow added in v0.4.0

type ListMCPServerConsumersRow struct {
	AgentID   pgtype.UUID `json:"agent_id"`
	AgentName string      `json:"agent_name"`
	AgentSlug string      `json:"agent_slug"`
	NeedType  string      `json:"need_type"`
	NeedSlug  string      `json:"need_slug"`
}

type ListMCPServerGrantsRow added in v0.4.0

type ListMCPServerGrantsRow struct {
	ID           pgtype.UUID `json:"id"`
	GranteeID    pgtype.UUID `json:"grantee_id"`
	Capabilities []string    `json:"capabilities"`
}

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 ListModelGrantsForGranteesRow added in v0.4.0

type ListModelGrantsForGranteesRow struct {
	CatalogID pgtype.UUID `json:"provider_id"`
	Model     string      `json:"model"`
}

type ListModelGrantsRow added in v0.4.0

type ListModelGrantsRow struct {
	ID              pgtype.UUID        `json:"id"`
	CatalogID       pgtype.UUID        `json:"provider_id"`
	Model           string             `json:"model"`
	GranteeID       pgtype.UUID        `json:"grantee_id"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
	ProviderCatalog string             `json:"provider_catalog"`
	ProviderSlug    string             `json:"provider_slug"`
}

type ListNonterminalJobHandlerVersionsRow added in v0.5.0

type ListNonterminalJobHandlerVersionsRow struct {
	HandlerName    string `json:"handler_name"`
	HandlerVersion int32  `json:"handler_version"`
}

type ListObservedArtifactCandidatesParams added in v0.6.1

type ListObservedArtifactCandidatesParams struct {
	Digest   string `json:"digest"`
	Platform string `json:"platform"`
}

type ListObservedArtifactCandidatesRow added in v0.6.1

type ListObservedArtifactCandidatesRow struct {
	ID                  pgtype.UUID        `json:"id"`
	AgentID             pgtype.UUID        `json:"agent_id"`
	BuildID             pgtype.UUID        `json:"build_id"`
	ConnectorSlug       string             `json:"connector_slug"`
	SourceRef           string             `json:"source_ref"`
	Kind                string             `json:"kind"`
	ContractID          string             `json:"contract_id"`
	Name                string             `json:"name"`
	Description         string             `json:"description"`
	ArtifactVersion     string             `json:"artifact_version"`
	ArtifactDigest      string             `json:"artifact_digest"`
	ProtocolMajor       int32              `json:"protocol_major"`
	ProtocolMinor       int32              `json:"protocol_minor"`
	Features            []string           `json:"features"`
	InterfaceDescriptor []byte             `json:"interface_descriptor"`
	InterfaceHash       string             `json:"interface_hash"`
	SettingsSchema      []byte             `json:"settings_schema"`
	RetiredAt           pgtype.Timestamptz `json:"retired_at"`
	CreatedAt           pgtype.Timestamptz `json:"created_at"`
	ServiceMode         pgtype.Text        `json:"service_mode"`
	ArtifactFileID      pgtype.UUID        `json:"artifact_file_id"`
	Platform            string             `json:"platform"`
	FileDigest          string             `json:"file_digest"`
	Targets             []string           `json:"targets"`
}

type ListOrphanToolCallsByRunRow added in v0.2.8

type ListOrphanToolCallsByRunRow struct {
	ConversationID pgtype.UUID `json:"conversation_id"`
	ToolCallID     string      `json:"tool_call_id"`
	ToolName       string      `json:"tool_name"`
}

type ListPausedAgentDeploymentsRow added in v0.5.0

type ListPausedAgentDeploymentsRow struct {
	ID                       pgtype.UUID        `json:"id"`
	OwnerPrincipalID         pgtype.UUID        `json:"owner_principal_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"`
	BuildProviderID          pgtype.UUID        `json:"build_provider_id"`
	BuildModel               string             `json:"build_model"`
	ExecProviderID           pgtype.UUID        `json:"exec_provider_id"`
	ExecModel                string             `json:"exec_model"`
	SttProviderID            pgtype.UUID        `json:"stt_provider_id"`
	SttModel                 string             `json:"stt_model"`
	VisionProviderID         pgtype.UUID        `json:"vision_provider_id"`
	VisionModel              string             `json:"vision_model"`
	TtsProviderID            pgtype.UUID        `json:"tts_provider_id"`
	TtsModel                 string             `json:"tts_model"`
	ImageGenProviderID       pgtype.UUID        `json:"image_gen_provider_id"`
	ImageGenModel            string             `json:"image_gen_model"`
	EmbeddingProviderID      pgtype.UUID        `json:"embedding_provider_id"`
	EmbeddingModel           string             `json:"embedding_model"`
	SearchProviderID         pgtype.UUID        `json:"search_provider_id"`
	SearchModel              string             `json:"search_model"`
	SourceRef                string             `json:"source_ref"`
	ImageRef                 string             `json:"image_ref"`
	DbSchema                 string             `json:"db_schema"`
	DbPassword               string             `json:"db_password"`
	SdkVersion               string             `json:"sdk_version"`
	Config                   []byte             `json:"config"`
	Instructions             []byte             `json:"instructions"`
	ErrorMessage             string             `json:"error_message"`
	CreatedAt                pgtype.Timestamptz `json:"created_at"`
	UpdatedAt                pgtype.Timestamptz `json:"updated_at"`
	McpEnabled               bool               `json:"mcp_enabled"`
	AllowPublicMcp           bool               `json:"allow_public_mcp"`
	AllowPublicRoutes        bool               `json:"allow_public_routes"`
	ToolsHash                []byte             `json:"tools_hash"`
	Emoji                    string             `json:"emoji"`
	AllowOauthMcpPrompt      bool               `json:"allow_oauth_mcp_prompt"`
	AllowPublicMcpPrompt     bool               `json:"allow_public_mcp_prompt"`
	GitRemoteUrl             string             `json:"git_remote_url"`
	GitMode                  string             `json:"git_mode"`
	GitCredentialID          pgtype.UUID        `json:"git_credential_id"`
	GitDefaultBranch         string             `json:"git_default_branch"`
	GitWebhookSecret         string             `json:"git_webhook_secret"`
	GitLastSyncedRef         string             `json:"git_last_synced_ref"`
	AgentTokenVersion        int64              `json:"agent_token_version"`
	JobDispatchPausedBuildID pgtype.UUID        `json:"job_dispatch_paused_build_id"`
	JobDispatchPausedAt      pgtype.Timestamptz `json:"job_dispatch_paused_at"`
	JobDispatchPauseDeadline pgtype.Timestamptz `json:"job_dispatch_pause_deadline"`
	DeploymentToken          pgtype.UUID        `json:"deployment_token"`
	DeploymentPhase          string             `json:"deployment_phase"`
}

type ListPlatformIdentitiesAllRow added in v0.4.0

type ListPlatformIdentitiesAllRow 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"`
	UserEmail       string             `json:"user_email"`
	UserDisplayName string             `json:"user_display_name"`
}

type ListRequiredConnectionScopesParams added in v0.4.0

type ListRequiredConnectionScopesParams struct {
	ResourceID   pgtype.UUID `json:"resource_id"`
	TargetNeedID pgtype.UUID `json:"target_need_id"`
}

type ListRequiredMCPScopesParams added in v0.4.0

type ListRequiredMCPScopesParams struct {
	ResourceID   pgtype.UUID `json:"resource_id"`
	TargetNeedID pgtype.UUID `json:"target_need_id"`
}

type ListResourceGrantDetailsParams added in v0.6.1

type ListResourceGrantDetailsParams struct {
	ResourceType string      `json:"resource_type"`
	ResourceID   pgtype.UUID `json:"resource_id"`
}

type ListResourceGrantDetailsRow added in v0.6.1

type ListResourceGrantDetailsRow struct {
	ID           pgtype.UUID        `json:"id"`
	GranteeID    pgtype.UUID        `json:"grantee_id"`
	Email        string             `json:"email"`
	GranteeName  string             `json:"grantee_name"`
	Capabilities []string           `json:"capabilities"`
	CreatedAt    pgtype.Timestamptz `json:"created_at"`
}

type ListResourceNeedsByAgentRow added in v0.6.1

type ListResourceNeedsByAgentRow struct {
	ID                      pgtype.UUID        `json:"id"`
	AgentID                 pgtype.UUID        `json:"agent_id"`
	Type                    string             `json:"type"`
	Slug                    string             `json:"slug"`
	Description             string             `json:"description"`
	SetupInstructions       string             `json:"setup_instructions"`
	ExpectedUrl             string             `json:"expected_url"`
	ExpectedScopes          string             `json:"expected_scopes"`
	Spec                    []byte             `json:"spec"`
	Required                bool               `json:"required"`
	BoundConnectionID       pgtype.UUID        `json:"bound_connection_id"`
	BoundMcpID              pgtype.UUID        `json:"bound_mcp_id"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	BoundConnectorID        pgtype.UUID        `json:"bound_connector_id"`
	BoundConnectorGroupID   pgtype.UUID        `json:"bound_connector_group_id"`
	DeletedAt               pgtype.Timestamptz `json:"deleted_at"`
	BoundConnectorGroupName pgtype.Text        `json:"bound_connector_group_name"`
}

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 ListSchedulesWithNextFireRow added in v0.4.0

type ListSchedulesWithNextFireRow struct {
	ID             pgtype.UUID        `json:"id"`
	AgentID        pgtype.UUID        `json:"agent_id"`
	Slug           string             `json:"slug"`
	Recurrence     string             `json:"recurrence"`
	HandlerName    string             `json:"handler_name"`
	HandlerVersion int32              `json:"handler_version"`
	Enabled        bool               `json:"enabled"`
	Description    string             `json:"description"`
	LastFiredAt    pgtype.Timestamptz `json:"last_fired_at"`
	NextFireAt     pgtype.Timestamptz `json:"next_fire_at"`
	CreatedAt      pgtype.Timestamptz `json:"created_at"`
}

type ListSiblingsRow added in v0.4.0

type ListSiblingsRow struct {
	ID              pgtype.UUID        `json:"id"`
	Slug            string             `json:"slug"`
	Name            string             `json:"name"`
	Description     string             `json:"description"`
	MaxAccess       string             `json:"max_access"`
	AuthorizingRole string             `json:"authorizing_role"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
}

type ListStoredSecretsRow added in v0.4.0

type ListStoredSecretsRow struct {
	Kind   string `json:"kind"`
	RowKey string `json:"row_key"`
	Field  string `json:"field"`
	Ref    string `json:"ref"`
	Stored string `json:"stored"`
}

type ListStuckRunsRow added in v0.2.8

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

type ListSubscribedConversationsForUserParams added in v0.4.0

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

type ListSubscribedConversationsParams

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

type ListSystemMessagesByConversationAfterParams added in v0.4.0

type ListSystemMessagesByConversationAfterParams struct {
	ConversationID pgtype.UUID `json:"conversation_id"`
	AfterSeq       int64       `json:"after_seq"`
	MaxRows        int32       `json:"max_rows"`
}

type ListSystemRunsByUserParams added in v0.4.0

type ListSystemRunsByUserParams struct {
	UserID pgtype.UUID        `json:"user_id"`
	Cursor pgtype.Timestamptz `json:"cursor"`
	Lim    int32              `json:"lim"`
}

type ListSystemRunsByUserRow added in v0.4.0

type ListSystemRunsByUserRow struct {
	ID                pgtype.UUID        `json:"id"`
	ConversationID    pgtype.UUID        `json:"conversation_id"`
	UserID            pgtype.UUID        `json:"user_id"`
	Status            string             `json:"status"`
	TriggerType       string             `json:"trigger_type"`
	MessagePreview    string             `json:"message_preview"`
	ErrorMessage      string             `json:"error_message"`
	LlmCostEstimate   float64            `json:"llm_cost_estimate"`
	StartedAt         pgtype.Timestamptz `json:"started_at"`
	FinishedAt        pgtype.Timestamptz `json:"finished_at"`
	ConversationTitle string             `json:"conversation_title"`
}

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 ListUserAgentGrantsRow added in v0.4.0

type ListUserAgentGrantsRow struct {
	ID        pgtype.UUID        `json:"id"`
	Slug      string             `json:"slug"`
	Name      string             `json:"name"`
	Role      string             `json:"role"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type ListVisibleSiblingsParams added in v0.4.0

type ListVisibleSiblingsParams struct {
	ParentAgentID pgtype.UUID   `json:"parent_agent_id"`
	GranteeIds    []pgtype.UUID `json:"grantee_ids"`
}

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 LlmUsage added in v0.4.0

type LlmUsage struct {
	ID                pgtype.UUID        `json:"id"`
	AgentID           pgtype.UUID        `json:"agent_id"`
	AgentSlug         string             `json:"agent_slug"`
	AgentName         string             `json:"agent_name"`
	RunID             pgtype.UUID        `json:"run_id"`
	BuildID           pgtype.UUID        `json:"build_id"`
	SystemRunID       pgtype.UUID        `json:"system_run_id"`
	UserID            pgtype.UUID        `json:"user_id"`
	UserEmail         string             `json:"user_email"`
	ConversationID    pgtype.UUID        `json:"conversation_id"`
	ProviderCatalogID string             `json:"provider_catalog_id"`
	ProviderSlug      string             `json:"provider_slug"`
	Model             string             `json:"model"`
	Capability        string             `json:"capability"`
	CallKind          string             `json:"call_kind"`
	Slug              string             `json:"slug"`
	TokensIn          int64              `json:"tokens_in"`
	TokensOut         int64              `json:"tokens_out"`
	TokensCached      int64              `json:"tokens_cached"`
	TokensReasoning   int64              `json:"tokens_reasoning"`
	Units             float64            `json:"units"`
	UnitKind          string             `json:"unit_kind"`
	CostInput         float64            `json:"cost_input"`
	CostOutput        float64            `json:"cost_output"`
	CostTotal         float64            `json:"cost_total"`
	FinishReason      string             `json:"finish_reason"`
	Errored           bool               `json:"errored"`
	LatencyMs         int32              `json:"latency_ms"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
}

type LockAgentForDueJobParams added in v0.5.0

type LockAgentForDueJobParams struct {
	GlobalLimit int64 `json:"global_limit"`
	AgentLimit  int64 `json:"agent_limit"`
}

type LockConnectionAuthorizationNeedsParams added in v0.4.0

type LockConnectionAuthorizationNeedsParams struct {
	ResourceID   pgtype.UUID `json:"resource_id"`
	TargetNeedID pgtype.UUID `json:"target_need_id"`
}

type LockMCPAuthorizationNeedsParams added in v0.4.0

type LockMCPAuthorizationNeedsParams struct {
	ResourceID   pgtype.UUID `json:"resource_id"`
	TargetNeedID pgtype.UUID `json:"target_need_id"`
}

type LockOAuthGrantLifecycleParams added in v0.4.0

type LockOAuthGrantLifecycleParams struct {
	UserID   string `json:"user_id"`
	ClientID string `json:"client_id"`
	AgentID  string `json:"agent_id"`
}

type LockQualifyingConnectionBindingsParams added in v0.4.0

type LockQualifyingConnectionBindingsParams struct {
	ResourceID     pgtype.UUID `json:"resource_id"`
	ScopesVerified bool        `json:"scopes_verified"`
	GrantedScopes  string      `json:"granted_scopes"`
}

type LockQualifyingMCPBindingsParams added in v0.4.0

type LockQualifyingMCPBindingsParams struct {
	ResourceID     pgtype.UUID `json:"resource_id"`
	ScopesVerified bool        `json:"scopes_verified"`
	GrantedScopes  string      `json:"granted_scopes"`
}

type LockRunningRunForConnectorTransferParams added in v0.6.1

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

type ManagedBotSession added in v0.4.0

type ManagedBotSession struct {
	ID                   pgtype.UUID        `json:"id"`
	OwnerID              pgtype.UUID        `json:"owner_id"`
	AgentID              pgtype.UUID        `json:"agent_id"`
	IsSystem             bool               `json:"is_system"`
	Nonce                string             `json:"nonce"`
	BridgeName           string             `json:"bridge_name"`
	ExpiresAt            pgtype.Timestamptz `json:"expires_at"`
	CreatedAt            pgtype.Timestamptz `json:"created_at"`
	SystemConversationID pgtype.UUID        `json:"system_conversation_id"`
}

type MarkAgentBuildJobManifestExtractedParams added in v0.5.0

type MarkAgentBuildJobManifestExtractedParams struct {
	JobManifestDigest pgtype.Text `json:"job_manifest_digest"`
	SourceRef         string      `json:"source_ref"`
	ImageRef          string      `json:"image_ref"`
	BuildID           pgtype.UUID `json:"build_id"`
	AgentID           pgtype.UUID `json:"agent_id"`
}

type MarkConnectorOfflineParams added in v0.6.1

type MarkConnectorOfflineParams struct {
	ReadinessMessage pgtype.Text `json:"readiness_message"`
	ID               pgtype.UUID `json:"id"`
}

type MarkMissingHostedConnectorsOfflineParams added in v0.6.1

type MarkMissingHostedConnectorsOfflineParams struct {
	HostID      pgtype.UUID   `json:"host_id"`
	ReportedIds []pgtype.UUID `json:"reported_ids"`
}

type MarkStaleConnectorsOfflineParams added in v0.6.1

type MarkStaleConnectorsOfflineParams struct {
	Cutoff pgtype.Timestamptz `json:"cutoff"`
	Lim    int32              `json:"lim"`
}

type McpActiveRequest added in v0.4.0

type McpActiveRequest struct {
	TargetAgentID     pgtype.UUID        `json:"target_agent_id"`
	PrincipalIdentity string             `json:"principal_identity"`
	RequestID         []byte             `json:"request_id"`
	RunID             pgtype.UUID        `json:"run_id"`
	ExpiresAt         pgtype.Timestamptz `json:"expires_at"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
}

type Migration004ResourceGrantBackup added in v0.6.1

type Migration004ResourceGrantBackup struct {
	ID               pgtype.UUID        `json:"id"`
	ConnectionID     pgtype.UUID        `json:"connection_id"`
	McpServerID      pgtype.UUID        `json:"mcp_server_id"`
	GitCredentialID  pgtype.UUID        `json:"git_credential_id"`
	GranteeID        pgtype.UUID        `json:"grantee_id"`
	Capabilities     []string           `json:"capabilities"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	GranteeKind      string             `json:"grantee_kind"`
	GranteeCreatedAt pgtype.Timestamptz `json:"grantee_created_at"`
	ResourceIdentity interface{}        `json:"resource_identity"`
}

type ModelGrant added in v0.4.0

type ModelGrant struct {
	ID        pgtype.UUID        `json:"id"`
	CatalogID pgtype.UUID        `json:"provider_id"`
	Model     string             `json:"model"`
	GranteeID pgtype.UUID        `json:"grantee_id"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type OauthAuthzCode added in v0.4.0

type OauthAuthzCode struct {
	Code          string             `json:"code"`
	UserID        pgtype.UUID        `json:"user_id"`
	ClientID      string             `json:"client_id"`
	AgentID       pgtype.UUID        `json:"agent_id"`
	RedirectUri   string             `json:"redirect_uri"`
	CodeChallenge string             `json:"code_challenge"`
	Scope         string             `json:"scope"`
	Resource      string             `json:"resource"`
	ExpiresAt     pgtype.Timestamptz `json:"expires_at"`
	CreatedAt     pgtype.Timestamptz `json:"created_at"`
}

type OauthClient added in v0.4.0

type OauthClient struct {
	ClientID                string             `json:"client_id"`
	ClientName              string             `json:"client_name"`
	RedirectUris            []string           `json:"redirect_uris"`
	GrantTypes              []string           `json:"grant_types"`
	ResponseTypes           []string           `json:"response_types"`
	TokenEndpointAuthMethod string             `json:"token_endpoint_auth_method"`
	Scope                   string             `json:"scope"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	LastUsedAt              pgtype.Timestamptz `json:"last_used_at"`
}

type OauthConsentTransaction added in v0.4.0

type OauthConsentTransaction struct {
	TransactionID pgtype.UUID        `json:"transaction_id"`
	BindingHash   []byte             `json:"binding_hash"`
	UserID        pgtype.UUID        `json:"user_id"`
	ClientID      string             `json:"client_id"`
	AgentID       pgtype.UUID        `json:"agent_id"`
	ExpiresAt     pgtype.Timestamptz `json:"expires_at"`
	CreatedAt     pgtype.Timestamptz `json:"created_at"`
}

type OauthDcrAttempt added in v0.4.0

type OauthDcrAttempt struct {
	IpAddress string             `json:"ip_address"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type OauthGrant added in v0.4.0

type OauthGrant struct {
	UserID    pgtype.UUID        `json:"user_id"`
	ClientID  string             `json:"client_id"`
	AgentID   pgtype.UUID        `json:"agent_id"`
	Scope     string             `json:"scope"`
	GrantedAt pgtype.Timestamptz `json:"granted_at"`
	ExpiresAt pgtype.Timestamptz `json:"expires_at"`
	RevokedAt pgtype.Timestamptz `json:"revoked_at"`
}

type OauthRefreshToken added in v0.4.0

type OauthRefreshToken struct {
	TokenHash       []byte             `json:"token_hash"`
	UserID          pgtype.UUID        `json:"user_id"`
	ClientID        string             `json:"client_id"`
	AgentID         pgtype.UUID        `json:"agent_id"`
	Scope           string             `json:"scope"`
	FamilyID        pgtype.UUID        `json:"family_id"`
	ParentTokenHash []byte             `json:"parent_token_hash"`
	ExpiresAt       pgtype.Timestamptz `json:"expires_at"`
	ConsumedAt      pgtype.Timestamptz `json:"consumed_at"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
}

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"`
	UserID                  pgtype.UUID        `json:"user_id"`
	ResourceID              pgtype.UUID        `json:"resource_id"`
	NeedID                  pgtype.UUID        `json:"need_id"`
	RequestedScopes         string             `json:"requested_scopes"`
	AuthorizationRevision   int64              `json:"authorization_revision"`
	ExpectedPriorResourceID pgtype.UUID        `json:"expected_prior_resource_id"`
	UsesPendingClient       bool               `json:"uses_pending_client"`
}

type PauseAgentJobDispatchParams added in v0.5.0

type PauseAgentJobDispatchParams struct {
	BuildID         pgtype.UUID `json:"build_id"`
	AgentID         pgtype.UUID `json:"agent_id"`
	DeploymentToken pgtype.UUID `json:"deployment_token"`
}

type PauseAgentJobDispatchRow added in v0.5.0

type PauseAgentJobDispatchRow struct {
	ID                       pgtype.UUID        `json:"id"`
	OwnerPrincipalID         pgtype.UUID        `json:"owner_principal_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"`
	BuildProviderID          pgtype.UUID        `json:"build_provider_id"`
	BuildModel               string             `json:"build_model"`
	ExecProviderID           pgtype.UUID        `json:"exec_provider_id"`
	ExecModel                string             `json:"exec_model"`
	SttProviderID            pgtype.UUID        `json:"stt_provider_id"`
	SttModel                 string             `json:"stt_model"`
	VisionProviderID         pgtype.UUID        `json:"vision_provider_id"`
	VisionModel              string             `json:"vision_model"`
	TtsProviderID            pgtype.UUID        `json:"tts_provider_id"`
	TtsModel                 string             `json:"tts_model"`
	ImageGenProviderID       pgtype.UUID        `json:"image_gen_provider_id"`
	ImageGenModel            string             `json:"image_gen_model"`
	EmbeddingProviderID      pgtype.UUID        `json:"embedding_provider_id"`
	EmbeddingModel           string             `json:"embedding_model"`
	SearchProviderID         pgtype.UUID        `json:"search_provider_id"`
	SearchModel              string             `json:"search_model"`
	SourceRef                string             `json:"source_ref"`
	ImageRef                 string             `json:"image_ref"`
	DbSchema                 string             `json:"db_schema"`
	DbPassword               string             `json:"db_password"`
	SdkVersion               string             `json:"sdk_version"`
	Config                   []byte             `json:"config"`
	Instructions             []byte             `json:"instructions"`
	ErrorMessage             string             `json:"error_message"`
	CreatedAt                pgtype.Timestamptz `json:"created_at"`
	UpdatedAt                pgtype.Timestamptz `json:"updated_at"`
	McpEnabled               bool               `json:"mcp_enabled"`
	AllowPublicMcp           bool               `json:"allow_public_mcp"`
	AllowPublicRoutes        bool               `json:"allow_public_routes"`
	ToolsHash                []byte             `json:"tools_hash"`
	Emoji                    string             `json:"emoji"`
	AllowOauthMcpPrompt      bool               `json:"allow_oauth_mcp_prompt"`
	AllowPublicMcpPrompt     bool               `json:"allow_public_mcp_prompt"`
	GitRemoteUrl             string             `json:"git_remote_url"`
	GitMode                  string             `json:"git_mode"`
	GitCredentialID          pgtype.UUID        `json:"git_credential_id"`
	GitDefaultBranch         string             `json:"git_default_branch"`
	GitWebhookSecret         string             `json:"git_webhook_secret"`
	GitLastSyncedRef         string             `json:"git_last_synced_ref"`
	AgentTokenVersion        int64              `json:"agent_token_version"`
	JobDispatchPausedBuildID pgtype.UUID        `json:"job_dispatch_paused_build_id"`
	JobDispatchPausedAt      pgtype.Timestamptz `json:"job_dispatch_paused_at"`
	JobDispatchPauseDeadline pgtype.Timestamptz `json:"job_dispatch_pause_deadline"`
}

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 Principal added in v0.4.0

type Principal struct {
	ID        pgtype.UUID        `json:"id"`
	Kind      string             `json:"kind"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type Provider

type Provider struct {
	ID          pgtype.UUID        `json:"id"`
	CatalogID   string             `json:"provider_id"`
	Slug        string             `json:"slug"`
	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 ProviderModel added in v0.4.1

type ProviderModel struct {
	ConfiguredProviderID pgtype.UUID        `json:"configured_provider_id"`
	ModelID              string             `json:"model_id"`
	DisplayName          string             `json:"display_name"`
	ToolCall             bool               `json:"tool_call"`
	Reasoning            bool               `json:"reasoning"`
	Vision               bool               `json:"vision"`
	ContextLimit         int32              `json:"context_limit"`
	OutputLimit          int32              `json:"output_limit"`
	StructuredOutputs    bool               `json:"structured_outputs"`
	IncludeUsage         bool               `json:"include_usage"`
	CreatedAt            pgtype.Timestamptz `json:"created_at"`
	UpdatedAt            pgtype.Timestamptz `json:"updated_at"`
}

type PruneTerminalAgentJobsParams added in v0.5.0

type PruneTerminalAgentJobsParams struct {
	Cutoff pgtype.Timestamptz `json:"cutoff"`
	Lim    int32              `json:"lim"`
}

type PublishConnectorInterfaceParams added in v0.6.1

type PublishConnectorInterfaceParams struct {
	Kind                pgtype.Text `json:"kind"`
	ContractID          pgtype.Text `json:"contract_id"`
	Name                pgtype.Text `json:"name"`
	Description         pgtype.Text `json:"description"`
	ProtocolMajor       pgtype.Int4 `json:"protocol_major"`
	ProtocolMinor       pgtype.Int4 `json:"protocol_minor"`
	Features            []string    `json:"features"`
	ServiceMode         pgtype.Text `json:"service_mode"`
	ArtifactVersion     pgtype.Text `json:"artifact_version"`
	ArtifactDigest      pgtype.Text `json:"artifact_digest"`
	ArtifactSetID       pgtype.UUID `json:"artifact_set_id"`
	InterfaceDescriptor []byte      `json:"interface_descriptor"`
	InterfaceHash       pgtype.Text `json:"interface_hash"`
	Readiness           string      `json:"readiness"`
	ReadinessMessage    pgtype.Text `json:"readiness_message"`
	ID                  pgtype.UUID `json:"id"`
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) AcceptConnectorExportCompletion added in v0.6.1

func (q *Queries) AcceptConnectorExportCompletion(ctx context.Context, arg AcceptConnectorExportCompletionParams) (ConnectorTransfer, error)

func (*Queries) ActivateConnectionWithCredentials added in v0.4.0

func (q *Queries) ActivateConnectionWithCredentials(ctx context.Context, arg ActivateConnectionWithCredentialsParams) (int64, error)

func (*Queries) ActivateMCPActiveRequest added in v0.4.0

func (q *Queries) ActivateMCPActiveRequest(ctx context.Context, arg ActivateMCPActiveRequestParams) (int64, error)

A consumed reservation cannot be activated, so cancellation racing dispatch is observed by the request owner after ForwardA2APrompt returns.

func (*Queries) ActivateMCPServerWithCredentials added in v0.4.0

func (q *Queries) ActivateMCPServerWithCredentials(ctx context.Context, arg ActivateMCPServerWithCredentialsParams) (int64, error)

func (*Queries) AddConnectorTargetGroupMember added in v0.6.1

func (q *Queries) AddConnectorTargetGroupMember(ctx context.Context, arg AddConnectorTargetGroupMemberParams) error

func (*Queries) AddSibling added in v0.4.0

func (q *Queries) AddSibling(ctx context.Context, arg AddSiblingParams) error

Insert one address-book edge. The add gate (the parent owner has access to the sibling) and the choice of authorizing_grantee_id live in the service; the composite FK to agent_grants(agent_id, grantee_id) makes the write atomic — if that grant vanished between check and insert, the FK rejects the row. A PK violation means it is already in the list (409).

func (*Queries) AdvanceAgentJobCron added in v0.5.0

func (q *Queries) AdvanceAgentJobCron(ctx context.Context, arg AdvanceAgentJobCronParams) (int64, error)

func (*Queries) AdvanceConnectionAuthorizationRevision added in v0.4.0

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

func (*Queries) AdvanceMCPServerAuthorizationRevision added in v0.4.0

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

func (*Queries) AdvanceUserAuthEpochAndRevokeSessions added in v0.4.0

func (q *Queries) AdvanceUserAuthEpochAndRevokeSessions(ctx context.Context, arg AdvanceUserAuthEpochAndRevokeSessionsParams) (int64, error)

func (*Queries) AgentBuildCancellationRequested added in v0.5.0

func (q *Queries) AgentBuildCancellationRequested(ctx context.Context, arg AgentBuildCancellationRequestedParams) (bool, error)

func (*Queries) AgentBuildIntegrationActive added in v0.4.0

func (q *Queries) AgentBuildIntegrationActive(ctx context.Context, arg AgentBuildIntegrationActiveParams) (bool, error)

func (*Queries) AgentHasUnresolvedDeployment added in v0.5.0

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

func (*Queries) AgentSetupStatus added in v0.2.12

func (q *Queries) AgentSetupStatus(ctx context.Context, agentID pgtype.UUID) (AgentSetupStatusRow, error)

Counts of registered slots that need operator action before the agent can run cleanly. "Needs setup" definitions:

resources: every required need must be bound and ready
env_vars: is_secret AND value_ref = ''  (no fallback)
        OR (NOT is_secret) AND value_ref = '' AND default_value = ''

Pattern mismatch on stored values is handled at sync time (UpsertAgentEnvVar clears value_ref when the pattern changes and the stored value no longer matches), so a non-empty value_ref means "configured + currently passes pattern".

func (*Queries) AllowHostEnrollment added in v0.6.1

func (q *Queries) AllowHostEnrollment(ctx context.Context, ipAddress string) (bool, error)

Host enrollment, authentication, inventory, and durable management work.

func (*Queries) AllowOAuthClientRegistration added in v0.4.0

func (q *Queries) AllowOAuthClientRegistration(ctx context.Context, ipAddress string) (bool, error)

Serialize each normalized IP bucket across replicas, prune its expired entries, and admit at most ten registrations in the rolling hour.

func (*Queries) AppendConnectorJobEvent added in v0.6.1

func (q *Queries) AppendConnectorJobEvent(ctx context.Context, arg AppendConnectorJobEventParams) (AppendConnectorJobEventRow, error)

func (*Queries) AppendHostManagementEvent added in v0.6.1

func (*Queries) AppendSystemMessage added in v0.4.0

func (q *Queries) AppendSystemMessage(ctx context.Context, arg AppendSystemMessageParams) (SystemMessage, error)

Mirrors agent_messages' (content, parts) split: content is the plain-text display string; parts carries the goai multi-part Content shape only when there are tool calls / results / images / etc. (left NULL for plain text answers). source distinguishes operator prompts ("") from system-injected events ("upgrade", "error", ...).

func (*Queries) ApplyConnectorOrchestrationOfflineSkip added in v0.6.1

func (q *Queries) ApplyConnectorOrchestrationOfflineSkip(ctx context.Context, ids []pgtype.UUID) (int64, error)

func (*Queries) ApplyConnectorOrchestrationOfflineWait added in v0.6.1

func (q *Queries) ApplyConnectorOrchestrationOfflineWait(ctx context.Context, ids []pgtype.UUID) (int64, error)

func (*Queries) ApproveDeviceLogin added in v0.4.0

func (q *Queries) ApproveDeviceLogin(ctx context.Context, arg ApproveDeviceLoginParams) (DeviceLoginSession, error)

func (*Queries) ApproveHostEnrollment added in v0.6.1

func (q *Queries) ApproveHostEnrollment(ctx context.Context, arg ApproveHostEnrollmentParams) (HostEnrollmentSession, error)

func (*Queries) BeginAgentDeploymentCutover added in v0.5.0

func (q *Queries) BeginAgentDeploymentCutover(ctx context.Context, arg BeginAgentDeploymentCutoverParams) (int64, error)

func (*Queries) BindConnectionNeed added in v0.4.0

func (q *Queries) BindConnectionNeed(ctx context.Context, arg BindConnectionNeedParams) (int64, error)

Binding management (operator selects/creates a resource for a need).

func (*Queries) BindConnectorGroupNeed added in v0.6.1

func (q *Queries) BindConnectorGroupNeed(ctx context.Context, arg BindConnectorGroupNeedParams) (int64, error)

func (*Queries) BindConnectorNeed added in v0.6.1

func (q *Queries) BindConnectorNeed(ctx context.Context, arg BindConnectorNeedParams) (int64, error)

func (*Queries) BindMCPServerNeed added in v0.4.0

func (q *Queries) BindMCPServerNeed(ctx context.Context, arg BindMCPServerNeedParams) (int64, error)

func (*Queries) CancelConnectorJob added in v0.6.1

func (q *Queries) CancelConnectorJob(ctx context.Context, arg CancelConnectorJobParams) (CancelConnectorJobRow, error)

func (*Queries) CancelConnectorOrchestrationJobs added in v0.6.1

func (q *Queries) CancelConnectorOrchestrationJobs(ctx context.Context, orchestrationID pgtype.UUID) (int64, error)

func (*Queries) CancelQueuedAgentJob added in v0.5.0

func (q *Queries) CancelQueuedAgentJob(ctx context.Context, arg CancelQueuedAgentJobParams) (AgentJob, error)

func (*Queries) CancelRun added in v0.5.0

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

func (*Queries) CancelRunningAgentJob added in v0.5.0

func (q *Queries) CancelRunningAgentJob(ctx context.Context, arg CancelRunningAgentJobParams) (AgentJob, error)

func (*Queries) CandidateAgentJobContractMatches added in v0.5.0

func (q *Queries) CandidateAgentJobContractMatches(ctx context.Context, arg CandidateAgentJobContractMatchesParams) (bool, error)

func (*Queries) ClaimActiveConnectorOrchestrationsForMaintenance added in v0.6.1

func (q *Queries) ClaimActiveConnectorOrchestrationsForMaintenance(ctx context.Context, lim int32) ([]pgtype.UUID, error)

func (*Queries) ClaimConnectorArtifactBlobDeletion added in v0.6.1

func (q *Queries) ClaimConnectorArtifactBlobDeletion(ctx context.Context, leaseSeconds int32) (ConnectorArtifactBlob, error)

func (*Queries) ClaimConnectorExportFinalization added in v0.6.1

func (q *Queries) ClaimConnectorExportFinalization(ctx context.Context, leaseSeconds int32) (ConnectorTransfer, error)

func (*Queries) ClaimConnectorJob added in v0.6.1

func (q *Queries) ClaimConnectorJob(ctx context.Context, arg ClaimConnectorJobParams) (ConnectorJobAttempt, error)

func (*Queries) ClaimConnectorJobForHost added in v0.6.1

func (*Queries) ClaimConnectorTransferCleanup added in v0.6.1

func (q *Queries) ClaimConnectorTransferCleanup(ctx context.Context, leaseSeconds int32) (ConnectorTransfer, error)

func (*Queries) ClaimDeviceLoginPoll added in v0.4.0

func (q *Queries) ClaimDeviceLoginPoll(ctx context.Context, deviceCodeHash string) (DeviceLoginSession, error)

func (*Queries) ClaimDueAgentJob added in v0.5.0

func (q *Queries) ClaimDueAgentJob(ctx context.Context, arg ClaimDueAgentJobParams) (AgentJobAttempt, error)

func (*Queries) ClaimHostEnrollmentPoll added in v0.6.1

func (q *Queries) ClaimHostEnrollmentPoll(ctx context.Context, deviceCodeHash []byte) (HostEnrollmentSession, error)

func (*Queries) ClaimHostManagementJob added in v0.6.1

func (q *Queries) ClaimHostManagementJob(ctx context.Context, arg ClaimHostManagementJobParams) (ClaimHostManagementJobRow, error)

func (*Queries) ClaimMCPTaskResume added in v0.4.0

func (q *Queries) ClaimMCPTaskResume(ctx context.Context, arg ClaimMCPTaskResumeParams) (int64, error)

A suspended MCP task is single-use. The conversation reference is part of the CAS so a stale or inconsistent context/task pair cannot consume it.

func (*Queries) ClaimSystemConversationCheckpoint added in v0.4.0

func (q *Queries) ClaimSystemConversationCheckpoint(ctx context.Context, arg ClaimSystemConversationCheckpointParams) (int64, error)

Clears only the checkpoint bound to the run the caller has already CASed. A replay or a reply to an older checkpoint affects no rows.

func (*Queries) CleanupAbandonedProvisionalConnections added in v0.4.0

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

func (*Queries) CleanupAbandonedProvisionalMCPServers added in v0.4.0

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

func (*Queries) CleanupExpiredAuthzCodes added in v0.4.0

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

Hard delete expired rows. Called from InboundOAuthGC every 5 min.

func (*Queries) CleanupExpiredGrants added in v0.4.0

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

GC: drop expired-or-revoked rows older than 1 year. Keeps audit trail for the typical compliance window.

func (*Queries) CleanupExpiredMCPActiveRequests added in v0.4.0

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

func (*Queries) CleanupExpiredOAuthConsentTransactions added in v0.4.0

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

func (*Queries) CleanupExpiredOAuthStates

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

func (*Queries) CleanupExpiredRefreshTokens added in v0.4.0

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

GC: drop expired tokens (passed their 30d hard limit) AND consumed tokens older than 7d. The 7d retention on consumed tokens preserves reuse-detection history; longer than that is forensic theater.

func (*Queries) CleanupExpiredUserSessions added in v0.4.0

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

func (*Queries) CleanupHostEnrollmentAttempts added in v0.6.1

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

func (*Queries) CleanupInactiveOAuthClients added in v0.4.0

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

Never-used DCR registrations have a 24-hour lifetime. Used clients become eligible after 180 days without a successful token exchange. Active grants, codes, consent transactions, and any retained refresh material keep a client alive. SKIP LOCKED divides each bounded sweep safely across replicas.

func (*Queries) CleanupOAuthDCRAttempts added in v0.4.0

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

func (*Queries) ClearAgentBuildIntegrationToken added in v0.4.0

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

func (*Queries) ClearAgentBuildModel added in v0.4.0

func (q *Queries) ClearAgentBuildModel(ctx context.Context, arg ClearAgentBuildModelParams) (int64, error)

Reset each capability override matching (provider, model) back to inherit (NULL provider + ” model → falls back to the workspace default). One statement per capability column keeps the named params unambiguous for the query generator; the revoke path runs all eight.

func (*Queries) ClearAgentEmbeddingModel added in v0.4.0

func (q *Queries) ClearAgentEmbeddingModel(ctx context.Context, arg ClearAgentEmbeddingModelParams) (int64, error)

func (*Queries) ClearAgentEnvVarValue added in v0.2.12

func (q *Queries) ClearAgentEnvVarValue(ctx context.Context, arg ClearAgentEnvVarValueParams) error

func (*Queries) ClearAgentExecModel added in v0.4.0

func (q *Queries) ClearAgentExecModel(ctx context.Context, arg ClearAgentExecModelParams) (int64, error)

func (*Queries) ClearAgentImageGenModel added in v0.4.0

func (q *Queries) ClearAgentImageGenModel(ctx context.Context, arg ClearAgentImageGenModelParams) (int64, error)

func (*Queries) ClearAgentModelSlotsForModel added in v0.4.0

func (q *Queries) ClearAgentModelSlotsForModel(ctx context.Context, arg ClearAgentModelSlotsForModelParams) (int64, error)

Reset declared model-slot assignments matching (provider, model) to inherit.

func (*Queries) ClearAgentSearchModel added in v0.4.0

func (q *Queries) ClearAgentSearchModel(ctx context.Context, arg ClearAgentSearchModelParams) (int64, error)

func (*Queries) ClearAgentSttModel added in v0.4.0

func (q *Queries) ClearAgentSttModel(ctx context.Context, arg ClearAgentSttModelParams) (int64, error)

func (*Queries) ClearAgentTtsModel added in v0.4.0

func (q *Queries) ClearAgentTtsModel(ctx context.Context, arg ClearAgentTtsModelParams) (int64, error)

func (*Queries) ClearAgentVisionModel added in v0.4.0

func (q *Queries) ClearAgentVisionModel(ctx context.Context, arg ClearAgentVisionModelParams) (int64, 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) ClearConnectionCredentialsByID added in v0.4.0

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

func (*Queries) ClearMCPServerCredentialsByID added in v0.4.0

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

func (*Queries) ClearMCPServerOAuthAppByID added in v0.4.0

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

Wipe the OAuth app config (client_id/secret) AND the access_token_ref that belong to it. 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) ClearMustChangePassword added in v0.4.0

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

Clears the forced-secure flag. Registering a passkey satisfies the "secure your account" requirement just as changing the password does.

func (*Queries) ClearPendingConnectionOAuthApp added in v0.4.0

func (q *Queries) ClearPendingConnectionOAuthApp(ctx context.Context, arg ClearPendingConnectionOAuthAppParams) (int64, error)

func (*Queries) ClearPendingMCPServerOAuthApp added in v0.4.0

func (q *Queries) ClearPendingMCPServerOAuthApp(ctx context.Context, arg ClearPendingMCPServerOAuthAppParams) (int64, error)

func (*Queries) ClearSystemConversationCheckpoint added in v0.4.0

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

func (*Queries) ClearUserPasswordAndRevokeSessions added in v0.4.0

func (q *Queries) ClearUserPasswordAndRevokeSessions(ctx context.Context, arg ClearUserPasswordAndRevokeSessionsParams) (int64, error)

Remove the password credential (passkey-only). Guarded by the last-credential check in service/passkeys.

func (*Queries) CompactOldRuns

func (q *Queries) CompactOldRuns(ctx context.Context, arg CompactOldRunsParams) (int64, error)

Nullify verbose fields on terminal runs older than the cutoff. Aggregates (token counts, cost, duration, timestamps, status, error) are preserved.

func (*Queries) CompleteActivation added in v0.6.1

func (q *Queries) CompleteActivation(ctx context.Context, uiLocale string) error

func (*Queries) CompleteConnectorJob added in v0.6.1

func (q *Queries) CompleteConnectorJob(ctx context.Context, arg CompleteConnectorJobParams) (ConnectorJob, error)

func (*Queries) CompleteHostManagementJob added in v0.6.1

func (*Queries) CompleteRecoveredAgentBuild added in v0.5.0

func (q *Queries) CompleteRecoveredAgentBuild(ctx context.Context, arg CompleteRecoveredAgentBuildParams) (int64, error)

func (*Queries) ConnectAgentGit added in v0.4.0

func (q *Queries) ConnectAgentGit(ctx context.Context, arg ConnectAgentGitParams) error

func (*Queries) ConsumeApprovedDeviceLogin added in v0.4.0

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

func (*Queries) ConsumeAuthzCode added in v0.4.0

func (q *Queries) ConsumeAuthzCode(ctx context.Context, code string) (OauthAuthzCode, error)

Single-use code exchange. The /token handler calls this inside a transaction; the DELETE ... RETURNING idiom guarantees the row (a) actually existed, (b) hadn't already been consumed (the row is gone after consumption, so a second attempt sees zero rows), (c) has the requested code-with-PK row locked-and-removed atomically. No SELECT FOR UPDATE needed — DELETE takes a row lock by itself, and concurrent attempts on the same code see zero rows because the first DELETE already removed it.

func (*Queries) ConsumeCeremony added in v0.4.0

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

func (*Queries) ConsumeHostEnrollment added in v0.6.1

func (q *Queries) ConsumeHostEnrollment(ctx context.Context, arg ConsumeHostEnrollmentParams) (HostEnrollmentSession, error)

func (*Queries) ConsumeIdentityLinkChallenge added in v0.4.0

func (q *Queries) ConsumeIdentityLinkChallenge(ctx context.Context, arg ConsumeIdentityLinkChallengeParams) (IdentityLinkChallenge, error)

func (*Queries) ConsumeMCPActiveRequest added in v0.4.0

func (q *Queries) ConsumeMCPActiveRequest(ctx context.Context, arg ConsumeMCPActiveRequestParams) (pgtype.UUID, error)

DELETE ... RETURNING makes notification handling single-use across replicas. run_id is NULL when cancellation wins before dispatch binds the reservation.

func (*Queries) ConsumeOAuthConsentTransaction added in v0.4.0

func (q *Queries) ConsumeOAuthConsentTransaction(ctx context.Context, arg ConsumeOAuthConsentTransactionParams) (OauthConsentTransaction, error)

Approve and deny both call this inside their response transaction. Deleting by transaction ID and signed-token hash gives every consent screen one successful decision across all replicas.

func (*Queries) ConsumeRelayCode added in v0.4.0

func (q *Queries) ConsumeRelayCode(ctx context.Context, codeHash []byte) (ConsumeRelayCodeRow, error)

func (*Queries) ConversationHasToolCall added in v0.4.0

func (q *Queries) ConversationHasToolCall(ctx context.Context, arg ConversationHasToolCallParams) (bool, error)

True if any assistant message in the conversation already carries a tool-call part with this id. SessionAppend uses it to tell a genuinely dangling tool-result (originating assistant turn never persisted) from the normal case where the call landed in a prior committed batch (e.g. the permission/question resume path) — only the former gets a synthetic assistant tool-call written ahead of it.

func (*Queries) CountAgentsUsingModel added in v0.4.0

func (q *Queries) CountAgentsUsingModel(ctx context.Context, arg CountAgentsUsingModelParams) (int64, error)

Number of agents that have (provider, model) configured as a capability override or a declared model-slot assignment. Drives the disable confirmation ("N agents will be reset to the default").

func (*Queries) CountCredentialsByUserID added in v0.4.0

func (q *Queries) CountCredentialsByUserID(ctx context.Context, userID pgtype.UUID) (int64, error)

func (*Queries) CountHostedConnectorsForHost added in v0.6.1

func (q *Queries) CountHostedConnectorsForHost(ctx context.Context, hostID pgtype.UUID) (int64, error)

func (*Queries) CountMatchingModelGrants added in v0.4.0

func (q *Queries) CountMatchingModelGrants(ctx context.Context, arg CountMatchingModelGrantsParams) (int64, error)

For the entitlement check: does any grant for this (provider, model) target a principal in the caller's grantee set?

func (*Queries) CountNonterminalConnectorJobsForAgent added in v0.6.1

func (q *Queries) CountNonterminalConnectorJobsForAgent(ctx context.Context, agentID pgtype.UUID) (int64, error)

func (*Queries) CountNonterminalConnectorJobsForNeed added in v0.6.1

func (q *Queries) CountNonterminalConnectorJobsForNeed(ctx context.Context, needID pgtype.UUID) (int64, error)

func (*Queries) CountNonterminalConnectorJobsForNeedConnector added in v0.6.1

func (q *Queries) CountNonterminalConnectorJobsForNeedConnector(ctx context.Context, arg CountNonterminalConnectorJobsForNeedConnectorParams) (int64, error)

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) CountTenantAdmins added in v0.4.0

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

func (*Queries) CreateA2AConversation added in v0.4.0

func (q *Queries) CreateA2AConversation(ctx context.Context, arg CreateA2AConversationParams) (AgentConversation, error)

A2A: each new context (caller passed no contextId) is its own conversation on the *called* agent, owned by the original user (user_id may be NULL for anonymous external-MCP callers). source is always 'a2a' so the partial DM index never collapses these. Plain INSERT — no upsert, every call without a contextId is a fresh thread.

func (*Queries) CreateAgent

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

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, instructions empty array. The agent's id is derived from a freshly-seeded principal (one statement, one tx), so every agent is guaranteed a matching principals row of kind 'agent' — the FK on agents.id fails loud otherwise.

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. LLM telemetry starts at 0 (no codegen spend yet) — set explicitly per the "no fake defaults" rule, mirroring CreateRun; UpdateBuildLLMStats fills it from the llm_usage ledger when codegen finishes.

func (*Queries) CreateAuthzCode added in v0.4.0

func (q *Queries) CreateAuthzCode(ctx context.Context, arg CreateAuthzCodeParams) error

func (*Queries) CreateBridge

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

func (*Queries) CreateCeremony added in v0.4.0

func (q *Queries) CreateCeremony(ctx context.Context, arg CreateCeremonyParams) (pgtype.UUID, error)

func (*Queries) CreateConnection added in v0.4.0

func (q *Queries) CreateConnection(ctx context.Context, arg CreateConnectionParams) (Connection, error)

func (*Queries) CreateConnectorArtifactFile added in v0.6.1

func (q *Queries) CreateConnectorArtifactFile(ctx context.Context, arg CreateConnectorArtifactFileParams) (ConnectorArtifactFile, error)

func (*Queries) CreateConnectorArtifactSet added in v0.6.1

func (q *Queries) CreateConnectorArtifactSet(ctx context.Context, arg CreateConnectorArtifactSetParams) (ConnectorArtifactSet, error)

func (*Queries) CreateConnectorOrchestration added in v0.6.1

func (q *Queries) CreateConnectorOrchestration(ctx context.Context, arg CreateConnectorOrchestrationParams) (ConnectorOrchestration, error)

func (*Queries) CreateConnectorResource added in v0.6.1

func (q *Queries) CreateConnectorResource(ctx context.Context, arg CreateConnectorResourceParams) (ConnectorResource, error)

Connector resources, inventory, and publication.

func (*Queries) CreateConnectorTargetGroup added in v0.6.1

func (q *Queries) CreateConnectorTargetGroup(ctx context.Context, arg CreateConnectorTargetGroupParams) (ConnectorTargetGroup, error)

Target groups and persisted multi-target orchestration.

func (*Queries) CreateCredential added in v0.4.0

func (q *Queries) CreateCredential(ctx context.Context, arg CreateCredentialParams) (WebauthnCredential, error)

func (*Queries) CreateDeviceLoginSession added in v0.4.0

func (q *Queries) CreateDeviceLoginSession(ctx context.Context, arg CreateDeviceLoginSessionParams) (DeviceLoginSession, error)

func (*Queries) CreateGitCredential added in v0.4.0

func (q *Queries) CreateGitCredential(ctx context.Context, arg CreateGitCredentialParams) (GitCredential, error)

id is caller-supplied (uuid.New) so token_ref ciphertext can be bound to it via AAD before INSERT — same shape as CreateProvider.

func (*Queries) CreateHost added in v0.6.1

func (q *Queries) CreateHost(ctx context.Context, arg CreateHostParams) (Host, error)

func (*Queries) CreateHostCredential added in v0.6.1

func (q *Queries) CreateHostCredential(ctx context.Context, arg CreateHostCredentialParams) (HostCredential, error)

func (*Queries) CreateHostEnrollment added in v0.6.1

func (q *Queries) CreateHostEnrollment(ctx context.Context, arg CreateHostEnrollmentParams) (HostEnrollmentSession, error)

func (*Queries) CreateHostedConnector added in v0.6.1

func (q *Queries) CreateHostedConnector(ctx context.Context, arg CreateHostedConnectorParams) (ConnectorResource, error)

func (*Queries) CreateIdentityLinkChallenge added in v0.4.0

func (q *Queries) CreateIdentityLinkChallenge(ctx context.Context, arg CreateIdentityLinkChallengeParams) (IdentityLinkChallenge, error)

func (*Queries) CreateMCPA2AConversation added in v0.4.0

func (q *Queries) CreateMCPA2AConversation(ctx context.Context, arg CreateMCPA2AConversationParams) (AgentConversation, error)

MCP continuations carry a server-generated principal binding in metadata. Callers cannot choose this value; subsequent context/task access must match it.

func (*Queries) CreateMCPServer added in v0.4.0

func (q *Queries) CreateMCPServer(ctx context.Context, arg CreateMCPServerParams) (AgentMcpServer, error)

func (*Queries) CreateManagedBotSession added in v0.4.0

func (q *Queries) CreateManagedBotSession(ctx context.Context, arg CreateManagedBotSessionParams) (ManagedBotSession, error)

managed_bot_sessions: per-create-flow correlation rows tying an airlock "Create new Telegram bot" click to the eventual ManagedBotCreated callback the manager bot receives.

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) CreateModelGrant added in v0.4.0

func (q *Queries) CreateModelGrant(ctx context.Context, arg CreateModelGrantParams) (ModelGrant, error)

Model entitlements: which (provider, model) a principal/group may be assigned. Deny-by-default — a model is allowed only if it is a system default or a grant matches the assigner's grantee set.

func (*Queries) CreateOAuthClient added in v0.4.0

func (q *Queries) CreateOAuthClient(ctx context.Context, arg CreateOAuthClientParams) (OauthClient, error)

func (*Queries) CreateOAuthConsentTransaction added in v0.4.0

func (q *Queries) CreateOAuthConsentTransaction(ctx context.Context, arg CreateOAuthConsentTransactionParams) error

func (*Queries) CreateOAuthState

func (q *Queries) CreateOAuthState(ctx context.Context, arg CreateOAuthStateParams) error

func (*Queries) CreateObservedConnectorInventory added in v0.6.1

func (q *Queries) CreateObservedConnectorInventory(ctx context.Context, arg CreateObservedConnectorInventoryParams) (ConnectorResource, error)

func (*Queries) CreatePlatformIdentity

func (q *Queries) CreatePlatformIdentity(ctx context.Context, arg CreatePlatformIdentityParams) (PlatformIdentity, error)

func (*Queries) CreatePlatformIdentityIfUnlinked added in v0.4.0

func (q *Queries) CreatePlatformIdentityIfUnlinked(ctx context.Context, arg CreatePlatformIdentityIfUnlinkedParams) (int64, error)

func (*Queries) CreateProvider

func (q *Queries) CreateProvider(ctx context.Context, arg CreateProviderParams) (Provider, error)

id is supplied by the caller (uuid.New) so the encryption ref path can be computed before the INSERT — every providers row's api_key ciphertext is bound to its own UUID via AAD.

func (*Queries) CreateProviderModel added in v0.4.1

func (q *Queries) CreateProviderModel(ctx context.Context, arg CreateProviderModelParams) (ProviderModel, error)

func (*Queries) CreateRefreshToken added in v0.4.0

func (q *Queries) CreateRefreshToken(ctx context.Context, arg CreateRefreshTokenParams) error

func (*Queries) CreateRelayCode added in v0.4.0

func (q *Queries) CreateRelayCode(ctx context.Context, arg CreateRelayCodeParams) error

func (*Queries) CreateRun

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

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 []. parent_run_id is NULL for top-level (web/bridge/cron/webhook) runs and the caller's run id for A2A child runs.

func (*Queries) CreateSystemConversation added in v0.4.0

func (q *Queries) CreateSystemConversation(ctx context.Context, arg CreateSystemConversationParams) (SystemConversation, error)

system_agent: per-user chat conversations + messages + lightweight runs + audit log for the in-airlock system agent. Schema lives in migrations/002_a2a.sql.

func (*Queries) CreateSystemRun added in v0.4.0

func (q *Queries) CreateSystemRun(ctx context.Context, arg CreateSystemRunParams) (SystemRun, error)

Inserts a fresh run row at the start of a turn. The id becomes the run_id every WS event carries so the frontend can group text_delta/tool_call/tool_result events under one bubble — same contract as agent chat's runs.id.

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)

Seed the principal supertype row and the user subtype atomically (one statement, one tx); the id is derived from the new principal so every user is guaranteed a matching principals row — the FK fails loud otherwise.

func (*Queries) CreateUserSession added in v0.4.0

func (q *Queries) CreateUserSession(ctx context.Context, arg CreateUserSessionParams) (UserSession, error)

func (*Queries) CreateWebConversation added in v0.4.0

func (q *Queries) CreateWebConversation(ctx context.Context, arg CreateWebConversationParams) (AgentConversation, error)

Web is multi-conversation: every call is a fresh thread owned by the user. Plain INSERT, no upsert — the row UUID is the identity and the client addresses one by id on each prompt.

func (*Queries) DeactivateJobHandlersByAgent added in v0.5.0

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

func (*Queries) DeferConnectorExportFinalization added in v0.6.1

func (q *Queries) DeferConnectorExportFinalization(ctx context.Context, arg DeferConnectorExportFinalizationParams) (int64, error)

func (*Queries) DeleteAgent

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

Delete through the principal: ON DELETE CASCADE removes the agents row and, via the agent's own FKs, all of its agent-scoped rows.

func (*Queries) DeleteAgentBuildJobHandlers added in v0.5.0

func (q *Queries) DeleteAgentBuildJobHandlers(ctx context.Context, buildID pgtype.UUID) error

func (*Queries) DeleteAgentGrant added in v0.4.0

func (q *Queries) DeleteAgentGrant(ctx context.Context, arg DeleteAgentGrantParams) error

func (*Queries) DeleteAgentJobCronsByAgentExcept added in v0.5.0

func (q *Queries) DeleteAgentJobCronsByAgentExcept(ctx context.Context, arg DeleteAgentJobCronsByAgentExceptParams) error

func (*Queries) DeleteBridge

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

func (*Queries) DeleteClaimedConnectorTransfer added in v0.6.1

func (q *Queries) DeleteClaimedConnectorTransfer(ctx context.Context, arg DeleteClaimedConnectorTransferParams) (int64, error)

func (*Queries) DeleteConnectionByID added in v0.4.0

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

Grants cascade with a deleted resource and bindings become unbound through ON DELETE SET NULL.

func (*Queries) DeleteConnectorReservationsForNeed added in v0.6.1

func (q *Queries) DeleteConnectorReservationsForNeed(ctx context.Context, needID pgtype.UUID) (int64, error)

func (*Queries) DeleteConnectorTargetGroup added in v0.6.1

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

func (*Queries) DeleteConversation

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

func (*Queries) DeleteCredential added in v0.4.0

func (q *Queries) DeleteCredential(ctx context.Context, arg DeleteCredentialParams) error

func (*Queries) DeleteDirectoriesByAgentExcept added in v0.2.0

func (q *Queries) DeleteDirectoriesByAgentExcept(ctx context.Context, arg DeleteDirectoriesByAgentExceptParams) error

func (*Queries) DeleteExpiredAnonA2AConversations added in v0.4.0

func (q *Queries) DeleteExpiredAnonA2AConversations(ctx context.Context, ttlSeconds int32) (int64, error)

Sweeper: anonymous A2A conversations (no owning user, minted for unauthenticated external-MCP callers) have no UI to resume them and would otherwise grow unbounded. Drop any idle past the TTL; the row delete cascades to agent_messages via FK. (user_id IS NULL AND source='a2a') is the precise anon-A2A key — authed A2A convs and bridge convs are untouched.

func (*Queries) DeleteExpiredCeremonies added in v0.4.0

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

func (*Queries) DeleteExpiredConnectorArtifactSets added in v0.6.1

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

func (*Queries) DeleteExpiredDeviceLoginSessions added in v0.4.0

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

func (*Queries) DeleteExpiredHostEnrollments added in v0.6.1

func (q *Queries) DeleteExpiredHostEnrollments(ctx context.Context, lim int32) (int64, error)

func (*Queries) DeleteGitCredential added in v0.4.0

func (q *Queries) DeleteGitCredential(ctx context.Context, arg DeleteGitCredentialParams) error

Owner-scoped: a user can only delete their own credentials.

func (*Queries) DeleteGitCredentialByID added in v0.6.1

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

func (*Queries) DeleteMCPActiveRequest added in v0.4.0

func (q *Queries) DeleteMCPActiveRequest(ctx context.Context, arg DeleteMCPActiveRequestParams) error

Include run_id so an old request's completion cannot remove a replacement.

func (*Queries) DeleteMCPServerByID added in v0.4.0

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

func (*Queries) DeleteManagedBotSessionByNonce added in v0.4.0

func (q *Queries) DeleteManagedBotSessionByNonce(ctx context.Context, nonce string) error

func (*Queries) DeleteMessagesByConversation

func (q *Queries) DeleteMessagesByConversation(ctx context.Context, conversationID pgtype.UUID) error

func (*Queries) DeleteOAuthConsentTransactionsForGrant added in v0.4.0

func (q *Queries) DeleteOAuthConsentTransactionsForGrant(ctx context.Context, arg DeleteOAuthConsentTransactionsForGrantParams) (int64, error)

Revocation invalidates consent screens issued before it commits, preventing a pending request from recreating the revoked grant.

func (*Queries) DeleteOAuthState

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

func (*Queries) DeletePlatformIdentityAny added in v0.4.0

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

Admin variant: delete any platform identity by id, without the caller's user_id constraint. Gated behind TenantIdentityManageAll.

func (*Queries) DeleteProvider

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

func (*Queries) DeleteProviderModels added in v0.4.1

func (q *Queries) DeleteProviderModels(ctx context.Context, configuredProviderID pgtype.UUID) error

func (*Queries) DeleteProvisionalConnection added in v0.4.0

func (q *Queries) DeleteProvisionalConnection(ctx context.Context, arg DeleteProvisionalConnectionParams) (int64, error)

func (*Queries) DeleteProvisionalMCPServer added in v0.4.0

func (q *Queries) DeleteProvisionalMCPServer(ctx context.Context, arg DeleteProvisionalMCPServerParams) (int64, error)

func (*Queries) DeleteResourceGrant added in v0.6.1

func (q *Queries) DeleteResourceGrant(ctx context.Context, arg DeleteResourceGrantParams) (int64, error)

func (*Queries) DeleteResourceNeedsByAgentTypeExcept added in v0.4.0

func (q *Queries) DeleteResourceNeedsByAgentTypeExcept(ctx context.Context, arg DeleteResourceNeedsByAgentTypeExceptParams) error

func (*Queries) DeleteRetainedConnectorJobs added in v0.6.1

func (q *Queries) DeleteRetainedConnectorJobs(ctx context.Context, lim int32) (int64, error)

func (*Queries) DeleteRetainedHostManagementJobs added in v0.6.1

func (q *Queries) DeleteRetainedHostManagementJobs(ctx context.Context, lim int32) (int64, error)

func (*Queries) DeleteRevokedConnectors added in v0.6.1

func (q *Queries) DeleteRevokedConnectors(ctx context.Context, lim int32) (int64, error)

func (*Queries) DeleteRoutesByAgentExcept

func (q *Queries) DeleteRoutesByAgentExcept(ctx context.Context, arg DeleteRoutesByAgentExceptParams) error

func (*Queries) DeleteStaleAgentEnvVars added in v0.6.3

func (q *Queries) DeleteStaleAgentEnvVars(ctx context.Context, arg DeleteStaleAgentEnvVarsParams) 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) DeleteSystemConversation added in v0.4.0

func (q *Queries) DeleteSystemConversation(ctx context.Context, arg DeleteSystemConversationParams) error

func (*Queries) DeleteTerminalTombstonedConnectorNeedReservations added in v0.6.1

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

func (*Queries) DeleteTombstonedConnectorNeeds added in v0.6.1

func (q *Queries) DeleteTombstonedConnectorNeeds(ctx context.Context, lim int32) (int64, 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

Delete through the principal: ON DELETE CASCADE removes the users row plus any grants/memberships keyed on this principal.

func (*Queries) DeleteWebhooksByAgentExcept

func (q *Queries) DeleteWebhooksByAgentExcept(ctx context.Context, arg DeleteWebhooksByAgentExceptParams) error

func (*Queries) DenyDeviceLogin added in v0.4.0

func (q *Queries) DenyDeviceLogin(ctx context.Context, userCodeHash string) (DeviceLoginSession, error)

func (*Queries) DenyHostEnrollment added in v0.6.1

func (q *Queries) DenyHostEnrollment(ctx context.Context, userCodeHash []byte) (HostEnrollmentSession, error)

func (*Queries) DisconnectAgentGit added in v0.4.0

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

Empty strings + NULL credential signal "internal-only" mode again. git_last_synced_ref is also cleared so a future reconnect starts fresh rather than comparing against a stale remote tip.

func (*Queries) EnsureSystemConversationForBridge added in v0.4.0

func (q *Queries) EnsureSystemConversationForBridge(ctx context.Context, arg EnsureSystemConversationForBridgeParams) (SystemConversation, error)

Upsert one sticky thread per (user, bridge) on the partial unique index (user_id, bridge_id) WHERE bridge_id IS NOT NULL — every system bridge funnels that user's inbound DMs into the same row. The first INSERT for a pair returns the new row; subsequent calls hit the conflict and return the existing one, refreshing external_id (the platform chat id) so a server-initiated follow-up — e.g. a build / upgrade completion auto-resume, which has no live inbound update to read the chat id from — can deliver back to the right chat.

func (*Queries) ExpireConnectorJobAttempts added in v0.6.1

func (q *Queries) ExpireConnectorJobAttempts(ctx context.Context, lim int32) ([]ConnectorJobAttempt, error)

func (*Queries) ExpireHostManagementAttempts added in v0.6.1

func (q *Queries) ExpireHostManagementAttempts(ctx context.Context, lim int32) (int64, error)

func (*Queries) FailAgentJob added in v0.5.0

func (q *Queries) FailAgentJob(ctx context.Context, arg FailAgentJobParams) (int64, error)

func (*Queries) FailAgentJobAttempt added in v0.5.0

func (q *Queries) FailAgentJobAttempt(ctx context.Context, arg FailAgentJobAttemptParams) (int64, error)

func (*Queries) FailConnectorExportFinalization added in v0.6.1

func (q *Queries) FailConnectorExportFinalization(ctx context.Context, arg FailConnectorExportFinalizationParams) (ConnectorJob, error)

func (*Queries) FailExpiredConnectorFinalizations added in v0.6.1

func (q *Queries) FailExpiredConnectorFinalizations(ctx context.Context, lim int32) ([]ConnectorJob, error)

func (*Queries) FailExpiredConnectorJobs added in v0.6.1

func (q *Queries) FailExpiredConnectorJobs(ctx context.Context, lim int32) ([]FailExpiredConnectorJobsRow, error)

func (*Queries) FailExpiredHostManagementJobs added in v0.6.1

func (q *Queries) FailExpiredHostManagementJobs(ctx context.Context, lim int32) (int64, error)

func (*Queries) FailInitialAgentBuild added in v0.4.0

func (q *Queries) FailInitialAgentBuild(ctx context.Context, arg FailInitialAgentBuildParams) (int64, error)

func (*Queries) FailPausedAgentDeployment added in v0.5.0

func (q *Queries) FailPausedAgentDeployment(ctx context.Context, arg FailPausedAgentDeploymentParams) (int64, error)

func (*Queries) FailRecoveredAgentBuild added in v0.5.0

func (q *Queries) FailRecoveredAgentBuild(ctx context.Context, arg FailRecoveredAgentBuildParams) (int64, error)

func (*Queries) FailRecoveredAgentLifecycle added in v0.5.0

func (q *Queries) FailRecoveredAgentLifecycle(ctx context.Context, arg FailRecoveredAgentLifecycleParams) (int64, error)

func (*Queries) FailRunDispatch added in v0.5.0

func (q *Queries) FailRunDispatch(ctx context.Context, arg FailRunDispatchParams) (int64, error)

Terminalize a run whose request could not establish a response stream from the agent. The running-state CAS preserves whichever terminal state commits first.

func (*Queries) FailStuckRun added in v0.5.0

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

func (*Queries) FinalizeAgentDeployment added in v0.4.0

func (q *Queries) FinalizeAgentDeployment(ctx context.Context, arg FinalizeAgentDeploymentParams) (int64, error)

func (*Queries) FinalizeCancelledConnectorJobs added in v0.6.1

func (q *Queries) FinalizeCancelledConnectorJobs(ctx context.Context, lim int32) ([]FinalizeCancelledConnectorJobsRow, error)

func (*Queries) FinalizeConnectorRemoval added in v0.6.1

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

func (*Queries) FinalizePausedAgentDeployment added in v0.5.0

func (q *Queries) FinalizePausedAgentDeployment(ctx context.Context, arg FinalizePausedAgentDeploymentParams) (int64, error)

func (*Queries) FinalizeStoppedAgentDeployment added in v0.5.0

func (q *Queries) FinalizeStoppedAgentDeployment(ctx context.Context, arg FinalizeStoppedAgentDeploymentParams) (int64, error)

func (*Queries) FindConnectorArtifactPublication added in v0.6.1

func (q *Queries) FindConnectorArtifactPublication(ctx context.Context, arg FindConnectorArtifactPublicationParams) (pgtype.UUID, error)

func (*Queries) FinishConnectorArtifactBlobDeletion added in v0.6.1

func (q *Queries) FinishConnectorArtifactBlobDeletion(ctx context.Context, arg FinishConnectorArtifactBlobDeletionParams) (int64, error)

func (*Queries) FinishConnectorExportFinalization added in v0.6.1

func (q *Queries) FinishConnectorExportFinalization(ctx context.Context, arg FinishConnectorExportFinalizationParams) (ConnectorJob, error)

func (*Queries) ForceInterruptAgentJobAttemptForDeployment added in v0.5.0

func (q *Queries) ForceInterruptAgentJobAttemptForDeployment(ctx context.Context, arg ForceInterruptAgentJobAttemptForDeploymentParams) (AgentJob, error)

func (*Queries) GetActiveGrant added in v0.4.0

func (q *Queries) GetActiveGrant(ctx context.Context, arg GetActiveGrantParams) (OauthGrant, error)

Looks up an active (non-revoked, non-expired) grant. /authorize uses this to decide whether to skip the consent screen.

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) GetActiveUserSessionByRefreshHash added in v0.4.0

func (q *Queries) GetActiveUserSessionByRefreshHash(ctx context.Context, refreshTokenHash []byte) (UserSession, error)

func (*Queries) GetActiveUserSessionByRefreshHashForUpdate added in v0.4.0

func (q *Queries) GetActiveUserSessionByRefreshHashForUpdate(ctx context.Context, refreshTokenHash []byte) (UserSession, error)

func (*Queries) GetAgentArtifactDeletionBlockers added in v0.6.1

func (q *Queries) GetAgentArtifactDeletionBlockers(ctx context.Context, agentID pgtype.UUID) (GetAgentArtifactDeletionBlockersRow, error)

func (*Queries) GetAgentBuild

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

func (*Queries) GetAgentBuildByIntegrationToken added in v0.4.0

func (q *Queries) GetAgentBuildByIntegrationToken(ctx context.Context, integrationTokenHash []byte) (GetAgentBuildByIntegrationTokenRow, error)

func (*Queries) GetAgentBuildForDeployment added in v0.5.0

func (q *Queries) GetAgentBuildForDeployment(ctx context.Context, arg GetAgentBuildForDeploymentParams) (AgentBuild, error)

func (*Queries) GetAgentByID

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

func (*Queries) GetAgentByIDForUpdate added in v0.4.0

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

func (*Queries) GetAgentBySlug

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

func (*Queries) GetAgentEnvVarBySlug added in v0.2.12

func (q *Queries) GetAgentEnvVarBySlug(ctx context.Context, arg GetAgentEnvVarBySlugParams) (AgentEnvVar, error)

func (*Queries) GetAgentForUpgrade

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

func (*Queries) GetAgentGitConfig added in v0.4.0

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

Joined with git_credentials so the UI can show the credential's name without a second round-trip. Returns empty/NULL values when no remote is configured.

func (*Queries) GetAgentGrant added in v0.4.0

func (q *Queries) GetAgentGrant(ctx context.Context, arg GetAgentGrantParams) (AgentGrant, error)

func (*Queries) GetAgentJobByAttemptRunID added in v0.5.0

func (q *Queries) GetAgentJobByAttemptRunID(ctx context.Context, runID pgtype.UUID) (AgentJob, error)

func (*Queries) GetAgentJobByID added in v0.5.0

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

func (*Queries) GetAgentJobByIDAndAgent added in v0.5.0

func (q *Queries) GetAgentJobByIDAndAgent(ctx context.Context, arg GetAgentJobByIDAndAgentParams) (AgentJob, error)

func (*Queries) GetAgentJobByIDAndAgentForUpdate added in v0.5.0

func (q *Queries) GetAgentJobByIDAndAgentForUpdate(ctx context.Context, arg GetAgentJobByIDAndAgentForUpdateParams) (AgentJob, error)

func (*Queries) GetAgentJobByIDForUpdate added in v0.5.0

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

func (*Queries) GetAgentJobCron added in v0.5.0

func (q *Queries) GetAgentJobCron(ctx context.Context, arg GetAgentJobCronParams) (AgentJobCron, error)

func (*Queries) GetAgentJobHandlerForEnqueue added in v0.5.0

func (q *Queries) GetAgentJobHandlerForEnqueue(ctx context.Context, arg GetAgentJobHandlerForEnqueueParams) (AgentJobHandler, error)

func (*Queries) GetAgentModelSlot

func (q *Queries) GetAgentModelSlot(ctx context.Context, arg GetAgentModelSlotParams) (AgentModelSlot, error)

func (*Queries) GetAgentTokenAuth added in v0.4.0

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

func (*Queries) GetBoundNeedForConnectorTargetGroup added in v0.6.1

func (q *Queries) GetBoundNeedForConnectorTargetGroup(ctx context.Context, groupID pgtype.UUID) (AgentResourceNeed, 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) GetBridgeByTelegramBotUserID added in v0.4.0

func (q *Queries) GetBridgeByTelegramBotUserID(ctx context.Context, telegramBotUserID pgtype.Int8) (Bridge, error)

Lookup a Telegram bridge by the bot's stable Telegram user_id. The manager-bot poller uses this for idempotency: a duplicate ManagedBotCreated for the same bot.id (paranoid backstop) no-ops instead of inserting a second row.

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) GetClaimedConnectorJob added in v0.6.1

func (q *Queries) GetClaimedConnectorJob(ctx context.Context, arg GetClaimedConnectorJobParams) (GetClaimedConnectorJobRow, error)

func (*Queries) GetCompatibleConnectorArtifactDownload added in v0.6.1

func (*Queries) GetCompatibleHostUpdateArtifact added in v0.6.1

func (*Queries) GetCompletedHostManagementJobForAttempt added in v0.6.1

func (q *Queries) GetCompletedHostManagementJobForAttempt(ctx context.Context, arg GetCompletedHostManagementJobForAttemptParams) (HostManagementJob, error)

func (*Queries) GetConnectionByID added in v0.4.0

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

func (*Queries) GetConnectionByIDForUpdate added in v0.4.0

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

The credential proxy and the operator credential ops key reads + write-backs on the resource id (one connection backs many agents' bindings), so the consuming agent is not a stable handle for the row. Callers resolve the binding to an id (ResolveBoundConnection / a freshly upserted row) first.

func (*Queries) GetConnectionOwner added in v0.4.0

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

Resource owner lookups for the capability check (owner holds all caps).

func (*Queries) GetConnectorArtifactLineage added in v0.6.1

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

func (*Queries) GetConnectorArtifactStatus added in v0.6.1

func (q *Queries) GetConnectorArtifactStatus(ctx context.Context, connectorID pgtype.UUID) (GetConnectorArtifactStatusRow, error)

func (*Queries) GetConnectorJob added in v0.6.1

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

func (*Queries) GetConnectorJobByAgent added in v0.6.1

func (q *Queries) GetConnectorJobByAgent(ctx context.Context, arg GetConnectorJobByAgentParams) (ConnectorJob, error)

func (*Queries) GetConnectorJobByAgentForUpdate added in v0.6.1

func (q *Queries) GetConnectorJobByAgentForUpdate(ctx context.Context, arg GetConnectorJobByAgentForUpdateParams) (ConnectorJob, error)

func (*Queries) GetConnectorJobByRequest added in v0.6.1

func (q *Queries) GetConnectorJobByRequest(ctx context.Context, arg GetConnectorJobByRequestParams) (ConnectorJob, error)

func (*Queries) GetConnectorOrchestration added in v0.6.1

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

func (*Queries) GetConnectorOrchestrationByRequest added in v0.6.1

func (q *Queries) GetConnectorOrchestrationByRequest(ctx context.Context, arg GetConnectorOrchestrationByRequestParams) (ConnectorOrchestration, error)

func (*Queries) GetConnectorOrchestrationForUpdate added in v0.6.1

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

func (*Queries) GetConnectorOwner added in v0.6.1

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

func (*Queries) GetConnectorReservation added in v0.6.1

func (q *Queries) GetConnectorReservation(ctx context.Context, connectorID pgtype.UUID) (ConnectorReservation, error)

func (*Queries) GetConnectorReservationForUpdate added in v0.6.1

func (q *Queries) GetConnectorReservationForUpdate(ctx context.Context, connectorID pgtype.UUID) (ConnectorReservation, error)

func (*Queries) GetConnectorResource added in v0.6.1

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

func (*Queries) GetConnectorResourceForUpdate added in v0.6.1

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

func (*Queries) GetConnectorTargetGroup added in v0.6.1

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

func (*Queries) GetConnectorTargetGroupForUpdate added in v0.6.1

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

func (*Queries) GetConnectorTargetGroupMember added in v0.6.1

func (q *Queries) GetConnectorTargetGroupMember(ctx context.Context, arg GetConnectorTargetGroupMemberParams) (ConnectorTargetGroupMember, error)

func (*Queries) GetConnectorTargetGroupOwner added in v0.6.1

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

func (*Queries) GetConnectorTransfer added in v0.6.1

func (q *Queries) GetConnectorTransfer(ctx context.Context, jobID pgtype.UUID) (ConnectorTransfer, error)

func (*Queries) GetConversationByID

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

func (*Queries) GetConversationByIDAndAgent added in v0.4.0

func (q *Queries) GetConversationByIDAndAgent(ctx context.Context, arg GetConversationByIDAndAgentParams) (AgentConversation, error)

func (*Queries) GetConversationByIDAndAgentForUpdate added in v0.4.0

func (q *Queries) GetConversationByIDAndAgentForUpdate(ctx context.Context, arg GetConversationByIDAndAgentForUpdateParams) (AgentConversation, error)

Session writes lock the parent row before inspecting context state. Child inserts take a foreign-key key-share lock, so this also orders every message insert against checkpoint advancement across replicas.

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) GetDescendantRuns added in v0.4.0

func (q *Queries) GetDescendantRuns(ctx context.Context, rootRunID pgtype.UUID) ([]GetDescendantRunsRow, error)

Recursive descent through parent_run_id for cancel cascade. Returns every run reachable from @root_run_id via parent_run_id (excluding the root itself). Order is unspecified; callers fire cancel funcs independently per row.

func (*Queries) GetDeviceLoginByUserCodeHash added in v0.4.0

func (q *Queries) GetDeviceLoginByUserCodeHash(ctx context.Context, userCodeHash string) (DeviceLoginSession, error)

func (*Queries) GetDeviceLoginForPoll added in v0.4.0

func (q *Queries) GetDeviceLoginForPoll(ctx context.Context, deviceCodeHash string) (DeviceLoginSession, 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 matching the requested path on an exact segment boundary.

func (*Queries) GetExpiredAgentJobAttemptForUpdate added in v0.5.0

func (q *Queries) GetExpiredAgentJobAttemptForUpdate(ctx context.Context) (AgentJobAttempt, error)

func (*Queries) GetGitCredential added in v0.4.0

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

Runtime resolution path: caller fetches the encrypted token_ref to decrypt and use against the remote. NOT scoped by user_id — the caller (e.g. the codegen push) must enforce permission via the owning agent's user_id matching.

func (*Queries) GetGitCredentialOwner added in v0.4.0

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

func (*Queries) GetHost added in v0.6.1

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

func (*Queries) GetHostArtifactFile added in v0.6.1

func (q *Queries) GetHostArtifactFile(ctx context.Context, artifactFileID pgtype.UUID) (GetHostArtifactFileRow, error)

func (*Queries) GetHostCredentialBySelector added in v0.6.1

func (q *Queries) GetHostCredentialBySelector(ctx context.Context, selector pgtype.UUID) (GetHostCredentialBySelectorRow, error)

func (*Queries) GetHostEnrollmentByUserCode added in v0.6.1

func (q *Queries) GetHostEnrollmentByUserCode(ctx context.Context, userCodeHash []byte) (HostEnrollmentSession, error)

func (*Queries) GetHostEnrollmentForPoll added in v0.6.1

func (q *Queries) GetHostEnrollmentForPoll(ctx context.Context, deviceCodeHash []byte) (HostEnrollmentSession, error)

func (*Queries) GetHostManagementJob added in v0.6.1

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

func (*Queries) GetHostOwner added in v0.6.1

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

func (*Queries) GetHostedConnector added in v0.6.1

func (q *Queries) GetHostedConnector(ctx context.Context, arg GetHostedConnectorParams) (ConnectorResource, error)

func (*Queries) GetHostedConnectorAnyLifecycle added in v0.6.1

func (q *Queries) GetHostedConnectorAnyLifecycle(ctx context.Context, arg GetHostedConnectorAnyLifecycleParams) (ConnectorResource, error)

func (*Queries) GetHostedConnectorForInventory added in v0.6.1

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

func (*Queries) GetLatestBuildForAgent added in v0.4.0

func (q *Queries) GetLatestBuildForAgent(ctx context.Context, agentID pgtype.UUID) (AgentBuild, error)

func (*Queries) GetLatestRunningPromptRun added in v0.2.11

func (q *Queries) GetLatestRunningPromptRun(ctx context.Context, triggerRef string) (pgtype.UUID, error)

Finds the most recent running prompt run for a conversation. Used by the /cancel slash command to discover which run to abort. Empty result means nothing's in flight (or it's already finished between the user typing /cancel and us querying).

func (*Queries) GetLatestRunningSystemRun added in v0.4.0

func (q *Queries) GetLatestRunningSystemRun(ctx context.Context, conversationID pgtype.UUID) (pgtype.UUID, error)

/cancel target: the most recent run on this conversation that hasn't terminated yet. Both 'running' and 'suspended' are cancellable — suspended runs that the user cancels via /cancel rather than via the confirmation dialog still need to be torn down.

func (*Queries) GetLatestSuspendedRun

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

func (*Queries) GetLatestSuspendedRunByConversation added in v0.4.0

func (q *Queries) GetLatestSuspendedRunByConversation(ctx context.Context, conversationID string) (Run, error)

Conversation-scoped suspended-run lookup. trigger_ref holds the conversation id for both web (trigger_type='prompt') and sibling (trigger_type='a2a') runs, and those live on distinct conversation rows — so scoping by trigger_ref keeps a web/bridge resume, the conversation view, and /clear from ever picking up an A2A delegated suspension that belongs to a different surface (the agent-wide GetLatestSuspendedRun cannot distinguish them).

func (*Queries) GetLatestSuspendedSystemRun added in v0.4.0

func (q *Queries) GetLatestSuspendedSystemRun(ctx context.Context, conversationID pgtype.UUID) (pgtype.UUID, error)

/clear target: a suspended run on this conversation belongs to the pending-confirmation UI; once the context is cleared the dialog is meaningless, so we cancel the run alongside the checkpoint advance.

func (*Queries) GetLiveUserForSession added in v0.4.0

func (q *Queries) GetLiveUserForSession(ctx context.Context, arg GetLiveUserForSessionParams) (GetLiveUserForSessionRow, 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) GetMCPActiveRequest added in v0.4.0

func (q *Queries) GetMCPActiveRequest(ctx context.Context, arg GetMCPActiveRequestParams) (pgtype.UUID, error)

The run owner polls this shared row so a notification handled by another replica still reaches the process-local canonical run cancellation hook.

func (*Queries) GetMCPServerByID added in v0.4.0

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

func (*Queries) GetMCPServerByIDForUpdate added in v0.4.0

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

id-keyed credential proxy + operator ops (one server backs many bindings).

func (*Queries) GetMCPServerOwner added in v0.4.0

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

func (*Queries) GetManagedBotSessionByNonce added in v0.4.0

func (q *Queries) GetManagedBotSessionByNonce(ctx context.Context, nonce string) (ManagedBotSession, error)

func (*Queries) GetManagerBridge added in v0.4.0

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

The Telegram manager bridge (is_manager). A partial unique index caps it at one across the instance. Includes 'error' status so the deep-link flow and the periodic capability re-check can still find and reconcile it.

func (*Queries) GetModelGrant added in v0.4.0

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

Resolve a grant id to its (provider, model) so a revoke can find and reset the agent overrides that referenced the now-disallowed model.

func (*Queries) GetOAuthClient added in v0.4.0

func (q *Queries) GetOAuthClient(ctx context.Context, clientID string) (OauthClient, error)

func (*Queries) GetOAuthState

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

func (*Queries) GetOAuthStateForResource added in v0.4.0

func (q *Queries) GetOAuthStateForResource(ctx context.Context, resourceID pgtype.UUID) (OauthState, error)

func (*Queries) GetOAuthStateForUpdate added in v0.4.0

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

func (*Queries) GetOrCreateBridgeAuthedConversation added in v0.4.0

func (q *Queries) GetOrCreateBridgeAuthedConversation(ctx context.Context, arg GetOrCreateBridgeAuthedConversationParams) (AgentConversation, error)

Authed bridge: one thread per (agent, user, bridge, external_id) — the same user reaching the same agent through a different bridge is a different conversation, and the same user in a different chat is also a different conversation (external_id covers that axis). Upserts on idx_conversations_bridge_authed; conflict target must match the partial index's keys + predicate so Postgres infers it.

func (*Queries) GetPlatformIdentity

func (q *Queries) GetPlatformIdentity(ctx context.Context, arg GetPlatformIdentityParams) (PlatformIdentity, error)

Look up Airlock user by their platform identity

func (*Queries) GetPlatformIdentityByID added in v0.4.0

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

Fetch a single identity by its row id. Used by the Unlink service path to resolve the owner before authz.AuthorizeOwnedResource gates the delete.

func (*Queries) GetPrincipalKind added in v0.6.1

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

func (*Queries) GetProviderByID

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

func (*Queries) GetProviderByIDForUpdate added in v0.4.1

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

func (*Queries) GetProviderModel added in v0.4.1

func (q *Queries) GetProviderModel(ctx context.Context, arg GetProviderModelParams) (ProviderModel, error)

func (*Queries) GetProvisionalConnectionForNeedOwner added in v0.4.0

func (q *Queries) GetProvisionalConnectionForNeedOwner(ctx context.Context, arg GetProvisionalConnectionForNeedOwnerParams) (Connection, error)

func (*Queries) GetProvisionalMCPServerForNeedOwner added in v0.4.0

func (q *Queries) GetProvisionalMCPServerForNeedOwner(ctx context.Context, arg GetProvisionalMCPServerForNeedOwnerParams) (AgentMcpServer, error)

func (*Queries) GetPublicSystemStatus added in v0.6.1

func (q *Queries) GetPublicSystemStatus(ctx context.Context) (GetPublicSystemStatusRow, error)

Reads activation state and locale from one statement snapshot so concurrent activation cannot expose a tenant paired with the pre-activation locale.

func (*Queries) GetRefreshTokenByHash added in v0.4.0

func (q *Queries) GetRefreshTokenByHash(ctx context.Context, tokenHash []byte) (OauthRefreshToken, error)

func (*Queries) GetRefreshTokenByHashForUpdate added in v0.4.0

func (q *Queries) GetRefreshTokenByHashForUpdate(ctx context.Context, tokenHash []byte) (OauthRefreshToken, error)

func (*Queries) GetResourceNeed added in v0.4.0

func (q *Queries) GetResourceNeed(ctx context.Context, arg GetResourceNeedParams) (AgentResourceNeed, error)

func (*Queries) GetResourceNeedForUpdate added in v0.4.0

func (q *Queries) GetResourceNeedForUpdate(ctx context.Context, arg GetResourceNeedForUpdateParams) (AgentResourceNeed, error)

func (*Queries) GetRunByID

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

func (*Queries) GetRunByIDAndAgent added in v0.4.0

func (q *Queries) GetRunByIDAndAgent(ctx context.Context, arg GetRunByIDAndAgentParams) (Run, error)

func (*Queries) GetRunCheckpoint

func (q *Queries) GetRunCheckpoint(ctx context.Context, arg GetRunCheckpointParams) ([]byte, error)

func (*Queries) GetRunningRunForJobEnqueue added in v0.5.0

func (q *Queries) GetRunningRunForJobEnqueue(ctx context.Context, arg GetRunningRunForJobEnqueueParams) (Run, error)

func (*Queries) GetSessionContextRevision added in v0.4.0

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

Opaque SessionStore revision. Including the active checkpoint seq prevents an empty post-clear context from reusing revision zero.

func (*Queries) GetSiblingMaxAccess added in v0.4.0

func (q *Queries) GetSiblingMaxAccess(ctx context.Context, arg GetSiblingMaxAccessParams) (string, error)

The per-edge max_access ceiling for a (parent → sibling) pair, read at A2A call time to admit the call and cap its effective access. No row means the target is not a declared sibling and the call is denied.

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 — there should be at most one

func (*Queries) GetSystemConversationByID added in v0.4.0

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

func (*Queries) GetSystemConversationByIDForUpdate added in v0.4.0

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

Serializes checkpoint claims across replicas. The caller keeps the lock through the exact suspended-run CAS and successor insert.

func (*Queries) GetSystemRunByID added in v0.4.0

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

func (*Queries) GetSystemSettings

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

func (*Queries) GetSystemSettingsForActivation added in v0.4.0

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

Serializes first-admin activation across replicas.

func (*Queries) GetSystemSettingsForUpdate added in v0.6.1

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

Serializes whole-row settings updates across replicas.

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) GetUserByCredentialID added in v0.4.0

func (q *Queries) GetUserByCredentialID(ctx context.Context, credentialID []byte) (User, error)

Resolve the owning user from a credential id — used by discoverable login to fetch the live user row after the assertion verifies.

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) GetUserByIDForUpdate added in v0.4.0

func (q *Queries) GetUserByIDForUpdate(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) HasActiveAgentJobAttempt added in v0.5.0

func (q *Queries) HasActiveAgentJobAttempt(ctx context.Context, jobID pgtype.UUID) (bool, error)

func (*Queries) HasActiveConnectorManagementTransition added in v0.6.1

func (q *Queries) HasActiveConnectorManagementTransition(ctx context.Context, connectorID pgtype.UUID) (bool, error)

func (*Queries) HasProviderLiveAssignments added in v0.4.1

func (q *Queries) HasProviderLiveAssignments(ctx context.Context, providerID pgtype.UUID) (bool, error)

func (*Queries) HasUserAgentGrant added in v0.4.0

func (q *Queries) HasUserAgentGrant(ctx context.Context, arg HasUserAgentGrantParams) (bool, error)

func (*Queries) HeartbeatConnector added in v0.6.1

func (q *Queries) HeartbeatConnector(ctx context.Context, arg HeartbeatConnectorParams) (ConnectorResource, error)

func (*Queries) IncrementAgentTokenVersion added in v0.4.0

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

func (*Queries) InsertAgentBuildJobHandler added in v0.5.0

func (q *Queries) InsertAgentBuildJobHandler(ctx context.Context, arg InsertAgentBuildJobHandlerParams) (int64, error)

func (*Queries) InsertAgentJob added in v0.5.0

func (q *Queries) InsertAgentJob(ctx context.Context, arg InsertAgentJobParams) (AgentJob, error)

func (*Queries) InsertAgentJobFromCron added in v0.5.0

func (q *Queries) InsertAgentJobFromCron(ctx context.Context, arg InsertAgentJobFromCronParams) (AgentJob, error)

func (*Queries) InsertConnectorJob added in v0.6.1

func (q *Queries) InsertConnectorJob(ctx context.Context, arg InsertConnectorJobParams) (ConnectorJob, error)

Durable connector work, token-fenced attempts, cancellation, and events.

func (*Queries) InsertConnectorTransfer added in v0.6.1

func (q *Queries) InsertConnectorTransfer(ctx context.Context, arg InsertConnectorTransferParams) (ConnectorTransfer, error)

Durable direct-storage transfer metadata, finalization, and cleanup claims.

func (*Queries) InsertHostManagementJob added in v0.6.1

func (q *Queries) InsertHostManagementJob(ctx context.Context, arg InsertHostManagementJobParams) (HostManagementJob, error)

func (*Queries) InsertLLMUsage added in v0.4.0

func (q *Queries) InsertLLMUsage(ctx context.Context, arg InsertLLMUsageParams) error

One append-only row per proxied model HTTP round-trip. Cost is computed at capture from the sol/provider token catalog; non-token units (image/audio/character) are recorded with cost 0 (not priced). Plain INSERT, no rate math here. run_id/user_id/conversation_id are nullable — an unattributed call still records its spend. id/created_at use defaults. agent_slug/agent_name/user_email are snapshotted from the referenced rows at write time (COALESCE to ” when absent) so the ledger row survives — and stays readable — after the agent or user is deleted. provider_slug is snapshotted by the caller (resolved from the providers row) for the same reason.

func (*Queries) InsertManualAgentJobFromCron added in v0.5.0

func (q *Queries) InsertManualAgentJobFromCron(ctx context.Context, arg InsertManualAgentJobFromCronParams) (AgentJob, error)

func (*Queries) InsertResourceOwnershipTransfer added in v0.6.1

func (q *Queries) InsertResourceOwnershipTransfer(ctx context.Context, arg InsertResourceOwnershipTransferParams) error

func (*Queries) InsertSystemAuditPending added in v0.4.0

func (q *Queries) InsertSystemAuditPending(ctx context.Context, arg InsertSystemAuditPendingParams) (int64, error)

Append an audit row BEFORE invoking the tool body. ok defaults to false / result_summary='pending' so a panic mid-tool leaves a visible trace. The follow-up UpdateSystemAudit flips ok + writes the real summary on completion.

func (*Queries) InterruptAgentJobAttempt added in v0.5.0

func (q *Queries) InterruptAgentJobAttempt(ctx context.Context, arg InterruptAgentJobAttemptParams) (int64, error)

func (*Queries) InterruptExpiredAgentJobAttempt added in v0.5.0

func (q *Queries) InterruptExpiredAgentJobAttempt(ctx context.Context, arg InterruptExpiredAgentJobAttemptParams) (int64, error)

func (*Queries) IsProviderModelReferenced added in v0.4.1

func (q *Queries) IsProviderModelReferenced(ctx context.Context, arg IsProviderModelReferencedParams) (bool, error)

func (*Queries) IsProviderReferenced added in v0.4.1

func (q *Queries) IsProviderReferenced(ctx context.Context, providerID pgtype.UUID) (bool, error)

func (*Queries) IsSystemDefaultModel added in v0.4.0

func (q *Queries) IsSystemDefaultModel(ctx context.Context, arg IsSystemDefaultModelParams) (bool, error)

Configured default models are always allowed (deny-by-default never locks out the baseline). True if (provider, model) matches any system_settings default capability pair.

func (*Queries) ListActiveAgentIDs added in v0.4.0

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

All agents in 'active' status. Used by the sibling-update broadcaster to fan a /refresh out to every running agent (cold containers no-op).

func (*Queries) ListActiveAgentJobAttempts added in v0.5.0

func (q *Queries) ListActiveAgentJobAttempts(ctx context.Context, arg ListActiveAgentJobAttemptsParams) ([]AgentJobAttempt, error)

func (*Queries) ListActiveBridges

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

All bridges to start polling on startup. Includes 'error' so a bridge that crashed during the previous run gets a fresh poll attempt — the next successful poll flips it back to 'active' via UpdateBridgeLastPolled.

func (*Queries) ListActiveConnectorOrchestrationsForConnector added in v0.6.1

func (q *Queries) ListActiveConnectorOrchestrationsForConnector(ctx context.Context, connectorID pgtype.UUID) ([]pgtype.UUID, error)

func (*Queries) ListAddableSiblings added in v0.4.0

func (q *Queries) ListAddableSiblings(ctx context.Context, arg ListAddableSiblingsParams) ([]ListAddableSiblingsRow, error)

Agents the parent MAY add as siblings: any agent its OWNER holds a grant on (a direct grant or a group in @owner_grantee_ids — incl. the All-Users group), excluding the parent itself and already-added siblings. Carries the candidate's owner name (a user's display_name or a group's name) so the picker can disambiguate same-named agents.

func (*Queries) ListAgentBuildBlockingJobs added in v0.5.0

func (q *Queries) ListAgentBuildBlockingJobs(ctx context.Context, arg ListAgentBuildBlockingJobsParams) ([]AgentJob, error)

func (*Queries) ListAgentBuildJobHandlers added in v0.5.0

func (q *Queries) ListAgentBuildJobHandlers(ctx context.Context, buildID pgtype.UUID) ([]AgentBuildJobHandler, error)

func (*Queries) ListAgentBuildsByAgent

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

func (*Queries) ListAgentEnvVars added in v0.2.12

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

For GET /api/v1/agents/{agentID}/env-vars (operator UI). Includes default_value so the UI can render it as a placeholder; secret rows always have default_value=” by RegisterEnvVar invariant.

func (*Queries) ListAgentGrantRowsForGrantees added in v0.4.0

func (q *Queries) ListAgentGrantRowsForGrantees(ctx context.Context, arg ListAgentGrantRowsForGranteesParams) ([]ListAgentGrantRowsForGranteesRow, error)

The (grantee_id, role) grants on @agent_id held by any grantee in @grantee_ids. The siblings service uses it to pick the authorizing grantee for a new edge — the highest-role grant in the parent owner's grantee-set.

func (*Queries) ListAgentGrants added in v0.4.0

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

The members UI list. A grantee is a user (per-user member) or a group (e.g. the built-in `user` group = "All users"); kind disambiguates and the label resolves from whichever subtype the grantee is.

func (*Queries) ListAgentGrantsForGrantees added in v0.4.0

func (q *Queries) ListAgentGrantsForGrantees(ctx context.Context, arg ListAgentGrantsForGranteesParams) ([]string, error)

The agent-access resolver: the roles granted on an agent to any principal in the caller's grantee-set (their own user principal + the role-groups they belong to). EffectiveAgentAccess folds these to the max.

func (*Queries) ListAgentIDsByGrantee added in v0.4.0

func (q *Queries) ListAgentIDsByGrantee(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 holds an explicit per-user grant on. Group-derived access is not expanded, so a shared-with-everyone agent doesn't fan a user out to every topic; the client subscribes to those on demand.

func (*Queries) ListAgentIDsUsingModel added in v0.4.1

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

Grant revocation locks every affected agent before it locks the provider. UNION removes agents referenced by more than one fixed override or slot; ORDER BY makes the subsequent LockAgentsByID call deterministic.

func (*Queries) ListAgentJobAttempts added in v0.5.0

func (q *Queries) ListAgentJobAttempts(ctx context.Context, jobID pgtype.UUID) ([]AgentJobAttempt, error)

func (*Queries) ListAgentJobCronsByAgent added in v0.5.0

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

func (*Queries) ListAgentJobsByAgent added in v0.5.0

func (q *Queries) ListAgentJobsByAgent(ctx context.Context, arg ListAgentJobsByAgentParams) ([]AgentJob, 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) ListAgentsForGitPolling added in v0.4.0

func (q *Queries) ListAgentsForGitPolling(ctx context.Context) ([]ListAgentsForGitPollingRow, error)

5-min polling fallback: returns agents with a remote + credential configured that are in a state where pulling makes sense (active or stopped — failed/draft agents shouldn't trigger rebuilds via webhook equivalent). Excludes agents currently in a build to avoid racing.

func (*Queries) ListAgentsVisibleToUser added in v0.4.0

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

Agents the caller can see: any agent carrying a grant to a principal in the caller's grantee-set (their own user principal — owners/members — or a role-group like the built-in `user` group for shared-with-everyone). The owner is always included because CreateAgent seeds the creator's admin grant.

func (*Queries) ListAllMessagesByConversation

func (q *Queries) ListAllMessagesByConversation(ctx context.Context, conversationID pgtype.UUID) ([]AgentMessage, error)

Persistence scan including model-only and UI-only rows. Run-grouped rows stay together in the slot of the run's first message; tiebreak by ephemeral (non-ephemeral first) then seq.

func (*Queries) ListAllWebConversationsByUser added in v0.4.0

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

Every web conversation the user owns, across all agents — backs the global sidebar list. Only source='web' (bridge is delivered over the bridge, a2a is sibling transport); the row carries agent_id so the UI can label each entry with its agent's name.

func (*Queries) ListAvailableConnections added in v0.4.0

func (q *Queries) ListAvailableConnections(ctx context.Context, arg ListAvailableConnectionsParams) ([]ListAvailableConnectionsRow, error)

Inventory includes owned resources and resources shared with any principal in the caller's grantee set. Owners implicitly hold every capability.

func (*Queries) ListAvailableConnectorTargetGroups added in v0.6.1

func (*Queries) ListAvailableConnectors added in v0.6.1

func (q *Queries) ListAvailableConnectors(ctx context.Context, arg ListAvailableConnectorsParams) ([]ListAvailableConnectorsRow, error)

func (*Queries) ListAvailableGitCredentials added in v0.6.1

func (q *Queries) ListAvailableGitCredentials(ctx context.Context, arg ListAvailableGitCredentialsParams) ([]ListAvailableGitCredentialsRow, error)

func (*Queries) ListAvailableMCPServers added in v0.4.0

func (q *Queries) ListAvailableMCPServers(ctx context.Context, arg ListAvailableMCPServersParams) ([]ListAvailableMCPServersRow, error)

func (*Queries) ListBoundMCPServersByAgent added in v0.4.0

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

The agent's bound MCP servers (resource rows), keyed by the NEED slug — for the sync-time tool-discovery sweep. Only bound needs have a server to probe.

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 an explicit per-user grant on, plus bridges the user owns that have since been orphaned (agent deleted but bridge preserved). The agent's creator is granted admin at agent-create time, so the grant 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 owner joined for the Owner column in the UI. owner_principal_id is NULL for system bridges (and for owner-deleted orphans, though those CASCADE today), 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) ListBridgesByOwner added in v0.4.0

func (q *Queries) ListBridgesByOwner(ctx context.Context, ownerPrincipalID pgtype.UUID) ([]pgtype.UUID, error)

All bridges owned by a specific user. Used by service/users.Delete to pre-stop the BridgeManager pollers before the ON DELETE CASCADE wipes the rows — leaving a goroutine polling a deleted row would race on token re-encryption if the user is re-created with the same id.

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) ListBuildingAgentBuilds added in v0.5.0

func (q *Queries) ListBuildingAgentBuilds(ctx context.Context) ([]ListBuildingAgentBuildsRow, error)

func (*Queries) ListCompatibleConnectorArtifactFiles added in v0.6.1

func (*Queries) ListConnectionConsumers added in v0.4.0

func (q *Queries) ListConnectionConsumers(ctx context.Context, resourceID pgtype.UUID) ([]ListConnectionConsumersRow, error)

func (*Queries) ListConnectionGrants added in v0.4.0

func (q *Queries) ListConnectionGrants(ctx context.Context, connectionID pgtype.UUID) ([]ListConnectionGrantsRow, error)

Stored capability grants are read by resource authorization. The owner holds view/bind/manage implicitly (see authz.HasResourceCapability).

func (*Queries) ListConnectionNeedsByAgent added in v0.4.0

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

The agent's connection needs joined to their bound resource (if any). The agent's local handle is the NEED slug; an unconfigured need surfaces with its declared spec shape and authorized=false so the operator can set it up. Drives the operator connections tab, the agent-detail bundle, and the prompt's "needs setup" hints — none of which should see another agent's slug.

func (*Queries) ListConnectionsAvailableToPrincipal added in v0.4.0

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

Resource lookups for reusable resource inventory and binding.

func (*Queries) ListConnectorCancellationNotices added in v0.6.1

func (q *Queries) ListConnectorCancellationNotices(ctx context.Context, connectorID pgtype.UUID) ([]ListConnectorCancellationNoticesRow, error)

func (*Queries) ListConnectorCancellationsForHost added in v0.6.1

func (q *Queries) ListConnectorCancellationsForHost(ctx context.Context, hostID pgtype.UUID) ([]ListConnectorCancellationsForHostRow, error)

func (*Queries) ListConnectorConsumers added in v0.6.1

func (q *Queries) ListConnectorConsumers(ctx context.Context, resourceID pgtype.UUID) ([]ListConnectorConsumersRow, error)

func (*Queries) ListConnectorGrantDetails added in v0.6.1

func (q *Queries) ListConnectorGrantDetails(ctx context.Context, connectorID pgtype.UUID) ([]ListConnectorGrantDetailsRow, error)

func (*Queries) ListConnectorGrants added in v0.6.1

func (q *Queries) ListConnectorGrants(ctx context.Context, connectorID pgtype.UUID) ([]ListConnectorGrantsRow, error)

func (*Queries) ListConnectorInventoryGroupIDs added in v0.6.1

func (q *Queries) ListConnectorInventoryGroupIDs(ctx context.Context, connectorID pgtype.UUID) ([]pgtype.UUID, error)

func (*Queries) ListConnectorJobEvents added in v0.6.1

func (q *Queries) ListConnectorJobEvents(ctx context.Context, arg ListConnectorJobEventsParams) ([]ConnectorJobEvent, error)

func (*Queries) ListConnectorJobsByOrchestration added in v0.6.1

func (q *Queries) ListConnectorJobsByOrchestration(ctx context.Context, orchestrationID pgtype.UUID) ([]ConnectorJob, error)

func (*Queries) ListConnectorOrchestrationReadiness added in v0.6.1

func (q *Queries) ListConnectorOrchestrationReadiness(ctx context.Context, orchestrationID pgtype.UUID) ([]ListConnectorOrchestrationReadinessRow, error)

func (*Queries) ListConnectorTargetGroupGrants added in v0.6.1

func (q *Queries) ListConnectorTargetGroupGrants(ctx context.Context, connectorTargetGroupID pgtype.UUID) ([]ListConnectorTargetGroupGrantsRow, error)

func (*Queries) ListConnectorTargetGroupMembers added in v0.6.1

func (q *Queries) ListConnectorTargetGroupMembers(ctx context.Context, groupID pgtype.UUID) ([]ListConnectorTargetGroupMembersRow, error)

func (*Queries) ListConnectorTargetGroups added in v0.6.1

func (q *Queries) ListConnectorTargetGroups(ctx context.Context, arg ListConnectorTargetGroupsParams) ([]ListConnectorTargetGroupsRow, error)

func (*Queries) ListConnectorsAvailableToPrincipal added in v0.6.1

func (q *Queries) ListConnectorsAvailableToPrincipal(ctx context.Context, principalIds []pgtype.UUID) ([]ConnectorResource, error)

func (*Queries) ListConversationFeed added in v0.4.0

func (q *Queries) ListConversationFeed(ctx context.Context, arg ListConversationFeedParams) ([]ListConversationFeedRow, error)

Merged sidebar feed: the user's web agent-conversations + system conversations as one stream, keyset-paginated by (updated_at, id) DESC so the windowed sidebar can page without loading everything. The first page passes cursor_updated='infinity' and cursor_id = the max uuid.

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 in the web UI. source='a2a' rows are a sibling-call transport detail (the called agent never "chats" them) and are excluded — surfacing them would also expose a delegated suspension as an actionable card here.

func (*Queries) ListCredentialsByUserID added in v0.4.0

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

func (*Queries) ListDirectoriesByAgent added in v0.2.0

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

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) ListEnabledProviderModels added in v0.4.1

func (q *Queries) ListEnabledProviderModels(ctx context.Context) ([]ListEnabledProviderModelsRow, error)

func (*Queries) ListExpiringConnections

func (q *Queries) ListExpiringConnections(ctx context.Context, expiryThreshold pgtype.Timestamptz) ([]ListExpiringConnectionsRow, error)

For the refresh job: OAuth tokens expiring within the buffer window that back at least one active agent's bound need (a connection bound only to suspended or stopped agents doesn't need a pre-warmed token).

func (*Queries) ListExpiringMCPServers

func (q *Queries) ListExpiringMCPServers(ctx context.Context, expiryThreshold pgtype.Timestamptz) ([]ListExpiringMCPServersRow, error)

For the refresh job: OAuth tokens expiring within the buffer window that back at least one active agent's bound need.

func (*Queries) ListGitCredentialGrants added in v0.4.0

func (q *Queries) ListGitCredentialGrants(ctx context.Context, gitCredentialID pgtype.UUID) ([]ListGitCredentialGrantsRow, error)

func (*Queries) ListGitCredentialsByUser added in v0.4.0

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

Omits token_ref by design — listing should never need to read the encrypted blob. Defense in depth against accidental token leaks.

func (*Queries) ListGrantsForUser added in v0.4.0

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

Drives the "Connected apps" section in Settings. Joins clients + agents so the UI can show "Claude → weather (granted 5 days ago)".

func (*Queries) ListHostGrants added in v0.6.1

func (q *Queries) ListHostGrants(ctx context.Context, hostID pgtype.UUID) ([]ListHostGrantsRow, error)

func (*Queries) ListHostManagementEvents added in v0.6.1

func (q *Queries) ListHostManagementEvents(ctx context.Context, jobID pgtype.UUID) ([]HostManagementEvent, error)

func (*Queries) ListHostManagementJobs added in v0.6.1

func (q *Queries) ListHostManagementJobs(ctx context.Context, arg ListHostManagementJobsParams) ([]HostManagementJob, error)

func (*Queries) ListHostedConnectors added in v0.6.1

func (q *Queries) ListHostedConnectors(ctx context.Context, hostID pgtype.UUID) ([]ConnectorResource, error)

func (*Queries) ListHosts added in v0.6.1

func (q *Queries) ListHosts(ctx context.Context, arg ListHostsParams) ([]ListHostsRow, error)

func (*Queries) ListInboundSiblings added in v0.4.0

func (q *Queries) ListInboundSiblings(ctx context.Context, siblingAgentID pgtype.UUID) ([]ListInboundSiblingsRow, error)

The reverse of ListSiblings: every agent that has added @sibling_agent_id to its address book, with the per-edge ceiling, the live authorizing-grant role on THIS agent, and the parent's owner name (a user's display_name or a group's name). Lets the target's admin see who can reach in, at what level. Inner join on the authorizing grant (guaranteed by the cascade FK).

func (*Queries) ListJobHandlersByAgent added in v0.5.0

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

func (*Queries) ListMCPNeedsByAgent added in v0.4.0

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

The agent's MCP needs joined to their bound server (if any), keyed by the NEED slug. Unconfigured needs surface with the declared spec shape and authorized=false. Drives the operator MCP tab.

func (*Queries) ListMCPServerConsumers added in v0.4.0

func (q *Queries) ListMCPServerConsumers(ctx context.Context, resourceID pgtype.UUID) ([]ListMCPServerConsumersRow, error)

func (*Queries) ListMCPServerGrants added in v0.4.0

func (q *Queries) ListMCPServerGrants(ctx context.Context, mcpServerID pgtype.UUID) ([]ListMCPServerGrantsRow, error)

func (*Queries) ListMCPServersAvailableToPrincipal added in v0.4.0

func (q *Queries) ListMCPServersAvailableToPrincipal(ctx context.Context, principalIds []pgtype.UUID) ([]AgentMcpServer, error)

func (*Queries) ListMessagesBackward

func (q *Queries) ListMessagesBackward(ctx context.Context, arg ListMessagesBackwardParams) ([]AgentMessage, error)

Older human transcript page for infinite-scroll-up. Returns up to @lim display 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 human transcript page: the 100 most recent display messages, returned in chronological order. Model-only compaction rows are projected out by source. 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 human transcript page for scroll-down after eviction. Returns up to @lim display messages with seq strictly greater than @after, in chronological order.

func (*Queries) ListModelGrants added in v0.4.0

func (q *Queries) ListModelGrants(ctx context.Context) ([]ListModelGrantsRow, error)

func (*Queries) ListModelGrantsForGrantees added in v0.4.0

func (q *Queries) ListModelGrantsForGrantees(ctx context.Context, granteeIds []pgtype.UUID) ([]ListModelGrantsForGranteesRow, error)

The (provider row, model) pairs granted to any principal in the caller's grantee set — the models a non-admin caller may assign. Powers the model picker's allow-list (defaults aren't listed; the caller leaves a slot unset to fall back to the capability default).

func (*Queries) ListNonterminalJobHandlerVersions added in v0.5.0

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

func (*Queries) ListObservedArtifactCandidates added in v0.6.1

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) ListPausedAgentDeployments added in v0.5.0

func (q *Queries) ListPausedAgentDeployments(ctx context.Context) ([]ListPausedAgentDeploymentsRow, error)

func (*Queries) ListPlatformIdentitiesAll added in v0.4.0

func (q *Queries) ListPlatformIdentitiesAll(ctx context.Context) ([]ListPlatformIdentitiesAllRow, error)

Admin variant: every platform identity in the tenant joined with the owning user's email + display_name for display in the admin UI. Gated behind authz.TenantIdentityManageAll; non-admin callers must use ListPlatformIdentitiesByUser.

func (*Queries) ListPlatformIdentitiesByUser

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

func (*Queries) ListProviderModels added in v0.4.1

func (q *Queries) ListProviderModels(ctx context.Context, configuredProviderID pgtype.UUID) ([]ProviderModel, error)

func (*Queries) ListProviders

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

func (*Queries) ListProvidersByCatalogID added in v0.2.15

func (q *Queries) ListProvidersByCatalogID(ctx context.Context, providerID string) ([]Provider, error)

All configured rows for a single catalog provider — used by the frontend to fan out picker entries (one per configured row × model).

func (*Queries) ListRebuildableAgents added in v0.4.0

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

Agents the SDK-bump mass rebuild iterates over. An empty image_ref means no successful build yet (draft / failed initial build) — nothing to re-image. Status='stopped' agents are included: a fleet SDK bump should re-image them so they're ready when the operator starts them again. Order by created_at ASC for deterministic iteration order across replicas (advisory-locked single-runner per agent prevents real races, but predictable order eases debugging).

func (*Queries) ListRequiredConnectionScopes added in v0.4.0

func (q *Queries) ListRequiredConnectionScopes(ctx context.Context, arg ListRequiredConnectionScopesParams) ([]string, error)

func (*Queries) ListRequiredMCPScopes added in v0.4.0

func (q *Queries) ListRequiredMCPScopes(ctx context.Context, arg ListRequiredMCPScopesParams) ([]string, error)

func (*Queries) ListResourceGrantDetails added in v0.6.1

func (q *Queries) ListResourceGrantDetails(ctx context.Context, arg ListResourceGrantDetailsParams) ([]ListResourceGrantDetailsRow, error)

func (*Queries) ListResourceNeedsByAgent added in v0.4.0

func (q *Queries) ListResourceNeedsByAgent(ctx context.Context, agentID pgtype.UUID) ([]ListResourceNeedsByAgentRow, 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) ListSchedulesWithNextFire added in v0.4.0

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

func (*Queries) ListSessionMessagesByConversation

func (q *Queries) ListSessionMessagesByConversation(ctx context.Context, conversationID pgtype.UUID) ([]AgentMessage, error)

Agent context loading — excludes ephemeral messages (output() / topic publish) 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) ListSiblings added in v0.4.0

func (q *Queries) ListSiblings(ctx context.Context, parentAgentID pgtype.UUID) ([]ListSiblingsRow, error)

The parent's address book with the data the prompt renderer needs (id, slug, name, description), the per-edge max_access ceiling, and the current role of the grant that authorizes the edge — so the service can show the live effective ceiling = min(max_access, authorizing role). The cascade FK guarantees the authorizing grant row exists, so the join is inner.

func (*Queries) ListStoredSecrets added in v0.4.0

func (q *Queries) ListStoredSecrets(ctx context.Context) ([]ListStoredSecretsRow, error)

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.error WS event.

func (*Queries) ListSubscribedConversations

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

func (*Queries) ListSubscribedConversationsForUser added in v0.4.0

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

func (*Queries) ListSystemConversationsByUser added in v0.4.0

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

Web-UI sidebar. Bridge-routed threads (source='bridge') are intentionally hidden — they live on Telegram, the operator can't meaningfully resume them from the web, and surfacing them would leak bot-driven chat into the operator's conversation list. Ordered by updated_at DESC so the most-recently-active web conversation is first. Covered by (user_id, updated_at DESC).

func (*Queries) ListSystemMessagesByConversation added in v0.4.0

func (q *Queries) ListSystemMessagesByConversation(ctx context.Context, conversationID pgtype.UUID) ([]SystemMessage, error)

Used by sol.SessionStore.Load: returns post-checkpoint messages in canonical seq order, skipping checkpoint-marker rows (UI-only, never sent to the LLM). When no checkpoint is set, returns the full conversation history.

func (*Queries) ListSystemMessagesByConversationAfter added in v0.4.0

func (q *Queries) ListSystemMessagesByConversationAfter(ctx context.Context, arg ListSystemMessagesByConversationAfterParams) ([]SystemMessage, error)

Pagination cursor for the UI: rows with seq > the client's last known seq, capped at @max_rows. Used to backfill on reconnect.

func (*Queries) ListSystemMessagesByConversationAll added in v0.4.0

func (q *Queries) ListSystemMessagesByConversationAll(ctx context.Context, conversationID pgtype.UUID) ([]SystemMessage, error)

Returns every row including pre-checkpoint history + checkpoint markers. Used by the UI message list (so the operator still sees everything that happened in the conversation), separate from the LLM context load above.

func (*Queries) ListSystemRunsByUser added in v0.4.0

func (q *Queries) ListSystemRunsByUser(ctx context.Context, arg ListSystemRunsByUserParams) ([]ListSystemRunsByUserRow, error)

Caller's runs across all their conversations, paginated by started_at. JOINs system_conversations for the conversation title so the operator's activity view doesn't need a second per-row fetch.

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) ListUserAgentGrants added in v0.4.0

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

For sysagent's whoami tool: one row per agent the user holds an explicit per-user grant on, with role + the agent's slug/name. Group-derived access (shared-with-everyone) is intentionally not expanded here.

func (*Queries) ListUserSessionsByUser added in v0.4.0

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

func (*Queries) ListUsers

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

func (*Queries) ListVisibleSiblings added in v0.4.0

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

Dispatch-time: the sibling agent IDs the run's user may A2A-call from the parent — those where the driving user (via @grantee_ids) holds a grant. Anonymous / cron / webhook runs pass an empty set and get nothing (they can't A2A in v1).

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) LockAgentForDueJob added in v0.5.0

func (q *Queries) LockAgentForDueJob(ctx context.Context, arg LockAgentForDueJobParams) (pgtype.UUID, error)

func (*Queries) LockAgentJobDispatch added in v0.5.0

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

func (*Queries) LockAgentsByID added in v0.4.0

func (q *Queries) LockAgentsByID(ctx context.Context, ids []pgtype.UUID) ([]pgtype.UUID, error)

func (*Queries) LockConnectionAuthorizationNeeds added in v0.4.0

func (q *Queries) LockConnectionAuthorizationNeeds(ctx context.Context, arg LockConnectionAuthorizationNeedsParams) ([]AgentResourceNeed, error)

OAuth transactions lock the target agent first, then these need rows by UUID, then the resource row, and finally the initiating user. The locked scope union cannot change underneath callback validation.

func (*Queries) LockConnectionBindings added in v0.4.0

func (q *Queries) LockConnectionBindings(ctx context.Context, resourceID pgtype.UUID) ([]pgtype.UUID, error)

Resource deletion takes bound need rows before the resource row so it uses the same need -> resource order as bind, callback, and token resolution.

func (*Queries) LockConnectionResource added in v0.4.0

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

func (*Queries) LockConnectorBindings added in v0.6.1

func (q *Queries) LockConnectorBindings(ctx context.Context, resourceID pgtype.UUID) ([]pgtype.UUID, error)

func (*Queries) LockConnectorInventoryBindings added in v0.6.1

func (q *Queries) LockConnectorInventoryBindings(ctx context.Context, connectorID pgtype.UUID) ([]pgtype.UUID, error)

func (*Queries) LockConnectorInventoryMemberships added in v0.6.1

func (q *Queries) LockConnectorInventoryMemberships(ctx context.Context, connectorID pgtype.UUID) ([]pgtype.UUID, error)

func (*Queries) LockConnectorInventoryReservations added in v0.6.1

func (q *Queries) LockConnectorInventoryReservations(ctx context.Context, connectorID pgtype.UUID) ([]pgtype.UUID, error)

func (*Queries) LockConnectorResource added in v0.6.1

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

func (*Queries) LockConnectorTargetGroup added in v0.6.1

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

func (*Queries) LockGitCredentialResource added in v0.4.0

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

func (*Queries) LockHostForInventory added in v0.6.1

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

func (*Queries) LockHostResource added in v0.6.1

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

func (*Queries) LockMCPAuthorizationNeeds added in v0.4.0

func (q *Queries) LockMCPAuthorizationNeeds(ctx context.Context, arg LockMCPAuthorizationNeedsParams) ([]AgentResourceNeed, error)

func (*Queries) LockMCPBindings added in v0.4.0

func (q *Queries) LockMCPBindings(ctx context.Context, resourceID pgtype.UUID) ([]pgtype.UUID, error)

func (*Queries) LockMCPServerResource added in v0.4.0

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

func (*Queries) LockOAuthGrantLifecycle added in v0.4.0

func (q *Queries) LockOAuthGrantLifecycle(ctx context.Context, arg LockOAuthGrantLifecycleParams) error

Serialize consent creation, consent decisions, and revocation for one grant identity. Hash collisions only serialize unrelated grants.

func (*Queries) LockProvidersByID added in v0.4.1

func (q *Queries) LockProvidersByID(ctx context.Context, ids []pgtype.UUID) ([]pgtype.UUID, error)

func (*Queries) LockQualifyingConnectionBindings added in v0.4.0

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

func (*Queries) LockQualifyingMCPBindings added in v0.4.0

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

func (*Queries) LockResourceNeedsByAgent added in v0.4.0

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

func (*Queries) LockRunningRunForConnectorTransfer added in v0.6.1

func (q *Queries) LockRunningRunForConnectorTransfer(ctx context.Context, arg LockRunningRunForConnectorTransferParams) (pgtype.UUID, error)

func (*Queries) LockUsersForAdminMutation added in v0.4.0

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

func (*Queries) MarkAgentBuildJobManifestExtracted added in v0.5.0

func (q *Queries) MarkAgentBuildJobManifestExtracted(ctx context.Context, arg MarkAgentBuildJobManifestExtractedParams) (int64, error)

func (*Queries) MarkConnectorOffline added in v0.6.1

func (q *Queries) MarkConnectorOffline(ctx context.Context, arg MarkConnectorOfflineParams) (int64, error)

func (*Queries) MarkMissingHostedConnectorsOffline added in v0.6.1

func (q *Queries) MarkMissingHostedConnectorsOffline(ctx context.Context, arg MarkMissingHostedConnectorsOfflineParams) (int64, error)

func (*Queries) MarkRefreshConsumed added in v0.4.0

func (q *Queries) MarkRefreshConsumed(ctx context.Context, tokenHash []byte) (OauthRefreshToken, error)

func (*Queries) MarkStaleConnectorsOffline added in v0.6.1

func (q *Queries) MarkStaleConnectorsOffline(ctx context.Context, arg MarkStaleConnectorsOfflineParams) ([]ConnectorResource, error)

func (*Queries) PauseAgentJobDispatch added in v0.5.0

func (q *Queries) PauseAgentJobDispatch(ctx context.Context, arg PauseAgentJobDispatchParams) (PauseAgentJobDispatchRow, 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) PruneTerminalAgentJobs added in v0.5.0

func (q *Queries) PruneTerminalAgentJobs(ctx context.Context, arg PruneTerminalAgentJobsParams) (int64, error)

func (*Queries) PublishConnectorInterface added in v0.6.1

func (q *Queries) PublishConnectorInterface(ctx context.Context, arg PublishConnectorInterfaceParams) (ConnectorResource, error)

func (*Queries) QueueUnreferencedConnectorArtifactBlobs added in v0.6.1

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

func (*Queries) ReconcileKnownConnectorInventory added in v0.6.1

func (q *Queries) ReconcileKnownConnectorInventory(ctx context.Context, arg ReconcileKnownConnectorInventoryParams) (ConnectorResource, error)

func (*Queries) ReconcileManagerBridge added in v0.4.0

func (q *Queries) ReconcileManagerBridge(ctx context.Context, arg ReconcileManagerBridgeParams) error

Refresh the manager bridge's live identity/capability from a getMe poll: bot_username (Telegram handles can change) + manager_error (” when the can_manage_bots capability is healthy).

func (*Queries) ReconcileManualConnectorInventory added in v0.6.1

func (q *Queries) ReconcileManualConnectorInventory(ctx context.Context, arg ReconcileManualConnectorInventoryParams) (ConnectorResource, error)

func (*Queries) RecordAuthFailure

func (q *Queries) RecordAuthFailure(ctx context.Context, arg RecordAuthFailureParams) error

func (*Queries) RefreshConnectorArtifactRetention added in v0.6.1

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

func (*Queries) ReleaseConnectorArtifactBlobDeletion added in v0.6.1

func (q *Queries) ReleaseConnectorArtifactBlobDeletion(ctx context.Context, arg ReleaseConnectorArtifactBlobDeletionParams) (int64, error)

func (*Queries) ReleaseConnectorExportFinalization added in v0.6.1

func (q *Queries) ReleaseConnectorExportFinalization(ctx context.Context, arg ReleaseConnectorExportFinalizationParams) (int64, error)

func (*Queries) ReleaseConnectorTransferCleanup added in v0.6.1

func (q *Queries) ReleaseConnectorTransferCleanup(ctx context.Context, arg ReleaseConnectorTransferCleanupParams) (int64, error)

func (*Queries) ReleaseHeldConnectorJobs added in v0.6.1

func (q *Queries) ReleaseHeldConnectorJobs(ctx context.Context, arg ReleaseHeldConnectorJobsParams) ([]ConnectorJob, error)

func (*Queries) ReleaseMCPActiveRequestReservation added in v0.4.0

func (q *Queries) ReleaseMCPActiveRequestReservation(ctx context.Context, arg ReleaseMCPActiveRequestReservationParams) error

Early validation or dispatch failures release only an unbound reservation.

func (*Queries) RemoveConnectorTargetGroupMember added in v0.6.1

func (q *Queries) RemoveConnectorTargetGroupMember(ctx context.Context, arg RemoveConnectorTargetGroupMemberParams) (int64, error)

func (*Queries) RemoveSibling added in v0.4.0

func (q *Queries) RemoveSibling(ctx context.Context, arg RemoveSiblingParams) error

func (*Queries) RenameConnection added in v0.4.0

func (q *Queries) RenameConnection(ctx context.Context, arg RenameConnectionParams) (int64, error)

func (*Queries) RenameConnector added in v0.6.1

func (q *Queries) RenameConnector(ctx context.Context, arg RenameConnectorParams) (int64, error)

func (*Queries) RenameCredential added in v0.4.0

func (q *Queries) RenameCredential(ctx context.Context, arg RenameCredentialParams) error

func (*Queries) RenameMCPServer added in v0.4.0

func (q *Queries) RenameMCPServer(ctx context.Context, arg RenameMCPServerParams) (int64, error)

func (*Queries) RenameSystemConversation added in v0.4.0

func (q *Queries) RenameSystemConversation(ctx context.Context, arg RenameSystemConversationParams) error

func (*Queries) RenewActiveConnectorJobAttempt added in v0.6.1

func (q *Queries) RenewActiveConnectorJobAttempt(ctx context.Context, arg RenewActiveConnectorJobAttemptParams) (int64, error)

func (*Queries) RenewAgentJobAttemptLease added in v0.5.0

func (q *Queries) RenewAgentJobAttemptLease(ctx context.Context, arg RenewAgentJobAttemptLeaseParams) (int64, error)

func (*Queries) RenewConnectorExportFinalizationLease added in v0.6.1

func (q *Queries) RenewConnectorExportFinalizationLease(ctx context.Context, arg RenewConnectorExportFinalizationLeaseParams) (int64, error)

func (*Queries) RenewConnectorJobAttemptForHost added in v0.6.1

func (q *Queries) RenewConnectorJobAttemptForHost(ctx context.Context, arg RenewConnectorJobAttemptForHostParams) (int64, error)

func (*Queries) RenewConnectorTransferCleanupLease added in v0.6.1

func (q *Queries) RenewConnectorTransferCleanupLease(ctx context.Context, arg RenewConnectorTransferCleanupLeaseParams) (int64, error)

func (*Queries) RenewHostManagementAttempt added in v0.6.1

func (q *Queries) RenewHostManagementAttempt(ctx context.Context, arg RenewHostManagementAttemptParams) (int64, error)

func (*Queries) ReplaceConnectionNeedBinding added in v0.4.0

func (q *Queries) ReplaceConnectionNeedBinding(ctx context.Context, arg ReplaceConnectionNeedBindingParams) (int64, error)

func (*Queries) ReplaceMCPServerNeedBinding added in v0.4.0

func (q *Queries) ReplaceMCPServerNeedBinding(ctx context.Context, arg ReplaceMCPServerNeedBindingParams) (int64, error)

func (*Queries) RequestConnectorOrchestrationCancellation added in v0.6.1

func (q *Queries) RequestConnectorOrchestrationCancellation(ctx context.Context, arg RequestConnectorOrchestrationCancellationParams) (ConnectorOrchestration, error)

func (*Queries) RequestCurrentAgentBuildCancellation added in v0.5.0

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

func (*Queries) RequestRunningAgentJobCancellation added in v0.5.0

func (q *Queries) RequestRunningAgentJobCancellation(ctx context.Context, arg RequestRunningAgentJobCancellationParams) (AgentJob, error)

func (*Queries) ReserveAddedConnectorTargetGroupMember added in v0.6.1

func (q *Queries) ReserveAddedConnectorTargetGroupMember(ctx context.Context, arg ReserveAddedConnectorTargetGroupMemberParams) error

func (*Queries) ReserveConnectorForNeed added in v0.6.1

func (q *Queries) ReserveConnectorForNeed(ctx context.Context, arg ReserveConnectorForNeedParams) error

func (*Queries) ReserveConnectorTargetGroupForNeed added in v0.6.1

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

func (*Queries) ReserveMCPActiveRequest added in v0.4.0

func (q *Queries) ReserveMCPActiveRequest(ctx context.Context, arg ReserveMCPActiveRequestParams) (int64, error)

JSON-RPC requires request IDs to remain unique while requests are active. Reserve before dispatch so cancellation can consume the request even before its run exists. An expired reservation may be replaced atomically.

func (*Queries) ResolveBoundConnection added in v0.4.0

func (q *Queries) ResolveBoundConnection(ctx context.Context, arg ResolveBoundConnectionParams) (Connection, error)

Runtime resolution: a need's slug resolves to its bound resource row. The credential proxy then keys off the resolved resource's own id/owner, never the calling agent — that is what lets one resource back many agents.

func (*Queries) ResolveBoundConnector added in v0.6.1

func (q *Queries) ResolveBoundConnector(ctx context.Context, arg ResolveBoundConnectorParams) (ResolveBoundConnectorRow, error)

func (*Queries) ResolveBoundMCPServer added in v0.4.0

func (q *Queries) ResolveBoundMCPServer(ctx context.Context, arg ResolveBoundMCPServerParams) (AgentMcpServer, error)

func (*Queries) ResolvePrincipalNames added in v0.4.0

func (q *Queries) ResolvePrincipalNames(ctx context.Context, ids []pgtype.UUID) ([]ResolvePrincipalNamesRow, error)

Resolve principal ids to a display name: a user's display_name or a group's name (a principal is one or the other). Used to label an agent's owner.

func (*Queries) ResolveSuspendedRun

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

func (*Queries) ResolveSuspendedSystemRun added in v0.4.0

func (q *Queries) ResolveSuspendedSystemRun(ctx context.Context, arg ResolveSuspendedSystemRunParams) (int64, error)

Confirmation checkpoints are single-use. The conversation id participates in the CAS so a run from another conversation cannot be consumed.

func (*Queries) ResumeAgentJobDispatch added in v0.5.0

func (q *Queries) ResumeAgentJobDispatch(ctx context.Context, arg ResumeAgentJobDispatchParams) (Agent, error)

func (*Queries) RetryAgentJob added in v0.5.0

func (q *Queries) RetryAgentJob(ctx context.Context, arg RetryAgentJobParams) (int64, error)

func (*Queries) RetryAgentJobAttempt added in v0.5.0

func (q *Queries) RetryAgentJobAttempt(ctx context.Context, arg RetryAgentJobAttemptParams) (int64, error)

func (*Queries) RetryAgentJobForDeployment added in v0.5.0

func (q *Queries) RetryAgentJobForDeployment(ctx context.Context, arg RetryAgentJobForDeploymentParams) (int64, error)

func (*Queries) RetryTerminalAgentJob added in v0.5.0

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

func (*Queries) RevokeGrant added in v0.4.0

func (q *Queries) RevokeGrant(ctx context.Context, arg RevokeGrantParams) (int64, error)

Marks a grant revoked. Caller also calls RevokeRefreshForGrant in the same handler so already-issued refresh tokens stop working.

func (*Queries) RevokeModelGrant added in v0.4.0

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

func (*Queries) RevokeRefreshFamily added in v0.4.0

func (q *Queries) RevokeRefreshFamily(ctx context.Context, familyID pgtype.UUID) (int64, error)

Reuse detection: nukes every still-rotatable token in the family. Already-consumed rows stay (we keep them for forensic 7d before GC) so we WHERE consumed_at IS NULL to avoid no-op updates.

func (*Queries) RevokeRefreshForGrant added in v0.4.0

func (q *Queries) RevokeRefreshForGrant(ctx context.Context, arg RevokeRefreshForGrantParams) (int64, error)

Called when a user revokes an oauth_grants row from the UI. Marks every still-active refresh in that (user, client, agent) as consumed, so the next refresh attempt fails. Already-issued access tokens (15min) survive until expiry — surfaced in the UI tooltip.

func (*Queries) RevokeUserSessionByID added in v0.4.0

func (q *Queries) RevokeUserSessionByID(ctx context.Context, arg RevokeUserSessionByIDParams) (int64, error)

func (*Queries) RevokeUserSessionByRefreshHash added in v0.4.0

func (q *Queries) RevokeUserSessionByRefreshHash(ctx context.Context, refreshTokenHash []byte) (int64, error)

func (*Queries) RewrapAgentSecret added in v0.4.0

func (q *Queries) RewrapAgentSecret(ctx context.Context, arg RewrapAgentSecretParams) (int64, error)

func (*Queries) RewrapBridgeSecret added in v0.4.0

func (q *Queries) RewrapBridgeSecret(ctx context.Context, arg RewrapBridgeSecretParams) (int64, error)

func (*Queries) RewrapConnectionSecret added in v0.4.0

func (q *Queries) RewrapConnectionSecret(ctx context.Context, arg RewrapConnectionSecretParams) (int64, error)

func (*Queries) RewrapEnvVarSecret added in v0.4.0

func (q *Queries) RewrapEnvVarSecret(ctx context.Context, arg RewrapEnvVarSecretParams) (int64, error)

func (*Queries) RewrapGitCredentialSecret added in v0.4.0

func (q *Queries) RewrapGitCredentialSecret(ctx context.Context, arg RewrapGitCredentialSecretParams) (int64, error)

func (*Queries) RewrapHostManagementSecret added in v0.6.1

func (q *Queries) RewrapHostManagementSecret(ctx context.Context, arg RewrapHostManagementSecretParams) (int64, error)

func (*Queries) RewrapMCPSecret added in v0.4.0

func (q *Queries) RewrapMCPSecret(ctx context.Context, arg RewrapMCPSecretParams) (int64, error)

func (*Queries) RewrapOAuthStateSecret added in v0.4.0

func (q *Queries) RewrapOAuthStateSecret(ctx context.Context, arg RewrapOAuthStateSecretParams) (int64, error)

func (*Queries) RewrapProviderSecret added in v0.4.0

func (q *Queries) RewrapProviderSecret(ctx context.Context, arg RewrapProviderSecretParams) (int64, error)

func (*Queries) RewrapWebhookSecret added in v0.4.0

func (q *Queries) RewrapWebhookSecret(ctx context.Context, arg RewrapWebhookSecretParams) (int64, error)

func (*Queries) RollbackMCPTaskResume added in v0.4.0

func (q *Queries) RollbackMCPTaskResume(ctx context.Context, arg RollbackMCPTaskResumeParams) (int64, error)

Restore a claimed task only when dispatch did not create a successor. Once a successor row exists, that run owns the resume attempt even if forwarding it to the agent later fails.

func (*Queries) RollbackPromptRunResume added in v0.4.0

func (q *Queries) RollbackPromptRunResume(ctx context.Context, arg RollbackPromptRunResumeParams) (int64, error)

Restore a claimed prompt suspension only when dispatch did not create a successor. A successor carrying resumeRunId owns the attempt even if its subsequent container request fails.

func (*Queries) RotateUserSessionRefreshToken added in v0.4.0

func (q *Queries) RotateUserSessionRefreshToken(ctx context.Context, arg RotateUserSessionRefreshTokenParams) (int64, error)

func (*Queries) ScrubClaimedConnectorTransferGrant added in v0.6.1

func (q *Queries) ScrubClaimedConnectorTransferGrant(ctx context.Context, arg ScrubClaimedConnectorTransferGrantParams) (int64, error)

func (*Queries) SelectDueAgentJobCrons added in v0.5.0

func (q *Queries) SelectDueAgentJobCrons(ctx context.Context, batchSize int32) ([]AgentJobCron, 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) SetAgentBuildDeploymentTarget added in v0.5.0

func (q *Queries) SetAgentBuildDeploymentTarget(ctx context.Context, arg SetAgentBuildDeploymentTargetParams) (int64, error)

func (*Queries) SetAgentBuildIntegrationToken added in v0.4.0

func (q *Queries) SetAgentBuildIntegrationToken(ctx context.Context, arg SetAgentBuildIntegrationTokenParams) (int64, error)

func (*Queries) SetAgentBuildModel added in v0.4.0

func (q *Queries) SetAgentBuildModel(ctx context.Context, arg SetAgentBuildModelParams) error

Records the LLM model resolved for this build's codegen. Written once the model is resolved (before the run), so a build that later fails still shows which model produced it.

func (*Queries) SetAgentDeploymentRollback added in v0.5.0

func (q *Queries) SetAgentDeploymentRollback(ctx context.Context, arg SetAgentDeploymentRollbackParams) (int64, error)

func (*Queries) SetAgentEnvVarValue added in v0.2.12

func (q *Queries) SetAgentEnvVarValue(ctx context.Context, arg SetAgentEnvVarValueParams) error

Updates only value_ref. Description / is_secret are managed by the agent's RegisterEnvVar declaration and shouldn't be mutated by the operator's value-setting flow.

func (*Queries) SetAgentModelSlotAssignment

func (q *Queries) SetAgentModelSlotAssignment(ctx context.Context, arg SetAgentModelSlotAssignmentParams) error

Both columns move together: empty model name means clear the FK too.

func (*Queries) SetConnectorLabels added in v0.6.1

func (q *Queries) SetConnectorLabels(ctx context.Context, arg SetConnectorLabelsParams) (ConnectorResource, error)

func (*Queries) SetConnectorOrchestrationCanaryState added in v0.6.1

func (q *Queries) SetConnectorOrchestrationCanaryState(ctx context.Context, arg SetConnectorOrchestrationCanaryStateParams) error

func (*Queries) SetConnectorOrchestrationStatus added in v0.6.1

func (q *Queries) SetConnectorOrchestrationStatus(ctx context.Context, arg SetConnectorOrchestrationStatusParams) (ConnectorOrchestration, error)

func (*Queries) SetConversationCheckpoint

func (q *Queries) SetConversationCheckpoint(ctx context.Context, arg SetConversationCheckpointParams) error

func (*Queries) SetSystemConversationCheckpoint added in v0.4.0

func (q *Queries) SetSystemConversationCheckpoint(ctx context.Context, arg SetSystemConversationCheckpointParams) (int64, error)

Stash the sol SuspensionContext (pending tool calls + completed results), bind it to the run that produced it, and flip the conversation to 'awaiting_confirmation'. The caller holds the conversation row lock and commits this alongside SuspendSystemRun.

func (*Queries) SetSystemConversationContextCheckpoint added in v0.4.0

func (q *Queries) SetSystemConversationContextCheckpoint(ctx context.Context, arg SetSystemConversationContextCheckpointParams) error

Compaction pointer: advances the context window so subsequent Loads filter to messages with seq >= the checkpoint message's seq. See ListSystemMessagesByConversation.

func (*Queries) SetTempPassword added in v0.4.0

func (q *Queries) SetTempPassword(ctx context.Context, arg SetTempPasswordParams) error

Set a password and force a change on next login. Used by admin user creation and the `airlock auth reset` break-glass CLI.

func (*Queries) SkipConnectorJob added in v0.6.1

func (q *Queries) SkipConnectorJob(ctx context.Context, arg SkipConnectorJobParams) (ConnectorJob, error)

func (*Queries) StageConnectionOAuthAppByID added in v0.4.0

func (q *Queries) StageConnectionOAuthAppByID(ctx context.Context, arg StageConnectionOAuthAppByIDParams) (int64, error)

func (*Queries) StageMCPServerOAuthAppByID added in v0.4.0

func (q *Queries) StageMCPServerOAuthAppByID(ctx context.Context, arg StageMCPServerOAuthAppByIDParams) (int64, error)

func (*Queries) StartAgentJobAttempt added in v0.5.0

func (q *Queries) StartAgentJobAttempt(ctx context.Context, arg StartAgentJobAttemptParams) (int64, error)

func (*Queries) StartConnectorJobAttempt added in v0.6.1

func (q *Queries) StartConnectorJobAttempt(ctx context.Context, arg StartConnectorJobAttemptParams) (int64, error)

func (*Queries) StartConnectorOrchestration added in v0.6.1

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

func (*Queries) StartInitialAgentBuild added in v0.4.0

func (q *Queries) StartInitialAgentBuild(ctx context.Context, arg StartInitialAgentBuildParams) (Agent, error)

func (*Queries) StopAgentAndRotateToken added in v0.4.0

func (q *Queries) StopAgentAndRotateToken(ctx context.Context, arg StopAgentAndRotateTokenParams) (int64, error)

func (*Queries) SubscribeTopic

func (q *Queries) SubscribeTopic(ctx context.Context, arg SubscribeTopicParams) error

func (*Queries) SucceedAgentJob added in v0.5.0

func (q *Queries) SucceedAgentJob(ctx context.Context, arg SucceedAgentJobParams) (int64, error)

func (*Queries) SucceedAgentJobAttempt added in v0.5.0

func (q *Queries) SucceedAgentJobAttempt(ctx context.Context, arg SucceedAgentJobAttemptParams) (int64, error)

func (*Queries) SummarizeAgentBuildBlockingJobs added in v0.5.0

func (*Queries) SuspendSystemRun added in v0.4.0

func (q *Queries) SuspendSystemRun(ctx context.Context, arg SuspendSystemRunParams) (int64, error)

func (*Queries) SweepExpiredManagedBotSessions added in v0.4.0

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

Janitor: drop rows past their 15-minute TTL. Called on manager-bot Reload and as part of periodic cleanup. The CHECK constraint guarantees agent_id is valid (FK CASCADE handles agent deletion) so we can't leak rows pointing at deleted agents.

func (*Queries) SyncHost added in v0.6.1

func (q *Queries) SyncHost(ctx context.Context, arg SyncHostParams) (Host, error)

func (*Queries) SyncHostedConnector added in v0.6.1

func (q *Queries) SyncHostedConnector(ctx context.Context, arg SyncHostedConnectorParams) (ConnectorResource, error)

func (*Queries) TenantExists

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

func (*Queries) TombstoneConnectorInventory added in v0.6.1

func (q *Queries) TombstoneConnectorInventory(ctx context.Context, arg TombstoneConnectorInventoryParams) (ConnectorResource, error)

func (*Queries) TouchGitCredentialUsage added in v0.4.0

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

Stamped on successful clone/push/refresh — surfaces "is this credential actually being used?" without needing audit-log scrubbing.

func (*Queries) TouchHostCredential added in v0.6.1

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

func (*Queries) TouchOAuthClient added in v0.4.0

func (q *Queries) TouchOAuthClient(ctx context.Context, clientID string) error

Bump last_used_at on a successful /token exchange.

func (*Queries) TouchSystemConversation added in v0.4.0

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

Bumps updated_at after a new message lands so list order reflects recency. Separate from rename so a chat turn doesn't accidentally rewrite the title.

func (*Queries) TouchUserSession added in v0.4.0

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

func (*Queries) TransferConnectionResourceOwnership added in v0.6.1

func (q *Queries) TransferConnectionResourceOwnership(ctx context.Context, arg TransferConnectionResourceOwnershipParams) (int64, error)

func (*Queries) TransferConnectorResourceOwnership added in v0.6.1

func (q *Queries) TransferConnectorResourceOwnership(ctx context.Context, arg TransferConnectorResourceOwnershipParams) (int64, error)

func (*Queries) TransferConnectorTargetGroupResourceOwnership added in v0.6.1

func (q *Queries) TransferConnectorTargetGroupResourceOwnership(ctx context.Context, arg TransferConnectorTargetGroupResourceOwnershipParams) (int64, error)

func (*Queries) TransferGitCredentialResourceOwnership added in v0.6.1

func (q *Queries) TransferGitCredentialResourceOwnership(ctx context.Context, arg TransferGitCredentialResourceOwnershipParams) (int64, error)

func (*Queries) TransferHostResourceOwnership added in v0.6.1

func (q *Queries) TransferHostResourceOwnership(ctx context.Context, arg TransferHostResourceOwnershipParams) (int64, error)

func (*Queries) TransferMCPServerResourceOwnership added in v0.6.1

func (q *Queries) TransferMCPServerResourceOwnership(ctx context.Context, arg TransferMCPServerResourceOwnershipParams) (int64, error)

func (*Queries) UnbindAllResourceNeedsByAgent added in v0.4.0

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

Clear every binding on an agent's needs (the need rows stay — they are the code-synced manifest). Used on ownership transfer: the bound resources are the OLD owner's, and the new owner has no access to them.

func (*Queries) UnbindBridgesByAgent added in v0.4.0

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

Detach every bridge from an agent (leaves the bridge rows, owned by the old owner, with a NULL target). Used on ownership transfer: a bridge holds the old owner's bot token. Enumerate with ListBridgesByAgentID first and cancel each in-memory poller — this only clears the DB target.

func (*Queries) UnbindConnectorInventory added in v0.6.1

func (q *Queries) UnbindConnectorInventory(ctx context.Context, connectorID pgtype.UUID) error

func (*Queries) UnbindResourceNeed added in v0.4.0

func (q *Queries) UnbindResourceNeed(ctx context.Context, arg UnbindResourceNeedParams) (int64, error)

func (*Queries) UnsubscribeTopic

func (q *Queries) UnsubscribeTopic(ctx context.Context, arg UnsubscribeTopicParams) error

func (*Queries) UpdateAgentA2ASettings added in v0.4.0

func (q *Queries) UpdateAgentA2ASettings(ctx context.Context, arg UpdateAgentA2ASettingsParams) error

Updates the three protocol-surface toggles. The grant ladder governs who may make an authed MCP call; these are orthogonal (anonymous MCP, the MCP master switch, anonymous public web routes).

func (*Queries) UpdateAgentBuildComplete

func (q *Queries) UpdateAgentBuildComplete(ctx context.Context, arg UpdateAgentBuildCompleteParams) error

func (*Queries) UpdateAgentBuildDeploymentPhase added in v0.5.0

func (q *Queries) UpdateAgentBuildDeploymentPhase(ctx context.Context, arg UpdateAgentBuildDeploymentPhaseParams) (int64, error)

func (*Queries) UpdateAgentBuildLogs

func (q *Queries) UpdateAgentBuildLogs(ctx context.Context, arg UpdateAgentBuildLogsParams) error

func (*Queries) UpdateAgentBuildTodos added in v0.4.0

func (q *Queries) UpdateAgentBuildTodos(ctx context.Context, arg UpdateAgentBuildTodosParams) error

Persists the agent's current task list (jsonb) as it rewrites it during codegen. Separate from UpdateAgentBuildLogs so the todo write cadence is independent of the 1s log flush.

func (*Queries) UpdateAgentConfig

func (q *Queries) UpdateAgentConfig(ctx context.Context, arg UpdateAgentConfigParams) error

func (*Queries) UpdateAgentDBPassword added in v0.2.11

func (q *Queries) UpdateAgentDBPassword(ctx context.Context, arg UpdateAgentDBPasswordParams) error

Set the encrypted DB password for the agent's per-schema role. Written once on first creation; rebuilds reuse the stored value (the role password is never rotated) so a running container's creds can't be invalidated mid-build.

func (*Queries) UpdateAgentDescription

func (q *Queries) UpdateAgentDescription(ctx context.Context, arg UpdateAgentDescriptionParams) error

func (*Queries) UpdateAgentEmoji added in v0.4.0

func (q *Queries) UpdateAgentEmoji(ctx context.Context, arg UpdateAgentEmojiParams) error

func (*Queries) UpdateAgentErrorMessage

func (q *Queries) UpdateAgentErrorMessage(ctx context.Context, arg UpdateAgentErrorMessageParams) error

func (*Queries) UpdateAgentFields

func (q *Queries) UpdateAgentFields(ctx context.Context, arg UpdateAgentFieldsParams) (Agent, error)

Caller resolves each value (keep-existing when the request omits it) before calling, so this is an unconditional set. slug uniqueness is enforced by the agents.slug UNIQUE constraint — a collision surfaces as a duplicate-key error the handler maps to 409.

func (*Queries) UpdateAgentGitLastSyncedRef added in v0.4.0

func (q *Queries) UpdateAgentGitLastSyncedRef(ctx context.Context, arg UpdateAgentGitLastSyncedRefParams) error

func (*Queries) UpdateAgentInstructions added in v0.4.0

func (q *Queries) UpdateAgentInstructions(ctx context.Context, arg UpdateAgentInstructionsParams) error

func (*Queries) UpdateAgentJobProgress added in v0.5.0

func (q *Queries) UpdateAgentJobProgress(ctx context.Context, arg UpdateAgentJobProgressParams) (AgentJob, error)

func (*Queries) UpdateAgentModels

func (q *Queries) UpdateAgentModels(ctx context.Context, arg UpdateAgentModelsParams) error

Atomic replace of all eight per-agent model overrides. Each slot is two columns: a provider FK (nullable) and the bare model name string. Empty/NULL means "inherit the corresponding system default".

func (*Queries) UpdateAgentOwner added in v0.4.0

func (q *Queries) UpdateAgentOwner(ctx context.Context, arg UpdateAgentOwnerParams) error

Reassign the agent's owner (transfer ownership). The caller separately moves the agent_grants admin membership and clears owner-scoped bindings — ownership is the column here plus the grant, and they must move together.

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) UpdateAgentToolsHash added in v0.4.0

func (q *Queries) UpdateAgentToolsHash(ctx context.Context, arg UpdateAgentToolsHashParams) error

Stamp the synced tool-set hash on the agent. Sync handler compares before/after to decide whether to broadcast a sibling-update refresh.

func (*Queries) UpdateAgentUpgradeStatus

func (q *Queries) UpdateAgentUpgradeStatus(ctx context.Context, arg UpdateAgentUpgradeStatusParams) error

func (*Queries) UpdateBridgeBinding added in v0.4.0

func (q *Queries) UpdateBridgeBinding(ctx context.Context, arg UpdateBridgeBindingParams) (Bridge, error)

Rebind the bridge's target. Either is_system=true with NULL agent_id (operator surface — routes to the in-airlock sysagent) or is_system=false with a non-NULL agent_id (agent surface) — the XOR is enforced by the service layer, not the schema. The running poller must be reloaded via BridgeManager.AddBridge after this update — it holds AgentID in memory.

func (*Queries) UpdateBridgeIdentity added in v0.4.0

func (q *Queries) UpdateBridgeIdentity(ctx context.Context, arg UpdateBridgeIdentityParams) error

Refresh a bridge's bot-controlled identity from a getMe poll: the display name (the bridge name shown in the UI) + bot_username (the @handle, which can change). The operator never sets these — they mirror the bot.

func (*Queries) UpdateBridgeLastPolled

func (q *Queries) UpdateBridgeLastPolled(ctx context.Context, arg UpdateBridgeLastPolledParams) error

Status flips back to 'active' on every successful poll so a past transient failure (network blip, brief upstream hiccup) doesn't leave the row stuck at 'error' once the poller recovers.

func (*Queries) UpdateBridgeStatus

func (q *Queries) UpdateBridgeStatus(ctx context.Context, arg UpdateBridgeStatusParams) error

func (*Queries) UpdateBuildLLMStats added in v0.4.0

func (q *Queries) UpdateBuildLLMStats(ctx context.Context, buildID pgtype.UUID) error

Build-side parity with UpdateRunLLMStats: aggregates the build's token/call/cost totals from the llm_usage ledger (rows the build codegen runner wrote with build_id; cost already computed per-row). Idempotent — recomputes the SUM each call. A build with no ledger rows zeroes out (correct — no codegen spend recorded).

func (*Queries) UpdateConnectionCredentialsByID added in v0.4.0

func (q *Queries) UpdateConnectionCredentialsByID(ctx context.Context, arg UpdateConnectionCredentialsByIDParams) error

func (*Queries) UpdateConnectionOwnerByID added in v0.4.0

func (q *Queries) UpdateConnectionOwnerByID(ctx context.Context, arg UpdateConnectionOwnerByIDParams) error

Set the resource owner to the principal who created it (the configuring user), overriding the agent-owner default the upsert seeds.

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) UpdateCredentialSignCount added in v0.4.0

func (q *Queries) UpdateCredentialSignCount(ctx context.Context, arg UpdateCredentialSignCountParams) error

func (*Queries) UpdateLastSeenSDKVersion added in v0.4.0

func (q *Queries) UpdateLastSeenSDKVersion(ctx context.Context, lastSeenSdkVersion string) error

Stamp the bundled agentsdk version after a successful mass rebuild (or on first boot when there's nothing to rebuild). Compared against agentsdk.Version on the next airlock startup to detect SDK drift.

func (*Queries) UpdateMCPServerCredentialsByID added in v0.4.0

func (q *Queries) UpdateMCPServerCredentialsByID(ctx context.Context, arg UpdateMCPServerCredentialsByIDParams) error

func (*Queries) UpdateMCPServerDiscoveryByID added in v0.4.0

func (q *Queries) UpdateMCPServerDiscoveryByID(ctx context.Context, arg UpdateMCPServerDiscoveryByIDParams) error

Lazy re-discovery: refresh auth_url / token_url / registration_endpoint after a fresh RFC 8414 fetch. Does NOT touch access_token_ref — re-discovery never invalidates auth state by itself.

func (*Queries) UpdateMCPServerOwnerByID added in v0.4.0

func (q *Queries) UpdateMCPServerOwnerByID(ctx context.Context, arg UpdateMCPServerOwnerByIDParams) error

Set the resource owner to the principal who created it (the configuring user).

func (*Queries) UpdateMCPServerToolSchemasByID added in v0.4.0

func (q *Queries) UpdateMCPServerToolSchemasByID(ctx context.Context, arg UpdateMCPServerToolSchemasByIDParams) 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, runID pgtype.UUID) error

Aggregates the run's token/call/cost totals from the llm_usage ledger (the single source of truth — one row per proxied model round-trip, cost already computed per-row at capture). Idempotent: safe to invoke from the agent's RunComplete handler and again from any bg fallback; it recomputes the SUM each time. A run with no ledger rows zeroes out (correct — no model spend recorded).

func (*Queries) UpdateRunStatus

func (q *Queries) UpdateRunStatus(ctx context.Context, arg UpdateRunStatusParams) error

func (*Queries) UpdateSiblingMaxAccess added in v0.4.0

func (q *Queries) UpdateSiblingMaxAccess(ctx context.Context, arg UpdateSiblingMaxAccessParams) (int64, error)

Change the per-edge ceiling (operator intent). Returns rows affected so the caller can distinguish a missing edge (0) from success (1).

func (*Queries) UpdateSystemAuditResult added in v0.4.0

func (q *Queries) UpdateSystemAuditResult(ctx context.Context, arg UpdateSystemAuditResultParams) error

func (*Queries) UpdateSystemConversationSettings added in v0.4.0

func (q *Queries) UpdateSystemConversationSettings(ctx context.Context, arg UpdateSystemConversationSettingsParams) error

JSONB shallow merge: caller passes a patch with only the keys to overwrite; existing keys not in the patch survive. Used by /echo to flip the echo setting without touching anything else.

func (*Queries) UpdateSystemRunLLMStats added in v0.4.0

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

Refreshes the run's token/call/cost aggregate from the llm_usage ledger (rows the sysagent turn wrote under this system_run_id). Mirrors UpdateRunLLMStats / UpdateBuildLLMStats so the per-run cost surfaced in the activity view stays the ledger's sum, computed in exactly one place.

func (*Queries) UpdateSystemRunStatus added in v0.4.0

func (q *Queries) UpdateSystemRunStatus(ctx context.Context, arg UpdateSystemRunStatusParams) error

func (*Queries) UpdateSystemSettings

func (q *Queries) UpdateSystemSettings(ctx context.Context, arg UpdateSystemSettingsParams) (SystemSetting, error)

Each system default is a pair: a providers row FK (nullable) and the bare model name. NULL/empty ⇄ no default configured for that slot.

func (*Queries) UpdateUserDisplayName added in v0.4.0

func (q *Queries) UpdateUserDisplayName(ctx context.Context, arg UpdateUserDisplayNameParams) (int64, error)

func (*Queries) UpdateUserPasswordAndRevokeSessions added in v0.4.0

func (q *Queries) UpdateUserPasswordAndRevokeSessions(ctx context.Context, arg UpdateUserPasswordAndRevokeSessionsParams) (int64, 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) UpsertAgentEnvVar added in v0.2.12

func (q *Queries) UpsertAgentEnvVar(ctx context.Context, arg UpsertAgentEnvVarParams) (AgentEnvVar, error)

Called from the agent-internal sync to declare a slot. Operator supplies the value separately via SetAgentEnvVarValue. Preserves any existing value_ref when an agent re-syncs the same slug; description, is_secret, default_value, and pattern track the agent's declaration.

func (*Queries) UpsertAgentGrant added in v0.4.0

func (q *Queries) UpsertAgentGrant(ctx context.Context, arg UpsertAgentGrantParams) error

func (*Queries) UpsertAgentJobCron added in v0.5.0

func (q *Queries) UpsertAgentJobCron(ctx context.Context, arg UpsertAgentJobCronParams) (AgentJobCron, 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; the assignment (assigned_provider_id + assigned_model) is admin-controlled and must survive re-syncs untouched. NULL provider FK ⇄ empty model name.

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)

Connections are principal-owned resources, identified by id or (owner_principal_id, slug). An agent reaches a connection only through a binding on agent_resource_needs, so credential-management queries address the resource by id (the service resolves the binding first) and listings join through the needs table, keyed by the agent's NEED slug. Create-or-refresh the owner's connection for @slug. The owner is the agent's user; @agent_id only resolves that owner — the row carries no agent_id. When scopes change, clear access_token_ref so the user must re-authorize with the new scopes. Credential fields are seeded empty on insert; ON CONFLICT preserves an existing access_token_ref unless scopes changed.

func (*Queries) UpsertConnectionResourceGrant added in v0.6.1

func (q *Queries) UpsertConnectionResourceGrant(ctx context.Context, arg UpsertConnectionResourceGrantParams) (ResourceGrant, error)

func (*Queries) UpsertConnectorArtifactBlob added in v0.6.1

func (q *Queries) UpsertConnectorArtifactBlob(ctx context.Context, arg UpsertConnectorArtifactBlobParams) (ConnectorArtifactBlob, error)

Connector artifact candidates, authorized downloads, and retention.

func (*Queries) UpsertConnectorResourceGrant added in v0.6.1

func (q *Queries) UpsertConnectorResourceGrant(ctx context.Context, arg UpsertConnectorResourceGrantParams) (ResourceGrant, error)

func (*Queries) UpsertConnectorTargetGroupResourceGrant added in v0.6.1

func (q *Queries) UpsertConnectorTargetGroupResourceGrant(ctx context.Context, arg UpsertConnectorTargetGroupResourceGrantParams) (ResourceGrant, error)

func (*Queries) UpsertDirectory added in v0.2.0

func (q *Queries) UpsertDirectory(ctx context.Context, arg UpsertDirectoryParams) error

func (*Queries) UpsertGitCredentialResourceGrant added in v0.6.1

func (q *Queries) UpsertGitCredentialResourceGrant(ctx context.Context, arg UpsertGitCredentialResourceGrantParams) (ResourceGrant, error)

func (*Queries) UpsertGrant added in v0.4.0

func (q *Queries) UpsertGrant(ctx context.Context, arg UpsertGrantParams) error

Inserts or refreshes a consent record. Called from /oauth/consent on user approval. The 90-day window slides forward on every consent; revoked_at is cleared on re-grant (user explicitly approving wipes the revoke).

func (*Queries) UpsertHostResourceGrant added in v0.6.1

func (q *Queries) UpsertHostResourceGrant(ctx context.Context, arg UpsertHostResourceGrantParams) (ResourceGrant, error)

func (*Queries) UpsertJobHandler added in v0.5.0

func (q *Queries) UpsertJobHandler(ctx context.Context, arg UpsertJobHandlerParams) (int64, 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)

MCP servers are principal-owned resources, identified by id or (owner_principal_id, slug). An agent reaches a server only through a binding on agent_resource_needs, so credential ops address the resource by id and listings join through the needs table, keyed by the agent's NEED slug. Create-or-refresh the owner's MCP server for @slug. The owner is the agent's user; @agent_id only resolves that owner — the row carries no agent_id. When url or scopes change, clear access_token_ref so the user must re-authorize. registration_endpoint is taken from EXCLUDED only when newly populated, so a fresh discovery run that turned up empty doesn't blow away a known endpoint.

func (*Queries) UpsertMCPServerResourceGrant added in v0.6.1

func (q *Queries) UpsertMCPServerResourceGrant(ctx context.Context, arg UpsertMCPServerResourceGrantParams) (ResourceGrant, error)

func (*Queries) UpsertResourceNeed added in v0.4.0

func (q *Queries) UpsertResourceNeed(ctx context.Context, arg UpsertResourceNeedParams) error

Agent resource needs (the manifest) + their bindings to concrete resources. Sync upserts the declarative fields and never touches the binding, so an operator-attached resource survives re-syncs.

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) (int64, error)

Recovery path: row may not exist if CreateRun never landed. All "starts empty" fields (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.

func (*Queries) UsageByAgent added in v0.4.0

func (q *Queries) UsageByAgent(ctx context.Context, since pgtype.Timestamptz) ([]UsageByAgentRow, error)

Owner (agents.owner_principal_id → users via the user-principal id) is joined live, so it's empty for rows whose agent (or whose agent's owner) is deleted.

func (*Queries) UsageByModel added in v0.4.0

func (q *Queries) UsageByModel(ctx context.Context, since pgtype.Timestamptz) ([]UsageByModelRow, error)

func (*Queries) UsageByUser added in v0.4.0

func (q *Queries) UsageByUser(ctx context.Context, since pgtype.Timestamptz) ([]UsageByUserRow, error)

Grouped by the triggering user's snapshot email. Spend with no user in the loop — agent HTTP route / scheduled "code" runs, or otherwise unattributed calls — carries an empty email snapshot; it is bucketed under its call_kind (e.g. "code") instead of shown as a phantom deleted user. deleted marks a real user whose row is gone (user_id SET NULL) but whose email snapshot survives — i.e. a non-empty email with no live user id.

func (*Queries) UsageSummary added in v0.4.0

func (q *Queries) UsageSummary(ctx context.Context, since pgtype.Timestamptz) (UsageSummaryRow, error)

Spend-ledger rollups for the admin Usage view. All read llm_usage (the durable, append-only ledger) over a created_at window. Rows for deleted agents survive with agent_id NULL but retain agent_slug/agent_name, so they still roll up under their original identity.

func (*Queries) WithTx

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

type ReconcileKnownConnectorInventoryParams added in v0.6.1

type ReconcileKnownConnectorInventoryParams struct {
	DisplayName              string      `json:"display_name"`
	ActiveDigest             pgtype.Text `json:"active_digest"`
	RollbackArtifactSetID    pgtype.UUID `json:"rollback_artifact_set_id"`
	InventoryRevision        int64       `json:"inventory_revision"`
	InventoryMutationHash    pgtype.Text `json:"inventory_mutation_hash"`
	RollbackProvenance       string      `json:"rollback_provenance"`
	RollbackObservationState string      `json:"rollback_observation_state"`
	ActiveManifest           []byte      `json:"active_manifest"`
	ActiveManifestHash       pgtype.Text `json:"active_manifest_hash"`
	RollbackDigest           pgtype.Text `json:"rollback_digest"`
	RollbackManifest         []byte      `json:"rollback_manifest"`
	RollbackManifestHash     pgtype.Text `json:"rollback_manifest_hash"`
	ID                       pgtype.UUID `json:"id"`
	ActiveArtifactSetID      pgtype.UUID `json:"active_artifact_set_id"`
}

type ReconcileManagerBridgeParams added in v0.4.0

type ReconcileManagerBridgeParams struct {
	BotUsername  string      `json:"bot_username"`
	ManagerError string      `json:"manager_error"`
	ID           pgtype.UUID `json:"id"`
}

type ReconcileManualConnectorInventoryParams added in v0.6.1

type ReconcileManualConnectorInventoryParams struct {
	DisplayName              string      `json:"display_name"`
	Kind                     pgtype.Text `json:"kind"`
	ContractID               pgtype.Text `json:"contract_id"`
	Name                     pgtype.Text `json:"name"`
	Description              pgtype.Text `json:"description"`
	ProtocolMajor            pgtype.Int4 `json:"protocol_major"`
	ProtocolMinor            pgtype.Int4 `json:"protocol_minor"`
	Features                 []string    `json:"features"`
	ArtifactVersion          pgtype.Text `json:"artifact_version"`
	ActiveDigest             pgtype.Text `json:"active_digest"`
	InterfaceDescriptor      []byte      `json:"interface_descriptor"`
	InterfaceHash            pgtype.Text `json:"interface_hash"`
	RollbackArtifactSetID    pgtype.UUID `json:"rollback_artifact_set_id"`
	InventoryRevision        int64       `json:"inventory_revision"`
	InventoryMutationHash    pgtype.Text `json:"inventory_mutation_hash"`
	RollbackProvenance       string      `json:"rollback_provenance"`
	ActiveObservationState   string      `json:"active_observation_state"`
	RollbackObservationState string      `json:"rollback_observation_state"`
	ActiveManifest           []byte      `json:"active_manifest"`
	ActiveManifestHash       pgtype.Text `json:"active_manifest_hash"`
	RollbackDigest           pgtype.Text `json:"rollback_digest"`
	RollbackManifest         []byte      `json:"rollback_manifest"`
	RollbackManifestHash     pgtype.Text `json:"rollback_manifest_hash"`
	Readiness                string      `json:"readiness"`
	ReadinessMessage         pgtype.Text `json:"readiness_message"`
	ID                       pgtype.UUID `json:"id"`
}

type RecordAuthFailureParams

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

type RelayCode added in v0.4.0

type RelayCode struct {
	CodeHash     []byte             `json:"code_hash"`
	NonceHash    []byte             `json:"nonce_hash"`
	UserID       pgtype.UUID        `json:"user_id"`
	Email        string             `json:"email"`
	TenantRole   string             `json:"tenant_role"`
	AuthEpoch    int64              `json:"auth_epoch"`
	AgentID      pgtype.UUID        `json:"agent_id"`
	TargetOrigin string             `json:"target_origin"`
	ReturnPath   string             `json:"return_path"`
	ExpiresAt    pgtype.Timestamptz `json:"expires_at"`
	CreatedAt    pgtype.Timestamptz `json:"created_at"`
	SessionID    pgtype.UUID        `json:"session_id"`
}

type ReleaseConnectorArtifactBlobDeletionParams added in v0.6.1

type ReleaseConnectorArtifactBlobDeletionParams struct {
	DeletionError pgtype.Text `json:"deletion_error"`
	Digest        string      `json:"digest"`
	DeletionToken pgtype.UUID `json:"deletion_token"`
}

type ReleaseConnectorExportFinalizationParams added in v0.6.1

type ReleaseConnectorExportFinalizationParams struct {
	ErrorMessage      pgtype.Text `json:"error_message"`
	JobID             pgtype.UUID `json:"job_id"`
	FinalizationToken pgtype.UUID `json:"finalization_token"`
}

type ReleaseConnectorTransferCleanupParams added in v0.6.1

type ReleaseConnectorTransferCleanupParams struct {
	ErrorMessage pgtype.Text `json:"error_message"`
	JobID        pgtype.UUID `json:"job_id"`
	CleanupToken pgtype.UUID `json:"cleanup_token"`
}

type ReleaseHeldConnectorJobsParams added in v0.6.1

type ReleaseHeldConnectorJobsParams struct {
	OrchestrationID pgtype.UUID `json:"orchestration_id"`
	CanaryOnly      bool        `json:"canary_only"`
	Lim             int32       `json:"lim"`
}

type ReleaseMCPActiveRequestReservationParams added in v0.4.0

type ReleaseMCPActiveRequestReservationParams struct {
	TargetAgentID     pgtype.UUID `json:"target_agent_id"`
	PrincipalIdentity string      `json:"principal_identity"`
	RequestID         []byte      `json:"request_id"`
}

type RemoveConnectorTargetGroupMemberParams added in v0.6.1

type RemoveConnectorTargetGroupMemberParams struct {
	GroupID     pgtype.UUID `json:"group_id"`
	ConnectorID pgtype.UUID `json:"connector_id"`
}

type RemoveSiblingParams added in v0.4.0

type RemoveSiblingParams struct {
	ParentAgentID  pgtype.UUID `json:"parent_agent_id"`
	SiblingAgentID pgtype.UUID `json:"sibling_agent_id"`
}

type RenameConnectionParams added in v0.4.0

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

type RenameConnectorParams added in v0.6.1

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

type RenameCredentialParams added in v0.4.0

type RenameCredentialParams struct {
	FriendlyName string      `json:"friendly_name"`
	ID           pgtype.UUID `json:"id"`
	UserID       pgtype.UUID `json:"user_id"`
}

type RenameMCPServerParams added in v0.4.0

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

type RenameSystemConversationParams added in v0.4.0

type RenameSystemConversationParams struct {
	Title  string      `json:"title"`
	ID     pgtype.UUID `json:"id"`
	UserID pgtype.UUID `json:"user_id"`
}

type RenewActiveConnectorJobAttemptParams added in v0.6.1

type RenewActiveConnectorJobAttemptParams struct {
	LeaseSeconds int32       `json:"lease_seconds"`
	JobID        pgtype.UUID `json:"job_id"`
	ConnectorID  pgtype.UUID `json:"connector_id"`
	AttemptToken pgtype.UUID `json:"attempt_token"`
}

type RenewAgentJobAttemptLeaseParams added in v0.5.0

type RenewAgentJobAttemptLeaseParams struct {
	LeaseSeconds  int32       `json:"lease_seconds"`
	JobID         pgtype.UUID `json:"job_id"`
	AttemptNumber int32       `json:"attempt_number"`
	LeaseOwner    pgtype.UUID `json:"lease_owner"`
	LeaseToken    pgtype.UUID `json:"lease_token"`
}

type RenewConnectorExportFinalizationLeaseParams added in v0.6.1

type RenewConnectorExportFinalizationLeaseParams struct {
	LeaseSeconds      int32       `json:"lease_seconds"`
	JobID             pgtype.UUID `json:"job_id"`
	FinalizationToken pgtype.UUID `json:"finalization_token"`
}

type RenewConnectorJobAttemptForHostParams added in v0.6.1

type RenewConnectorJobAttemptForHostParams struct {
	LeaseSeconds int32       `json:"lease_seconds"`
	JobID        pgtype.UUID `json:"job_id"`
	HostID       pgtype.UUID `json:"host_id"`
	AttemptToken pgtype.UUID `json:"attempt_token"`
}

type RenewConnectorTransferCleanupLeaseParams added in v0.6.1

type RenewConnectorTransferCleanupLeaseParams struct {
	LeaseSeconds int32       `json:"lease_seconds"`
	JobID        pgtype.UUID `json:"job_id"`
	CleanupToken pgtype.UUID `json:"cleanup_token"`
}

type RenewHostManagementAttemptParams added in v0.6.1

type RenewHostManagementAttemptParams struct {
	LeaseSeconds int32       `json:"lease_seconds"`
	JobID        pgtype.UUID `json:"job_id"`
	HostID       pgtype.UUID `json:"host_id"`
	AttemptToken pgtype.UUID `json:"attempt_token"`
}

type ReplaceConnectionNeedBindingParams added in v0.4.0

type ReplaceConnectionNeedBindingParams struct {
	ResourceID         pgtype.UUID `json:"resource_id"`
	NeedID             pgtype.UUID `json:"need_id"`
	ExpectedResourceID pgtype.UUID `json:"expected_resource_id"`
}

type ReplaceMCPServerNeedBindingParams added in v0.4.0

type ReplaceMCPServerNeedBindingParams struct {
	ResourceID         pgtype.UUID `json:"resource_id"`
	NeedID             pgtype.UUID `json:"need_id"`
	ExpectedResourceID pgtype.UUID `json:"expected_resource_id"`
}

type RequestConnectorOrchestrationCancellationParams added in v0.6.1

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

type RequestRunningAgentJobCancellationParams added in v0.5.0

type RequestRunningAgentJobCancellationParams struct {
	CancelledByUserID pgtype.UUID `json:"cancelled_by_user_id"`
	ID                pgtype.UUID `json:"id"`
	AgentID           pgtype.UUID `json:"agent_id"`
}

type ReserveAddedConnectorTargetGroupMemberParams added in v0.6.1

type ReserveAddedConnectorTargetGroupMemberParams struct {
	ConnectorID pgtype.UUID `json:"connector_id"`
	NeedID      pgtype.UUID `json:"need_id"`
	GroupID     pgtype.UUID `json:"group_id"`
}

type ReserveConnectorForNeedParams added in v0.6.1

type ReserveConnectorForNeedParams struct {
	ConnectorID pgtype.UUID `json:"connector_id"`
	NeedID      pgtype.UUID `json:"need_id"`
}

type ReserveConnectorTargetGroupForNeedParams added in v0.6.1

type ReserveConnectorTargetGroupForNeedParams struct {
	NeedID  pgtype.UUID `json:"need_id"`
	GroupID pgtype.UUID `json:"group_id"`
}

type ReserveMCPActiveRequestParams added in v0.4.0

type ReserveMCPActiveRequestParams struct {
	TargetAgentID     pgtype.UUID `json:"target_agent_id"`
	PrincipalIdentity string      `json:"principal_identity"`
	RequestID         []byte      `json:"request_id"`
	TtlSeconds        int32       `json:"ttl_seconds"`
}

type ResolveBoundConnectionParams added in v0.4.0

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

type ResolveBoundConnectorParams added in v0.6.1

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

type ResolveBoundConnectorRow added in v0.6.1

type ResolveBoundConnectorRow struct {
	ID                           pgtype.UUID        `json:"id"`
	OwnerPrincipalID             pgtype.UUID        `json:"owner_principal_id"`
	Slug                         string             `json:"slug"`
	Kind                         pgtype.Text        `json:"kind"`
	ContractID                   pgtype.Text        `json:"contract_id"`
	Name                         pgtype.Text        `json:"name"`
	DisplayName                  string             `json:"display_name"`
	Description                  pgtype.Text        `json:"description"`
	ProtocolMajor                pgtype.Int4        `json:"protocol_major"`
	ProtocolMinor                pgtype.Int4        `json:"protocol_minor"`
	Features                     []string           `json:"features"`
	ArtifactVersion              pgtype.Text        `json:"artifact_version"`
	ArtifactDigest               pgtype.Text        `json:"artifact_digest"`
	InterfaceDescriptor          []byte             `json:"interface_descriptor"`
	InterfaceHash                pgtype.Text        `json:"interface_hash"`
	Readiness                    string             `json:"readiness"`
	ReadinessMessage             pgtype.Text        `json:"readiness_message"`
	Labels                       []byte             `json:"labels"`
	Lifecycle                    string             `json:"lifecycle"`
	LastSeenAt                   pgtype.Timestamptz `json:"last_seen_at"`
	LastReadyAt                  pgtype.Timestamptz `json:"last_ready_at"`
	CreatedAt                    pgtype.Timestamptz `json:"created_at"`
	UpdatedAt                    pgtype.Timestamptz `json:"updated_at"`
	StorageOrigins               []string           `json:"storage_origins"`
	ActivationManifest           []byte             `json:"activation_manifest"`
	ActivationManifestHash       pgtype.Text        `json:"activation_manifest_hash"`
	ServiceMode                  pgtype.Text        `json:"service_mode"`
	ArtifactSetID                pgtype.UUID        `json:"artifact_set_id"`
	HostID                       pgtype.UUID        `json:"host_id"`
	RollbackArtifactSetID        pgtype.UUID        `json:"rollback_artifact_set_id"`
	InventoryRevision            int64              `json:"inventory_revision"`
	InventoryMutationHash        pgtype.Text        `json:"inventory_mutation_hash"`
	ActiveProvenance             string             `json:"active_provenance"`
	RollbackProvenance           string             `json:"rollback_provenance"`
	ActiveObservationState       string             `json:"active_observation_state"`
	RollbackObservationState     string             `json:"rollback_observation_state"`
	ObservedActiveDigest         pgtype.Text        `json:"observed_active_digest"`
	ObservedActiveManifest       []byte             `json:"observed_active_manifest"`
	ObservedActiveManifestHash   pgtype.Text        `json:"observed_active_manifest_hash"`
	ObservedRollbackDigest       pgtype.Text        `json:"observed_rollback_digest"`
	ObservedRollbackManifest     []byte             `json:"observed_rollback_manifest"`
	ObservedRollbackManifestHash pgtype.Text        `json:"observed_rollback_manifest_hash"`
	NeedID                       pgtype.UUID        `json:"need_id"`
	NeedSpec                     []byte             `json:"need_spec"`
}

type ResolveBoundMCPServerParams added in v0.4.0

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

type ResolvePrincipalNamesRow added in v0.4.0

type ResolvePrincipalNamesRow struct {
	ID   pgtype.UUID `json:"id"`
	Name string      `json:"name"`
}

type ResolveSuspendedSystemRunParams added in v0.4.0

type ResolveSuspendedSystemRunParams struct {
	ID             pgtype.UUID `json:"id"`
	ConversationID pgtype.UUID `json:"conversation_id"`
}

type ResourceGrant added in v0.4.0

type ResourceGrant struct {
	ID                     pgtype.UUID        `json:"id"`
	ConnectionID           pgtype.UUID        `json:"connection_id"`
	McpServerID            pgtype.UUID        `json:"mcp_server_id"`
	GitCredentialID        pgtype.UUID        `json:"git_credential_id"`
	GranteeID              pgtype.UUID        `json:"grantee_id"`
	Capabilities           []string           `json:"capabilities"`
	CreatedAt              pgtype.Timestamptz `json:"created_at"`
	ConnectorID            pgtype.UUID        `json:"connector_id"`
	HostID                 pgtype.UUID        `json:"host_id"`
	ConnectorTargetGroupID pgtype.UUID        `json:"connector_target_group_id"`
}

type ResourceOwnershipTransfer added in v0.6.1

type ResourceOwnershipTransfer struct {
	ID                       pgtype.UUID        `json:"id"`
	ResourceType             string             `json:"resource_type"`
	ResourceID               pgtype.UUID        `json:"resource_id"`
	ActorUserID              pgtype.UUID        `json:"actor_user_id"`
	PreviousOwnerPrincipalID pgtype.UUID        `json:"previous_owner_principal_id"`
	NewOwnerUserID           pgtype.UUID        `json:"new_owner_user_id"`
	CreatedAt                pgtype.Timestamptz `json:"created_at"`
}

type ResumeAgentJobDispatchParams added in v0.5.0

type ResumeAgentJobDispatchParams struct {
	AgentID         pgtype.UUID `json:"agent_id"`
	BuildID         pgtype.UUID `json:"build_id"`
	DeploymentToken pgtype.UUID `json:"deployment_token"`
}

type RetryAgentJobAttemptParams added in v0.5.0

type RetryAgentJobAttemptParams struct {
	ErrorMessage  pgtype.Text `json:"error_message"`
	JobID         pgtype.UUID `json:"job_id"`
	AttemptNumber int32       `json:"attempt_number"`
	LeaseOwner    pgtype.UUID `json:"lease_owner"`
	LeaseToken    pgtype.UUID `json:"lease_token"`
}

type RetryAgentJobForDeploymentParams added in v0.5.0

type RetryAgentJobForDeploymentParams struct {
	LastError pgtype.Text `json:"last_error"`
	ID        pgtype.UUID `json:"id"`
}

type RetryAgentJobParams added in v0.5.0

type RetryAgentJobParams struct {
	LastError      pgtype.Text `json:"last_error"`
	BackoffSeconds int32       `json:"backoff_seconds"`
	ID             pgtype.UUID `json:"id"`
}

type RevokeGrantParams added in v0.4.0

type RevokeGrantParams struct {
	UserID   pgtype.UUID `json:"user_id"`
	ClientID string      `json:"client_id"`
	AgentID  pgtype.UUID `json:"agent_id"`
}

type RevokeRefreshForGrantParams added in v0.4.0

type RevokeRefreshForGrantParams struct {
	UserID   pgtype.UUID `json:"user_id"`
	ClientID string      `json:"client_id"`
	AgentID  pgtype.UUID `json:"agent_id"`
}

type RevokeUserSessionByIDParams added in v0.4.0

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

type RewrapAgentSecretParams added in v0.4.0

type RewrapAgentSecretParams struct {
	Field     string      `json:"field"`
	NewStored string      `json:"new_stored"`
	RowKey    pgtype.UUID `json:"row_key"`
	OldStored string      `json:"old_stored"`
}

type RewrapBridgeSecretParams added in v0.4.0

type RewrapBridgeSecretParams struct {
	NewStored string      `json:"new_stored"`
	RowKey    pgtype.UUID `json:"row_key"`
	OldStored string      `json:"old_stored"`
}

type RewrapConnectionSecretParams added in v0.4.0

type RewrapConnectionSecretParams struct {
	Field     string      `json:"field"`
	NewStored string      `json:"new_stored"`
	RowKey    pgtype.UUID `json:"row_key"`
	OldStored string      `json:"old_stored"`
}

type RewrapEnvVarSecretParams added in v0.4.0

type RewrapEnvVarSecretParams struct {
	NewStored string      `json:"new_stored"`
	RowKey    pgtype.UUID `json:"row_key"`
	OldStored string      `json:"old_stored"`
}

type RewrapGitCredentialSecretParams added in v0.4.0

type RewrapGitCredentialSecretParams struct {
	NewStored string      `json:"new_stored"`
	RowKey    pgtype.UUID `json:"row_key"`
	OldStored string      `json:"old_stored"`
}

type RewrapHostManagementSecretParams added in v0.6.1

type RewrapHostManagementSecretParams struct {
	Field     string      `json:"field"`
	NewStored string      `json:"new_stored"`
	RowKey    pgtype.UUID `json:"row_key"`
	OldStored string      `json:"old_stored"`
}

type RewrapMCPSecretParams added in v0.4.0

type RewrapMCPSecretParams struct {
	Field     string      `json:"field"`
	NewStored string      `json:"new_stored"`
	RowKey    pgtype.UUID `json:"row_key"`
	OldStored string      `json:"old_stored"`
}

type RewrapOAuthStateSecretParams added in v0.4.0

type RewrapOAuthStateSecretParams struct {
	NewStored string `json:"new_stored"`
	RowKey    string `json:"row_key"`
	OldStored string `json:"old_stored"`
}

type RewrapProviderSecretParams added in v0.4.0

type RewrapProviderSecretParams struct {
	NewStored string      `json:"new_stored"`
	RowKey    pgtype.UUID `json:"row_key"`
	OldStored string      `json:"old_stored"`
}

type RewrapWebhookSecretParams added in v0.4.0

type RewrapWebhookSecretParams struct {
	NewStored string      `json:"new_stored"`
	RowKey    pgtype.UUID `json:"row_key"`
	OldStored string      `json:"old_stored"`
}

type RollbackMCPTaskResumeParams added in v0.4.0

type RollbackMCPTaskResumeParams struct {
	ID         pgtype.UUID `json:"id"`
	AgentID    pgtype.UUID `json:"agent_id"`
	TriggerRef string      `json:"trigger_ref"`
}

type RollbackPromptRunResumeParams added in v0.4.0

type RollbackPromptRunResumeParams struct {
	ID         pgtype.UUID `json:"id"`
	AgentID    pgtype.UUID `json:"agent_id"`
	TriggerRef string      `json:"trigger_ref"`
}

type RotateUserSessionRefreshTokenParams added in v0.4.0

type RotateUserSessionRefreshTokenParams struct {
	RefreshTokenHash []byte      `json:"refresh_token_hash"`
	ID               pgtype.UUID `json:"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"`
	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"`
	ParentRunID          pgtype.UUID        `json:"parent_run_id"`
	LlmTokensCached      int32              `json:"llm_tokens_cached"`
	CallerUserID         pgtype.UUID        `json:"caller_user_id"`
	CallerConversationID pgtype.UUID        `json:"caller_conversation_id"`
	CallerAccess         string             `json:"caller_access"`
}

type ScrubClaimedConnectorTransferGrantParams added in v0.6.1

type ScrubClaimedConnectorTransferGrantParams struct {
	JobID        pgtype.UUID `json:"job_id"`
	CleanupToken pgtype.UUID `json:"cleanup_token"`
}

type SetAgentBuildDeploymentTargetParams added in v0.5.0

type SetAgentBuildDeploymentTargetParams struct {
	DeploymentPhase        string      `json:"deployment_phase"`
	DeploymentTargetStatus pgtype.Text `json:"deployment_target_status"`
	DeploymentToken        pgtype.UUID `json:"deployment_token"`
	BuildID                pgtype.UUID `json:"build_id"`
	AgentID                pgtype.UUID `json:"agent_id"`
}

type SetAgentBuildIntegrationTokenParams added in v0.4.0

type SetAgentBuildIntegrationTokenParams struct {
	IntegrationTokenHash      []byte             `json:"integration_token_hash"`
	IntegrationTokenExpiresAt pgtype.Timestamptz `json:"integration_token_expires_at"`
	ID                        pgtype.UUID        `json:"id"`
}

type SetAgentBuildModelParams added in v0.4.0

type SetAgentBuildModelParams struct {
	BuildModel string      `json:"build_model"`
	ID         pgtype.UUID `json:"id"`
}

type SetAgentDeploymentRollbackParams added in v0.5.0

type SetAgentDeploymentRollbackParams struct {
	BuildID         pgtype.UUID `json:"build_id"`
	AgentID         pgtype.UUID `json:"agent_id"`
	DeploymentToken pgtype.UUID `json:"deployment_token"`
}

type SetAgentEnvVarValueParams added in v0.2.12

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

type SetAgentModelSlotAssignmentParams

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

type SetConnectorLabelsParams added in v0.6.1

type SetConnectorLabelsParams struct {
	Labels []byte      `json:"labels"`
	ID     pgtype.UUID `json:"id"`
}

type SetConnectorOrchestrationCanaryStateParams added in v0.6.1

type SetConnectorOrchestrationCanaryStateParams struct {
	CanaryPhase          string      `json:"canary_phase"`
	CanarySucceededCount int32       `json:"canary_succeeded_count"`
	ID                   pgtype.UUID `json:"id"`
}

type SetConnectorOrchestrationStatusParams added in v0.6.1

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

type SetConversationCheckpointParams

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

type SetSystemConversationCheckpointParams added in v0.4.0

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

type SetSystemConversationContextCheckpointParams added in v0.4.0

type SetSystemConversationContextCheckpointParams struct {
	CheckpointMessageID pgtype.UUID `json:"checkpoint_message_id"`
	ID                  pgtype.UUID `json:"id"`
}

type SetTempPasswordParams added in v0.4.0

type SetTempPasswordParams struct {
	PasswordHash pgtype.Text `json:"password_hash"`
	ID           pgtype.UUID `json:"id"`
}

type SkipConnectorJobParams added in v0.6.1

type SkipConnectorJobParams struct {
	ErrorMessage pgtype.Text `json:"error_message"`
	ID           pgtype.UUID `json:"id"`
}

type StageConnectionOAuthAppByIDParams added in v0.4.0

type StageConnectionOAuthAppByIDParams struct {
	ClientID     string      `json:"client_id"`
	ClientSecret string      `json:"client_secret"`
	ID           pgtype.UUID `json:"id"`
}

type StageMCPServerOAuthAppByIDParams added in v0.4.0

type StageMCPServerOAuthAppByIDParams struct {
	ClientID     string      `json:"client_id"`
	ClientSecret string      `json:"client_secret"`
	ID           pgtype.UUID `json:"id"`
}

type StartAgentJobAttemptParams added in v0.5.0

type StartAgentJobAttemptParams struct {
	RunID         pgtype.UUID `json:"run_id"`
	JobID         pgtype.UUID `json:"job_id"`
	AttemptNumber int32       `json:"attempt_number"`
	LeaseOwner    pgtype.UUID `json:"lease_owner"`
	LeaseToken    pgtype.UUID `json:"lease_token"`
}

type StartConnectorJobAttemptParams added in v0.6.1

type StartConnectorJobAttemptParams struct {
	JobID        pgtype.UUID `json:"job_id"`
	AttemptToken pgtype.UUID `json:"attempt_token"`
	ConnectorID  pgtype.UUID `json:"connector_id"`
}

type StartInitialAgentBuildParams added in v0.4.0

type StartInitialAgentBuildParams struct {
	ID                pgtype.UUID `json:"id"`
	AgentTokenVersion int64       `json:"agent_token_version"`
}

type StopAgentAndRotateTokenParams added in v0.4.0

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

type SubscribeTopicParams

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

type SucceedAgentJobAttemptParams added in v0.5.0

type SucceedAgentJobAttemptParams struct {
	JobID         pgtype.UUID `json:"job_id"`
	AttemptNumber int32       `json:"attempt_number"`
	LeaseOwner    pgtype.UUID `json:"lease_owner"`
	LeaseToken    pgtype.UUID `json:"lease_token"`
}

type SucceedAgentJobParams added in v0.5.0

type SucceedAgentJobParams struct {
	OutputPayload []byte      `json:"output_payload"`
	ID            pgtype.UUID `json:"id"`
}

type SummarizeAgentBuildBlockingJobsParams added in v0.5.0

type SummarizeAgentBuildBlockingJobsParams struct {
	BuildID pgtype.UUID `json:"build_id"`
	AgentID pgtype.UUID `json:"agent_id"`
}

type SummarizeAgentBuildBlockingJobsRow added in v0.5.0

type SummarizeAgentBuildBlockingJobsRow struct {
	HandlerName      string `json:"handler_name"`
	HandlerVersion   int32  `json:"handler_version"`
	InputSchemaHash  string `json:"input_schema_hash"`
	OutputSchemaHash string `json:"output_schema_hash"`
	QueuedCount      int64  `json:"queued_count"`
	RunningCount     int64  `json:"running_count"`
}

type SuspendSystemRunParams added in v0.4.0

type SuspendSystemRunParams struct {
	ID             pgtype.UUID `json:"id"`
	ConversationID pgtype.UUID `json:"conversation_id"`
}

type SyncHostParams added in v0.6.1

type SyncHostParams struct {
	Name            string      `json:"name"`
	Platform        string      `json:"platform"`
	Architecture    string      `json:"architecture"`
	AccessMode      string      `json:"access_mode"`
	Version         string      `json:"version"`
	ProtocolVersion int32       `json:"protocol_version"`
	ID              pgtype.UUID `json:"id"`
}

type SyncHostedConnectorParams added in v0.6.1

type SyncHostedConnectorParams struct {
	ProtocolMajor    pgtype.Int4 `json:"protocol_major"`
	ProtocolMinor    pgtype.Int4 `json:"protocol_minor"`
	Features         []string    `json:"features"`
	ArtifactVersion  pgtype.Text `json:"artifact_version"`
	ArtifactDigest   pgtype.Text `json:"artifact_digest"`
	InterfaceHash    pgtype.Text `json:"interface_hash"`
	Readiness        string      `json:"readiness"`
	ReadinessMessage pgtype.Text `json:"readiness_message"`
	ID               pgtype.UUID `json:"id"`
	HostID           pgtype.UUID `json:"host_id"`
}

type SystemAudit added in v0.4.0

type SystemAudit struct {
	ID             int64              `json:"id"`
	UserID         pgtype.UUID        `json:"user_id"`
	ConversationID pgtype.UUID        `json:"conversation_id"`
	Tool           string             `json:"tool"`
	Args           []byte             `json:"args"`
	ResultSummary  string             `json:"result_summary"`
	Ok             bool               `json:"ok"`
	CreatedAt      pgtype.Timestamptz `json:"created_at"`
}

type SystemConversation added in v0.4.0

type SystemConversation struct {
	ID                         pgtype.UUID        `json:"id"`
	UserID                     pgtype.UUID        `json:"user_id"`
	Title                      string             `json:"title"`
	Status                     string             `json:"status"`
	Checkpoint                 []byte             `json:"checkpoint"`
	ContextCheckpointMessageID pgtype.UUID        `json:"context_checkpoint_message_id"`
	Settings                   []byte             `json:"settings"`
	CreatedAt                  pgtype.Timestamptz `json:"created_at"`
	UpdatedAt                  pgtype.Timestamptz `json:"updated_at"`
	Source                     string             `json:"source"`
	BridgeID                   pgtype.UUID        `json:"bridge_id"`
	ExternalID                 pgtype.Text        `json:"external_id"`
	SuspendedRunID             pgtype.UUID        `json:"suspended_run_id"`
}

type SystemMessage added in v0.4.0

type SystemMessage struct {
	ID             pgtype.UUID        `json:"id"`
	Seq            int64              `json:"seq"`
	ConversationID pgtype.UUID        `json:"conversation_id"`
	Role           string             `json:"role"`
	Source         string             `json:"source"`
	Content        string             `json:"content"`
	Parts          []byte             `json:"parts"`
	RunID          pgtype.UUID        `json:"run_id"`
	TokensIn       int32              `json:"tokens_in"`
	TokensOut      int32              `json:"tokens_out"`
	CostEstimate   pgtype.Numeric     `json:"cost_estimate"`
	CreatedAt      pgtype.Timestamptz `json:"created_at"`
}

type SystemRun added in v0.4.0

type SystemRun struct {
	ID              pgtype.UUID        `json:"id"`
	ConversationID  pgtype.UUID        `json:"conversation_id"`
	UserID          pgtype.UUID        `json:"user_id"`
	Status          string             `json:"status"`
	TriggerType     string             `json:"trigger_type"`
	ErrorMessage    string             `json:"error_message"`
	LlmCalls        int32              `json:"llm_calls"`
	LlmTokensIn     int64              `json:"llm_tokens_in"`
	LlmTokensOut    int64              `json:"llm_tokens_out"`
	LlmCostEstimate float64            `json:"llm_cost_estimate"`
	StartedAt       pgtype.Timestamptz `json:"started_at"`
	FinishedAt      pgtype.Timestamptz `json:"finished_at"`
}

type SystemSetting

type SystemSetting struct {
	ID                         bool               `json:"id"`
	DefaultBuildProviderID     pgtype.UUID        `json:"default_build_provider_id"`
	DefaultBuildModel          string             `json:"default_build_model"`
	DefaultExecProviderID      pgtype.UUID        `json:"default_exec_provider_id"`
	DefaultExecModel           string             `json:"default_exec_model"`
	DefaultSttProviderID       pgtype.UUID        `json:"default_stt_provider_id"`
	DefaultSttModel            string             `json:"default_stt_model"`
	DefaultVisionProviderID    pgtype.UUID        `json:"default_vision_provider_id"`
	DefaultVisionModel         string             `json:"default_vision_model"`
	DefaultTtsProviderID       pgtype.UUID        `json:"default_tts_provider_id"`
	DefaultTtsModel            string             `json:"default_tts_model"`
	DefaultImageGenProviderID  pgtype.UUID        `json:"default_image_gen_provider_id"`
	DefaultImageGenModel       string             `json:"default_image_gen_model"`
	DefaultEmbeddingProviderID pgtype.UUID        `json:"default_embedding_provider_id"`
	DefaultEmbeddingModel      string             `json:"default_embedding_model"`
	DefaultSearchProviderID    pgtype.UUID        `json:"default_search_provider_id"`
	DefaultSearchModel         string             `json:"default_search_model"`
	ActivationCode             pgtype.Text        `json:"activation_code"`
	CreatedAt                  pgtype.Timestamptz `json:"created_at"`
	UpdatedAt                  pgtype.Timestamptz `json:"updated_at"`
	LastSeenSdkVersion         string             `json:"last_seen_sdk_version"`
	UiLocale                   string             `json:"ui_locale"`
}

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 TombstoneConnectorInventoryParams added in v0.6.1

type TombstoneConnectorInventoryParams struct {
	InventoryRevision     int64       `json:"inventory_revision"`
	InventoryMutationHash pgtype.Text `json:"inventory_mutation_hash"`
	ID                    pgtype.UUID `json:"id"`
}

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 TransferConnectionResourceOwnershipParams added in v0.6.1

type TransferConnectionResourceOwnershipParams struct {
	NewOwnerUserID pgtype.UUID `json:"new_owner_user_id"`
	ResourceID     pgtype.UUID `json:"resource_id"`
}

type TransferConnectorResourceOwnershipParams added in v0.6.1

type TransferConnectorResourceOwnershipParams struct {
	NewOwnerUserID pgtype.UUID `json:"new_owner_user_id"`
	ResourceID     pgtype.UUID `json:"resource_id"`
}

type TransferConnectorTargetGroupResourceOwnershipParams added in v0.6.1

type TransferConnectorTargetGroupResourceOwnershipParams struct {
	NewOwnerUserID pgtype.UUID `json:"new_owner_user_id"`
	ResourceID     pgtype.UUID `json:"resource_id"`
}

type TransferGitCredentialResourceOwnershipParams added in v0.6.1

type TransferGitCredentialResourceOwnershipParams struct {
	NewOwnerUserID pgtype.UUID `json:"new_owner_user_id"`
	ResourceID     pgtype.UUID `json:"resource_id"`
}

type TransferHostResourceOwnershipParams added in v0.6.1

type TransferHostResourceOwnershipParams struct {
	NewOwnerUserID pgtype.UUID `json:"new_owner_user_id"`
	ResourceID     pgtype.UUID `json:"resource_id"`
}

type TransferMCPServerResourceOwnershipParams added in v0.6.1

type TransferMCPServerResourceOwnershipParams struct {
	NewOwnerUserID pgtype.UUID `json:"new_owner_user_id"`
	ResourceID     pgtype.UUID `json:"resource_id"`
}

type UnbindResourceNeedParams added in v0.4.0

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

type UnsubscribeTopicParams

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

type UpdateAgentA2ASettingsParams added in v0.4.0

type UpdateAgentA2ASettingsParams struct {
	McpEnabled        bool        `json:"mcp_enabled"`
	AllowPublicMcp    bool        `json:"allow_public_mcp"`
	AllowPublicRoutes bool        `json:"allow_public_routes"`
	ID                pgtype.UUID `json:"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"`
	SdkVersion   string      `json:"sdk_version"`
	ExitStatus   string      `json:"exit_status"`
	ExitMessage  string      `json:"exit_message"`
	FailureKind  string      `json:"failure_kind"`
	ID           pgtype.UUID `json:"id"`
}

type UpdateAgentBuildDeploymentPhaseParams added in v0.5.0

type UpdateAgentBuildDeploymentPhaseParams struct {
	DeploymentPhase string      `json:"deployment_phase"`
	BuildID         pgtype.UUID `json:"build_id"`
	AgentID         pgtype.UUID `json:"agent_id"`
	DeploymentToken pgtype.UUID `json:"deployment_token"`
}

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 UpdateAgentBuildTodosParams added in v0.4.0

type UpdateAgentBuildTodosParams struct {
	Todos []byte      `json:"todos"`
	ID    pgtype.UUID `json:"id"`
}

type UpdateAgentConfigParams

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

type UpdateAgentDBPasswordParams added in v0.2.11

type UpdateAgentDBPasswordParams struct {
	DbPassword string      `json:"db_password"`
	ID         pgtype.UUID `json:"id"`
}

type UpdateAgentDescriptionParams

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

type UpdateAgentEmojiParams added in v0.4.0

type UpdateAgentEmojiParams struct {
	Emoji string      `json:"emoji"`
	ID    pgtype.UUID `json:"id"`
}

type UpdateAgentErrorMessageParams

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

type UpdateAgentFieldsParams

type UpdateAgentFieldsParams struct {
	Name    string      `json:"name"`
	Slug    string      `json:"slug"`
	AutoFix bool        `json:"auto_fix"`
	ID      pgtype.UUID `json:"id"`
}

type UpdateAgentGitLastSyncedRefParams added in v0.4.0

type UpdateAgentGitLastSyncedRefParams struct {
	ID               pgtype.UUID `json:"id"`
	GitLastSyncedRef string      `json:"git_last_synced_ref"`
}

type UpdateAgentInstructionsParams added in v0.4.0

type UpdateAgentInstructionsParams struct {
	Instructions []byte      `json:"instructions"`
	ID           pgtype.UUID `json:"id"`
}

type UpdateAgentJobProgressParams added in v0.5.0

type UpdateAgentJobProgressParams struct {
	ProgressPhase     pgtype.Text `json:"progress_phase"`
	ProgressMessage   pgtype.Text `json:"progress_message"`
	ProgressCompleted pgtype.Int8 `json:"progress_completed"`
	ProgressTotal     pgtype.Int8 `json:"progress_total"`
	AttemptNumber     pgtype.Int4 `json:"attempt_number"`
	JobID             pgtype.UUID `json:"job_id"`
	AgentID           pgtype.UUID `json:"agent_id"`
	RuntimeGeneration int64       `json:"runtime_generation"`
	RunID             pgtype.UUID `json:"run_id"`
	LeaseToken        pgtype.UUID `json:"lease_token"`
}

type UpdateAgentModelsParams

type UpdateAgentModelsParams struct {
	BuildProviderID     pgtype.UUID `json:"build_provider_id"`
	BuildModel          string      `json:"build_model"`
	ExecProviderID      pgtype.UUID `json:"exec_provider_id"`
	ExecModel           string      `json:"exec_model"`
	SttProviderID       pgtype.UUID `json:"stt_provider_id"`
	SttModel            string      `json:"stt_model"`
	VisionProviderID    pgtype.UUID `json:"vision_provider_id"`
	VisionModel         string      `json:"vision_model"`
	TtsProviderID       pgtype.UUID `json:"tts_provider_id"`
	TtsModel            string      `json:"tts_model"`
	ImageGenProviderID  pgtype.UUID `json:"image_gen_provider_id"`
	ImageGenModel       string      `json:"image_gen_model"`
	EmbeddingProviderID pgtype.UUID `json:"embedding_provider_id"`
	EmbeddingModel      string      `json:"embedding_model"`
	SearchProviderID    pgtype.UUID `json:"search_provider_id"`
	SearchModel         string      `json:"search_model"`
	ID                  pgtype.UUID `json:"id"`
}

type UpdateAgentOwnerParams added in v0.4.0

type UpdateAgentOwnerParams struct {
	OwnerPrincipalID pgtype.UUID `json:"owner_principal_id"`
	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 UpdateAgentToolsHashParams added in v0.4.0

type UpdateAgentToolsHashParams struct {
	ToolsHash []byte      `json:"tools_hash"`
	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 UpdateBridgeBindingParams added in v0.4.0

type UpdateBridgeBindingParams struct {
	AgentID   pgtype.UUID `json:"agent_id"`
	IsSystem  bool        `json:"is_system"`
	IsManager bool        `json:"is_manager"`
	ID        pgtype.UUID `json:"id"`
}

type UpdateBridgeIdentityParams added in v0.4.0

type UpdateBridgeIdentityParams struct {
	Name        string      `json:"name"`
	BotUsername string      `json:"bot_username"`
	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 UpdateConnectionCredentialsByIDParams added in v0.4.0

type UpdateConnectionCredentialsByIDParams struct {
	AccessTokenRef string             `json:"access_token_ref"`
	TokenExpiresAt pgtype.Timestamptz `json:"token_expires_at"`
	RefreshToken   string             `json:"refresh_token"`
	GrantedScopes  string             `json:"granted_scopes"`
	ScopesVerified bool               `json:"scopes_verified"`
	ID             pgtype.UUID        `json:"id"`
}

type UpdateConnectionOwnerByIDParams added in v0.4.0

type UpdateConnectionOwnerByIDParams struct {
	OwnerPrincipalID pgtype.UUID `json:"owner_principal_id"`
	ID               pgtype.UUID `json:"id"`
}

type UpdateConversationSettingsParams

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

type UpdateCredentialSignCountParams added in v0.4.0

type UpdateCredentialSignCountParams struct {
	SignCount    int64  `json:"sign_count"`
	CloneWarning bool   `json:"clone_warning"`
	BackupState  bool   `json:"backup_state"`
	CredentialID []byte `json:"credential_id"`
}

type UpdateMCPServerCredentialsByIDParams added in v0.4.0

type UpdateMCPServerCredentialsByIDParams struct {
	AccessTokenRef string             `json:"access_token_ref"`
	TokenExpiresAt pgtype.Timestamptz `json:"token_expires_at"`
	RefreshToken   string             `json:"refresh_token"`
	GrantedScopes  string             `json:"granted_scopes"`
	ScopesVerified bool               `json:"scopes_verified"`
	ID             pgtype.UUID        `json:"id"`
}

type UpdateMCPServerDiscoveryByIDParams added in v0.4.0

type UpdateMCPServerDiscoveryByIDParams struct {
	AuthUrl              string      `json:"auth_url"`
	TokenUrl             string      `json:"token_url"`
	RegistrationEndpoint string      `json:"registration_endpoint"`
	ID                   pgtype.UUID `json:"id"`
}

type UpdateMCPServerOwnerByIDParams added in v0.4.0

type UpdateMCPServerOwnerByIDParams struct {
	OwnerPrincipalID pgtype.UUID `json:"owner_principal_id"`
	ID               pgtype.UUID `json:"id"`
}

type UpdateMCPServerToolSchemasByIDParams added in v0.4.0

type UpdateMCPServerToolSchemasByIDParams struct {
	ToolSchemas        []byte      `json:"tool_schemas"`
	ServerInstructions string      `json:"server_instructions"`
	ID                 pgtype.UUID `json:"id"`
}

type UpdateProviderParams

type UpdateProviderParams struct {
	DisplayName     string      `json:"display_name"`
	Slug            string      `json:"slug"`
	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 UpdateRunStatusParams

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

type UpdateSiblingMaxAccessParams added in v0.4.0

type UpdateSiblingMaxAccessParams struct {
	MaxAccess      string      `json:"max_access"`
	ParentAgentID  pgtype.UUID `json:"parent_agent_id"`
	SiblingAgentID pgtype.UUID `json:"sibling_agent_id"`
}

type UpdateSystemAuditResultParams added in v0.4.0

type UpdateSystemAuditResultParams struct {
	ResultSummary string `json:"result_summary"`
	Ok            bool   `json:"ok"`
	ID            int64  `json:"id"`
}

type UpdateSystemConversationSettingsParams added in v0.4.0

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

type UpdateSystemRunStatusParams added in v0.4.0

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

type UpdateSystemSettingsParams

type UpdateSystemSettingsParams struct {
	DefaultBuildProviderID     pgtype.UUID `json:"default_build_provider_id"`
	DefaultBuildModel          string      `json:"default_build_model"`
	DefaultExecProviderID      pgtype.UUID `json:"default_exec_provider_id"`
	DefaultExecModel           string      `json:"default_exec_model"`
	DefaultSttProviderID       pgtype.UUID `json:"default_stt_provider_id"`
	DefaultSttModel            string      `json:"default_stt_model"`
	DefaultVisionProviderID    pgtype.UUID `json:"default_vision_provider_id"`
	DefaultVisionModel         string      `json:"default_vision_model"`
	DefaultTtsProviderID       pgtype.UUID `json:"default_tts_provider_id"`
	DefaultTtsModel            string      `json:"default_tts_model"`
	DefaultImageGenProviderID  pgtype.UUID `json:"default_image_gen_provider_id"`
	DefaultImageGenModel       string      `json:"default_image_gen_model"`
	DefaultEmbeddingProviderID pgtype.UUID `json:"default_embedding_provider_id"`
	DefaultEmbeddingModel      string      `json:"default_embedding_model"`
	DefaultSearchProviderID    pgtype.UUID `json:"default_search_provider_id"`
	DefaultSearchModel         string      `json:"default_search_model"`
	UiLocale                   string      `json:"ui_locale"`
}

type UpdateUserDisplayNameParams added in v0.4.0

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

type UpdateUserPasswordAndRevokeSessionsParams added in v0.4.0

type UpdateUserPasswordAndRevokeSessionsParams struct {
	PasswordHash      pgtype.Text `json:"password_hash"`
	ID                pgtype.UUID `json:"id"`
	PreserveSessionID pgtype.UUID `json:"preserve_session_id"`
}

type UpdateUserRoleParams

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

type UpdateWebhookSecretParams

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

type UpsertAgentEnvVarParams added in v0.2.12

type UpsertAgentEnvVarParams struct {
	AgentID      pgtype.UUID `json:"agent_id"`
	Slug         string      `json:"slug"`
	Description  string      `json:"description"`
	IsSecret     bool        `json:"is_secret"`
	DefaultValue string      `json:"default_value"`
	Pattern      string      `json:"pattern"`
}

type UpsertAgentGrantParams added in v0.4.0

type UpsertAgentGrantParams struct {
	AgentID   pgtype.UUID `json:"agent_id"`
	GranteeID pgtype.UUID `json:"grantee_id"`
	Role      string      `json:"role"`
}

type UpsertAgentJobCronParams added in v0.5.0

type UpsertAgentJobCronParams struct {
	AgentID           pgtype.UUID        `json:"agent_id"`
	Slug              string             `json:"slug"`
	Schedule          string             `json:"schedule"`
	Description       string             `json:"description"`
	HandlerName       string             `json:"handler_name"`
	HandlerVersion    int32              `json:"handler_version"`
	InputSchemaHash   string             `json:"input_schema_hash"`
	OutputSchemaHash  string             `json:"output_schema_hash"`
	InputPayload      []byte             `json:"input_payload"`
	AgentTokenVersion int64              `json:"agent_token_version"`
	NextFireAt        pgtype.Timestamptz `json:"next_fire_at"`
}

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"`
	LlmHint      string      `json:"llm_hint"`
	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"`
	DisplayName       string      `json:"display_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"`
	AuthParams        []byte      `json:"auth_params"`
	Headers           []byte      `json:"headers"`
	Access            string      `json:"access"`
}

type UpsertConnectionResourceGrantParams added in v0.6.1

type UpsertConnectionResourceGrantParams struct {
	ResourceID   pgtype.UUID `json:"resource_id"`
	GranteeID    pgtype.UUID `json:"grantee_id"`
	Capabilities []string    `json:"capabilities"`
}

type UpsertConnectorArtifactBlobParams added in v0.6.1

type UpsertConnectorArtifactBlobParams struct {
	Digest    string `json:"digest"`
	ObjectKey string `json:"object_key"`
	SizeBytes int64  `json:"size_bytes"`
	MediaType string `json:"media_type"`
}

type UpsertConnectorResourceGrantParams added in v0.6.1

type UpsertConnectorResourceGrantParams struct {
	ResourceID   pgtype.UUID `json:"resource_id"`
	GranteeID    pgtype.UUID `json:"grantee_id"`
	Capabilities []string    `json:"capabilities"`
}

type UpsertConnectorTargetGroupResourceGrantParams added in v0.6.1

type UpsertConnectorTargetGroupResourceGrantParams struct {
	ResourceID   pgtype.UUID `json:"resource_id"`
	GranteeID    pgtype.UUID `json:"grantee_id"`
	Capabilities []string    `json:"capabilities"`
}

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"`
	Scope          string      `json:"scope"`
}

type UpsertGitCredentialResourceGrantParams added in v0.6.1

type UpsertGitCredentialResourceGrantParams struct {
	ResourceID   pgtype.UUID `json:"resource_id"`
	GranteeID    pgtype.UUID `json:"grantee_id"`
	Capabilities []string    `json:"capabilities"`
}

type UpsertGrantParams added in v0.4.0

type UpsertGrantParams struct {
	UserID    pgtype.UUID        `json:"user_id"`
	ClientID  string             `json:"client_id"`
	AgentID   pgtype.UUID        `json:"agent_id"`
	Scope     string             `json:"scope"`
	ExpiresAt pgtype.Timestamptz `json:"expires_at"`
}

type UpsertHostResourceGrantParams added in v0.6.1

type UpsertHostResourceGrantParams struct {
	ResourceID   pgtype.UUID `json:"resource_id"`
	GranteeID    pgtype.UUID `json:"grantee_id"`
	Capabilities []string    `json:"capabilities"`
}

type UpsertJobHandlerParams added in v0.5.0

type UpsertJobHandlerParams struct {
	AgentID           pgtype.UUID `json:"agent_id"`
	Name              string      `json:"name"`
	Version           int32       `json:"version"`
	Description       string      `json:"description"`
	TimeoutMs         int64       `json:"timeout_ms"`
	MaxAttempts       int32       `json:"max_attempts"`
	MaxConcurrency    int32       `json:"max_concurrency"`
	InputSchema       []byte      `json:"input_schema"`
	OutputSchema      []byte      `json:"output_schema"`
	InputSchemaHash   string      `json:"input_schema_hash"`
	OutputSchemaHash  string      `json:"output_schema_hash"`
	AgentTokenVersion int64       `json:"agent_token_version"`
}

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"`
	DisplayName          string      `json:"display_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"`
	AuthInjection        []byte      `json:"auth_injection"`
}

type UpsertMCPServerResourceGrantParams added in v0.6.1

type UpsertMCPServerResourceGrantParams struct {
	ResourceID   pgtype.UUID `json:"resource_id"`
	GranteeID    pgtype.UUID `json:"grantee_id"`
	Capabilities []string    `json:"capabilities"`
}

type UpsertResourceNeedParams added in v0.4.0

type UpsertResourceNeedParams struct {
	AgentID           pgtype.UUID `json:"agent_id"`
	Type              string      `json:"type"`
	Slug              string      `json:"slug"`
	Description       string      `json:"description"`
	SetupInstructions string      `json:"setup_instructions"`
	ExpectedUrl       string      `json:"expected_url"`
	ExpectedScopes    string      `json:"expected_scopes"`
	Spec              []byte      `json:"spec"`
}

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"`
	Checkpoint   []byte      `json:"checkpoint"`
}

type UpsertTopicParams

type UpsertTopicParams struct {
	AgentID     pgtype.UUID `json:"agent_id"`
	Slug        string      `json:"slug"`
	Description string      `json:"description"`
	LlmHint     string      `json:"llm_hint"`
	Access      string      `json:"access"`
	PerUser     bool        `json:"per_user"`
}

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 UsageByAgentRow added in v0.4.0

type UsageByAgentRow struct {
	AgentSlug    string  `json:"agent_slug"`
	AgentName    string  `json:"agent_name"`
	Deleted      bool    `json:"deleted"`
	OwnerEmail   string  `json:"owner_email"`
	OwnerName    string  `json:"owner_name"`
	Calls        int64   `json:"calls"`
	TokensIn     int64   `json:"tokens_in"`
	TokensOut    int64   `json:"tokens_out"`
	TokensCached int64   `json:"tokens_cached"`
	CostTotal    float64 `json:"cost_total"`
}

type UsageByModelRow added in v0.4.0

type UsageByModelRow struct {
	ProviderCatalogID string  `json:"provider_catalog_id"`
	ProviderSlug      string  `json:"provider_slug"`
	Model             string  `json:"model"`
	Calls             int64   `json:"calls"`
	TokensIn          int64   `json:"tokens_in"`
	TokensOut         int64   `json:"tokens_out"`
	CostTotal         float64 `json:"cost_total"`
}

type UsageByUserRow added in v0.4.0

type UsageByUserRow struct {
	UserEmail    string  `json:"user_email"`
	Deleted      bool    `json:"deleted"`
	Calls        int64   `json:"calls"`
	TokensIn     int64   `json:"tokens_in"`
	TokensOut    int64   `json:"tokens_out"`
	TokensCached int64   `json:"tokens_cached"`
	CostTotal    float64 `json:"cost_total"`
}

type UsageSummaryRow added in v0.4.0

type UsageSummaryRow struct {
	Calls        int64   `json:"calls"`
	TokensIn     int64   `json:"tokens_in"`
	TokensOut    int64   `json:"tokens_out"`
	TokensCached int64   `json:"tokens_cached"`
	CostTotal    float64 `json:"cost_total"`
}

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       pgtype.Text        `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"`
	AuthEpoch          int64              `json:"auth_epoch"`
}

type UserSession added in v0.4.0

type UserSession struct {
	ID               pgtype.UUID        `json:"id"`
	UserID           pgtype.UUID        `json:"user_id"`
	Kind             string             `json:"kind"`
	ClientName       string             `json:"client_name"`
	DeviceName       string             `json:"device_name"`
	RefreshTokenHash []byte             `json:"refresh_token_hash"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	LastUsedAt       pgtype.Timestamptz `json:"last_used_at"`
	ExpiresAt        pgtype.Timestamptz `json:"expires_at"`
	RevokedAt        pgtype.Timestamptz `json:"revoked_at"`
	AuthenticatedAt  pgtype.Timestamptz `json:"authenticated_at"`
}

type WebauthnCeremony added in v0.4.0

type WebauthnCeremony struct {
	ID          pgtype.UUID        `json:"id"`
	UserID      pgtype.UUID        `json:"user_id"`
	Kind        string             `json:"kind"`
	SessionData []byte             `json:"session_data"`
	CreatedAt   pgtype.Timestamptz `json:"created_at"`
	ExpiresAt   pgtype.Timestamptz `json:"expires_at"`
}

type WebauthnCredential added in v0.4.0

type WebauthnCredential struct {
	ID              pgtype.UUID        `json:"id"`
	UserID          pgtype.UUID        `json:"user_id"`
	CredentialID    []byte             `json:"credential_id"`
	PublicKey       []byte             `json:"public_key"`
	AttestationType string             `json:"attestation_type"`
	Aaguid          []byte             `json:"aaguid"`
	SignCount       int64              `json:"sign_count"`
	Transports      []string           `json:"transports"`
	BackupEligible  bool               `json:"backup_eligible"`
	BackupState     bool               `json:"backup_state"`
	CloneWarning    bool               `json:"clone_warning"`
	FriendlyName    string             `json:"friendly_name"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
	LastUsedAt      pgtype.Timestamptz `json:"last_used_at"`
}

Jump to

Keyboard shortcuts

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