sqlc

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcceptSessionRunDecisionContinuationParams added in v0.21.0

type AcceptSessionRunDecisionContinuationParams struct {
	DecisionID   string      `json:"decision_id"`
	DecisionKind string      `json:"decision_kind"`
	BotID        pgtype.UUID `json:"bot_id"`
	SessionID    pgtype.UUID `json:"session_id"`
	RunID        pgtype.UUID `json:"run_id"`
	FencingToken int64       `json:"fencing_token"`
}

type AcpSessionPublication

type AcpSessionPublication struct {
	TeamID          pgtype.UUID        `json:"team_id"`
	SessionID       pgtype.UUID        `json:"session_id"`
	RunID           pgtype.UUID        `json:"run_id"`
	CheckpointReset bool               `json:"checkpoint_reset"`
	UpdatedAt       pgtype.Timestamptz `json:"updated_at"`
}

type AcpSessionState

type AcpSessionState struct {
	TeamID              pgtype.UUID        `json:"team_id"`
	SessionID           pgtype.UUID        `json:"session_id"`
	ThroughRunID        pgtype.UUID        `json:"through_run_id"`
	AgentID             string             `json:"agent_id"`
	AcpSessionID        string             `json:"acp_session_id"`
	Cwd                 string             `json:"cwd"`
	TranscriptPath      string             `json:"transcript_path"`
	RuntimeFencingToken int64              `json:"runtime_fencing_token"`
	FileCount           int32              `json:"file_count"`
	RecordCount         int64              `json:"record_count"`
	FileShapes          []byte             `json:"file_shapes"`
	CreatedAt           pgtype.Timestamptz `json:"created_at"`
	UpdatedAt           pgtype.Timestamptz `json:"updated_at"`
}

type AcpSessionStateLine

type AcpSessionStateLine struct {
	TeamID       pgtype.UUID `json:"team_id"`
	SessionID    pgtype.UUID `json:"session_id"`
	FilePath     string      `json:"file_path"`
	LineNumber   int64       `json:"line_number"`
	Content      string      `json:"content"`
	ContentBytes int32       `json:"content_bytes"`
}

type AcquireLockedBotRuntimeResetParams

type AcquireLockedBotRuntimeResetParams struct {
	ResetToken        pgtype.UUID `json:"reset_token"`
	LeaseMilliseconds int64       `json:"lease_milliseconds"`
	BotID             pgtype.UUID `json:"bot_id"`
}

type AcquireLockedBotSessionRuntimeResetParams

type AcquireLockedBotSessionRuntimeResetParams struct {
	ResetToken        pgtype.UUID `json:"reset_token"`
	LeaseMilliseconds int64       `json:"lease_milliseconds"`
	SessionID         pgtype.UUID `json:"session_id"`
	BotID             pgtype.UUID `json:"bot_id"`
}

type ActivateSessionRuntimeFenceParams

type ActivateSessionRuntimeFenceParams struct {
	RuntimeFencingToken int64       `json:"runtime_fencing_token"`
	SessionID           pgtype.UUID `json:"session_id"`
	BotID               pgtype.UUID `json:"bot_id"`
}

type ActivateUserRuntimeParams

type ActivateUserRuntimeParams struct {
	ID       pgtype.UUID `json:"id"`
	ApiToken string      `json:"api_token"`
}

type AdmitLockedSessionRunParams

type AdmitLockedSessionRunParams struct {
	RunID            pgtype.UUID `json:"run_id"`
	BotID            pgtype.UUID `json:"bot_id"`
	InvocationID     string      `json:"invocation_id"`
	TurnID           pgtype.UUID `json:"turn_id"`
	InputJson        []byte      `json:"input_json"`
	InputFingerprint string      `json:"input_fingerprint"`
	SessionID        pgtype.UUID `json:"session_id"`
}

type AgentAuthorization added in v0.20.0

type AgentAuthorization struct {
	ID               pgtype.UUID        `json:"id"`
	TeamID           pgtype.UUID        `json:"team_id"`
	OwnerUserID      pgtype.UUID        `json:"owner_user_id"`
	Runtime          string             `json:"runtime"`
	AuthKind         string             `json:"auth_kind"`
	Status           string             `json:"status"`
	EncryptedPayload []byte             `json:"encrypted_payload"`
	EncryptionNonce  []byte             `json:"encryption_nonce"`
	ExpiresAt        pgtype.Timestamptz `json:"expires_at"`
	PollAfter        pgtype.Timestamptz `json:"poll_after"`
	ClaimedAgentID   pgtype.UUID        `json:"claimed_agent_id"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
}

type AgentCredential added in v0.20.0

type AgentCredential struct {
	ID                pgtype.UUID        `json:"id"`
	TeamID            pgtype.UUID        `json:"team_id"`
	OwnerUserID       pgtype.UUID        `json:"owner_user_id"`
	Provider          string             `json:"provider"`
	AuthKind          string             `json:"auth_kind"`
	Label             string             `json:"label"`
	EncryptedPayload  []byte             `json:"encrypted_payload"`
	EncryptionNonce   []byte             `json:"encryption_nonce"`
	KeyVersion        int32              `json:"key_version"`
	AccountMetadata   []byte             `json:"account_metadata"`
	ExpiresAt         pgtype.Timestamptz `json:"expires_at"`
	CredentialVersion int64              `json:"credential_version"`
	RevokedAt         pgtype.Timestamptz `json:"revoked_at"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
}

type AgentSessionPublication added in v0.20.0

type AgentSessionPublication struct {
	TeamID    pgtype.UUID        `json:"team_id"`
	SessionID pgtype.UUID        `json:"session_id"`
	RunID     pgtype.UUID        `json:"run_id"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
}

type AppendMessageToHistoryTurnByRequestParams

type AppendMessageToHistoryTurnByRequestParams struct {
	MessageID        pgtype.UUID `json:"message_id"`
	SessionID        pgtype.UUID `json:"session_id"`
	RequestMessageID pgtype.UUID `json:"request_message_id"`
}

type AppendMessageToLatestHistoryTurnParams

type AppendMessageToLatestHistoryTurnParams struct {
	MessageID pgtype.UUID `json:"message_id"`
	SessionID pgtype.UUID `json:"session_id"`
}

type ApproveToolApprovalRequestParams

type ApproveToolApprovalRequestParams struct {
	Reason                     string      `json:"reason"`
	SelectedOptionID           string      `json:"selected_option_id"`
	DecidedByChannelIdentityID pgtype.UUID `json:"decided_by_channel_identity_id"`
	ResponseControlID          pgtype.Text `json:"response_control_id"`
	ResponsePayloadHash        pgtype.Text `json:"response_payload_hash"`
	ID                         pgtype.UUID `json:"id"`
	RuntimeFencingToken        pgtype.Int8 `json:"runtime_fencing_token"`
}

type ArchiveBotWorkdirParams

type ArchiveBotWorkdirParams struct {
	BotID     pgtype.UUID `json:"bot_id"`
	WorkdirID pgtype.UUID `json:"workdir_id"`
}

type BackfillUserRuntimeNameParams

type BackfillUserRuntimeNameParams struct {
	Name        string      `json:"name"`
	ID          pgtype.UUID `json:"id"`
	UserID      pgtype.UUID `json:"user_id"`
	DefaultName string      `json:"default_name"`
}

type BindHistoryTurnAssistantByRequestParams

type BindHistoryTurnAssistantByRequestParams struct {
	SessionID          pgtype.UUID `json:"session_id"`
	RequestMessageID   pgtype.UUID `json:"request_message_id"`
	AssistantMessageID pgtype.UUID `json:"assistant_message_id"`
}

type BindHistoryTurnAssistantByRequestRow

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

type BindLatestHistoryTurnAssistantParams

type BindLatestHistoryTurnAssistantParams struct {
	SessionID          pgtype.UUID `json:"session_id"`
	AssistantMessageID pgtype.UUID `json:"assistant_message_id"`
}

type BindLatestHistoryTurnAssistantRow

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

type Bot

type Bot struct {
	ID                     pgtype.UUID        `json:"id"`
	OwnerUserID            pgtype.UUID        `json:"owner_user_id"`
	Name                   string             `json:"name"`
	DisplayName            pgtype.Text        `json:"display_name"`
	AvatarUrl              pgtype.Text        `json:"avatar_url"`
	Timezone               pgtype.Text        `json:"timezone"`
	IsActive               bool               `json:"is_active"`
	Status                 string             `json:"status"`
	CreateRequestKey       pgtype.Text        `json:"create_request_key"`
	Language               string             `json:"language"`
	CommandUiLanguage      string             `json:"command_ui_language"`
	ReasoningEffort        string             `json:"reasoning_effort"`
	ChatModelID            pgtype.UUID        `json:"chat_model_id"`
	ChatRuntime            string             `json:"chat_runtime"`
	ChatAcpAgentID         pgtype.Text        `json:"chat_acp_agent_id"`
	ChatAcpProjectPath     string             `json:"chat_acp_project_path"`
	ChatAcpProjectMode     string             `json:"chat_acp_project_mode"`
	SearchProviderID       pgtype.UUID        `json:"search_provider_id"`
	FetchProviderID        pgtype.UUID        `json:"fetch_provider_id"`
	MemoryProviderID       pgtype.UUID        `json:"memory_provider_id"`
	MemoryLlmModelID       pgtype.UUID        `json:"memory_llm_model_id"`
	ImageModelID           pgtype.UUID        `json:"image_model_id"`
	DiscussProbeModelID    pgtype.UUID        `json:"discuss_probe_model_id"`
	TtsModelID             pgtype.UUID        `json:"tts_model_id"`
	TranscriptionModelID   pgtype.UUID        `json:"transcription_model_id"`
	VideoModelID           pgtype.UUID        `json:"video_model_id"`
	PersistFullToolResults bool               `json:"persist_full_tool_results"`
	ShowToolCallsInIm      bool               `json:"show_tool_calls_in_im"`
	ToolApprovalConfig     []byte             `json:"tool_approval_config"`
	DisplayEnabled         bool               `json:"display_enabled"`
	OverlayProvider        string             `json:"overlay_provider"`
	OverlayEnabled         bool               `json:"overlay_enabled"`
	OverlayConfig          []byte             `json:"overlay_config"`
	Metadata               []byte             `json:"metadata"`
	RuntimeResetToken      pgtype.UUID        `json:"runtime_reset_token"`
	RuntimeResetExpiresAt  pgtype.Timestamptz `json:"runtime_reset_expires_at"`
	RuntimeConfigEpoch     int64              `json:"runtime_config_epoch"`
	CreatedAt              pgtype.Timestamptz `json:"created_at"`
	UpdatedAt              pgtype.Timestamptz `json:"updated_at"`
	AclDefaultEffect       string             `json:"acl_default_effect"`
	TeamID                 pgtype.UUID        `json:"team_id"`
	DefaultBotAgentID      pgtype.UUID        `json:"default_bot_agent_id"`
}

type BotAclRule

type BotAclRule struct {
	ID                     pgtype.UUID        `json:"id"`
	BotID                  pgtype.UUID        `json:"bot_id"`
	Action                 string             `json:"action"`
	Effect                 string             `json:"effect"`
	ChannelIdentityID      pgtype.UUID        `json:"channel_identity_id"`
	SourceChannel          pgtype.Text        `json:"source_channel"`
	SourceConversationType pgtype.Text        `json:"source_conversation_type"`
	SourceConversationID   pgtype.Text        `json:"source_conversation_id"`
	SourceThreadID         pgtype.Text        `json:"source_thread_id"`
	CreatedByUserID        pgtype.UUID        `json:"created_by_user_id"`
	CreatedAt              pgtype.Timestamptz `json:"created_at"`
	UpdatedAt              pgtype.Timestamptz `json:"updated_at"`
	Enabled                bool               `json:"enabled"`
	Description            pgtype.Text        `json:"description"`
	SubjectChannelType     pgtype.Text        `json:"subject_channel_type"`
	TeamID                 pgtype.UUID        `json:"team_id"`
}

type BotAgent

type BotAgent struct {
	TeamID            pgtype.UUID        `json:"team_id"`
	ID                pgtype.UUID        `json:"id"`
	BotID             pgtype.UUID        `json:"bot_id"`
	Name              string             `json:"name"`
	Runtime           string             `json:"runtime"`
	Enabled           bool               `json:"enabled"`
	Metadata          []byte             `json:"metadata"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
	DeletedAt         pgtype.Timestamptz `json:"deleted_at"`
	AgentCredentialID pgtype.UUID        `json:"agent_credential_id"`
}

type BotAgentIsDefaultParams

type BotAgentIsDefaultParams struct {
	BotID pgtype.UUID `json:"bot_id"`
	ID    pgtype.UUID `json:"id"`
}

type BotAppConnectorRef added in v0.20.0

type BotAppConnectorRef struct {
	ID             pgtype.UUID        `json:"id"`
	TeamID         pgtype.UUID        `json:"team_id"`
	InstallationID pgtype.UUID        `json:"installation_id"`
	ConnectorType  string             `json:"connector_type"`
	ConnectionID   string             `json:"connection_id"`
	Required       bool               `json:"required"`
	CreatedAt      pgtype.Timestamptz `json:"created_at"`
	UpdatedAt      pgtype.Timestamptz `json:"updated_at"`
}

type BotAppDependencyRef added in v0.20.0

type BotAppDependencyRef struct {
	ID             pgtype.UUID        `json:"id"`
	TeamID         pgtype.UUID        `json:"team_id"`
	InstallationID pgtype.UUID        `json:"installation_id"`
	DependencyID   string             `json:"dependency_id"`
	CreatedAt      pgtype.Timestamptz `json:"created_at"`
}

type BotAppInstallation added in v0.20.0

type BotAppInstallation struct {
	ID                pgtype.UUID        `json:"id"`
	TeamID            pgtype.UUID        `json:"team_id"`
	BotID             pgtype.UUID        `json:"bot_id"`
	RegistryID        string             `json:"registry_id"`
	AppID             string             `json:"app_id"`
	Revision          string             `json:"revision"`
	Version           string             `json:"version"`
	Status            string             `json:"status"`
	Reason            string             `json:"reason"`
	AvailableRevision string             `json:"available_revision"`
	AvailableVersion  string             `json:"available_version"`
	LastCheckedAt     pgtype.Timestamptz `json:"last_checked_at"`
	LastError         string             `json:"last_error"`
	LastErrorCode     string             `json:"last_error_code"`
	Release           []byte             `json:"release"`
	InstalledAt       pgtype.Timestamptz `json:"installed_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
}

type BotChannelAdmin

type BotChannelAdmin struct {
	ID                pgtype.UUID        `json:"id"`
	BotID             pgtype.UUID        `json:"bot_id"`
	ChannelIdentityID pgtype.UUID        `json:"channel_identity_id"`
	Granted           bool               `json:"granted"`
	CreatedByUserID   pgtype.UUID        `json:"created_by_user_id"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
	TeamID            pgtype.UUID        `json:"team_id"`
}

type BotChannelConfig

type BotChannelConfig struct {
	ID               pgtype.UUID        `json:"id"`
	BotID            pgtype.UUID        `json:"bot_id"`
	ChannelType      string             `json:"channel_type"`
	Credentials      []byte             `json:"credentials"`
	ExternalIdentity pgtype.Text        `json:"external_identity"`
	SelfIdentity     []byte             `json:"self_identity"`
	Routing          []byte             `json:"routing"`
	Capabilities     []byte             `json:"capabilities"`
	Disabled         bool               `json:"disabled"`
	VerifiedAt       pgtype.Timestamptz `json:"verified_at"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
	TeamID           pgtype.UUID        `json:"team_id"`
}

type BotChannelRoute

type BotChannelRoute struct {
	ID                     pgtype.UUID        `json:"id"`
	BotID                  pgtype.UUID        `json:"bot_id"`
	ChannelType            string             `json:"channel_type"`
	ChannelConfigID        pgtype.UUID        `json:"channel_config_id"`
	ExternalConversationID string             `json:"external_conversation_id"`
	ExternalThreadID       pgtype.Text        `json:"external_thread_id"`
	ConversationType       pgtype.Text        `json:"conversation_type"`
	DefaultReplyTarget     pgtype.Text        `json:"default_reply_target"`
	ActiveSessionID        pgtype.UUID        `json:"active_session_id"`
	Metadata               []byte             `json:"metadata"`
	CreatedAt              pgtype.Timestamptz `json:"created_at"`
	UpdatedAt              pgtype.Timestamptz `json:"updated_at"`
	TeamID                 pgtype.UUID        `json:"team_id"`
}

type BotDependencyInstallation added in v0.20.0

type BotDependencyInstallation struct {
	ID                 pgtype.UUID        `json:"id"`
	TeamID             pgtype.UUID        `json:"team_id"`
	BotID              pgtype.UUID        `json:"bot_id"`
	DependencyID       string             `json:"dependency_id"`
	Source             string             `json:"source"`
	Status             string             `json:"status"`
	InstalledVersion   string             `json:"installed_version"`
	LatestVersion      string             `json:"latest_version"`
	LastCheckedAt      pgtype.Timestamptz `json:"last_checked_at"`
	LastError          string             `json:"last_error"`
	LastErrorCode      string             `json:"last_error_code"`
	ManifestDigest     string             `json:"manifest_digest"`
	SourceUrl          string             `json:"source_url"`
	RegistryID         string             `json:"registry_id"`
	DefinitionRevision string             `json:"definition_revision"`
	OperationID        string             `json:"operation_id"`
	CreatedAt          pgtype.Timestamptz `json:"created_at"`
	UpdatedAt          pgtype.Timestamptz `json:"updated_at"`
}

type BotHistoryCheckpoint added in v1.0.0

type BotHistoryCheckpoint struct {
	ID             pgtype.UUID        `json:"id"`
	TeamID         pgtype.UUID        `json:"team_id"`
	SessionID      pgtype.UUID        `json:"session_id"`
	ParentID       pgtype.UUID        `json:"parent_id"`
	TurnPosition   int64              `json:"turn_position"`
	TurnMessageSeq int64              `json:"turn_message_seq"`
	Items          []byte             `json:"items"`
	CreatedAt      pgtype.Timestamptz `json:"created_at"`
}

type BotHistoryMessage

type BotHistoryMessage struct {
	ID                      pgtype.UUID        `json:"id"`
	BotID                   pgtype.UUID        `json:"bot_id"`
	SessionID               pgtype.UUID        `json:"session_id"`
	SenderChannelIdentityID pgtype.UUID        `json:"sender_channel_identity_id"`
	SenderAccountUserID     pgtype.UUID        `json:"sender_account_user_id"`
	SourceMessageID         pgtype.Text        `json:"source_message_id"`
	SourceReplyToMessageID  pgtype.Text        `json:"source_reply_to_message_id"`
	Role                    string             `json:"role"`
	Content                 []byte             `json:"content"`
	Metadata                []byte             `json:"metadata"`
	Usage                   []byte             `json:"usage"`
	SessionMode             string             `json:"session_mode"`
	RuntimeType             string             `json:"runtime_type"`
	ModelID                 pgtype.UUID        `json:"model_id"`
	EventID                 pgtype.UUID        `json:"event_id"`
	DisplayText             pgtype.Text        `json:"display_text"`
	TurnID                  pgtype.UUID        `json:"turn_id"`
	TurnPosition            pgtype.Int8        `json:"turn_position"`
	TurnMessageSeq          pgtype.Int8        `json:"turn_message_seq"`
	TurnVisible             bool               `json:"turn_visible"`
	TurnSupersededByTurnID  pgtype.UUID        `json:"turn_superseded_by_turn_id"`
	TurnSupersededAt        pgtype.Timestamptz `json:"turn_superseded_at"`
	TurnSupersededReason    pgtype.Text        `json:"turn_superseded_reason"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	TeamID                  pgtype.UUID        `json:"team_id"`
	RunID                   pgtype.UUID        `json:"run_id"`
}

type BotHistoryMessageAsset

type BotHistoryMessageAsset struct {
	ID          pgtype.UUID        `json:"id"`
	MessageID   pgtype.UUID        `json:"message_id"`
	Role        string             `json:"role"`
	Ordinal     int32              `json:"ordinal"`
	ContentHash string             `json:"content_hash"`
	Mime        string             `json:"mime"`
	SizeBytes   int64              `json:"size_bytes"`
	StorageKey  string             `json:"storage_key"`
	Name        string             `json:"name"`
	Metadata    []byte             `json:"metadata"`
	CreatedAt   pgtype.Timestamptz `json:"created_at"`
	TeamID      pgtype.UUID        `json:"team_id"`
}

type BotHistoryMessageCompact

type BotHistoryMessageCompact struct {
	ID           pgtype.UUID        `json:"id"`
	BotID        pgtype.UUID        `json:"bot_id"`
	SessionID    pgtype.UUID        `json:"session_id"`
	Status       string             `json:"status"`
	Summary      string             `json:"summary"`
	MessageCount int32              `json:"message_count"`
	ErrorMessage string             `json:"error_message"`
	Usage        []byte             `json:"usage"`
	ModelID      pgtype.UUID        `json:"model_id"`
	StartedAt    pgtype.Timestamptz `json:"started_at"`
	CompletedAt  pgtype.Timestamptz `json:"completed_at"`
	TeamID       pgtype.UUID        `json:"team_id"`
}

type BotMemoryUsage added in v0.21.0

type BotMemoryUsage struct {
	ID        pgtype.UUID        `json:"id"`
	TeamID    pgtype.UUID        `json:"team_id"`
	BotID     pgtype.UUID        `json:"bot_id"`
	ModelID   pgtype.UUID        `json:"model_id"`
	Operation string             `json:"operation"`
	Usage     []byte             `json:"usage"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type BotRemoteRuntimeBinding

type BotRemoteRuntimeBinding struct {
	ID                 pgtype.UUID        `json:"id"`
	BotID              pgtype.UUID        `json:"bot_id"`
	RuntimeID          pgtype.UUID        `json:"runtime_id"`
	IsPrimary          bool               `json:"is_primary"`
	ToolApprovalConfig []byte             `json:"tool_approval_config"`
	CreatedAt          pgtype.Timestamptz `json:"created_at"`
	UpdatedAt          pgtype.Timestamptz `json:"updated_at"`
	TeamID             pgtype.UUID        `json:"team_id"`
}

type BotSession

type BotSession struct {
	ID                       pgtype.UUID        `json:"id"`
	BotID                    pgtype.UUID        `json:"bot_id"`
	RouteID                  pgtype.UUID        `json:"route_id"`
	ChannelType              pgtype.Text        `json:"channel_type"`
	Type                     string             `json:"type"`
	SessionMode              string             `json:"session_mode"`
	RuntimeType              string             `json:"runtime_type"`
	RuntimeMetadata          []byte             `json:"runtime_metadata"`
	PreferredChatModelID     pgtype.UUID        `json:"preferred_chat_model_id"`
	PreferredReasoningEffort pgtype.Text        `json:"preferred_reasoning_effort"`
	PreferredExternalModelID pgtype.Text        `json:"preferred_external_model_id"`
	ModelPreferenceRevision  pgtype.UUID        `json:"model_preference_revision"`
	Visibility               string             `json:"visibility"`
	Title                    string             `json:"title"`
	Metadata                 []byte             `json:"metadata"`
	NextTurnPosition         int64              `json:"next_turn_position"`
	HistoryCheckpointID      pgtype.UUID        `json:"history_checkpoint_id"`
	RuntimeFencingToken      int64              `json:"runtime_fencing_token"`
	RuntimeResetToken        pgtype.UUID        `json:"runtime_reset_token"`
	RuntimeResetExpiresAt    pgtype.Timestamptz `json:"runtime_reset_expires_at"`
	RuntimeConfigEpoch       int64              `json:"runtime_config_epoch"`
	ParentSessionID          pgtype.UUID        `json:"parent_session_id"`
	CreatedByUserID          pgtype.UUID        `json:"created_by_user_id"`
	CreatedAt                pgtype.Timestamptz `json:"created_at"`
	UpdatedAt                pgtype.Timestamptz `json:"updated_at"`
	DeletedAt                pgtype.Timestamptz `json:"deleted_at"`
	TeamID                   pgtype.UUID        `json:"team_id"`
	WorkdirID                pgtype.UUID        `json:"workdir_id"`
	BotAgentID               pgtype.UUID        `json:"bot_agent_id"`
}

type BotSessionDiscussCursor

type BotSessionDiscussCursor struct {
	SessionID           pgtype.UUID        `json:"session_id"`
	ScopeKey            string             `json:"scope_key"`
	RouteID             pgtype.UUID        `json:"route_id"`
	Source              string             `json:"source"`
	ConsumedCursor      int64              `json:"consumed_cursor"`
	ConsumedEventCursor int64              `json:"consumed_event_cursor"`
	UpdatedAt           pgtype.Timestamptz `json:"updated_at"`
	TeamID              pgtype.UUID        `json:"team_id"`
}

type BotSessionEvent

type BotSessionEvent struct {
	ID                      pgtype.UUID        `json:"id"`
	BotID                   pgtype.UUID        `json:"bot_id"`
	SessionID               pgtype.UUID        `json:"session_id"`
	EventKind               string             `json:"event_kind"`
	EventData               []byte             `json:"event_data"`
	ExternalMessageID       pgtype.Text        `json:"external_message_id"`
	SenderChannelIdentityID pgtype.UUID        `json:"sender_channel_identity_id"`
	ReceivedAtMs            int64              `json:"received_at_ms"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	TeamID                  pgtype.UUID        `json:"team_id"`
}

type BotStorageBinding

type BotStorageBinding struct {
	ID                pgtype.UUID        `json:"id"`
	BotID             pgtype.UUID        `json:"bot_id"`
	StorageProviderID pgtype.UUID        `json:"storage_provider_id"`
	BasePath          string             `json:"base_path"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
	TeamID            pgtype.UUID        `json:"team_id"`
}

type BotUserGrant

type BotUserGrant struct {
	ID              pgtype.UUID        `json:"id"`
	BotID           pgtype.UUID        `json:"bot_id"`
	SubjectType     string             `json:"subject_type"`
	UserID          pgtype.UUID        `json:"user_id"`
	Permissions     []byte             `json:"permissions"`
	CreatedByUserID pgtype.UUID        `json:"created_by_user_id"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
	UpdatedAt       pgtype.Timestamptz `json:"updated_at"`
	TeamID          pgtype.UUID        `json:"team_id"`
}

type BotVisibleHistoryMessage

type BotVisibleHistoryMessage struct {
	TeamID                  pgtype.UUID        `json:"team_id"`
	TurnID                  pgtype.UUID        `json:"turn_id"`
	TurnPosition            pgtype.Int8        `json:"turn_position"`
	TurnMessageSeq          pgtype.Int8        `json:"turn_message_seq"`
	ID                      pgtype.UUID        `json:"id"`
	BotID                   pgtype.UUID        `json:"bot_id"`
	SessionID               pgtype.UUID        `json:"session_id"`
	SenderChannelIdentityID pgtype.UUID        `json:"sender_channel_identity_id"`
	SenderAccountUserID     pgtype.UUID        `json:"sender_account_user_id"`
	SourceMessageID         pgtype.Text        `json:"source_message_id"`
	SourceReplyToMessageID  pgtype.Text        `json:"source_reply_to_message_id"`
	Role                    string             `json:"role"`
	Content                 []byte             `json:"content"`
	Metadata                []byte             `json:"metadata"`
	Usage                   []byte             `json:"usage"`
	SessionMode             string             `json:"session_mode"`
	RuntimeType             string             `json:"runtime_type"`
	ModelID                 pgtype.UUID        `json:"model_id"`
	EventID                 pgtype.UUID        `json:"event_id"`
	DisplayText             pgtype.Text        `json:"display_text"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
}

type BotWorkdir

type BotWorkdir struct {
	ID              pgtype.UUID        `json:"id"`
	TeamID          pgtype.UUID        `json:"team_id"`
	BotID           pgtype.UUID        `json:"bot_id"`
	Name            string             `json:"name"`
	TargetKind      string             `json:"target_kind"`
	RemoteBindingID pgtype.UUID        `json:"remote_binding_id"`
	Path            string             `json:"path"`
	CreatedByUserID pgtype.UUID        `json:"created_by_user_id"`
	ArchivedAt      pgtype.Timestamptz `json:"archived_at"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
	UpdatedAt       pgtype.Timestamptz `json:"updated_at"`
}

type BotWorkspace added in v0.21.0

type BotWorkspace struct {
	BotID              pgtype.UUID        `json:"bot_id"`
	TeamID             pgtype.UUID        `json:"team_id"`
	DesiredState       string             `json:"desired_state"`
	DesiredGeneration  int64              `json:"desired_generation"`
	Image              string             `json:"image"`
	PreserveData       bool               `json:"preserve_data"`
	ObservedState      string             `json:"observed_state"`
	ObservedGeneration int64              `json:"observed_generation"`
	EverReady          bool               `json:"ever_ready"`
	LastError          string             `json:"last_error"`
	LastErrorCode      string             `json:"last_error_code"`
	LastErrorPhase     string             `json:"last_error_phase"`
	Attempts           int32              `json:"attempts"`
	NextAttemptAt      pgtype.Timestamptz `json:"next_attempt_at"`
	LeaseOwner         string             `json:"lease_owner"`
	LeaseUntil         pgtype.Timestamptz `json:"lease_until"`
	Version            int64              `json:"version"`
	CreatedAt          pgtype.Timestamptz `json:"created_at"`
	UpdatedAt          pgtype.Timestamptz `json:"updated_at"`
}

type BotWorkspaceResourceLimit

type BotWorkspaceResourceLimit struct {
	BotID         pgtype.UUID        `json:"bot_id"`
	CpuMillicores int64              `json:"cpu_millicores"`
	MemoryBytes   int64              `json:"memory_bytes"`
	StorageBytes  int64              `json:"storage_bytes"`
	CreatedAt     pgtype.Timestamptz `json:"created_at"`
	UpdatedAt     pgtype.Timestamptz `json:"updated_at"`
	TeamID        pgtype.UUID        `json:"team_id"`
}

type CacheWorkspaceDependencyCatalogParams added in v0.20.0

type CacheWorkspaceDependencyCatalogParams struct {
	SourceUrl          string `json:"source_url"`
	CatalogBytes       []byte `json:"catalog_bytes"`
	ExpectedGeneration int64  `json:"expected_generation"`
}

type CacheWorkspaceDependencyDefinitionParams added in v0.20.0

type CacheWorkspaceDependencyDefinitionParams struct {
	SourceUrl     string `json:"source_url"`
	RegistryID    string `json:"registry_id"`
	DependencyID  string `json:"dependency_id"`
	Revision      string `json:"revision"`
	ReleaseBytes  []byte `json:"release_bytes"`
	ArtifactBytes []byte `json:"artifact_bytes"`
	IconDigest    string `json:"icon_digest"`
}

type CancelBotWorkspaceRemovalParams added in v0.22.0

type CancelBotWorkspaceRemovalParams struct {
	ObservedState string      `json:"observed_state"`
	BotID         pgtype.UUID `json:"bot_id"`
}

type CancelPendingToolApprovalsBySessionParams

type CancelPendingToolApprovalsBySessionParams struct {
	Reason              string      `json:"reason"`
	BotID               pgtype.UUID `json:"bot_id"`
	SessionID           pgtype.UUID `json:"session_id"`
	RuntimeFencingToken pgtype.Int8 `json:"runtime_fencing_token"`
}

type CancelPendingUserInputsByRunParams added in v0.20.0

type CancelPendingUserInputsByRunParams struct {
	ResultJson          []byte      `json:"result_json"`
	BotID               pgtype.UUID `json:"bot_id"`
	SessionID           pgtype.UUID `json:"session_id"`
	RunID               pgtype.UUID `json:"run_id"`
	RuntimeFencingToken pgtype.Int8 `json:"runtime_fencing_token"`
}

type CancelPendingUserInputsBySessionParams

type CancelPendingUserInputsBySessionParams struct {
	ResultJson          []byte      `json:"result_json"`
	BotID               pgtype.UUID `json:"bot_id"`
	SessionID           pgtype.UUID `json:"session_id"`
	RuntimeFencingToken pgtype.Int8 `json:"runtime_fencing_token"`
}

type CancelToolApprovalRequestParams added in v1.0.0

type CancelToolApprovalRequestParams struct {
	Reason              string      `json:"reason"`
	ID                  pgtype.UUID `json:"id"`
	RuntimeFencingToken pgtype.Int8 `json:"runtime_fencing_token"`
}

type CancelUserInputRequestParams

type CancelUserInputRequestParams struct {
	ResultJson                   []byte      `json:"result_json"`
	RespondedByChannelIdentityID pgtype.UUID `json:"responded_by_channel_identity_id"`
	ResponseControlID            pgtype.Text `json:"response_control_id"`
	ResponsePayloadHash          pgtype.Text `json:"response_payload_hash"`
	ID                           pgtype.UUID `json:"id"`
	RuntimeFencingToken          pgtype.Int8 `json:"runtime_fencing_token"`
}

type ChannelIdentity

type ChannelIdentity struct {
	ID               pgtype.UUID        `json:"id"`
	ChannelType      string             `json:"channel_type"`
	ChannelSubjectID string             `json:"channel_subject_id"`
	DisplayName      pgtype.Text        `json:"display_name"`
	AvatarUrl        pgtype.Text        `json:"avatar_url"`
	Metadata         []byte             `json:"metadata"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
	TeamID           pgtype.UUID        `json:"team_id"`
}

type ChannelLinkCode

type ChannelLinkCode struct {
	Token                     string             `json:"token"`
	UserID                    pgtype.UUID        `json:"user_id"`
	ChannelType               string             `json:"channel_type"`
	ExpiresAt                 pgtype.Timestamptz `json:"expires_at"`
	ConsumedAt                pgtype.Timestamptz `json:"consumed_at"`
	ConsumedChannelIdentityID pgtype.UUID        `json:"consumed_channel_identity_id"`
	CreatedAt                 pgtype.Timestamptz `json:"created_at"`
	TeamID                    pgtype.UUID        `json:"team_id"`
}

type ClaimBotDependencyOperationParams added in v0.20.0

type ClaimBotDependencyOperationParams struct {
	BotID              pgtype.UUID `json:"bot_id"`
	DependencyID       string      `json:"dependency_id"`
	Source             string      `json:"source"`
	Status             string      `json:"status"`
	InstalledVersion   string      `json:"installed_version"`
	ManifestDigest     string      `json:"manifest_digest"`
	SourceUrl          string      `json:"source_url"`
	RegistryID         string      `json:"registry_id"`
	DefinitionRevision string      `json:"definition_revision"`
	OperationID        string      `json:"operation_id"`
}

type ClaimBotWorkspaceParams added in v0.21.0

type ClaimBotWorkspaceParams struct {
	LeaseOwner   string      `json:"lease_owner"`
	LeaseSeconds float64     `json:"lease_seconds"`
	BotID        pgtype.UUID `json:"bot_id"`
}

type ClaimBotWorkspacesParams added in v0.21.0

type ClaimBotWorkspacesParams struct {
	LeaseOwner   string      `json:"lease_owner"`
	LeaseSeconds float64     `json:"lease_seconds"`
	DesiredState pgtype.Text `json:"desired_state"`
	Lim          int32       `json:"lim"`
}

type ClaimLockedSessionRunParams

type ClaimLockedSessionRunParams struct {
	OwnerID        pgtype.Text `json:"owner_id"`
	FencingToken   int64       `json:"fencing_token"`
	LiveGeneration pgtype.Text `json:"live_generation"`
	RunID          pgtype.UUID `json:"run_id"`
	BotID          pgtype.UUID `json:"bot_id"`
	SessionID      pgtype.UUID `json:"session_id"`
}

type ClaimToolApprovalRequestForRuntimeParams

type ClaimToolApprovalRequestForRuntimeParams struct {
	RuntimeFencingToken pgtype.Int8 `json:"runtime_fencing_token"`
	ID                  pgtype.UUID `json:"id"`
	BotID               pgtype.UUID `json:"bot_id"`
	SessionID           pgtype.UUID `json:"session_id"`
}

type ClaimUserInputRequestForRuntimeParams

type ClaimUserInputRequestForRuntimeParams struct {
	RuntimeFencingToken pgtype.Int8 `json:"runtime_fencing_token"`
	ID                  pgtype.UUID `json:"id"`
	BotID               pgtype.UUID `json:"bot_id"`
	SessionID           pgtype.UUID `json:"session_id"`
}

type ClassifyHistoryCheckpointMessagesParams added in v1.0.0

type ClassifyHistoryCheckpointMessagesParams struct {
	AfterTurnPosition   int64         `json:"after_turn_position"`
	AfterTurnMessageSeq int64         `json:"after_turn_message_seq"`
	KeptIds             []pgtype.UUID `json:"kept_ids"`
	SessionID           pgtype.UUID   `json:"session_id"`
	ExternalMessageIds  []string      `json:"external_message_ids"`
}

type ClassifyHistoryCheckpointMessagesRow added in v1.0.0

type ClassifyHistoryCheckpointMessagesRow struct {
	ExternalMessageID string `json:"external_message_id"`
	Kept              bool   `json:"kept"`
	EventCursor       int64  `json:"event_cursor"`
}

type ClearBotAgentCredentialParams added in v0.20.0

type ClearBotAgentCredentialParams struct {
	BotID      pgtype.UUID `json:"bot_id"`
	BotAgentID pgtype.UUID `json:"bot_agent_id"`
}

type CloneHistoryTurnRequestForRetryParams added in v1.0.0

type CloneHistoryTurnRequestForRetryParams struct {
	RunID            pgtype.UUID `json:"run_id"`
	TurnID           pgtype.UUID `json:"turn_id"`
	TurnPosition     int64       `json:"turn_position"`
	SessionID        pgtype.UUID `json:"session_id"`
	BotID            pgtype.UUID `json:"bot_id"`
	RequestMessageID pgtype.UUID `json:"request_message_id"`
	OldTurnID        pgtype.UUID `json:"old_turn_id"`
}

type CompareAndSetSessionModelPreferenceParams added in v0.20.0

type CompareAndSetSessionModelPreferenceParams struct {
	PreferredChatModelID     pgtype.UUID `json:"preferred_chat_model_id"`
	PreferredExternalModelID pgtype.Text `json:"preferred_external_model_id"`
	PreferredReasoningEffort pgtype.Text `json:"preferred_reasoning_effort"`
	ID                       pgtype.UUID `json:"id"`
	RuntimeType              string      `json:"runtime_type"`
	ExpectedRevision         pgtype.UUID `json:"expected_revision"`
}

type CompleteCompactionLogParams

type CompleteCompactionLogParams struct {
	Status       string      `json:"status"`
	Summary      string      `json:"summary"`
	MessageCount int32       `json:"message_count"`
	ErrorMessage string      `json:"error_message"`
	Usage        []byte      `json:"usage"`
	ModelID      pgtype.UUID `json:"model_id"`
	ID           pgtype.UUID `json:"id"`
}

type CompleteScheduleLogParams

type CompleteScheduleLogParams struct {
	ID         pgtype.UUID `json:"id"`
	Status     string      `json:"status"`
	ResultText string      `json:"result_text"`
	ErrorCode  string      `json:"error_code"`
	Usage      []byte      `json:"usage"`
	ModelID    pgtype.UUID `json:"model_id"`
}

type Connector

type Connector struct {
	TeamID       pgtype.UUID        `json:"team_id"`
	BotID        pgtype.UUID        `json:"bot_id"`
	ConnectionID string             `json:"connection_id"`
	Alias        string             `json:"alias"`
	Enabled      bool               `json:"enabled"`
	CreatedAt    pgtype.Timestamptz `json:"created_at"`
	UpdatedAt    pgtype.Timestamptz `json:"updated_at"`
}

type Container

type Container struct {
	ID               pgtype.UUID        `json:"id"`
	BotID            pgtype.UUID        `json:"bot_id"`
	ContainerID      string             `json:"container_id"`
	ContainerName    string             `json:"container_name"`
	Image            string             `json:"image"`
	Status           string             `json:"status"`
	Namespace        string             `json:"namespace"`
	AutoStart        bool               `json:"auto_start"`
	ContainerPath    string             `json:"container_path"`
	WorkspaceBackend string             `json:"workspace_backend"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
	LastStartedAt    pgtype.Timestamptz `json:"last_started_at"`
	LastStoppedAt    pgtype.Timestamptz `json:"last_stopped_at"`
	TeamID           pgtype.UUID        `json:"team_id"`
}

type ContainerVersion

type ContainerVersion struct {
	ID          pgtype.UUID        `json:"id"`
	ContainerID string             `json:"container_id"`
	SnapshotID  pgtype.UUID        `json:"snapshot_id"`
	Version     int32              `json:"version"`
	CreatedAt   pgtype.Timestamptz `json:"created_at"`
	TeamID      pgtype.UUID        `json:"team_id"`
}

type ContextLifecycle

type ContextLifecycle struct {
	RunID              pgtype.UUID        `json:"run_id"`
	TeamID             pgtype.UUID        `json:"team_id"`
	BotID              pgtype.UUID        `json:"bot_id"`
	SessionID          pgtype.UUID        `json:"session_id"`
	Status             string             `json:"status"`
	ErrorCode          pgtype.Text        `json:"error_code"`
	Snapshot           []byte             `json:"snapshot"`
	SelectionDecisions []byte             `json:"selection_decisions"`
	CreatedAt          pgtype.Timestamptz `json:"created_at"`
}

type CopyCompactionSummaryParams added in v1.0.0

type CopyCompactionSummaryParams struct {
	Summary         string      `json:"summary"`
	SessionID       pgtype.UUID `json:"session_id"`
	SourceCompactID pgtype.UUID `json:"source_compact_id"`
}

type CountBotWorkspacesByObservedStateRow added in v0.21.0

type CountBotWorkspacesByObservedStateRow struct {
	ObservedState string `json:"observed_state"`
	Total         int64  `json:"total"`
}

type CountHistoryCheckpointCandidatesParams added in v1.0.0

type CountHistoryCheckpointCandidatesParams struct {
	SessionID            pgtype.UUID   `json:"session_id"`
	AfterTurnPosition    int64         `json:"after_turn_position"`
	AfterTurnMessageSeq  int64         `json:"after_turn_message_seq"`
	KeptIds              []pgtype.UUID `json:"kept_ids"`
	BeforeTurnPosition   pgtype.Int8   `json:"before_turn_position"`
	BeforeTurnMessageSeq pgtype.Int8   `json:"before_turn_message_seq"`
}

type CountTokenUsageRecordsParams

type CountTokenUsageRecordsParams struct {
	BotID       pgtype.UUID        `json:"bot_id"`
	FromTime    pgtype.Timestamptz `json:"from_time"`
	ToTime      pgtype.Timestamptz `json:"to_time"`
	ModelID     pgtype.UUID        `json:"model_id"`
	SessionType pgtype.Text        `json:"session_type"`
}

type CreateAccountParams

type CreateAccountParams struct {
	Username     pgtype.Text `json:"username"`
	Email        pgtype.Text `json:"email"`
	PasswordHash pgtype.Text `json:"password_hash"`
	DisplayName  pgtype.Text `json:"display_name"`
	AvatarUrl    pgtype.Text `json:"avatar_url"`
	UserID       pgtype.UUID `json:"user_id"`
	Role         string      `json:"role"`
	IsActive     bool        `json:"is_active"`
	DataRoot     pgtype.Text `json:"data_root"`
}

type CreateAccountRow

type CreateAccountRow struct {
	ID                  pgtype.UUID        `json:"id"`
	Username            pgtype.Text        `json:"username"`
	Email               pgtype.Text        `json:"email"`
	PasswordHash        pgtype.Text        `json:"password_hash"`
	Role                string             `json:"role"`
	DisplayName         pgtype.Text        `json:"display_name"`
	AvatarUrl           pgtype.Text        `json:"avatar_url"`
	Timezone            string             `json:"timezone"`
	DataRoot            pgtype.Text        `json:"data_root"`
	LastLoginAt         pgtype.Timestamptz `json:"last_login_at"`
	IsActive            pgtype.Bool        `json:"is_active"`
	Metadata            []byte             `json:"metadata"`
	CreatedAt           pgtype.Timestamptz `json:"created_at"`
	UpdatedAt           pgtype.Timestamptz `json:"updated_at"`
	TeamID              pgtype.UUID        `json:"team_id"`
	PrincipalIsActive   bool               `json:"principal_is_active"`
	MembershipIsActive  bool               `json:"membership_is_active"`
	JoinedAt            pgtype.Timestamptz `json:"joined_at"`
	MembershipUpdatedAt pgtype.Timestamptz `json:"membership_updated_at"`
	TitleModelID        pgtype.UUID        `json:"title_model_id"`
}

type CreateAgentAuthorizationParams added in v0.20.0

type CreateAgentAuthorizationParams struct {
	OwnerUserID      pgtype.UUID        `json:"owner_user_id"`
	Runtime          string             `json:"runtime"`
	AuthKind         string             `json:"auth_kind"`
	Status           string             `json:"status"`
	EncryptedPayload []byte             `json:"encrypted_payload"`
	EncryptionNonce  []byte             `json:"encryption_nonce"`
	ExpiresAt        pgtype.Timestamptz `json:"expires_at"`
	PollAfter        pgtype.Timestamptz `json:"poll_after"`
}

type CreateAgentCredentialParams added in v0.20.0

type CreateAgentCredentialParams struct {
	OwnerUserID      pgtype.UUID        `json:"owner_user_id"`
	Provider         string             `json:"provider"`
	AuthKind         string             `json:"auth_kind"`
	Label            string             `json:"label"`
	EncryptedPayload []byte             `json:"encrypted_payload"`
	EncryptionNonce  []byte             `json:"encryption_nonce"`
	KeyVersion       int32              `json:"key_version"`
	AccountMetadata  []byte             `json:"account_metadata"`
	ExpiresAt        pgtype.Timestamptz `json:"expires_at"`
}

type CreateBotACLRuleParams

type CreateBotACLRuleParams struct {
	BotID                  pgtype.UUID `json:"bot_id"`
	Enabled                bool        `json:"enabled"`
	Effect                 string      `json:"effect"`
	CreatedByUserID        pgtype.UUID `json:"created_by_user_id"`
	Description            pgtype.Text `json:"description"`
	ChannelIdentityID      pgtype.UUID `json:"channel_identity_id"`
	SubjectChannelType     pgtype.Text `json:"subject_channel_type"`
	SourceChannel          pgtype.Text `json:"source_channel"`
	SourceConversationType pgtype.Text `json:"source_conversation_type"`
	SourceConversationID   pgtype.Text `json:"source_conversation_id"`
	SourceThreadID         pgtype.Text `json:"source_thread_id"`
}

type CreateBotAgentParams

type CreateBotAgentParams struct {
	BotID    pgtype.UUID `json:"bot_id"`
	Name     string      `json:"name"`
	Runtime  string      `json:"runtime"`
	Enabled  bool        `json:"enabled"`
	Metadata []byte      `json:"metadata"`
}

type CreateBotParams

type CreateBotParams struct {
	OwnerUserID      pgtype.UUID `json:"owner_user_id"`
	Name             string      `json:"name"`
	DisplayName      pgtype.Text `json:"display_name"`
	AvatarUrl        pgtype.Text `json:"avatar_url"`
	Timezone         pgtype.Text `json:"timezone"`
	IsActive         bool        `json:"is_active"`
	Metadata         []byte      `json:"metadata"`
	Status           string      `json:"status"`
	CreateRequestKey pgtype.Text `json:"create_request_key"`
}

type CreateBotRow

type CreateBotRow struct {
	ID               pgtype.UUID        `json:"id"`
	OwnerUserID      pgtype.UUID        `json:"owner_user_id"`
	Name             string             `json:"name"`
	DisplayName      pgtype.Text        `json:"display_name"`
	AvatarUrl        pgtype.Text        `json:"avatar_url"`
	Timezone         pgtype.Text        `json:"timezone"`
	IsActive         bool               `json:"is_active"`
	Status           string             `json:"status"`
	ReasoningEffort  string             `json:"reasoning_effort"`
	ChatModelID      pgtype.UUID        `json:"chat_model_id"`
	SearchProviderID pgtype.UUID        `json:"search_provider_id"`
	MemoryProviderID pgtype.UUID        `json:"memory_provider_id"`
	Metadata         []byte             `json:"metadata"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
}

type CreateBotUserGrantParams

type CreateBotUserGrantParams struct {
	BotID           pgtype.UUID `json:"bot_id"`
	SubjectType     string      `json:"subject_type"`
	Permissions     []byte      `json:"permissions"`
	UserID          pgtype.UUID `json:"user_id"`
	CreatedByUserID pgtype.UUID `json:"created_by_user_id"`
}

type CreateBotWorkdirParams

type CreateBotWorkdirParams struct {
	BotID           pgtype.UUID `json:"bot_id"`
	Name            string      `json:"name"`
	TargetKind      string      `json:"target_kind"`
	RemoteBindingID pgtype.UUID `json:"remote_binding_id"`
	Path            string      `json:"path"`
	CreatedByUserID pgtype.UUID `json:"created_by_user_id"`
}

type CreateChannelIdentityParams

type CreateChannelIdentityParams struct {
	ChannelType      string      `json:"channel_type"`
	ChannelSubjectID string      `json:"channel_subject_id"`
	DisplayName      pgtype.Text `json:"display_name"`
	AvatarUrl        pgtype.Text `json:"avatar_url"`
	Metadata         []byte      `json:"metadata"`
}

type CreateChannelLinkCodeParams

type CreateChannelLinkCodeParams struct {
	Token       string             `json:"token"`
	UserID      pgtype.UUID        `json:"user_id"`
	ExpiresAt   pgtype.Timestamptz `json:"expires_at"`
	ChannelType pgtype.Text        `json:"channel_type"`
}

type CreateChatRouteParams

type CreateChatRouteParams struct {
	BotID            pgtype.UUID `json:"bot_id"`
	Platform         string      `json:"platform"`
	ChannelConfigID  pgtype.UUID `json:"channel_config_id"`
	ConversationID   string      `json:"conversation_id"`
	ThreadID         pgtype.Text `json:"thread_id"`
	ConversationType pgtype.Text `json:"conversation_type"`
	ReplyTarget      pgtype.Text `json:"reply_target"`
	Metadata         []byte      `json:"metadata"`
}

type CreateChatRouteRow

type CreateChatRouteRow struct {
	ID               pgtype.UUID        `json:"id"`
	BotID            pgtype.UUID        `json:"bot_id"`
	Platform         string             `json:"platform"`
	ChannelConfigID  pgtype.UUID        `json:"channel_config_id"`
	ConversationID   string             `json:"conversation_id"`
	ThreadID         pgtype.Text        `json:"thread_id"`
	ConversationType pgtype.Text        `json:"conversation_type"`
	ReplyTarget      pgtype.Text        `json:"reply_target"`
	ActiveSessionID  pgtype.UUID        `json:"active_session_id"`
	Metadata         []byte             `json:"metadata"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
}

type CreateCompactionLogParams

type CreateCompactionLogParams struct {
	SessionID pgtype.UUID `json:"session_id"`
	BotID     pgtype.UUID `json:"bot_id"`
}

type CreateConnectorParams

type CreateConnectorParams struct {
	BotID        pgtype.UUID `json:"bot_id"`
	ConnectionID string      `json:"connection_id"`
	Alias        string      `json:"alias"`
}

type CreateContextLifecycleParams

type CreateContextLifecycleParams struct {
	RunID     pgtype.UUID `json:"run_id"`
	BotID     pgtype.UUID `json:"bot_id"`
	SessionID pgtype.UUID `json:"session_id"`
	Status    string      `json:"status"`
	ErrorCode pgtype.Text `json:"error_code"`
	Snapshot  []byte      `json:"snapshot"`
}

type CreateContextLifecycleRow added in v0.20.0

type CreateContextLifecycleRow struct {
	RunID     pgtype.UUID        `json:"run_id"`
	BotID     pgtype.UUID        `json:"bot_id"`
	SessionID pgtype.UUID        `json:"session_id"`
	Status    string             `json:"status"`
	ErrorCode pgtype.Text        `json:"error_code"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type CreateFetchProviderParams

type CreateFetchProviderParams struct {
	Name     string `json:"name"`
	Provider string `json:"provider"`
	Config   []byte `json:"config"`
	Enable   bool   `json:"enable"`
}

type CreateHistoryCheckpointParams added in v1.0.0

type CreateHistoryCheckpointParams struct {
	ParentID       pgtype.UUID `json:"parent_id"`
	TurnPosition   int64       `json:"turn_position"`
	TurnMessageSeq int64       `json:"turn_message_seq"`
	Items          []byte      `json:"items"`
	SessionID      pgtype.UUID `json:"session_id"`
}

type CreateHistoryTurnParams

type CreateHistoryTurnParams struct {
	SessionID          pgtype.UUID `json:"session_id"`
	BotID              pgtype.UUID `json:"bot_id"`
	RequestMessageID   pgtype.UUID `json:"request_message_id"`
	AssistantMessageID pgtype.UUID `json:"assistant_message_id"`
}

type CreateHistoryTurnRow

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

type CreateHistoryTurnWithIDAtPositionParams

type CreateHistoryTurnWithIDAtPositionParams struct {
	TurnID             pgtype.UUID `json:"turn_id"`
	BotID              pgtype.UUID `json:"bot_id"`
	SessionID          pgtype.UUID `json:"session_id"`
	TurnPosition       int64       `json:"turn_position"`
	RequestMessageID   pgtype.UUID `json:"request_message_id"`
	AssistantMessageID pgtype.UUID `json:"assistant_message_id"`
}

type CreateHistoryTurnWithIDAtPositionRow

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

type CreateHistoryTurnWithIDParams

type CreateHistoryTurnWithIDParams struct {
	SessionID          pgtype.UUID `json:"session_id"`
	TurnID             pgtype.UUID `json:"turn_id"`
	BotID              pgtype.UUID `json:"bot_id"`
	RequestMessageID   pgtype.UUID `json:"request_message_id"`
	AssistantMessageID pgtype.UUID `json:"assistant_message_id"`
}

type CreateHistoryTurnWithIDRow

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

type CreateMCPConnectionParams

type CreateMCPConnectionParams struct {
	BotID    pgtype.UUID `json:"bot_id"`
	Name     string      `json:"name"`
	Type     string      `json:"type"`
	Config   []byte      `json:"config"`
	IsActive bool        `json:"is_active"`
	AuthType string      `json:"auth_type"`
}

type CreateMemoryProviderParams

type CreateMemoryProviderParams struct {
	Name      string `json:"name"`
	Provider  string `json:"provider"`
	Config    []byte `json:"config"`
	IsDefault bool   `json:"is_default"`
}

type CreateMemoryUsageParams added in v0.21.0

type CreateMemoryUsageParams struct {
	BotID     pgtype.UUID `json:"bot_id"`
	ModelID   pgtype.UUID `json:"model_id"`
	Operation string      `json:"operation"`
	Usage     []byte      `json:"usage"`
}

type CreateMessageAssetParams

type CreateMessageAssetParams struct {
	MessageID   pgtype.UUID `json:"message_id"`
	Role        string      `json:"role"`
	Ordinal     int32       `json:"ordinal"`
	ContentHash string      `json:"content_hash"`
	Mime        string      `json:"mime"`
	SizeBytes   int64       `json:"size_bytes"`
	StorageKey  string      `json:"storage_key"`
	Name        string      `json:"name"`
	Metadata    []byte      `json:"metadata"`
}

type CreateMessageAssetRow

type CreateMessageAssetRow struct {
	ID          pgtype.UUID        `json:"id"`
	MessageID   pgtype.UUID        `json:"message_id"`
	Role        string             `json:"role"`
	Ordinal     int32              `json:"ordinal"`
	ContentHash string             `json:"content_hash"`
	Mime        string             `json:"mime"`
	SizeBytes   int64              `json:"size_bytes"`
	StorageKey  string             `json:"storage_key"`
	Name        string             `json:"name"`
	Metadata    []byte             `json:"metadata"`
	CreatedAt   pgtype.Timestamptz `json:"created_at"`
}

type CreateMessageInHistoryTurnByRequestAndBindParams

type CreateMessageInHistoryTurnByRequestAndBindParams struct {
	SessionID               pgtype.UUID `json:"session_id"`
	Role                    string      `json:"role"`
	RequestMessageID        pgtype.UUID `json:"request_message_id"`
	BotID                   pgtype.UUID `json:"bot_id"`
	SenderChannelIdentityID pgtype.UUID `json:"sender_channel_identity_id"`
	SenderUserID            pgtype.UUID `json:"sender_user_id"`
	ExternalMessageID       pgtype.Text `json:"external_message_id"`
	SourceReplyToMessageID  pgtype.Text `json:"source_reply_to_message_id"`
	Content                 []byte      `json:"content"`
	Metadata                []byte      `json:"metadata"`
	Usage                   []byte      `json:"usage"`
	SessionMode             string      `json:"session_mode"`
	RuntimeType             string      `json:"runtime_type"`
	ModelID                 pgtype.UUID `json:"model_id"`
	EventID                 pgtype.UUID `json:"event_id"`
	DisplayText             pgtype.Text `json:"display_text"`
	RunID                   pgtype.UUID `json:"run_id"`
}

type CreateMessageInHistoryTurnByRequestAndBindRow

type CreateMessageInHistoryTurnByRequestAndBindRow struct {
	ID           pgtype.UUID        `json:"id"`
	CreatedAt    pgtype.Timestamptz `json:"created_at"`
	TurnID       pgtype.UUID        `json:"turn_id"`
	TurnPosition pgtype.Int8        `json:"turn_position"`
}

type CreateMessageInHistoryTurnByRequestParams

type CreateMessageInHistoryTurnByRequestParams struct {
	SessionID               pgtype.UUID `json:"session_id"`
	Role                    string      `json:"role"`
	RequestMessageID        pgtype.UUID `json:"request_message_id"`
	BotID                   pgtype.UUID `json:"bot_id"`
	SenderChannelIdentityID pgtype.UUID `json:"sender_channel_identity_id"`
	SenderUserID            pgtype.UUID `json:"sender_user_id"`
	ExternalMessageID       pgtype.Text `json:"external_message_id"`
	SourceReplyToMessageID  pgtype.Text `json:"source_reply_to_message_id"`
	Content                 []byte      `json:"content"`
	Metadata                []byte      `json:"metadata"`
	Usage                   []byte      `json:"usage"`
	SessionMode             string      `json:"session_mode"`
	RuntimeType             string      `json:"runtime_type"`
	ModelID                 pgtype.UUID `json:"model_id"`
	EventID                 pgtype.UUID `json:"event_id"`
	DisplayText             pgtype.Text `json:"display_text"`
	RunID                   pgtype.UUID `json:"run_id"`
}

type CreateMessageInHistoryTurnByRequestRow

type CreateMessageInHistoryTurnByRequestRow struct {
	ID                      pgtype.UUID        `json:"id"`
	BotID                   pgtype.UUID        `json:"bot_id"`
	SessionID               pgtype.UUID        `json:"session_id"`
	SenderChannelIdentityID pgtype.UUID        `json:"sender_channel_identity_id"`
	SenderUserID            pgtype.UUID        `json:"sender_user_id"`
	ExternalMessageID       pgtype.Text        `json:"external_message_id"`
	SourceReplyToMessageID  pgtype.Text        `json:"source_reply_to_message_id"`
	Role                    string             `json:"role"`
	Content                 []byte             `json:"content"`
	Metadata                []byte             `json:"metadata"`
	Usage                   []byte             `json:"usage"`
	SessionMode             string             `json:"session_mode"`
	RuntimeType             string             `json:"runtime_type"`
	EventID                 pgtype.UUID        `json:"event_id"`
	DisplayText             pgtype.Text        `json:"display_text"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
}

type CreateMessageParams

type CreateMessageParams struct {
	BotID                   pgtype.UUID `json:"bot_id"`
	SessionID               pgtype.UUID `json:"session_id"`
	SenderChannelIdentityID pgtype.UUID `json:"sender_channel_identity_id"`
	SenderUserID            pgtype.UUID `json:"sender_user_id"`
	ExternalMessageID       pgtype.Text `json:"external_message_id"`
	SourceReplyToMessageID  pgtype.Text `json:"source_reply_to_message_id"`
	Role                    string      `json:"role"`
	Content                 []byte      `json:"content"`
	Metadata                []byte      `json:"metadata"`
	Usage                   []byte      `json:"usage"`
	SessionMode             string      `json:"session_mode"`
	RuntimeType             string      `json:"runtime_type"`
	ModelID                 pgtype.UUID `json:"model_id"`
	EventID                 pgtype.UUID `json:"event_id"`
	DisplayText             pgtype.Text `json:"display_text"`
	RunID                   pgtype.UUID `json:"run_id"`
}

type CreateMessageRow

type CreateMessageRow struct {
	ID                      pgtype.UUID        `json:"id"`
	BotID                   pgtype.UUID        `json:"bot_id"`
	SessionID               pgtype.UUID        `json:"session_id"`
	SenderChannelIdentityID pgtype.UUID        `json:"sender_channel_identity_id"`
	SenderUserID            pgtype.UUID        `json:"sender_user_id"`
	ExternalMessageID       pgtype.Text        `json:"external_message_id"`
	SourceReplyToMessageID  pgtype.Text        `json:"source_reply_to_message_id"`
	Role                    string             `json:"role"`
	Content                 []byte             `json:"content"`
	Metadata                []byte             `json:"metadata"`
	Usage                   []byte             `json:"usage"`
	SessionMode             string             `json:"session_mode"`
	RuntimeType             string             `json:"runtime_type"`
	EventID                 pgtype.UUID        `json:"event_id"`
	DisplayText             pgtype.Text        `json:"display_text"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
}

type CreateMessageWithHistoryTurnParams

type CreateMessageWithHistoryTurnParams struct {
	SessionID               pgtype.UUID `json:"session_id"`
	TurnPosition            pgtype.Int8 `json:"turn_position"`
	MessageID               pgtype.UUID `json:"message_id"`
	BotID                   pgtype.UUID `json:"bot_id"`
	SenderChannelIdentityID pgtype.UUID `json:"sender_channel_identity_id"`
	SenderUserID            pgtype.UUID `json:"sender_user_id"`
	ExternalMessageID       pgtype.Text `json:"external_message_id"`
	SourceReplyToMessageID  pgtype.Text `json:"source_reply_to_message_id"`
	Role                    string      `json:"role"`
	Content                 []byte      `json:"content"`
	Metadata                []byte      `json:"metadata"`
	Usage                   []byte      `json:"usage"`
	SessionMode             string      `json:"session_mode"`
	RuntimeType             string      `json:"runtime_type"`
	ModelID                 pgtype.UUID `json:"model_id"`
	EventID                 pgtype.UUID `json:"event_id"`
	DisplayText             pgtype.Text `json:"display_text"`
	RunID                   pgtype.UUID `json:"run_id"`
	TurnID                  pgtype.UUID `json:"turn_id"`
	TurnMessageSeq          pgtype.Int8 `json:"turn_message_seq"`
}

type CreateMessageWithHistoryTurnRow

type CreateMessageWithHistoryTurnRow struct {
	ID           pgtype.UUID        `json:"id"`
	CreatedAt    pgtype.Timestamptz `json:"created_at"`
	TurnID       pgtype.UUID        `json:"turn_id"`
	TurnPosition pgtype.Int8        `json:"turn_position"`
}

type CreateMessageWithTurnParams

type CreateMessageWithTurnParams struct {
	MessageID               pgtype.UUID `json:"message_id"`
	BotID                   pgtype.UUID `json:"bot_id"`
	SenderChannelIdentityID pgtype.UUID `json:"sender_channel_identity_id"`
	SenderUserID            pgtype.UUID `json:"sender_user_id"`
	ExternalMessageID       pgtype.Text `json:"external_message_id"`
	SourceReplyToMessageID  pgtype.Text `json:"source_reply_to_message_id"`
	Role                    string      `json:"role"`
	Content                 []byte      `json:"content"`
	Metadata                []byte      `json:"metadata"`
	Usage                   []byte      `json:"usage"`
	SessionMode             string      `json:"session_mode"`
	RuntimeType             string      `json:"runtime_type"`
	ModelID                 pgtype.UUID `json:"model_id"`
	EventID                 pgtype.UUID `json:"event_id"`
	DisplayText             pgtype.Text `json:"display_text"`
	TurnMessageSeq          pgtype.Int8 `json:"turn_message_seq"`
	TurnID                  pgtype.UUID `json:"turn_id"`
	SessionID               pgtype.UUID `json:"session_id"`
}

type CreateMessageWithTurnRow

type CreateMessageWithTurnRow struct {
	ID                      pgtype.UUID        `json:"id"`
	BotID                   pgtype.UUID        `json:"bot_id"`
	SessionID               pgtype.UUID        `json:"session_id"`
	SenderChannelIdentityID pgtype.UUID        `json:"sender_channel_identity_id"`
	SenderUserID            pgtype.UUID        `json:"sender_user_id"`
	ExternalMessageID       pgtype.Text        `json:"external_message_id"`
	SourceReplyToMessageID  pgtype.Text        `json:"source_reply_to_message_id"`
	Role                    string             `json:"role"`
	Content                 []byte             `json:"content"`
	Metadata                []byte             `json:"metadata"`
	Usage                   []byte             `json:"usage"`
	SessionMode             string             `json:"session_mode"`
	RuntimeType             string             `json:"runtime_type"`
	EventID                 pgtype.UUID        `json:"event_id"`
	DisplayText             pgtype.Text        `json:"display_text"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
}

type CreateModelParams

type CreateModelParams struct {
	ModelID    string      `json:"model_id"`
	Name       pgtype.Text `json:"name"`
	ProviderID pgtype.UUID `json:"provider_id"`
	Type       string      `json:"type"`
	Enable     bool        `json:"enable"`
	Config     []byte      `json:"config"`
}

type CreateModelVariantParams

type CreateModelVariantParams struct {
	ModelUuid pgtype.UUID `json:"model_uuid"`
	VariantID string      `json:"variant_id"`
	Weight    int32       `json:"weight"`
	Metadata  []byte      `json:"metadata"`
}

type CreateOrUpdateBotRemoteRuntimeMountParams

type CreateOrUpdateBotRemoteRuntimeMountParams struct {
	RuntimeID pgtype.UUID `json:"runtime_id"`
	BotID     pgtype.UUID `json:"bot_id"`
}

type CreateProviderFromTemplateParams

type CreateProviderFromTemplateParams struct {
	ProviderTemplateID pgtype.UUID `json:"provider_template_id"`
	Name               string      `json:"name"`
	ClientType         string      `json:"client_type"`
	Icon               pgtype.Text `json:"icon"`
	Enable             bool        `json:"enable"`
	Config             []byte      `json:"config"`
	Metadata           []byte      `json:"metadata"`
}

type CreateProviderParams

type CreateProviderParams struct {
	Name       string      `json:"name"`
	ClientType string      `json:"client_type"`
	Icon       pgtype.Text `json:"icon"`
	Enable     bool        `json:"enable"`
	Config     []byte      `json:"config"`
	Metadata   []byte      `json:"metadata"`
}

type CreateScheduleLogParams

type CreateScheduleLogParams struct {
	ScheduleID pgtype.UUID `json:"schedule_id"`
	BotID      pgtype.UUID `json:"bot_id"`
	SessionID  pgtype.UUID `json:"session_id"`
}

type CreateScheduleLogRow

type CreateScheduleLogRow struct {
	ID           pgtype.UUID        `json:"id"`
	ScheduleID   pgtype.UUID        `json:"schedule_id"`
	BotID        pgtype.UUID        `json:"bot_id"`
	SessionID    pgtype.UUID        `json:"session_id"`
	Status       string             `json:"status"`
	ResultText   string             `json:"result_text"`
	ErrorMessage string             `json:"error_message"`
	ErrorCode    string             `json:"error_code"`
	Usage        []byte             `json:"usage"`
	StartedAt    pgtype.Timestamptz `json:"started_at"`
	CompletedAt  pgtype.Timestamptz `json:"completed_at"`
}

type CreateScheduleParams

type CreateScheduleParams struct {
	Name            string      `json:"name"`
	Description     string      `json:"description"`
	Pattern         string      `json:"pattern"`
	MaxCalls        pgtype.Int4 `json:"max_calls"`
	Enabled         bool        `json:"enabled"`
	Command         string      `json:"command"`
	BotID           pgtype.UUID `json:"bot_id"`
	RunTarget       string      `json:"run_target"`
	TargetSessionID pgtype.UUID `json:"target_session_id"`
	RuntimeType     pgtype.Text `json:"runtime_type"`
	BotAgentID      pgtype.UUID `json:"bot_agent_id"`
	AcpAgentID      pgtype.Text `json:"acp_agent_id"`
	ModelID         pgtype.UUID `json:"model_id"`
	AcpModelID      pgtype.Text `json:"acp_model_id"`
	ReasoningEffort pgtype.Text `json:"reasoning_effort"`
	WorkdirID       pgtype.UUID `json:"workdir_id"`
	MaxRunSeconds   int32       `json:"max_run_seconds"`
}

type CreateSearchProviderParams

type CreateSearchProviderParams struct {
	Name     string `json:"name"`
	Provider string `json:"provider"`
	Config   []byte `json:"config"`
	Enable   bool   `json:"enable"`
}

type CreateSessionEventParams

type CreateSessionEventParams struct {
	BotID                   pgtype.UUID `json:"bot_id"`
	SessionID               pgtype.UUID `json:"session_id"`
	EventKind               string      `json:"event_kind"`
	EventData               []byte      `json:"event_data"`
	ExternalMessageID       pgtype.Text `json:"external_message_id"`
	SenderChannelIdentityID pgtype.UUID `json:"sender_channel_identity_id"`
	ReceivedAtMs            int64       `json:"received_at_ms"`
}

type CreateSessionParams

type CreateSessionParams struct {
	BotID                    pgtype.UUID `json:"bot_id"`
	BotAgentID               pgtype.UUID `json:"bot_agent_id"`
	RouteID                  pgtype.UUID `json:"route_id"`
	ChannelType              pgtype.Text `json:"channel_type"`
	Type                     string      `json:"type"`
	SessionMode              string      `json:"session_mode"`
	RuntimeType              string      `json:"runtime_type"`
	Visibility               string      `json:"visibility"`
	RuntimeMetadata          []byte      `json:"runtime_metadata"`
	Title                    string      `json:"title"`
	Metadata                 []byte      `json:"metadata"`
	ParentSessionID          pgtype.UUID `json:"parent_session_id"`
	CreatedByUserID          pgtype.UUID `json:"created_by_user_id"`
	WorkdirID                pgtype.UUID `json:"workdir_id"`
	PreferredChatModelID     pgtype.UUID `json:"preferred_chat_model_id"`
	PreferredReasoningEffort pgtype.Text `json:"preferred_reasoning_effort"`
}

type CreateStorageProviderParams

type CreateStorageProviderParams struct {
	Name     string `json:"name"`
	Provider string `json:"provider"`
	Config   []byte `json:"config"`
}

type CreateSubagentConfigParams

type CreateSubagentConfigParams struct {
	SessionID    pgtype.UUID `json:"session_id"`
	ModelUuid    pgtype.UUID `json:"model_uuid"`
	ModelID      string      `json:"model_id"`
	ProviderName string      `json:"provider_name"`
	Forked       bool        `json:"forked"`
}

type CreateSubagentForkContextParams

type CreateSubagentForkContextParams struct {
	ParentSessionID pgtype.UUID `json:"parent_session_id"`
	SessionID       pgtype.UUID `json:"session_id"`
	ContextMessages []byte      `json:"context_messages"`
}

type CreateSubagentForkContextRow

type CreateSubagentForkContextRow struct {
	InsertedCount    int64 `json:"inserted_count"`
	CopiedAssetCount int64 `json:"copied_asset_count"`
}

type CreateToolApprovalRequestParams

type CreateToolApprovalRequestParams struct {
	BotID                        pgtype.UUID `json:"bot_id"`
	SessionID                    pgtype.UUID `json:"session_id"`
	RouteID                      pgtype.UUID `json:"route_id"`
	ChannelIdentityID            pgtype.UUID `json:"channel_identity_id"`
	WorkspaceTargetID            string      `json:"workspace_target_id"`
	ToolCallID                   string      `json:"tool_call_id"`
	ToolName                     string      `json:"tool_name"`
	Operation                    string      `json:"operation"`
	ToolInput                    []byte      `json:"tool_input"`
	Options                      []byte      `json:"options"`
	RuntimeFencingToken          pgtype.Int8 `json:"runtime_fencing_token"`
	RequestedByChannelIdentityID pgtype.UUID `json:"requested_by_channel_identity_id"`
	RequestedMessageID           pgtype.UUID `json:"requested_message_id"`
	SourcePlatform               string      `json:"source_platform"`
	ReplyTarget                  string      `json:"reply_target"`
	ConversationType             string      `json:"conversation_type"`
}

type CreateToolTailRoundParams

type CreateToolTailRoundParams struct {
	UserMessageID                            pgtype.UUID `json:"user_message_id"`
	UserSenderChannelIdentityID              pgtype.UUID `json:"user_sender_channel_identity_id"`
	UserSenderUserID                         pgtype.UUID `json:"user_sender_user_id"`
	UserExternalMessageID                    pgtype.Text `json:"user_external_message_id"`
	UserSourceReplyToMessageID               pgtype.Text `json:"user_source_reply_to_message_id"`
	UserContent                              []byte      `json:"user_content"`
	UserMetadata                             []byte      `json:"user_metadata"`
	UserUsage                                []byte      `json:"user_usage"`
	UserSessionMode                          string      `json:"user_session_mode"`
	UserRuntimeType                          string      `json:"user_runtime_type"`
	UserModelID                              pgtype.UUID `json:"user_model_id"`
	UserEventID                              pgtype.UUID `json:"user_event_id"`
	UserDisplayText                          pgtype.Text `json:"user_display_text"`
	ToolCallAssistantMessageID               pgtype.UUID `json:"tool_call_assistant_message_id"`
	ToolCallAssistantSenderChannelIdentityID pgtype.UUID `json:"tool_call_assistant_sender_channel_identity_id"`
	ToolCallAssistantSenderUserID            pgtype.UUID `json:"tool_call_assistant_sender_user_id"`
	ToolCallAssistantExternalMessageID       pgtype.Text `json:"tool_call_assistant_external_message_id"`
	ToolCallAssistantSourceReplyToMessageID  pgtype.Text `json:"tool_call_assistant_source_reply_to_message_id"`
	ToolCallAssistantContent                 []byte      `json:"tool_call_assistant_content"`
	ToolCallAssistantMetadata                []byte      `json:"tool_call_assistant_metadata"`
	ToolCallAssistantUsage                   []byte      `json:"tool_call_assistant_usage"`
	ToolCallAssistantSessionMode             string      `json:"tool_call_assistant_session_mode"`
	ToolCallAssistantRuntimeType             string      `json:"tool_call_assistant_runtime_type"`
	ToolCallAssistantModelID                 pgtype.UUID `json:"tool_call_assistant_model_id"`
	ToolCallAssistantEventID                 pgtype.UUID `json:"tool_call_assistant_event_id"`
	ToolCallAssistantDisplayText             pgtype.Text `json:"tool_call_assistant_display_text"`
	ToolMessageID                            pgtype.UUID `json:"tool_message_id"`
	ToolSenderChannelIdentityID              pgtype.UUID `json:"tool_sender_channel_identity_id"`
	ToolSenderUserID                         pgtype.UUID `json:"tool_sender_user_id"`
	ToolExternalMessageID                    pgtype.Text `json:"tool_external_message_id"`
	ToolSourceReplyToMessageID               pgtype.Text `json:"tool_source_reply_to_message_id"`
	ToolContent                              []byte      `json:"tool_content"`
	ToolMetadata                             []byte      `json:"tool_metadata"`
	ToolUsage                                []byte      `json:"tool_usage"`
	ToolSessionMode                          string      `json:"tool_session_mode"`
	ToolRuntimeType                          string      `json:"tool_runtime_type"`
	ToolModelID                              pgtype.UUID `json:"tool_model_id"`
	ToolEventID                              pgtype.UUID `json:"tool_event_id"`
	ToolDisplayText                          pgtype.Text `json:"tool_display_text"`
	FinalAssistantMessageID                  pgtype.UUID `json:"final_assistant_message_id"`
	FinalAssistantSenderChannelIdentityID    pgtype.UUID `json:"final_assistant_sender_channel_identity_id"`
	FinalAssistantSenderUserID               pgtype.UUID `json:"final_assistant_sender_user_id"`
	FinalAssistantExternalMessageID          pgtype.Text `json:"final_assistant_external_message_id"`
	FinalAssistantSourceReplyToMessageID     pgtype.Text `json:"final_assistant_source_reply_to_message_id"`
	FinalAssistantContent                    []byte      `json:"final_assistant_content"`
	FinalAssistantMetadata                   []byte      `json:"final_assistant_metadata"`
	FinalAssistantUsage                      []byte      `json:"final_assistant_usage"`
	FinalAssistantSessionMode                string      `json:"final_assistant_session_mode"`
	FinalAssistantRuntimeType                string      `json:"final_assistant_runtime_type"`
	FinalAssistantModelID                    pgtype.UUID `json:"final_assistant_model_id"`
	FinalAssistantEventID                    pgtype.UUID `json:"final_assistant_event_id"`
	FinalAssistantDisplayText                pgtype.Text `json:"final_assistant_display_text"`
	SessionID                                pgtype.UUID `json:"session_id"`
	TurnPosition                             pgtype.Int8 `json:"turn_position"`
	BotID                                    pgtype.UUID `json:"bot_id"`
	RunID                                    pgtype.UUID `json:"run_id"`
	TurnID                                   pgtype.UUID `json:"turn_id"`
}

type CreateToolTailRoundRow

type CreateToolTailRoundRow struct {
	ID        pgtype.UUID        `json:"id"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type CreateUserInputRequestParams

type CreateUserInputRequestParams struct {
	BotID                        pgtype.UUID        `json:"bot_id"`
	SessionID                    pgtype.UUID        `json:"session_id"`
	RouteID                      pgtype.UUID        `json:"route_id"`
	ChannelIdentityID            pgtype.UUID        `json:"channel_identity_id"`
	WorkspaceTargetID            string             `json:"workspace_target_id"`
	ToolCallID                   string             `json:"tool_call_id"`
	ToolName                     string             `json:"tool_name"`
	RuntimeFencingToken          pgtype.Int8        `json:"runtime_fencing_token"`
	InputJson                    []byte             `json:"input_json"`
	UiPayloadJson                []byte             `json:"ui_payload_json"`
	ProviderMetadata             []byte             `json:"provider_metadata"`
	RequestedByChannelIdentityID pgtype.UUID        `json:"requested_by_channel_identity_id"`
	SourcePlatform               string             `json:"source_platform"`
	ReplyTarget                  string             `json:"reply_target"`
	ConversationType             string             `json:"conversation_type"`
	ExpiresAt                    pgtype.Timestamptz `json:"expires_at"`
}

type CreateUserParams

type CreateUserParams struct {
	IsActive bool   `json:"is_active"`
	Metadata []byte `json:"metadata"`
}

type CreateUserRow

type CreateUserRow struct {
	ID                  pgtype.UUID        `json:"id"`
	Username            pgtype.Text        `json:"username"`
	Email               pgtype.Text        `json:"email"`
	PasswordHash        pgtype.Text        `json:"password_hash"`
	Role                string             `json:"role"`
	DisplayName         pgtype.Text        `json:"display_name"`
	AvatarUrl           pgtype.Text        `json:"avatar_url"`
	Timezone            string             `json:"timezone"`
	DataRoot            pgtype.Text        `json:"data_root"`
	LastLoginAt         pgtype.Timestamptz `json:"last_login_at"`
	IsActive            pgtype.Bool        `json:"is_active"`
	Metadata            []byte             `json:"metadata"`
	CreatedAt           pgtype.Timestamptz `json:"created_at"`
	UpdatedAt           pgtype.Timestamptz `json:"updated_at"`
	TeamID              pgtype.UUID        `json:"team_id"`
	PrincipalIsActive   bool               `json:"principal_is_active"`
	MembershipIsActive  bool               `json:"membership_is_active"`
	JoinedAt            pgtype.Timestamptz `json:"joined_at"`
	MembershipUpdatedAt pgtype.Timestamptz `json:"membership_updated_at"`
	TitleModelID        pgtype.UUID        `json:"title_model_id"`
}

type CreateUserRuntimeParams

type CreateUserRuntimeParams struct {
	UserID   pgtype.UUID `json:"user_id"`
	Name     string      `json:"name"`
	ApiToken string      `json:"api_token"`
}

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 DeleteAgentAuthorizationParams added in v0.20.0

type DeleteAgentAuthorizationParams struct {
	ID          pgtype.UUID `json:"id"`
	OwnerUserID pgtype.UUID `json:"owner_user_id"`
}

type DeleteAppConnectorRefParams added in v0.20.0

type DeleteAppConnectorRefParams struct {
	InstallationID pgtype.UUID `json:"installation_id"`
	ConnectorType  string      `json:"connector_type"`
}

type DeleteAppDependencyRefParams added in v0.20.0

type DeleteAppDependencyRefParams struct {
	InstallationID pgtype.UUID `json:"installation_id"`
	DependencyID   string      `json:"dependency_id"`
}

type DeleteBotAppInstallationParams added in v0.20.0

type DeleteBotAppInstallationParams struct {
	BotID pgtype.UUID `json:"bot_id"`
	ID    pgtype.UUID `json:"id"`
}

type DeleteBotChannelAdminParams

type DeleteBotChannelAdminParams struct {
	BotID             pgtype.UUID `json:"bot_id"`
	ChannelIdentityID pgtype.UUID `json:"channel_identity_id"`
}

type DeleteBotChannelConfigParams

type DeleteBotChannelConfigParams struct {
	BotID       pgtype.UUID `json:"bot_id"`
	ChannelType string      `json:"channel_type"`
}

type DeleteBotDependencyInstallationParams added in v0.20.0

type DeleteBotDependencyInstallationParams struct {
	BotID        pgtype.UUID `json:"bot_id"`
	DependencyID string      `json:"dependency_id"`
}

type DeleteBotDependencyOperationParams added in v0.20.0

type DeleteBotDependencyOperationParams struct {
	BotID        pgtype.UUID `json:"bot_id"`
	DependencyID string      `json:"dependency_id"`
	OperationID  string      `json:"operation_id"`
}

type DeleteBotRemoteRuntimeMountParams

type DeleteBotRemoteRuntimeMountParams struct {
	BotID    pgtype.UUID `json:"bot_id"`
	TargetID pgtype.UUID `json:"target_id"`
}

type DeleteConnectorParams

type DeleteConnectorParams struct {
	BotID        pgtype.UUID `json:"bot_id"`
	ConnectionID string      `json:"connection_id"`
}

type DeleteMCPConnectionParams

type DeleteMCPConnectionParams struct {
	BotID pgtype.UUID `json:"bot_id"`
	ID    pgtype.UUID `json:"id"`
}

type DeleteMemoryEdgesByRelForBotParams

type DeleteMemoryEdgesByRelForBotParams struct {
	BotID pgtype.UUID `json:"bot_id"`
	Rel   string      `json:"rel"`
}

type DeleteMemoryEdgesForNodeParams

type DeleteMemoryEdgesForNodeParams struct {
	BotID   pgtype.UUID `json:"bot_id"`
	SrcNode string      `json:"src_node"`
}

type DeleteMemoryNodeParams

type DeleteMemoryNodeParams struct {
	BotID pgtype.UUID `json:"bot_id"`
	ID    string      `json:"id"`
}

type DeleteModelByProviderAndTypeParams

type DeleteModelByProviderAndTypeParams struct {
	ProviderID pgtype.UUID `json:"provider_id"`
	ModelID    string      `json:"model_id"`
	Type       string      `json:"type"`
}

type DeleteModelByProviderIDAndModelIDParams

type DeleteModelByProviderIDAndModelIDParams struct {
	ProviderID pgtype.UUID `json:"provider_id"`
	ModelID    string      `json:"model_id"`
}

type DeleteRuntimeDecisionProjectionsByRunParams added in v0.20.0

type DeleteRuntimeDecisionProjectionsByRunParams struct {
	SessionID pgtype.UUID `json:"session_id"`
	BotID     pgtype.UUID `json:"bot_id"`
	RunID     pgtype.UUID `json:"run_id"`
}

type DeleteUserChannelIdentityBindingParams

type DeleteUserChannelIdentityBindingParams struct {
	UserID            pgtype.UUID `json:"user_id"`
	ChannelIdentityID pgtype.UUID `json:"channel_identity_id"`
}

type DeleteUserProviderOAuthTokenParams

type DeleteUserProviderOAuthTokenParams struct {
	ProviderID pgtype.UUID `json:"provider_id"`
	UserID     pgtype.UUID `json:"user_id"`
}

type EvaluateBotACLRuleParams

type EvaluateBotACLRuleParams struct {
	Action                 string      `json:"action"`
	SubjectChannelType     pgtype.Text `json:"subject_channel_type"`
	ChannelIdentityID      pgtype.UUID `json:"channel_identity_id"`
	SourceConversationType pgtype.Text `json:"source_conversation_type"`
	SourceConversationID   pgtype.Text `json:"source_conversation_id"`
	SourceThreadID         pgtype.Text `json:"source_thread_id"`
	BotID                  pgtype.UUID `json:"bot_id"`
}

type FailUserInputRequestParams

type FailUserInputRequestParams struct {
	ResultJson          []byte      `json:"result_json"`
	ID                  pgtype.UUID `json:"id"`
	RuntimeFencingToken pgtype.Int8 `json:"runtime_fencing_token"`
}

type FetchProvider

type FetchProvider struct {
	ID        pgtype.UUID        `json:"id"`
	Name      string             `json:"name"`
	Provider  string             `json:"provider"`
	Config    []byte             `json:"config"`
	Enable    bool               `json:"enable"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
	TeamID    pgtype.UUID        `json:"team_id"`
}

type FinalizeSessionRunParams

type FinalizeSessionRunParams struct {
	State         string      `json:"state"`
	ErrorCode     pgtype.Text `json:"error_code"`
	ErrorMessage  pgtype.Text `json:"error_message"`
	RunID         pgtype.UUID `json:"run_id"`
	FencingToken  int64       `json:"fencing_token"`
	ExpectedState pgtype.Text `json:"expected_state"`
}

type FindActiveBotAgentByRuntimeProviderParams

type FindActiveBotAgentByRuntimeProviderParams struct {
	BotID    pgtype.UUID `json:"bot_id"`
	Runtime  string      `json:"runtime"`
	Provider string      `json:"provider"`
}

type FindChatRouteParams

type FindChatRouteParams struct {
	BotID          pgtype.UUID `json:"bot_id"`
	Platform       string      `json:"platform"`
	ConversationID string      `json:"conversation_id"`
	ThreadID       pgtype.Text `json:"thread_id"`
}

type FindChatRouteRow

type FindChatRouteRow struct {
	ID               pgtype.UUID        `json:"id"`
	BotID            pgtype.UUID        `json:"bot_id"`
	Platform         string             `json:"platform"`
	ChannelConfigID  pgtype.UUID        `json:"channel_config_id"`
	ConversationID   string             `json:"conversation_id"`
	ThreadID         pgtype.Text        `json:"thread_id"`
	ConversationType pgtype.Text        `json:"conversation_type"`
	ReplyTarget      pgtype.Text        `json:"reply_target"`
	ActiveSessionID  pgtype.UUID        `json:"active_session_id"`
	Metadata         []byte             `json:"metadata"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
}

type FindWorkspaceDependencyIconParams added in v0.20.0

type FindWorkspaceDependencyIconParams struct {
	SourceUrl string `json:"source_url"`
	Digest    string `json:"digest"`
}

type FindWorkspaceDependencyIconRow added in v0.20.0

type FindWorkspaceDependencyIconRow struct {
	SourceUrl     string `json:"source_url"`
	RegistryID    string `json:"registry_id"`
	DependencyID  string `json:"dependency_id"`
	Revision      string `json:"revision"`
	ReleaseBytes  []byte `json:"release_bytes"`
	ArtifactBytes []byte `json:"artifact_bytes"`
}

type FinishBotDependencyOperationParams added in v0.20.0

type FinishBotDependencyOperationParams struct {
	Source             string             `json:"source"`
	Status             string             `json:"status"`
	InstalledVersion   string             `json:"installed_version"`
	LatestVersion      string             `json:"latest_version"`
	LastCheckedAt      pgtype.Timestamptz `json:"last_checked_at"`
	LastErrorCode      string             `json:"last_error_code"`
	ManifestDigest     string             `json:"manifest_digest"`
	SourceUrl          string             `json:"source_url"`
	RegistryID         string             `json:"registry_id"`
	DefinitionRevision string             `json:"definition_revision"`
	BotID              pgtype.UUID        `json:"bot_id"`
	DependencyID       string             `json:"dependency_id"`
	OperationID        string             `json:"operation_id"`
}

type ForkSessionFromAssistantTurnParams

type ForkSessionFromAssistantTurnParams struct {
	SessionID               pgtype.UUID `json:"session_id"`
	BotID                   pgtype.UUID `json:"bot_id"`
	TurnID                  pgtype.UUID `json:"turn_id"`
	Metadata                []byte      `json:"metadata"`
	RuntimeMetadataOverride []byte      `json:"runtime_metadata_override"`
	Title                   string      `json:"title"`
	CreatedByUserID         pgtype.UUID `json:"created_by_user_id"`
}

type ForkSessionFromAssistantTurnRow

type ForkSessionFromAssistantTurnRow struct {
	ID                  pgtype.UUID   `json:"id"`
	SourceMessageIds    []pgtype.UUID `json:"source_message_ids"`
	ForkMessageIds      []pgtype.UUID `json:"fork_message_ids"`
	ThroughTurnPosition int64         `json:"through_turn_position"`
}

type GetActiveBotAgentByIDParams

type GetActiveBotAgentByIDParams struct {
	BotID pgtype.UUID `json:"bot_id"`
	ID    pgtype.UUID `json:"id"`
}

type GetAgentAuthorizationParams added in v0.20.0

type GetAgentAuthorizationParams struct {
	ID          pgtype.UUID `json:"id"`
	OwnerUserID pgtype.UUID `json:"owner_user_id"`
}

type GetBotAgentByIDParams

type GetBotAgentByIDParams struct {
	BotID pgtype.UUID `json:"bot_id"`
	ID    pgtype.UUID `json:"id"`
}

type GetBotAgentCredentialParams added in v0.20.0

type GetBotAgentCredentialParams struct {
	BotID      pgtype.UUID `json:"bot_id"`
	BotAgentID pgtype.UUID `json:"bot_agent_id"`
}

type GetBotAgentCredentialRow added in v0.20.0

type GetBotAgentCredentialRow struct {
	ID                pgtype.UUID        `json:"id"`
	TeamID            pgtype.UUID        `json:"team_id"`
	OwnerUserID       pgtype.UUID        `json:"owner_user_id"`
	Provider          string             `json:"provider"`
	AuthKind          string             `json:"auth_kind"`
	Label             string             `json:"label"`
	EncryptedPayload  []byte             `json:"encrypted_payload"`
	EncryptionNonce   []byte             `json:"encryption_nonce"`
	KeyVersion        int32              `json:"key_version"`
	AccountMetadata   []byte             `json:"account_metadata"`
	ExpiresAt         pgtype.Timestamptz `json:"expires_at"`
	CredentialVersion int64              `json:"credential_version"`
	RevokedAt         pgtype.Timestamptz `json:"revoked_at"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
	AgentRuntime      string             `json:"agent_runtime"`
}

type GetBotAgentRuntimeParams added in v0.20.0

type GetBotAgentRuntimeParams struct {
	BotID      pgtype.UUID `json:"bot_id"`
	BotAgentID pgtype.UUID `json:"bot_agent_id"`
}

type GetBotAppInstallationByIDParams added in v0.20.0

type GetBotAppInstallationByIDParams struct {
	BotID pgtype.UUID `json:"bot_id"`
	ID    pgtype.UUID `json:"id"`
}

type GetBotAppInstallationParams added in v0.20.0

type GetBotAppInstallationParams struct {
	BotID      pgtype.UUID `json:"bot_id"`
	RegistryID string      `json:"registry_id"`
	AppID      string      `json:"app_id"`
}

type GetBotByCreateRequestKeyParams added in v0.21.0

type GetBotByCreateRequestKeyParams struct {
	OwnerUserID      pgtype.UUID `json:"owner_user_id"`
	CreateRequestKey pgtype.Text `json:"create_request_key"`
}

type GetBotByCreateRequestKeyRow added in v0.21.0

type GetBotByCreateRequestKeyRow struct {
	ID               pgtype.UUID        `json:"id"`
	OwnerUserID      pgtype.UUID        `json:"owner_user_id"`
	Name             string             `json:"name"`
	DisplayName      pgtype.Text        `json:"display_name"`
	AvatarUrl        pgtype.Text        `json:"avatar_url"`
	Timezone         pgtype.Text        `json:"timezone"`
	IsActive         bool               `json:"is_active"`
	Status           string             `json:"status"`
	ReasoningEffort  string             `json:"reasoning_effort"`
	ChatModelID      pgtype.UUID        `json:"chat_model_id"`
	SearchProviderID pgtype.UUID        `json:"search_provider_id"`
	MemoryProviderID pgtype.UUID        `json:"memory_provider_id"`
	Metadata         []byte             `json:"metadata"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
}

type GetBotByIDRow

type GetBotByIDRow struct {
	ID               pgtype.UUID        `json:"id"`
	OwnerUserID      pgtype.UUID        `json:"owner_user_id"`
	Name             string             `json:"name"`
	DisplayName      pgtype.Text        `json:"display_name"`
	AvatarUrl        pgtype.Text        `json:"avatar_url"`
	Timezone         pgtype.Text        `json:"timezone"`
	IsActive         bool               `json:"is_active"`
	Status           string             `json:"status"`
	ReasoningEffort  string             `json:"reasoning_effort"`
	ChatModelID      pgtype.UUID        `json:"chat_model_id"`
	SearchProviderID pgtype.UUID        `json:"search_provider_id"`
	MemoryProviderID pgtype.UUID        `json:"memory_provider_id"`
	Metadata         []byte             `json:"metadata"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
}

type GetBotByNameRow

type GetBotByNameRow struct {
	ID               pgtype.UUID        `json:"id"`
	OwnerUserID      pgtype.UUID        `json:"owner_user_id"`
	Name             string             `json:"name"`
	DisplayName      pgtype.Text        `json:"display_name"`
	AvatarUrl        pgtype.Text        `json:"avatar_url"`
	Timezone         pgtype.Text        `json:"timezone"`
	IsActive         bool               `json:"is_active"`
	Status           string             `json:"status"`
	ReasoningEffort  string             `json:"reasoning_effort"`
	ChatModelID      pgtype.UUID        `json:"chat_model_id"`
	SearchProviderID pgtype.UUID        `json:"search_provider_id"`
	MemoryProviderID pgtype.UUID        `json:"memory_provider_id"`
	Metadata         []byte             `json:"metadata"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
}

type GetBotChannelAdminParams

type GetBotChannelAdminParams struct {
	BotID             pgtype.UUID `json:"bot_id"`
	ChannelIdentityID pgtype.UUID `json:"channel_identity_id"`
}

type GetBotChannelConfigByExternalIdentityParams

type GetBotChannelConfigByExternalIdentityParams struct {
	ChannelType      string      `json:"channel_type"`
	ExternalIdentity pgtype.Text `json:"external_identity"`
}

type GetBotChannelConfigParams

type GetBotChannelConfigParams struct {
	BotID       pgtype.UUID `json:"bot_id"`
	ChannelType string      `json:"channel_type"`
}

type GetBotDependencyInstallationParams added in v0.20.0

type GetBotDependencyInstallationParams struct {
	BotID        pgtype.UUID `json:"bot_id"`
	DependencyID string      `json:"dependency_id"`
}

type GetBotOverlayConfigRow

type GetBotOverlayConfigRow struct {
	OverlayEnabled  bool   `json:"overlay_enabled"`
	OverlayProvider string `json:"overlay_provider"`
	OverlayConfig   []byte `json:"overlay_config"`
}

type GetBotRemoteRuntimeMountParams

type GetBotRemoteRuntimeMountParams struct {
	BotID    pgtype.UUID `json:"bot_id"`
	TargetID pgtype.UUID `json:"target_id"`
}

type GetBotRemoteRuntimeMountRow

type GetBotRemoteRuntimeMountRow struct {
	ID                 pgtype.UUID        `json:"id"`
	BotID              pgtype.UUID        `json:"bot_id"`
	RuntimeID          pgtype.UUID        `json:"runtime_id"`
	IsPrimary          bool               `json:"is_primary"`
	ToolApprovalConfig []byte             `json:"tool_approval_config"`
	CreatedAt          pgtype.Timestamptz `json:"created_at"`
	UpdatedAt          pgtype.Timestamptz `json:"updated_at"`
	RuntimeName        string             `json:"runtime_name"`
	RuntimeUserID      pgtype.UUID        `json:"runtime_user_id"`
	RuntimeUnavailable pgtype.Bool        `json:"runtime_unavailable"`
	BotOwnerUserID     pgtype.UUID        `json:"bot_owner_user_id"`
}

type GetBotRuntimeResetRow

type GetBotRuntimeResetRow struct {
	RuntimeResetToken     pgtype.UUID        `json:"runtime_reset_token"`
	RuntimeResetExpiresAt pgtype.Timestamptz `json:"runtime_reset_expires_at"`
}

type GetBotWorkdirParams

type GetBotWorkdirParams struct {
	BotID     pgtype.UUID `json:"bot_id"`
	WorkdirID pgtype.UUID `json:"workdir_id"`
}

type GetChannelIdentityByChannelSubjectParams

type GetChannelIdentityByChannelSubjectParams struct {
	ChannelType      string `json:"channel_type"`
	ChannelSubjectID string `json:"channel_subject_id"`
}

type GetChatRouteByIDRow

type GetChatRouteByIDRow struct {
	ID               pgtype.UUID        `json:"id"`
	BotID            pgtype.UUID        `json:"bot_id"`
	Platform         string             `json:"platform"`
	ChannelConfigID  pgtype.UUID        `json:"channel_config_id"`
	ConversationID   string             `json:"conversation_id"`
	ThreadID         pgtype.Text        `json:"thread_id"`
	ConversationType pgtype.Text        `json:"conversation_type"`
	ReplyTarget      pgtype.Text        `json:"reply_target"`
	ActiveSessionID  pgtype.UUID        `json:"active_session_id"`
	Metadata         []byte             `json:"metadata"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
}

type GetConnectorByConnectionIDParams

type GetConnectorByConnectionIDParams struct {
	BotID        pgtype.UUID `json:"bot_id"`
	ConnectionID string      `json:"connection_id"`
}

type GetContextLifecycleByRunIDRow added in v0.20.0

type GetContextLifecycleByRunIDRow struct {
	RunID     pgtype.UUID        `json:"run_id"`
	TeamID    pgtype.UUID        `json:"team_id"`
	BotID     pgtype.UUID        `json:"bot_id"`
	SessionID pgtype.UUID        `json:"session_id"`
	Status    string             `json:"status"`
	ErrorCode pgtype.Text        `json:"error_code"`
	Snapshot  []byte             `json:"snapshot"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type GetEffectiveBotScopeRuntimeResetRow

type GetEffectiveBotScopeRuntimeResetRow struct {
	Scope                 string             `json:"scope"`
	SessionID             pgtype.UUID        `json:"session_id"`
	ResetToken            pgtype.UUID        `json:"reset_token"`
	RuntimeResetExpiresAt pgtype.Timestamptz `json:"runtime_reset_expires_at"`
}

type GetEffectiveSessionRuntimeResetParams

type GetEffectiveSessionRuntimeResetParams struct {
	BotID     pgtype.UUID `json:"bot_id"`
	SessionID pgtype.UUID `json:"session_id"`
}

type GetEffectiveSessionRuntimeResetRow

type GetEffectiveSessionRuntimeResetRow struct {
	Scope                 string             `json:"scope"`
	ResetToken            pgtype.UUID        `json:"reset_token"`
	RuntimeResetExpiresAt pgtype.Timestamptz `json:"runtime_reset_expires_at"`
}

type GetForkHistoryPositionParams added in v1.0.0

type GetForkHistoryPositionParams struct {
	TurnPosition     int64         `json:"turn_position"`
	TurnMessageSeq   int64         `json:"turn_message_seq"`
	SourceMessageIds []pgtype.UUID `json:"source_message_ids"`
	ForkMessageIds   []pgtype.UUID `json:"fork_message_ids"`
}

type GetForkHistoryPositionRow added in v1.0.0

type GetForkHistoryPositionRow struct {
	TurnPosition   int64 `json:"turn_position"`
	TurnMessageSeq int64 `json:"turn_message_seq"`
}

type GetHistoryCheckpointKeptBeforeTurnParams added in v1.0.0

type GetHistoryCheckpointKeptBeforeTurnParams struct {
	SessionID pgtype.UUID `json:"session_id"`
	TurnID    pgtype.UUID `json:"turn_id"`
}

type GetHistoryCheckpointKeptBeforeTurnRow added in v1.0.0

type GetHistoryCheckpointKeptBeforeTurnRow struct {
	TurnFound    bool        `json:"turn_found"`
	CheckpointID pgtype.UUID `json:"checkpoint_id"`
}

type GetHistoryCheckpointKeptThroughTurnParams added in v1.0.0

type GetHistoryCheckpointKeptThroughTurnParams struct {
	SessionID           pgtype.UUID `json:"session_id"`
	ThroughTurnPosition int64       `json:"through_turn_position"`
}

type GetHistoryTurnByIDParams

type GetHistoryTurnByIDParams struct {
	OldTurnID pgtype.UUID `json:"old_turn_id"`
	SessionID pgtype.UUID `json:"session_id"`
}

type GetHistoryTurnByIDRow

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

type GetInteractiveUserInputRequestParams added in v0.20.0

type GetInteractiveUserInputRequestParams struct {
	BotID pgtype.UUID `json:"bot_id"`
	ID    pgtype.UUID `json:"id"`
}

type GetLatestAssistantContextLifecycleByRunIDRow

type GetLatestAssistantContextLifecycleByRunIDRow struct {
	ID       pgtype.UUID `json:"id"`
	Metadata []byte      `json:"metadata"`
}

type GetLatestInputEstimateSampleParams added in v1.0.0

type GetLatestInputEstimateSampleParams struct {
	ModelID   pgtype.UUID `json:"model_id"`
	SessionID pgtype.UUID `json:"session_id"`
}

type GetLatestInputEstimateSampleRow added in v1.0.0

type GetLatestInputEstimateSampleRow struct {
	InputTokens    int64 `json:"input_tokens"`
	EstimateTokens int64 `json:"estimate_tokens"`
}

type GetLatestPendingToolApprovalBySessionParams

type GetLatestPendingToolApprovalBySessionParams struct {
	BotID     pgtype.UUID `json:"bot_id"`
	SessionID pgtype.UUID `json:"session_id"`
}

type GetLatestPendingUserInputBySessionParams

type GetLatestPendingUserInputBySessionParams struct {
	BotID     pgtype.UUID `json:"bot_id"`
	SessionID pgtype.UUID `json:"session_id"`
}

type GetLatestSessionModelPreferenceParams added in v0.20.0

type GetLatestSessionModelPreferenceParams struct {
	BotID           pgtype.UUID `json:"bot_id"`
	CreatedByUserID pgtype.UUID `json:"created_by_user_id"`
}

type GetLatestSessionModelPreferenceRow added in v0.20.0

type GetLatestSessionModelPreferenceRow struct {
	PreferredChatModelID     pgtype.UUID `json:"preferred_chat_model_id"`
	PreferredReasoningEffort pgtype.Text `json:"preferred_reasoning_effort"`
}

type GetLatestVisibleHistoryTurnBySessionRow

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

type GetLocatedMessageByExternalIDBySessionParams

type GetLocatedMessageByExternalIDBySessionParams struct {
	SessionID         pgtype.UUID `json:"session_id"`
	ExternalMessageID pgtype.Text `json:"external_message_id"`
}

type GetLocatedMessageByExternalIDBySessionRow

type GetLocatedMessageByExternalIDBySessionRow struct {
	ID                      pgtype.UUID        `json:"id"`
	TurnPosition            pgtype.Int8        `json:"turn_position"`
	TurnMessageSeq          pgtype.Int8        `json:"turn_message_seq"`
	BotID                   pgtype.UUID        `json:"bot_id"`
	SessionID               pgtype.UUID        `json:"session_id"`
	SenderChannelIdentityID pgtype.UUID        `json:"sender_channel_identity_id"`
	SenderUserID            pgtype.UUID        `json:"sender_user_id"`
	ExternalMessageID       pgtype.Text        `json:"external_message_id"`
	SourceReplyToMessageID  pgtype.Text        `json:"source_reply_to_message_id"`
	Role                    string             `json:"role"`
	Content                 []byte             `json:"content"`
	Metadata                []byte             `json:"metadata"`
	Usage                   []byte             `json:"usage"`
	SessionMode             string             `json:"session_mode"`
	RuntimeType             string             `json:"runtime_type"`
	EventID                 pgtype.UUID        `json:"event_id"`
	DisplayText             pgtype.Text        `json:"display_text"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	SenderDisplayName       pgtype.Text        `json:"sender_display_name"`
	SenderAvatarUrl         pgtype.Text        `json:"sender_avatar_url"`
	Platform                pgtype.Text        `json:"platform"`
}

type GetMCPConnectionByIDParams

type GetMCPConnectionByIDParams struct {
	BotID pgtype.UUID `json:"bot_id"`
	ID    pgtype.UUID `json:"id"`
}

type GetMemoryNodeParams

type GetMemoryNodeParams struct {
	BotID pgtype.UUID `json:"bot_id"`
	ID    string      `json:"id"`
}

type GetMemoryTokenUsageByDayParams added in v0.21.0

type GetMemoryTokenUsageByDayParams struct {
	BotID    pgtype.UUID        `json:"bot_id"`
	FromTime pgtype.Timestamptz `json:"from_time"`
	ToTime   pgtype.Timestamptz `json:"to_time"`
	ModelID  pgtype.UUID        `json:"model_id"`
}

type GetMemoryTokenUsageByDayRow added in v0.21.0

type GetMemoryTokenUsageByDayRow struct {
	Day             pgtype.Date `json:"day"`
	InputTokens     int64       `json:"input_tokens"`
	OutputTokens    int64       `json:"output_tokens"`
	CacheReadTokens int64       `json:"cache_read_tokens"`
	ReasoningTokens int64       `json:"reasoning_tokens"`
}

type GetMemoryTokenUsageByModelParams added in v0.21.0

type GetMemoryTokenUsageByModelParams struct {
	BotID    pgtype.UUID        `json:"bot_id"`
	FromTime pgtype.Timestamptz `json:"from_time"`
	ToTime   pgtype.Timestamptz `json:"to_time"`
}

type GetMemoryTokenUsageByModelRow added in v0.21.0

type GetMemoryTokenUsageByModelRow struct {
	ModelID      pgtype.UUID `json:"model_id"`
	ModelSlug    string      `json:"model_slug"`
	ModelName    string      `json:"model_name"`
	ProviderName string      `json:"provider_name"`
	InputTokens  int64       `json:"input_tokens"`
	OutputTokens int64       `json:"output_tokens"`
}

type GetMessageByExternalIDBySessionParams

type GetMessageByExternalIDBySessionParams struct {
	SessionID         pgtype.UUID `json:"session_id"`
	ExternalMessageID pgtype.Text `json:"external_message_id"`
}

type GetMessageByExternalIDBySessionRow

type GetMessageByExternalIDBySessionRow struct {
	ID                      pgtype.UUID        `json:"id"`
	BotID                   pgtype.UUID        `json:"bot_id"`
	SessionID               pgtype.UUID        `json:"session_id"`
	SenderChannelIdentityID pgtype.UUID        `json:"sender_channel_identity_id"`
	SenderUserID            pgtype.UUID        `json:"sender_user_id"`
	ExternalMessageID       pgtype.Text        `json:"external_message_id"`
	SourceReplyToMessageID  pgtype.Text        `json:"source_reply_to_message_id"`
	Role                    string             `json:"role"`
	Content                 []byte             `json:"content"`
	Metadata                []byte             `json:"metadata"`
	Usage                   []byte             `json:"usage"`
	SessionMode             string             `json:"session_mode"`
	RuntimeType             string             `json:"runtime_type"`
	EventID                 pgtype.UUID        `json:"event_id"`
	DisplayText             pgtype.Text        `json:"display_text"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	SenderDisplayName       pgtype.Text        `json:"sender_display_name"`
	SenderAvatarUrl         pgtype.Text        `json:"sender_avatar_url"`
	Platform                pgtype.Text        `json:"platform"`
}

type GetMessageByIDBySessionParams

type GetMessageByIDBySessionParams struct {
	SessionID pgtype.UUID `json:"session_id"`
	MessageID pgtype.UUID `json:"message_id"`
}

type GetMessageByIDBySessionRow

type GetMessageByIDBySessionRow struct {
	ID                      pgtype.UUID        `json:"id"`
	BotID                   pgtype.UUID        `json:"bot_id"`
	SessionID               pgtype.UUID        `json:"session_id"`
	SenderChannelIdentityID pgtype.UUID        `json:"sender_channel_identity_id"`
	SenderUserID            pgtype.UUID        `json:"sender_user_id"`
	ExternalMessageID       pgtype.Text        `json:"external_message_id"`
	SourceReplyToMessageID  pgtype.Text        `json:"source_reply_to_message_id"`
	Role                    string             `json:"role"`
	Content                 []byte             `json:"content"`
	Metadata                []byte             `json:"metadata"`
	Usage                   []byte             `json:"usage"`
	SessionMode             string             `json:"session_mode"`
	RuntimeType             string             `json:"runtime_type"`
	EventID                 pgtype.UUID        `json:"event_id"`
	TurnID                  pgtype.UUID        `json:"turn_id"`
	TurnPosition            pgtype.Int8        `json:"turn_position"`
	DisplayText             pgtype.Text        `json:"display_text"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	SenderDisplayName       pgtype.Text        `json:"sender_display_name"`
	SenderAvatarUrl         pgtype.Text        `json:"sender_avatar_url"`
	Platform                pgtype.Text        `json:"platform"`
}

type GetModelByProviderAndModelIDParams

type GetModelByProviderAndModelIDParams struct {
	ProviderID pgtype.UUID `json:"provider_id"`
	ModelID    string      `json:"model_id"`
}

type GetPendingToolApprovalByReplyMessageParams

type GetPendingToolApprovalByReplyMessageParams struct {
	BotID                   pgtype.UUID `json:"bot_id"`
	SessionID               pgtype.UUID `json:"session_id"`
	PromptExternalMessageID string      `json:"prompt_external_message_id"`
}

type GetPendingToolApprovalBySessionShortIDParams

type GetPendingToolApprovalBySessionShortIDParams struct {
	BotID     pgtype.UUID `json:"bot_id"`
	SessionID pgtype.UUID `json:"session_id"`
	ShortID   int32       `json:"short_id"`
}

type GetPendingUserInputByReplyMessageParams

type GetPendingUserInputByReplyMessageParams struct {
	BotID                   pgtype.UUID `json:"bot_id"`
	SessionID               pgtype.UUID `json:"session_id"`
	PromptExternalMessageID string      `json:"prompt_external_message_id"`
}

type GetPendingUserInputBySessionShortIDParams

type GetPendingUserInputBySessionShortIDParams struct {
	BotID     pgtype.UUID `json:"bot_id"`
	SessionID pgtype.UUID `json:"session_id"`
	ShortID   int32       `json:"short_id"`
}

type GetPrimaryBotRemoteRuntimeMountRow

type GetPrimaryBotRemoteRuntimeMountRow struct {
	ID                 pgtype.UUID        `json:"id"`
	BotID              pgtype.UUID        `json:"bot_id"`
	RuntimeID          pgtype.UUID        `json:"runtime_id"`
	IsPrimary          bool               `json:"is_primary"`
	ToolApprovalConfig []byte             `json:"tool_approval_config"`
	CreatedAt          pgtype.Timestamptz `json:"created_at"`
	UpdatedAt          pgtype.Timestamptz `json:"updated_at"`
	RuntimeName        string             `json:"runtime_name"`
	RuntimeUserID      pgtype.UUID        `json:"runtime_user_id"`
	RuntimeUnavailable pgtype.Bool        `json:"runtime_unavailable"`
	BotOwnerUserID     pgtype.UUID        `json:"bot_owner_user_id"`
}

type GetProviderTemplateByDomainAndKeyParams

type GetProviderTemplateByDomainAndKeyParams struct {
	Domain string `json:"domain"`
	Key    string `json:"key"`
}

type GetRespondableUserInputRequestParams

type GetRespondableUserInputRequestParams struct {
	ID                  pgtype.UUID `json:"id"`
	RuntimeFencingToken pgtype.Int8 `json:"runtime_fencing_token"`
}

type GetRunHistoryTurnRequestMessageIDParams added in v1.0.0

type GetRunHistoryTurnRequestMessageIDParams struct {
	SessionID  pgtype.UUID `json:"session_id"`
	RunID      pgtype.UUID `json:"run_id"`
	RootTurnID pgtype.UUID `json:"root_turn_id"`
}

type GetRuntimeConfigEpochParams added in v0.20.0

type GetRuntimeConfigEpochParams struct {
	SessionID pgtype.UUID `json:"session_id"`
	BotID     pgtype.UUID `json:"bot_id"`
}

type GetRuntimeConfigEpochRow added in v0.20.0

type GetRuntimeConfigEpochRow struct {
	BotRuntimeConfigEpoch     int64 `json:"bot_runtime_config_epoch"`
	SessionRuntimeConfigEpoch int64 `json:"session_runtime_config_epoch"`
}

type GetRuntimeLeadingUserMessageIDParams added in v0.20.0

type GetRuntimeLeadingUserMessageIDParams struct {
	BotID     pgtype.UUID `json:"bot_id"`
	SessionID pgtype.UUID `json:"session_id"`
	RunID     pgtype.UUID `json:"run_id"`
	TurnID    pgtype.UUID `json:"turn_id"`
}

type GetRuntimeRoundOutcomeParams added in v0.20.0

type GetRuntimeRoundOutcomeParams struct {
	BotID     pgtype.UUID `json:"bot_id"`
	SessionID pgtype.UUID `json:"session_id"`
	RunID     pgtype.UUID `json:"run_id"`
}

type GetSessionCacheStatsRow

type GetSessionCacheStatsRow struct {
	TotalInputTokens int64 `json:"total_input_tokens"`
	CacheReadTokens  int64 `json:"cache_read_tokens"`
}

type GetSessionDiscussCursorParams

type GetSessionDiscussCursorParams struct {
	SessionID pgtype.UUID `json:"session_id"`
	ScopeKey  string      `json:"scope_key"`
}

type GetSessionRunByInvocationParams

type GetSessionRunByInvocationParams struct {
	SessionID    pgtype.UUID `json:"session_id"`
	InvocationID string      `json:"invocation_id"`
}

type GetSettingsByBotIDRow

type GetSettingsByBotIDRow struct {
	BotID                  pgtype.UUID `json:"bot_id"`
	ReasoningEffort        string      `json:"reasoning_effort"`
	Timezone               pgtype.Text `json:"timezone"`
	ChatModelID            pgtype.UUID `json:"chat_model_id"`
	DefaultBotAgentID      pgtype.UUID `json:"default_bot_agent_id"`
	ChatRuntime            string      `json:"chat_runtime"`
	ChatAcpAgentID         pgtype.Text `json:"chat_acp_agent_id"`
	ChatAcpProjectPath     string      `json:"chat_acp_project_path"`
	ChatAcpProjectMode     string      `json:"chat_acp_project_mode"`
	MemoryLlmModelID       pgtype.UUID `json:"memory_llm_model_id"`
	SearchProviderID       pgtype.UUID `json:"search_provider_id"`
	FetchProviderID        pgtype.UUID `json:"fetch_provider_id"`
	MemoryProviderID       pgtype.UUID `json:"memory_provider_id"`
	ImageModelID           pgtype.UUID `json:"image_model_id"`
	TtsModelID             pgtype.UUID `json:"tts_model_id"`
	TranscriptionModelID   pgtype.UUID `json:"transcription_model_id"`
	VideoModelID           pgtype.UUID `json:"video_model_id"`
	PersistFullToolResults bool        `json:"persist_full_tool_results"`
	ShowToolCallsInIm      bool        `json:"show_tool_calls_in_im"`
	ToolApprovalConfig     []byte      `json:"tool_approval_config"`
	DisplayEnabled         bool        `json:"display_enabled"`
	OverlayProvider        string      `json:"overlay_provider"`
	OverlayEnabled         bool        `json:"overlay_enabled"`
	OverlayConfig          []byte      `json:"overlay_config"`
	CommandUiLanguage      string      `json:"command_ui_language"`
}

type GetSnapshotByContainerAndRuntimeNameParams

type GetSnapshotByContainerAndRuntimeNameParams struct {
	ContainerID         string `json:"container_id"`
	RuntimeSnapshotName string `json:"runtime_snapshot_name"`
}

type GetSpeechModelWithProviderRow

type GetSpeechModelWithProviderRow struct {
	ID           pgtype.UUID        `json:"id"`
	ModelID      string             `json:"model_id"`
	Name         pgtype.Text        `json:"name"`
	ProviderID   pgtype.UUID        `json:"provider_id"`
	Type         string             `json:"type"`
	Enable       bool               `json:"enable"`
	Config       []byte             `json:"config"`
	CreatedAt    pgtype.Timestamptz `json:"created_at"`
	UpdatedAt    pgtype.Timestamptz `json:"updated_at"`
	TeamID       pgtype.UUID        `json:"team_id"`
	ProviderType string             `json:"provider_type"`
}

type GetTokenUsageByDayAndTypeParams

type GetTokenUsageByDayAndTypeParams struct {
	BotID       pgtype.UUID        `json:"bot_id"`
	FromTime    pgtype.Timestamptz `json:"from_time"`
	ToTime      pgtype.Timestamptz `json:"to_time"`
	ModelID     pgtype.UUID        `json:"model_id"`
	SessionType pgtype.Text        `json:"session_type"`
}

type GetTokenUsageByDayAndTypeRow

type GetTokenUsageByDayAndTypeRow struct {
	SessionType     string      `json:"session_type"`
	Day             pgtype.Date `json:"day"`
	InputTokens     int64       `json:"input_tokens"`
	OutputTokens    int64       `json:"output_tokens"`
	CacheReadTokens int64       `json:"cache_read_tokens"`
	ReasoningTokens int64       `json:"reasoning_tokens"`
}

type GetTokenUsageByModelParams

type GetTokenUsageByModelParams struct {
	BotID       pgtype.UUID        `json:"bot_id"`
	FromTime    pgtype.Timestamptz `json:"from_time"`
	ToTime      pgtype.Timestamptz `json:"to_time"`
	SessionType pgtype.Text        `json:"session_type"`
}

type GetTokenUsageByModelRow

type GetTokenUsageByModelRow struct {
	ModelID      pgtype.UUID `json:"model_id"`
	ModelSlug    string      `json:"model_slug"`
	ModelName    string      `json:"model_name"`
	ProviderName string      `json:"provider_name"`
	InputTokens  int64       `json:"input_tokens"`
	OutputTokens int64       `json:"output_tokens"`
}

type GetTranscriptionModelWithProviderRow

type GetTranscriptionModelWithProviderRow struct {
	ID           pgtype.UUID        `json:"id"`
	ModelID      string             `json:"model_id"`
	Name         pgtype.Text        `json:"name"`
	ProviderID   pgtype.UUID        `json:"provider_id"`
	Type         string             `json:"type"`
	Enable       bool               `json:"enable"`
	Config       []byte             `json:"config"`
	CreatedAt    pgtype.Timestamptz `json:"created_at"`
	UpdatedAt    pgtype.Timestamptz `json:"updated_at"`
	TeamID       pgtype.UUID        `json:"team_id"`
	ProviderType string             `json:"provider_type"`
}

type GetTurnAgentTurnIDParams added in v0.20.0

type GetTurnAgentTurnIDParams struct {
	BotID     pgtype.UUID `json:"bot_id"`
	SessionID pgtype.UUID `json:"session_id"`
	TurnID    pgtype.UUID `json:"turn_id"`
}

type GetUserChannelBindingParams

type GetUserChannelBindingParams struct {
	UserID      pgtype.UUID `json:"user_id"`
	ChannelType string      `json:"channel_type"`
}

type GetUserInputRequestBySessionToolCallParams

type GetUserInputRequestBySessionToolCallParams struct {
	SessionID  pgtype.UUID `json:"session_id"`
	ToolCallID string      `json:"tool_call_id"`
}

type GetUserProviderOAuthTokenParams

type GetUserProviderOAuthTokenParams struct {
	ProviderID pgtype.UUID `json:"provider_id"`
	UserID     pgtype.UUID `json:"user_id"`
}

type GetVersionSnapshotRuntimeNameParams

type GetVersionSnapshotRuntimeNameParams struct {
	ContainerID string `json:"container_id"`
	Version     int32  `json:"version"`
}

type GetVideoModelWithProviderRow

type GetVideoModelWithProviderRow struct {
	ID           pgtype.UUID        `json:"id"`
	ModelID      string             `json:"model_id"`
	Name         pgtype.Text        `json:"name"`
	ProviderID   pgtype.UUID        `json:"provider_id"`
	Type         string             `json:"type"`
	Enable       bool               `json:"enable"`
	Config       []byte             `json:"config"`
	CreatedAt    pgtype.Timestamptz `json:"created_at"`
	UpdatedAt    pgtype.Timestamptz `json:"updated_at"`
	TeamID       pgtype.UUID        `json:"team_id"`
	ProviderType string             `json:"provider_type"`
}

type GetVisibleHistoryTurnByMessageParams

type GetVisibleHistoryTurnByMessageParams struct {
	SessionID pgtype.UUID `json:"session_id"`
	MessageID pgtype.UUID `json:"message_id"`
}

type GetVisibleHistoryTurnByMessageRow

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

type GetVisibleMessageCursorByExternalIDBySessionParams

type GetVisibleMessageCursorByExternalIDBySessionParams struct {
	SessionID         pgtype.UUID `json:"session_id"`
	ExternalMessageID pgtype.Text `json:"external_message_id"`
}

type GetVisibleMessageCursorByExternalIDBySessionRow

type GetVisibleMessageCursorByExternalIDBySessionRow struct {
	ID             pgtype.UUID        `json:"id"`
	TurnPosition   pgtype.Int8        `json:"turn_position"`
	TurnMessageSeq pgtype.Int8        `json:"turn_message_seq"`
	CreatedAt      pgtype.Timestamptz `json:"created_at"`
}

type GetVisibleMessageCursorByIDBySessionParams

type GetVisibleMessageCursorByIDBySessionParams struct {
	SessionID pgtype.UUID `json:"session_id"`
	MessageID pgtype.UUID `json:"message_id"`
}

type GetVisibleMessageCursorByIDBySessionRow

type GetVisibleMessageCursorByIDBySessionRow struct {
	ID             pgtype.UUID        `json:"id"`
	TurnPosition   pgtype.Int8        `json:"turn_position"`
	TurnMessageSeq pgtype.Int8        `json:"turn_message_seq"`
	CreatedAt      pgtype.Timestamptz `json:"created_at"`
}

type GetWorkspaceDependencyDefinitionParams added in v0.20.0

type GetWorkspaceDependencyDefinitionParams struct {
	SourceUrl    string `json:"source_url"`
	RegistryID   string `json:"registry_id"`
	DependencyID string `json:"dependency_id"`
	Revision     string `json:"revision"`
}

type GetWorkspaceDependencyDefinitionRow added in v0.20.0

type GetWorkspaceDependencyDefinitionRow struct {
	SourceUrl     string `json:"source_url"`
	RegistryID    string `json:"registry_id"`
	DependencyID  string `json:"dependency_id"`
	Revision      string `json:"revision"`
	ReleaseBytes  []byte `json:"release_bytes"`
	ArtifactBytes []byte `json:"artifact_bytes"`
}

type InsertLifecycleEventParams

type InsertLifecycleEventParams struct {
	ID          string `json:"id"`
	ContainerID string `json:"container_id"`
	EventType   string `json:"event_type"`
	Payload     []byte `json:"payload"`
}

type InsertMemoryEdgeParams

type InsertMemoryEdgeParams struct {
	BotID    pgtype.UUID `json:"bot_id"`
	SrcNode  string      `json:"src_node"`
	DstNode  string      `json:"dst_node"`
	Rel      string      `json:"rel"`
	Weight   float32     `json:"weight"`
	Metadata []byte      `json:"metadata"`
}

type InsertVersionParams

type InsertVersionParams struct {
	ContainerID string      `json:"container_id"`
	SnapshotID  pgtype.UUID `json:"snapshot_id"`
	Version     int32       `json:"version"`
}

type LifecycleEvent

type LifecycleEvent struct {
	ID          string             `json:"id"`
	ContainerID string             `json:"container_id"`
	EventType   string             `json:"event_type"`
	Payload     []byte             `json:"payload"`
	CreatedAt   pgtype.Timestamptz `json:"created_at"`
	TeamID      pgtype.UUID        `json:"team_id"`
}

type LinkMessageToHistoryTurnParams

type LinkMessageToHistoryTurnParams struct {
	TurnMessageSeq pgtype.Int8 `json:"turn_message_seq"`
	MessageID      pgtype.UUID `json:"message_id"`
	TurnID         pgtype.UUID `json:"turn_id"`
}

type ListAccessibleBotsRow

type ListAccessibleBotsRow struct {
	ID               pgtype.UUID        `json:"id"`
	OwnerUserID      pgtype.UUID        `json:"owner_user_id"`
	Name             string             `json:"name"`
	DisplayName      pgtype.Text        `json:"display_name"`
	AvatarUrl        pgtype.Text        `json:"avatar_url"`
	Timezone         pgtype.Text        `json:"timezone"`
	IsActive         bool               `json:"is_active"`
	Status           string             `json:"status"`
	ReasoningEffort  string             `json:"reasoning_effort"`
	ChatModelID      pgtype.UUID        `json:"chat_model_id"`
	SearchProviderID pgtype.UUID        `json:"search_provider_id"`
	MemoryProviderID pgtype.UUID        `json:"memory_provider_id"`
	Metadata         []byte             `json:"metadata"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
}

type ListActiveMessagesSinceBySessionParams

type ListActiveMessagesSinceBySessionParams struct {
	SessionID pgtype.UUID        `json:"session_id"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type ListActiveMessagesSinceBySessionRow

type ListActiveMessagesSinceBySessionRow struct {
	ID                      pgtype.UUID        `json:"id"`
	BotID                   pgtype.UUID        `json:"bot_id"`
	SessionID               pgtype.UUID        `json:"session_id"`
	SenderChannelIdentityID pgtype.UUID        `json:"sender_channel_identity_id"`
	SenderUserID            pgtype.UUID        `json:"sender_user_id"`
	ExternalMessageID       pgtype.Text        `json:"external_message_id"`
	SourceReplyToMessageID  pgtype.Text        `json:"source_reply_to_message_id"`
	Role                    string             `json:"role"`
	Content                 []byte             `json:"content"`
	Metadata                []byte             `json:"metadata"`
	Usage                   []byte             `json:"usage"`
	SessionMode             string             `json:"session_mode"`
	RuntimeType             string             `json:"runtime_type"`
	EventID                 pgtype.UUID        `json:"event_id"`
	DisplayText             pgtype.Text        `json:"display_text"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	SenderDisplayName       pgtype.Text        `json:"sender_display_name"`
	SenderAvatarUrl         pgtype.Text        `json:"sender_avatar_url"`
	Platform                pgtype.Text        `json:"platform"`
}

type ListAllMessagesForBackupRow

type ListAllMessagesForBackupRow struct {
	ID                      pgtype.UUID        `json:"id"`
	BotID                   pgtype.UUID        `json:"bot_id"`
	SessionID               pgtype.UUID        `json:"session_id"`
	SenderChannelIdentityID pgtype.UUID        `json:"sender_channel_identity_id"`
	SenderUserID            pgtype.UUID        `json:"sender_user_id"`
	ExternalMessageID       pgtype.Text        `json:"external_message_id"`
	SourceReplyToMessageID  pgtype.Text        `json:"source_reply_to_message_id"`
	Role                    string             `json:"role"`
	Content                 []byte             `json:"content"`
	Metadata                []byte             `json:"metadata"`
	Usage                   []byte             `json:"usage"`
	SessionMode             string             `json:"session_mode"`
	RuntimeType             string             `json:"runtime_type"`
	EventID                 pgtype.UUID        `json:"event_id"`
	DisplayText             pgtype.Text        `json:"display_text"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	TurnID                  pgtype.UUID        `json:"turn_id"`
	TurnPosition            pgtype.Int8        `json:"turn_position"`
	TurnMessageSeq          pgtype.Int8        `json:"turn_message_seq"`
	TurnVisible             bool               `json:"turn_visible"`
	TurnSupersededByTurnID  pgtype.UUID        `json:"turn_superseded_by_turn_id"`
	TurnSupersededAt        pgtype.Timestamptz `json:"turn_superseded_at"`
	TurnSupersededReason    pgtype.Text        `json:"turn_superseded_reason"`
	SenderDisplayName       pgtype.Text        `json:"sender_display_name"`
	SenderAvatarUrl         pgtype.Text        `json:"sender_avatar_url"`
	Platform                pgtype.Text        `json:"platform"`
}

type ListAppConnectorRefsForBotRow added in v0.20.0

type ListAppConnectorRefsForBotRow struct {
	ID             pgtype.UUID        `json:"id"`
	TeamID         pgtype.UUID        `json:"team_id"`
	InstallationID pgtype.UUID        `json:"installation_id"`
	ConnectorType  string             `json:"connector_type"`
	ConnectionID   string             `json:"connection_id"`
	Required       bool               `json:"required"`
	CreatedAt      pgtype.Timestamptz `json:"created_at"`
	UpdatedAt      pgtype.Timestamptz `json:"updated_at"`
	RegistryID     string             `json:"registry_id"`
	AppID          string             `json:"app_id"`
}

type ListAppDependencyRefsForBotRow added in v0.20.0

type ListAppDependencyRefsForBotRow struct {
	ID             pgtype.UUID        `json:"id"`
	TeamID         pgtype.UUID        `json:"team_id"`
	InstallationID pgtype.UUID        `json:"installation_id"`
	DependencyID   string             `json:"dependency_id"`
	CreatedAt      pgtype.Timestamptz `json:"created_at"`
	RegistryID     string             `json:"registry_id"`
	AppID          string             `json:"app_id"`
}

type ListBotACLRulesRow

type ListBotACLRulesRow struct {
	ID                          pgtype.UUID        `json:"id"`
	BotID                       pgtype.UUID        `json:"bot_id"`
	Enabled                     bool               `json:"enabled"`
	Description                 pgtype.Text        `json:"description"`
	Action                      string             `json:"action"`
	Effect                      string             `json:"effect"`
	ChannelIdentityID           pgtype.UUID        `json:"channel_identity_id"`
	SubjectChannelType          pgtype.Text        `json:"subject_channel_type"`
	SourceConversationType      pgtype.Text        `json:"source_conversation_type"`
	SourceConversationID        pgtype.Text        `json:"source_conversation_id"`
	SourceThreadID              pgtype.Text        `json:"source_thread_id"`
	CreatedByUserID             pgtype.UUID        `json:"created_by_user_id"`
	CreatedAt                   pgtype.Timestamptz `json:"created_at"`
	UpdatedAt                   pgtype.Timestamptz `json:"updated_at"`
	ChannelType                 pgtype.Text        `json:"channel_type"`
	ChannelSubjectID            pgtype.Text        `json:"channel_subject_id"`
	ChannelIdentityDisplayName  pgtype.Text        `json:"channel_identity_display_name"`
	ChannelIdentityAvatarUrl    pgtype.Text        `json:"channel_identity_avatar_url"`
	SourceConversationName      string             `json:"source_conversation_name"`
	SourceConversationAvatarUrl string             `json:"source_conversation_avatar_url"`
}

type ListBotChannelAdminsRow

type ListBotChannelAdminsRow struct {
	ID                         pgtype.UUID        `json:"id"`
	BotID                      pgtype.UUID        `json:"bot_id"`
	ChannelIdentityID          pgtype.UUID        `json:"channel_identity_id"`
	Granted                    bool               `json:"granted"`
	CreatedByUserID            pgtype.UUID        `json:"created_by_user_id"`
	CreatedAt                  pgtype.Timestamptz `json:"created_at"`
	UpdatedAt                  pgtype.Timestamptz `json:"updated_at"`
	ChannelType                pgtype.Text        `json:"channel_type"`
	ChannelSubjectID           pgtype.Text        `json:"channel_subject_id"`
	ChannelIdentityDisplayName pgtype.Text        `json:"channel_identity_display_name"`
	ChannelIdentityAvatarUrl   pgtype.Text        `json:"channel_identity_avatar_url"`
}

type ListBotRemoteRuntimeGrantsByRuntimeOwnerRow

type ListBotRemoteRuntimeGrantsByRuntimeOwnerRow struct {
	ID        pgtype.UUID `json:"id"`
	BotID     pgtype.UUID `json:"bot_id"`
	RuntimeID pgtype.UUID `json:"runtime_id"`
	IsPrimary bool        `json:"is_primary"`
}

type ListBotRemoteRuntimeMountsRow

type ListBotRemoteRuntimeMountsRow struct {
	ID                 pgtype.UUID        `json:"id"`
	BotID              pgtype.UUID        `json:"bot_id"`
	RuntimeID          pgtype.UUID        `json:"runtime_id"`
	IsPrimary          bool               `json:"is_primary"`
	ToolApprovalConfig []byte             `json:"tool_approval_config"`
	CreatedAt          pgtype.Timestamptz `json:"created_at"`
	UpdatedAt          pgtype.Timestamptz `json:"updated_at"`
	RuntimeName        string             `json:"runtime_name"`
	RuntimeUserID      pgtype.UUID        `json:"runtime_user_id"`
	RuntimeUnavailable pgtype.Bool        `json:"runtime_unavailable"`
	BotOwnerUserID     pgtype.UUID        `json:"bot_owner_user_id"`
}

type ListBotUserGrantsForUserParams

type ListBotUserGrantsForUserParams struct {
	BotID  pgtype.UUID `json:"bot_id"`
	UserID pgtype.UUID `json:"user_id"`
}

type ListBotUserGrantsForUserRow

type ListBotUserGrantsForUserRow struct {
	ID          pgtype.UUID `json:"id"`
	BotID       pgtype.UUID `json:"bot_id"`
	SubjectType string      `json:"subject_type"`
	UserID      pgtype.UUID `json:"user_id"`
	Permissions []byte      `json:"permissions"`
}

type ListBotUserGrantsRow

type ListBotUserGrantsRow struct {
	ID              pgtype.UUID        `json:"id"`
	BotID           pgtype.UUID        `json:"bot_id"`
	SubjectType     string             `json:"subject_type"`
	UserID          pgtype.UUID        `json:"user_id"`
	Permissions     []byte             `json:"permissions"`
	CreatedByUserID pgtype.UUID        `json:"created_by_user_id"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
	UpdatedAt       pgtype.Timestamptz `json:"updated_at"`
	UserUsername    pgtype.Text        `json:"user_username"`
	UserDisplayName pgtype.Text        `json:"user_display_name"`
	UserAvatarUrl   pgtype.Text        `json:"user_avatar_url"`
}

type ListBotWorkdirsParams

type ListBotWorkdirsParams struct {
	BotID           pgtype.UUID `json:"bot_id"`
	IncludeArchived bool        `json:"include_archived"`
}

type ListBotWorkspacesByObservedStateParams added in v0.21.0

type ListBotWorkspacesByObservedStateParams struct {
	ObservedState string `json:"observed_state"`
	Lim           int32  `json:"lim"`
}

type ListBotsByOwnerRow

type ListBotsByOwnerRow struct {
	ID               pgtype.UUID        `json:"id"`
	OwnerUserID      pgtype.UUID        `json:"owner_user_id"`
	Name             string             `json:"name"`
	DisplayName      pgtype.Text        `json:"display_name"`
	AvatarUrl        pgtype.Text        `json:"avatar_url"`
	Timezone         pgtype.Text        `json:"timezone"`
	IsActive         bool               `json:"is_active"`
	Status           string             `json:"status"`
	ReasoningEffort  string             `json:"reasoning_effort"`
	ChatModelID      pgtype.UUID        `json:"chat_model_id"`
	SearchProviderID pgtype.UUID        `json:"search_provider_id"`
	MemoryProviderID pgtype.UUID        `json:"memory_provider_id"`
	Metadata         []byte             `json:"metadata"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
}

type ListChannelIdentityBindingsForBotRow

type ListChannelIdentityBindingsForBotRow struct {
	ID                         pgtype.UUID        `json:"id"`
	UserID                     pgtype.UUID        `json:"user_id"`
	ChannelIdentityID          pgtype.UUID        `json:"channel_identity_id"`
	CreatedAt                  pgtype.Timestamptz `json:"created_at"`
	UpdatedAt                  pgtype.Timestamptz `json:"updated_at"`
	ChannelType                pgtype.Text        `json:"channel_type"`
	ChannelSubjectID           pgtype.Text        `json:"channel_subject_id"`
	ChannelIdentityDisplayName pgtype.Text        `json:"channel_identity_display_name"`
	ChannelIdentityAvatarUrl   pgtype.Text        `json:"channel_identity_avatar_url"`
}

type ListChannelIdentityBindingsForUserRow

type ListChannelIdentityBindingsForUserRow struct {
	ID                         pgtype.UUID        `json:"id"`
	UserID                     pgtype.UUID        `json:"user_id"`
	ChannelIdentityID          pgtype.UUID        `json:"channel_identity_id"`
	CreatedAt                  pgtype.Timestamptz `json:"created_at"`
	UpdatedAt                  pgtype.Timestamptz `json:"updated_at"`
	ChannelType                pgtype.Text        `json:"channel_type"`
	ChannelSubjectID           pgtype.Text        `json:"channel_subject_id"`
	ChannelIdentityDisplayName pgtype.Text        `json:"channel_identity_display_name"`
	ChannelIdentityAvatarUrl   pgtype.Text        `json:"channel_identity_avatar_url"`
}

type ListChannelIdentityBindingsRow

type ListChannelIdentityBindingsRow struct {
	ID                         pgtype.UUID        `json:"id"`
	UserID                     pgtype.UUID        `json:"user_id"`
	ChannelIdentityID          pgtype.UUID        `json:"channel_identity_id"`
	CreatedAt                  pgtype.Timestamptz `json:"created_at"`
	UpdatedAt                  pgtype.Timestamptz `json:"updated_at"`
	ChannelType                pgtype.Text        `json:"channel_type"`
	ChannelSubjectID           pgtype.Text        `json:"channel_subject_id"`
	ChannelIdentityDisplayName pgtype.Text        `json:"channel_identity_display_name"`
	ChannelIdentityAvatarUrl   pgtype.Text        `json:"channel_identity_avatar_url"`
}

type ListChatRouteThreadProjectionsByIDsParams

type ListChatRouteThreadProjectionsByIDsParams struct {
	BotID    pgtype.UUID   `json:"bot_id"`
	RouteIds []pgtype.UUID `json:"route_ids"`
}

type ListChatRouteThreadProjectionsByIDsRow

type ListChatRouteThreadProjectionsByIDsRow struct {
	ID               pgtype.UUID `json:"id"`
	ConversationType pgtype.Text `json:"conversation_type"`
	Metadata         []byte      `json:"metadata"`
}

type ListChatRoutesRow

type ListChatRoutesRow struct {
	ID               pgtype.UUID        `json:"id"`
	BotID            pgtype.UUID        `json:"bot_id"`
	Platform         string             `json:"platform"`
	ChannelConfigID  pgtype.UUID        `json:"channel_config_id"`
	ConversationID   string             `json:"conversation_id"`
	ThreadID         pgtype.Text        `json:"thread_id"`
	ConversationType pgtype.Text        `json:"conversation_type"`
	ReplyTarget      pgtype.Text        `json:"reply_target"`
	ActiveSessionID  pgtype.UUID        `json:"active_session_id"`
	Metadata         []byte             `json:"metadata"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
}

type ListCompactionLogsByBotParams

type ListCompactionLogsByBotParams struct {
	BotID  pgtype.UUID `json:"bot_id"`
	Limit  int32       `json:"limit"`
	Offset int32       `json:"offset"`
}

type ListHistoryCheckpointCandidatesWithinBytesParams added in v1.0.0

type ListHistoryCheckpointCandidatesWithinBytesParams struct {
	SessionID            pgtype.UUID   `json:"session_id"`
	AfterTurnPosition    int64         `json:"after_turn_position"`
	AfterTurnMessageSeq  int64         `json:"after_turn_message_seq"`
	KeptIds              []pgtype.UUID `json:"kept_ids"`
	BeforeTurnPosition   pgtype.Int8   `json:"before_turn_position"`
	BeforeTurnMessageSeq pgtype.Int8   `json:"before_turn_message_seq"`
	MaxBytes             int64         `json:"max_bytes"`
	MaxRowBytes          int64         `json:"max_row_bytes"`
}

type ListHistoryCheckpointCandidatesWithinBytesRow added in v1.0.0

type ListHistoryCheckpointCandidatesWithinBytesRow struct {
	ID                pgtype.UUID `json:"id"`
	ExternalMessageID pgtype.Text `json:"external_message_id"`
	Role              string      `json:"role"`
	Content           []byte      `json:"content"`
	TurnPosition      pgtype.Int8 `json:"turn_position"`
	TurnMessageSeq    pgtype.Int8 `json:"turn_message_seq"`
	CandidateCount    int64       `json:"candidate_count"`
}

type ListHistoryCheckpointSpanRowsParams added in v1.0.0

type ListHistoryCheckpointSpanRowsParams struct {
	SessionID             pgtype.UUID   `json:"session_id"`
	AfterTurnPosition     int64         `json:"after_turn_position"`
	AfterTurnMessageSeq   int64         `json:"after_turn_message_seq"`
	ThroughTurnPosition   int64         `json:"through_turn_position"`
	ThroughTurnMessageSeq int64         `json:"through_turn_message_seq"`
	Ids                   []pgtype.UUID `json:"ids"`
}

type ListHistoryCheckpointSpanRowsRow added in v1.0.0

type ListHistoryCheckpointSpanRowsRow struct {
	ID             pgtype.UUID `json:"id"`
	TurnPosition   pgtype.Int8 `json:"turn_position"`
	TurnMessageSeq pgtype.Int8 `json:"turn_message_seq"`
}

type ListHistoryCheckpointSummariesParams added in v1.0.0

type ListHistoryCheckpointSummariesParams struct {
	SessionID pgtype.UUID   `json:"session_id"`
	Ids       []pgtype.UUID `json:"ids"`
}

type ListHistoryCheckpointSummariesRow added in v1.0.0

type ListHistoryCheckpointSummariesRow struct {
	ID      pgtype.UUID `json:"id"`
	Summary string      `json:"summary"`
}

type ListHistoryMessagesAfterWithinBytesParams added in v1.0.0

type ListHistoryMessagesAfterWithinBytesParams struct {
	SessionID            pgtype.UUID `json:"session_id"`
	AfterTurnPosition    int64       `json:"after_turn_position"`
	AfterTurnMessageSeq  int64       `json:"after_turn_message_seq"`
	BeforeTurnPosition   pgtype.Int8 `json:"before_turn_position"`
	BeforeTurnMessageSeq pgtype.Int8 `json:"before_turn_message_seq"`
	MaxBytes             int64       `json:"max_bytes"`
}

type ListHistoryMessagesAfterWithinBytesRow added in v1.0.0

type ListHistoryMessagesAfterWithinBytesRow struct {
	ID                      pgtype.UUID        `json:"id"`
	BotID                   pgtype.UUID        `json:"bot_id"`
	SessionID               pgtype.UUID        `json:"session_id"`
	SenderChannelIdentityID pgtype.UUID        `json:"sender_channel_identity_id"`
	SenderUserID            pgtype.UUID        `json:"sender_user_id"`
	ExternalMessageID       pgtype.Text        `json:"external_message_id"`
	SourceReplyToMessageID  pgtype.Text        `json:"source_reply_to_message_id"`
	Role                    string             `json:"role"`
	Content                 []byte             `json:"content"`
	Metadata                []byte             `json:"metadata"`
	Usage                   []byte             `json:"usage"`
	SessionMode             string             `json:"session_mode"`
	RuntimeType             string             `json:"runtime_type"`
	EventID                 pgtype.UUID        `json:"event_id"`
	DisplayText             pgtype.Text        `json:"display_text"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	SenderDisplayName       pgtype.Text        `json:"sender_display_name"`
	SenderAvatarUrl         pgtype.Text        `json:"sender_avatar_url"`
	Platform                pgtype.Text        `json:"platform"`
	Truncated               bool               `json:"truncated"`
}

type ListHistoryMessagesByIDsParams added in v1.0.0

type ListHistoryMessagesByIDsParams struct {
	SessionID pgtype.UUID   `json:"session_id"`
	Ids       []pgtype.UUID `json:"ids"`
}

type ListHistoryMessagesByIDsRow added in v1.0.0

type ListHistoryMessagesByIDsRow struct {
	ID                      pgtype.UUID        `json:"id"`
	BotID                   pgtype.UUID        `json:"bot_id"`
	SessionID               pgtype.UUID        `json:"session_id"`
	SenderChannelIdentityID pgtype.UUID        `json:"sender_channel_identity_id"`
	SenderUserID            pgtype.UUID        `json:"sender_user_id"`
	ExternalMessageID       pgtype.Text        `json:"external_message_id"`
	SourceReplyToMessageID  pgtype.Text        `json:"source_reply_to_message_id"`
	Role                    string             `json:"role"`
	Content                 []byte             `json:"content"`
	Metadata                []byte             `json:"metadata"`
	Usage                   []byte             `json:"usage"`
	SessionMode             string             `json:"session_mode"`
	RuntimeType             string             `json:"runtime_type"`
	EventID                 pgtype.UUID        `json:"event_id"`
	DisplayText             pgtype.Text        `json:"display_text"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	SenderDisplayName       pgtype.Text        `json:"sender_display_name"`
	SenderAvatarUrl         pgtype.Text        `json:"sender_avatar_url"`
	Platform                pgtype.Text        `json:"platform"`
}

type ListHistoryRowsBySourcesParams added in v1.0.0

type ListHistoryRowsBySourcesParams struct {
	SessionID          pgtype.UUID   `json:"session_id"`
	Ids                []pgtype.UUID `json:"ids"`
	ExternalMessageIds []string      `json:"external_message_ids"`
}

type ListHistoryRowsBySourcesRow added in v1.0.0

type ListHistoryRowsBySourcesRow struct {
	ID              pgtype.UUID `json:"id"`
	SourceMessageID pgtype.Text `json:"source_message_id"`
	TurnPosition    pgtype.Int8 `json:"turn_position"`
	TurnMessageSeq  pgtype.Int8 `json:"turn_message_seq"`
}

type ListHistoryTurnsByBotRow

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

type ListMemoryEdgesByRelParams

type ListMemoryEdgesByRelParams struct {
	BotID pgtype.UUID `json:"bot_id"`
	Rel   string      `json:"rel"`
}

type ListMemoryEdgesFromNodeParams

type ListMemoryEdgesFromNodeParams struct {
	BotID   pgtype.UUID `json:"bot_id"`
	SrcNode string      `json:"src_node"`
}

type ListMemoryNodesByBotLayerParams

type ListMemoryNodesByBotLayerParams struct {
	BotID pgtype.UUID `json:"bot_id"`
	Layer string      `json:"layer"`
}

type ListMemoryNodesByBotProfileParams

type ListMemoryNodesByBotProfileParams struct {
	BotID      pgtype.UUID `json:"bot_id"`
	ProfileRef string      `json:"profile_ref"`
}

type ListMessageAssetsBatchRow

type ListMessageAssetsBatchRow struct {
	RelID       pgtype.UUID `json:"rel_id"`
	MessageID   pgtype.UUID `json:"message_id"`
	Role        string      `json:"role"`
	Ordinal     int32       `json:"ordinal"`
	ContentHash string      `json:"content_hash"`
	Mime        string      `json:"mime"`
	SizeBytes   int64       `json:"size_bytes"`
	StorageKey  string      `json:"storage_key"`
	Name        string      `json:"name"`
	Metadata    []byte      `json:"metadata"`
}

type ListMessageAssetsRow

type ListMessageAssetsRow struct {
	RelID       pgtype.UUID `json:"rel_id"`
	MessageID   pgtype.UUID `json:"message_id"`
	Role        string      `json:"role"`
	Ordinal     int32       `json:"ordinal"`
	ContentHash string      `json:"content_hash"`
	Mime        string      `json:"mime"`
	SizeBytes   int64       `json:"size_bytes"`
	StorageKey  string      `json:"storage_key"`
	Name        string      `json:"name"`
	Metadata    []byte      `json:"metadata"`
}

type ListMessagesAfterBySessionParams

type ListMessagesAfterBySessionParams struct {
	SessionID pgtype.UUID        `json:"session_id"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	MaxCount  int32              `json:"max_count"`
}

type ListMessagesAfterBySessionRow

type ListMessagesAfterBySessionRow struct {
	ID                      pgtype.UUID        `json:"id"`
	BotID                   pgtype.UUID        `json:"bot_id"`
	SessionID               pgtype.UUID        `json:"session_id"`
	SenderChannelIdentityID pgtype.UUID        `json:"sender_channel_identity_id"`
	SenderUserID            pgtype.UUID        `json:"sender_user_id"`
	ExternalMessageID       pgtype.Text        `json:"external_message_id"`
	SourceReplyToMessageID  pgtype.Text        `json:"source_reply_to_message_id"`
	Role                    string             `json:"role"`
	Content                 []byte             `json:"content"`
	Metadata                []byte             `json:"metadata"`
	Usage                   []byte             `json:"usage"`
	SessionMode             string             `json:"session_mode"`
	RuntimeType             string             `json:"runtime_type"`
	EventID                 pgtype.UUID        `json:"event_id"`
	DisplayText             pgtype.Text        `json:"display_text"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	SenderDisplayName       pgtype.Text        `json:"sender_display_name"`
	SenderAvatarUrl         pgtype.Text        `json:"sender_avatar_url"`
	Platform                pgtype.Text        `json:"platform"`
}

type ListMessagesAfterCursorBySessionParams

type ListMessagesAfterCursorBySessionParams struct {
	SessionID            pgtype.UUID        `json:"session_id"`
	CursorTurnPosition   int64              `json:"cursor_turn_position"`
	CursorTurnMessageSeq int64              `json:"cursor_turn_message_seq"`
	CursorCreatedAt      pgtype.Timestamptz `json:"cursor_created_at"`
	CursorMessageID      pgtype.UUID        `json:"cursor_message_id"`
	MaxCount             int32              `json:"max_count"`
}

type ListMessagesAfterCursorBySessionRow

type ListMessagesAfterCursorBySessionRow struct {
	ID                      pgtype.UUID        `json:"id"`
	BotID                   pgtype.UUID        `json:"bot_id"`
	SessionID               pgtype.UUID        `json:"session_id"`
	SenderChannelIdentityID pgtype.UUID        `json:"sender_channel_identity_id"`
	SenderUserID            pgtype.UUID        `json:"sender_user_id"`
	ExternalMessageID       pgtype.Text        `json:"external_message_id"`
	SourceReplyToMessageID  pgtype.Text        `json:"source_reply_to_message_id"`
	Role                    string             `json:"role"`
	Content                 []byte             `json:"content"`
	Metadata                []byte             `json:"metadata"`
	Usage                   []byte             `json:"usage"`
	SessionMode             string             `json:"session_mode"`
	RuntimeType             string             `json:"runtime_type"`
	EventID                 pgtype.UUID        `json:"event_id"`
	DisplayText             pgtype.Text        `json:"display_text"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	SenderDisplayName       pgtype.Text        `json:"sender_display_name"`
	SenderAvatarUrl         pgtype.Text        `json:"sender_avatar_url"`
	Platform                pgtype.Text        `json:"platform"`
}

type ListMessagesAfterMessageBySessionParams

type ListMessagesAfterMessageBySessionParams struct {
	SessionID      pgtype.UUID `json:"session_id"`
	AfterMessageID pgtype.UUID `json:"after_message_id"`
	MaxCount       int32       `json:"max_count"`
}

type ListMessagesAfterMessageBySessionRow

type ListMessagesAfterMessageBySessionRow struct {
	ID                      pgtype.UUID        `json:"id"`
	BotID                   pgtype.UUID        `json:"bot_id"`
	SessionID               pgtype.UUID        `json:"session_id"`
	SenderChannelIdentityID pgtype.UUID        `json:"sender_channel_identity_id"`
	SenderUserID            pgtype.UUID        `json:"sender_user_id"`
	ExternalMessageID       pgtype.Text        `json:"external_message_id"`
	SourceReplyToMessageID  pgtype.Text        `json:"source_reply_to_message_id"`
	Role                    string             `json:"role"`
	Content                 []byte             `json:"content"`
	Metadata                []byte             `json:"metadata"`
	Usage                   []byte             `json:"usage"`
	SessionMode             string             `json:"session_mode"`
	RuntimeType             string             `json:"runtime_type"`
	EventID                 pgtype.UUID        `json:"event_id"`
	DisplayText             pgtype.Text        `json:"display_text"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	SenderDisplayName       pgtype.Text        `json:"sender_display_name"`
	SenderAvatarUrl         pgtype.Text        `json:"sender_avatar_url"`
	Platform                pgtype.Text        `json:"platform"`
}

type ListMessagesBeforeBySessionParams

type ListMessagesBeforeBySessionParams struct {
	SessionID pgtype.UUID        `json:"session_id"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	MaxCount  int32              `json:"max_count"`
}

type ListMessagesBeforeBySessionRow

type ListMessagesBeforeBySessionRow struct {
	ID                      pgtype.UUID        `json:"id"`
	BotID                   pgtype.UUID        `json:"bot_id"`
	SessionID               pgtype.UUID        `json:"session_id"`
	SenderChannelIdentityID pgtype.UUID        `json:"sender_channel_identity_id"`
	SenderUserID            pgtype.UUID        `json:"sender_user_id"`
	ExternalMessageID       pgtype.Text        `json:"external_message_id"`
	SourceReplyToMessageID  pgtype.Text        `json:"source_reply_to_message_id"`
	Role                    string             `json:"role"`
	Content                 []byte             `json:"content"`
	Metadata                []byte             `json:"metadata"`
	TurnID                  pgtype.UUID        `json:"turn_id"`
	TurnPosition            pgtype.Int8        `json:"turn_position"`
	Usage                   []byte             `json:"usage"`
	SessionMode             string             `json:"session_mode"`
	RuntimeType             string             `json:"runtime_type"`
	EventID                 pgtype.UUID        `json:"event_id"`
	DisplayText             pgtype.Text        `json:"display_text"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	SenderDisplayName       pgtype.Text        `json:"sender_display_name"`
	SenderAvatarUrl         pgtype.Text        `json:"sender_avatar_url"`
	Platform                pgtype.Text        `json:"platform"`
}

type ListMessagesBeforeCursorBySessionParams

type ListMessagesBeforeCursorBySessionParams struct {
	SessionID            pgtype.UUID        `json:"session_id"`
	CursorTurnPosition   int64              `json:"cursor_turn_position"`
	CursorTurnMessageSeq int64              `json:"cursor_turn_message_seq"`
	CursorCreatedAt      pgtype.Timestamptz `json:"cursor_created_at"`
	CursorMessageID      pgtype.UUID        `json:"cursor_message_id"`
	MaxCount             int32              `json:"max_count"`
}

type ListMessagesBeforeCursorBySessionRow

type ListMessagesBeforeCursorBySessionRow struct {
	ID                      pgtype.UUID        `json:"id"`
	BotID                   pgtype.UUID        `json:"bot_id"`
	SessionID               pgtype.UUID        `json:"session_id"`
	SenderChannelIdentityID pgtype.UUID        `json:"sender_channel_identity_id"`
	SenderUserID            pgtype.UUID        `json:"sender_user_id"`
	ExternalMessageID       pgtype.Text        `json:"external_message_id"`
	SourceReplyToMessageID  pgtype.Text        `json:"source_reply_to_message_id"`
	Role                    string             `json:"role"`
	Content                 []byte             `json:"content"`
	Metadata                []byte             `json:"metadata"`
	TurnID                  pgtype.UUID        `json:"turn_id"`
	TurnPosition            pgtype.Int8        `json:"turn_position"`
	Usage                   []byte             `json:"usage"`
	SessionMode             string             `json:"session_mode"`
	RuntimeType             string             `json:"runtime_type"`
	EventID                 pgtype.UUID        `json:"event_id"`
	DisplayText             pgtype.Text        `json:"display_text"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	SenderDisplayName       pgtype.Text        `json:"sender_display_name"`
	SenderAvatarUrl         pgtype.Text        `json:"sender_avatar_url"`
	Platform                pgtype.Text        `json:"platform"`
}

type ListMessagesBeforeMessageBySessionParams

type ListMessagesBeforeMessageBySessionParams struct {
	SessionID       pgtype.UUID `json:"session_id"`
	BeforeMessageID pgtype.UUID `json:"before_message_id"`
	MaxCount        int32       `json:"max_count"`
}

type ListMessagesBeforeMessageBySessionRow

type ListMessagesBeforeMessageBySessionRow struct {
	ID                      pgtype.UUID        `json:"id"`
	BotID                   pgtype.UUID        `json:"bot_id"`
	SessionID               pgtype.UUID        `json:"session_id"`
	SenderChannelIdentityID pgtype.UUID        `json:"sender_channel_identity_id"`
	SenderUserID            pgtype.UUID        `json:"sender_user_id"`
	ExternalMessageID       pgtype.Text        `json:"external_message_id"`
	SourceReplyToMessageID  pgtype.Text        `json:"source_reply_to_message_id"`
	Role                    string             `json:"role"`
	Content                 []byte             `json:"content"`
	Metadata                []byte             `json:"metadata"`
	Usage                   []byte             `json:"usage"`
	SessionMode             string             `json:"session_mode"`
	RuntimeType             string             `json:"runtime_type"`
	EventID                 pgtype.UUID        `json:"event_id"`
	DisplayText             pgtype.Text        `json:"display_text"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	SenderDisplayName       pgtype.Text        `json:"sender_display_name"`
	SenderAvatarUrl         pgtype.Text        `json:"sender_avatar_url"`
	Platform                pgtype.Text        `json:"platform"`
}

type ListMessagesBeforeParams

type ListMessagesBeforeParams struct {
	BotID     pgtype.UUID        `json:"bot_id"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	MaxCount  int32              `json:"max_count"`
}

type ListMessagesBeforeRow

type ListMessagesBeforeRow struct {
	ID                      pgtype.UUID        `json:"id"`
	BotID                   pgtype.UUID        `json:"bot_id"`
	SessionID               pgtype.UUID        `json:"session_id"`
	SenderChannelIdentityID pgtype.UUID        `json:"sender_channel_identity_id"`
	SenderUserID            pgtype.UUID        `json:"sender_user_id"`
	ExternalMessageID       pgtype.Text        `json:"external_message_id"`
	SourceReplyToMessageID  pgtype.Text        `json:"source_reply_to_message_id"`
	Role                    string             `json:"role"`
	Content                 []byte             `json:"content"`
	Metadata                []byte             `json:"metadata"`
	Usage                   []byte             `json:"usage"`
	SessionMode             string             `json:"session_mode"`
	RuntimeType             string             `json:"runtime_type"`
	EventID                 pgtype.UUID        `json:"event_id"`
	DisplayText             pgtype.Text        `json:"display_text"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	SenderDisplayName       pgtype.Text        `json:"sender_display_name"`
	SenderAvatarUrl         pgtype.Text        `json:"sender_avatar_url"`
	Platform                pgtype.Text        `json:"platform"`
}

type ListMessagesBySessionRow

type ListMessagesBySessionRow struct {
	ID                      pgtype.UUID        `json:"id"`
	BotID                   pgtype.UUID        `json:"bot_id"`
	SessionID               pgtype.UUID        `json:"session_id"`
	SenderChannelIdentityID pgtype.UUID        `json:"sender_channel_identity_id"`
	SenderUserID            pgtype.UUID        `json:"sender_user_id"`
	ExternalMessageID       pgtype.Text        `json:"external_message_id"`
	SourceReplyToMessageID  pgtype.Text        `json:"source_reply_to_message_id"`
	Role                    string             `json:"role"`
	Content                 []byte             `json:"content"`
	Metadata                []byte             `json:"metadata"`
	Usage                   []byte             `json:"usage"`
	SessionMode             string             `json:"session_mode"`
	RuntimeType             string             `json:"runtime_type"`
	EventID                 pgtype.UUID        `json:"event_id"`
	DisplayText             pgtype.Text        `json:"display_text"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	SenderDisplayName       pgtype.Text        `json:"sender_display_name"`
	SenderAvatarUrl         pgtype.Text        `json:"sender_avatar_url"`
	Platform                pgtype.Text        `json:"platform"`
}

type ListMessagesLatestBySessionParams

type ListMessagesLatestBySessionParams struct {
	SessionID pgtype.UUID `json:"session_id"`
	MaxCount  int32       `json:"max_count"`
}

type ListMessagesLatestBySessionRow

type ListMessagesLatestBySessionRow struct {
	ID                      pgtype.UUID        `json:"id"`
	BotID                   pgtype.UUID        `json:"bot_id"`
	SessionID               pgtype.UUID        `json:"session_id"`
	SenderChannelIdentityID pgtype.UUID        `json:"sender_channel_identity_id"`
	SenderUserID            pgtype.UUID        `json:"sender_user_id"`
	ExternalMessageID       pgtype.Text        `json:"external_message_id"`
	SourceReplyToMessageID  pgtype.Text        `json:"source_reply_to_message_id"`
	Role                    string             `json:"role"`
	Content                 []byte             `json:"content"`
	Metadata                []byte             `json:"metadata"`
	TurnID                  pgtype.UUID        `json:"turn_id"`
	Usage                   []byte             `json:"usage"`
	SessionMode             string             `json:"session_mode"`
	RuntimeType             string             `json:"runtime_type"`
	EventID                 pgtype.UUID        `json:"event_id"`
	DisplayText             pgtype.Text        `json:"display_text"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	SenderDisplayName       pgtype.Text        `json:"sender_display_name"`
	SenderAvatarUrl         pgtype.Text        `json:"sender_avatar_url"`
	Platform                pgtype.Text        `json:"platform"`
}

type ListMessagesLatestParams

type ListMessagesLatestParams struct {
	BotID    pgtype.UUID `json:"bot_id"`
	MaxCount int32       `json:"max_count"`
}

type ListMessagesLatestRow

type ListMessagesLatestRow struct {
	ID                      pgtype.UUID        `json:"id"`
	BotID                   pgtype.UUID        `json:"bot_id"`
	SessionID               pgtype.UUID        `json:"session_id"`
	SenderChannelIdentityID pgtype.UUID        `json:"sender_channel_identity_id"`
	SenderUserID            pgtype.UUID        `json:"sender_user_id"`
	ExternalMessageID       pgtype.Text        `json:"external_message_id"`
	SourceReplyToMessageID  pgtype.Text        `json:"source_reply_to_message_id"`
	Role                    string             `json:"role"`
	Content                 []byte             `json:"content"`
	Metadata                []byte             `json:"metadata"`
	Usage                   []byte             `json:"usage"`
	SessionMode             string             `json:"session_mode"`
	RuntimeType             string             `json:"runtime_type"`
	EventID                 pgtype.UUID        `json:"event_id"`
	DisplayText             pgtype.Text        `json:"display_text"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	SenderDisplayName       pgtype.Text        `json:"sender_display_name"`
	SenderAvatarUrl         pgtype.Text        `json:"sender_avatar_url"`
	Platform                pgtype.Text        `json:"platform"`
}

type ListMessagesLatestUIBySessionParams

type ListMessagesLatestUIBySessionParams struct {
	SessionID pgtype.UUID `json:"session_id"`
	MaxCount  int32       `json:"max_count"`
}

type ListMessagesLatestUIBySessionRow

type ListMessagesLatestUIBySessionRow struct {
	ID                      pgtype.UUID        `json:"id"`
	BotID                   pgtype.UUID        `json:"bot_id"`
	SessionID               pgtype.UUID        `json:"session_id"`
	SenderChannelIdentityID pgtype.UUID        `json:"sender_channel_identity_id"`
	SenderUserID            pgtype.UUID        `json:"sender_user_id"`
	ExternalMessageID       pgtype.Text        `json:"external_message_id"`
	SourceReplyToMessageID  pgtype.Text        `json:"source_reply_to_message_id"`
	Role                    string             `json:"role"`
	Content                 []byte             `json:"content"`
	Metadata                []byte             `json:"metadata"`
	TurnID                  pgtype.UUID        `json:"turn_id"`
	TurnPosition            pgtype.Int8        `json:"turn_position"`
	DisplayText             pgtype.Text        `json:"display_text"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	SenderDisplayName       pgtype.Text        `json:"sender_display_name"`
	SenderAvatarUrl         pgtype.Text        `json:"sender_avatar_url"`
	Platform                pgtype.Text        `json:"platform"`
}

type ListMessagesRow

type ListMessagesRow struct {
	ID                      pgtype.UUID        `json:"id"`
	BotID                   pgtype.UUID        `json:"bot_id"`
	SessionID               pgtype.UUID        `json:"session_id"`
	SenderChannelIdentityID pgtype.UUID        `json:"sender_channel_identity_id"`
	SenderUserID            pgtype.UUID        `json:"sender_user_id"`
	ExternalMessageID       pgtype.Text        `json:"external_message_id"`
	SourceReplyToMessageID  pgtype.Text        `json:"source_reply_to_message_id"`
	Role                    string             `json:"role"`
	Content                 []byte             `json:"content"`
	Metadata                []byte             `json:"metadata"`
	Usage                   []byte             `json:"usage"`
	SessionMode             string             `json:"session_mode"`
	RuntimeType             string             `json:"runtime_type"`
	EventID                 pgtype.UUID        `json:"event_id"`
	DisplayText             pgtype.Text        `json:"display_text"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	SenderDisplayName       pgtype.Text        `json:"sender_display_name"`
	SenderAvatarUrl         pgtype.Text        `json:"sender_avatar_url"`
	Platform                pgtype.Text        `json:"platform"`
}

type ListMessagesSinceBySessionParams

type ListMessagesSinceBySessionParams struct {
	SessionID pgtype.UUID        `json:"session_id"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type ListMessagesSinceBySessionRow

type ListMessagesSinceBySessionRow struct {
	ID                      pgtype.UUID        `json:"id"`
	BotID                   pgtype.UUID        `json:"bot_id"`
	SessionID               pgtype.UUID        `json:"session_id"`
	SenderChannelIdentityID pgtype.UUID        `json:"sender_channel_identity_id"`
	SenderUserID            pgtype.UUID        `json:"sender_user_id"`
	ExternalMessageID       pgtype.Text        `json:"external_message_id"`
	SourceReplyToMessageID  pgtype.Text        `json:"source_reply_to_message_id"`
	Role                    string             `json:"role"`
	Content                 []byte             `json:"content"`
	Metadata                []byte             `json:"metadata"`
	Usage                   []byte             `json:"usage"`
	SessionMode             string             `json:"session_mode"`
	RuntimeType             string             `json:"runtime_type"`
	EventID                 pgtype.UUID        `json:"event_id"`
	DisplayText             pgtype.Text        `json:"display_text"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	SenderDisplayName       pgtype.Text        `json:"sender_display_name"`
	SenderAvatarUrl         pgtype.Text        `json:"sender_avatar_url"`
	Platform                pgtype.Text        `json:"platform"`
}

type ListMessagesSinceParams

type ListMessagesSinceParams struct {
	BotID     pgtype.UUID        `json:"bot_id"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type ListMessagesSinceRow

type ListMessagesSinceRow struct {
	ID                      pgtype.UUID        `json:"id"`
	BotID                   pgtype.UUID        `json:"bot_id"`
	SessionID               pgtype.UUID        `json:"session_id"`
	SenderChannelIdentityID pgtype.UUID        `json:"sender_channel_identity_id"`
	SenderUserID            pgtype.UUID        `json:"sender_user_id"`
	ExternalMessageID       pgtype.Text        `json:"external_message_id"`
	SourceReplyToMessageID  pgtype.Text        `json:"source_reply_to_message_id"`
	Role                    string             `json:"role"`
	Content                 []byte             `json:"content"`
	Metadata                []byte             `json:"metadata"`
	Usage                   []byte             `json:"usage"`
	SessionMode             string             `json:"session_mode"`
	RuntimeType             string             `json:"runtime_type"`
	EventID                 pgtype.UUID        `json:"event_id"`
	DisplayText             pgtype.Text        `json:"display_text"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	SenderDisplayName       pgtype.Text        `json:"sender_display_name"`
	SenderAvatarUrl         pgtype.Text        `json:"sender_avatar_url"`
	Platform                pgtype.Text        `json:"platform"`
}

type ListModelsByProviderIDAndTypeParams

type ListModelsByProviderIDAndTypeParams struct {
	ProviderID pgtype.UUID `json:"provider_id"`
	Type       string      `json:"type"`
}

type ListObservedConversationsByChannelIdentityParams

type ListObservedConversationsByChannelIdentityParams struct {
	BotID             pgtype.UUID `json:"bot_id"`
	ChannelIdentityID pgtype.UUID `json:"channel_identity_id"`
}

type ListObservedConversationsByChannelIdentityRow

type ListObservedConversationsByChannelIdentityRow struct {
	RouteID               pgtype.UUID        `json:"route_id"`
	Channel               string             `json:"channel"`
	ConversationType      string             `json:"conversation_type"`
	ConversationID        string             `json:"conversation_id"`
	ThreadID              string             `json:"thread_id"`
	ConversationName      string             `json:"conversation_name"`
	ConversationAvatarUrl string             `json:"conversation_avatar_url"`
	LastObservedAt        pgtype.Timestamptz `json:"last_observed_at"`
}

type ListObservedConversationsByChannelTypeParams

type ListObservedConversationsByChannelTypeParams struct {
	BotID       pgtype.UUID `json:"bot_id"`
	ChannelType string      `json:"channel_type"`
}

type ListObservedConversationsByChannelTypeRow

type ListObservedConversationsByChannelTypeRow struct {
	RouteID               pgtype.UUID        `json:"route_id"`
	Channel               string             `json:"channel"`
	ConversationType      string             `json:"conversation_type"`
	ConversationID        string             `json:"conversation_id"`
	ThreadID              string             `json:"thread_id"`
	ConversationName      string             `json:"conversation_name"`
	ConversationAvatarUrl string             `json:"conversation_avatar_url"`
	LastObservedAt        pgtype.Timestamptz `json:"last_observed_at"`
}

type ListOrphanedSessionRunsParams

type ListOrphanedSessionRunsParams struct {
	GraceSeconds float64 `json:"grace_seconds"`
	BatchSize    int32   `json:"batch_size"`
}

type ListPendingToolApprovalsBySessionParams

type ListPendingToolApprovalsBySessionParams struct {
	BotID     pgtype.UUID `json:"bot_id"`
	SessionID pgtype.UUID `json:"session_id"`
}

type ListPendingUserInputsBySessionParams

type ListPendingUserInputsBySessionParams struct {
	BotID     pgtype.UUID `json:"bot_id"`
	SessionID pgtype.UUID `json:"session_id"`
}

type ListProviderTemplatesRow

type ListProviderTemplatesRow struct {
	ID            pgtype.UUID        `json:"id"`
	Key           string             `json:"key"`
	Domain        string             `json:"domain"`
	Name          string             `json:"name"`
	Description   string             `json:"description"`
	Icon          pgtype.Text        `json:"icon"`
	Driver        string             `json:"driver"`
	ConfigSchema  []byte             `json:"config_schema"`
	DefaultConfig []byte             `json:"default_config"`
	Metadata      []byte             `json:"metadata"`
	Source        string             `json:"source"`
	ContentHash   string             `json:"content_hash"`
	SortOrder     int32              `json:"sort_order"`
	Active        bool               `json:"active"`
	CreatedAt     pgtype.Timestamptz `json:"created_at"`
	UpdatedAt     pgtype.Timestamptz `json:"updated_at"`
	Configured    bool               `json:"configured"`
}

type ListRecentAssistantMessagesBySessionParams

type ListRecentAssistantMessagesBySessionParams struct {
	SessionID pgtype.UUID `json:"session_id"`
	MaxCount  int32       `json:"max_count"`
}

type ListRecentAssistantMessagesBySessionRow

type ListRecentAssistantMessagesBySessionRow struct {
	ID        pgtype.UUID        `json:"id"`
	RunID     pgtype.UUID        `json:"run_id"`
	Role      string             `json:"role"`
	Metadata  []byte             `json:"metadata"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type ListRecentContextLifecyclesBySessionParams

type ListRecentContextLifecyclesBySessionParams struct {
	SessionID pgtype.UUID `json:"session_id"`
	MaxCount  int32       `json:"max_count"`
}

type ListRecentContextLifecyclesBySessionRow

type ListRecentContextLifecyclesBySessionRow struct {
	RunID     pgtype.UUID        `json:"run_id"`
	Status    string             `json:"status"`
	ErrorCode pgtype.Text        `json:"error_code"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	Snapshot  []byte             `json:"snapshot"`
}

type ListRunHistoryTurnRequestMessageIDsParams added in v1.0.0

type ListRunHistoryTurnRequestMessageIDsParams struct {
	SessionID  pgtype.UUID `json:"session_id"`
	RunID      pgtype.UUID `json:"run_id"`
	RootTurnID pgtype.UUID `json:"root_turn_id"`
}

type ListScheduleLogsByBotParams

type ListScheduleLogsByBotParams struct {
	BotID  pgtype.UUID `json:"bot_id"`
	Limit  int32       `json:"limit"`
	Offset int32       `json:"offset"`
}

type ListScheduleLogsByBotRow

type ListScheduleLogsByBotRow struct {
	ID           pgtype.UUID        `json:"id"`
	ScheduleID   pgtype.UUID        `json:"schedule_id"`
	BotID        pgtype.UUID        `json:"bot_id"`
	SessionID    pgtype.UUID        `json:"session_id"`
	Status       string             `json:"status"`
	ResultText   string             `json:"result_text"`
	ErrorMessage string             `json:"error_message"`
	ErrorCode    string             `json:"error_code"`
	Usage        []byte             `json:"usage"`
	StartedAt    pgtype.Timestamptz `json:"started_at"`
	CompletedAt  pgtype.Timestamptz `json:"completed_at"`
}

type ListScheduleLogsByScheduleParams

type ListScheduleLogsByScheduleParams struct {
	ScheduleID pgtype.UUID `json:"schedule_id"`
	Limit      int32       `json:"limit"`
	Offset     int32       `json:"offset"`
}

type ListScheduleLogsByScheduleRow

type ListScheduleLogsByScheduleRow struct {
	ID           pgtype.UUID        `json:"id"`
	ScheduleID   pgtype.UUID        `json:"schedule_id"`
	BotID        pgtype.UUID        `json:"bot_id"`
	SessionID    pgtype.UUID        `json:"session_id"`
	Status       string             `json:"status"`
	ResultText   string             `json:"result_text"`
	ErrorMessage string             `json:"error_message"`
	ErrorCode    string             `json:"error_code"`
	Usage        []byte             `json:"usage"`
	StartedAt    pgtype.Timestamptz `json:"started_at"`
	CompletedAt  pgtype.Timestamptz `json:"completed_at"`
}

type ListScheduleRunSessionsParams added in v0.22.0

type ListScheduleRunSessionsParams struct {
	ScheduleID      pgtype.UUID        `json:"schedule_id"`
	UseCursor       bool               `json:"use_cursor"`
	CursorStartedAt pgtype.Timestamptz `json:"cursor_started_at"`
	CursorID        pgtype.UUID        `json:"cursor_id"`
	LimitCount      int32              `json:"limit_count"`
}

type ListScheduleRunSessionsRow added in v0.22.0

type ListScheduleRunSessionsRow struct {
	ID           pgtype.UUID        `json:"id"`
	SessionID    pgtype.UUID        `json:"session_id"`
	Status       string             `json:"status"`
	ErrorCode    string             `json:"error_code"`
	StartedAt    pgtype.Timestamptz `json:"started_at"`
	CompletedAt  pgtype.Timestamptz `json:"completed_at"`
	SessionTitle string             `json:"session_title"`
}

type ListSessionEventsBySessionAfterParams

type ListSessionEventsBySessionAfterParams struct {
	SessionID    pgtype.UUID `json:"session_id"`
	ReceivedAtMs int64       `json:"received_at_ms"`
}

type ListSessionEventsBySessionPageBeforeWithinBytesParams added in v0.20.0

type ListSessionEventsBySessionPageBeforeWithinBytesParams struct {
	AfterTurnPosition   int64              `json:"after_turn_position"`
	AfterTurnMessageSeq int64              `json:"after_turn_message_seq"`
	KeptIds             []pgtype.UUID      `json:"kept_ids"`
	SessionID           pgtype.UUID        `json:"session_id"`
	HasCursor           bool               `json:"has_cursor"`
	BeforeReceivedAtMs  int64              `json:"before_received_at_ms"`
	BeforeCreatedAt     pgtype.Timestamptz `json:"before_created_at"`
	BeforeID            pgtype.UUID        `json:"before_id"`
	MaxBytes            int64              `json:"max_bytes"`
	PageSize            int32              `json:"page_size"`
}

type ListSessionEventsBySessionPageBeforeWithinBytesRow added in v0.20.0

type ListSessionEventsBySessionPageBeforeWithinBytesRow struct {
	ID                      pgtype.UUID        `json:"id"`
	TeamID                  pgtype.UUID        `json:"team_id"`
	BotID                   pgtype.UUID        `json:"bot_id"`
	SessionID               pgtype.UUID        `json:"session_id"`
	EventKind               string             `json:"event_kind"`
	EventData               []byte             `json:"event_data"`
	ExternalMessageID       pgtype.Text        `json:"external_message_id"`
	SenderChannelIdentityID pgtype.UUID        `json:"sender_channel_identity_id"`
	ReceivedAtMs            int64              `json:"received_at_ms"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	PayloadBytes            int64              `json:"payload_bytes"`
	CumulativeBytes         int64              `json:"cumulative_bytes"`
}

type ListSessionsByBotAndCreatedByUserPagedParams

type ListSessionsByBotAndCreatedByUserPagedParams struct {
	BotID             pgtype.UUID        `json:"bot_id"`
	CreatedByUserID   pgtype.UUID        `json:"created_by_user_id"`
	Types             []string           `json:"types"`
	UseParentSession  bool               `json:"use_parent_session"`
	ParentSessionID   pgtype.UUID        `json:"parent_session_id"`
	UseWorkdir        bool               `json:"use_workdir"`
	WorkdirUnassigned bool               `json:"workdir_unassigned"`
	WorkdirID         pgtype.UUID        `json:"workdir_id"`
	UseVisibility     bool               `json:"use_visibility"`
	Visibility        string             `json:"visibility"`
	HideScheduleRuns  bool               `json:"hide_schedule_runs"`
	UseCursor         bool               `json:"use_cursor"`
	CursorUpdatedAt   pgtype.Timestamptz `json:"cursor_updated_at"`
	CursorID          pgtype.UUID        `json:"cursor_id"`
	LimitCount        int32              `json:"limit_count"`
}

type ListSessionsByBotAndCreatedByUserPagedRow

type ListSessionsByBotAndCreatedByUserPagedRow struct {
	ID                       pgtype.UUID        `json:"id"`
	BotID                    pgtype.UUID        `json:"bot_id"`
	BotAgentID               pgtype.UUID        `json:"bot_agent_id"`
	RouteID                  pgtype.UUID        `json:"route_id"`
	ChannelType              pgtype.Text        `json:"channel_type"`
	Type                     string             `json:"type"`
	SessionMode              string             `json:"session_mode"`
	RuntimeType              string             `json:"runtime_type"`
	Visibility               string             `json:"visibility"`
	RuntimeMetadata          []byte             `json:"runtime_metadata"`
	Title                    string             `json:"title"`
	Metadata                 []byte             `json:"metadata"`
	ParentSessionID          pgtype.UUID        `json:"parent_session_id"`
	CreatedByUserID          pgtype.UUID        `json:"created_by_user_id"`
	WorkdirID                pgtype.UUID        `json:"workdir_id"`
	CreatedAt                pgtype.Timestamptz `json:"created_at"`
	UpdatedAt                pgtype.Timestamptz `json:"updated_at"`
	DeletedAt                pgtype.Timestamptz `json:"deleted_at"`
	PreferredChatModelID     pgtype.UUID        `json:"preferred_chat_model_id"`
	PreferredReasoningEffort pgtype.Text        `json:"preferred_reasoning_effort"`
	PreferredExternalModelID pgtype.Text        `json:"preferred_external_model_id"`
	ModelPreferenceRevision  pgtype.UUID        `json:"model_preference_revision"`
}

type ListSessionsByBotAndCreatedByUserParams

type ListSessionsByBotAndCreatedByUserParams struct {
	BotID           pgtype.UUID `json:"bot_id"`
	CreatedByUserID pgtype.UUID `json:"created_by_user_id"`
}

type ListSessionsByBotAndCreatedByUserRow

type ListSessionsByBotAndCreatedByUserRow struct {
	ID                       pgtype.UUID        `json:"id"`
	BotID                    pgtype.UUID        `json:"bot_id"`
	BotAgentID               pgtype.UUID        `json:"bot_agent_id"`
	RouteID                  pgtype.UUID        `json:"route_id"`
	ChannelType              pgtype.Text        `json:"channel_type"`
	Type                     string             `json:"type"`
	SessionMode              string             `json:"session_mode"`
	RuntimeType              string             `json:"runtime_type"`
	Visibility               string             `json:"visibility"`
	RuntimeMetadata          []byte             `json:"runtime_metadata"`
	Title                    string             `json:"title"`
	Metadata                 []byte             `json:"metadata"`
	ParentSessionID          pgtype.UUID        `json:"parent_session_id"`
	CreatedByUserID          pgtype.UUID        `json:"created_by_user_id"`
	WorkdirID                pgtype.UUID        `json:"workdir_id"`
	CreatedAt                pgtype.Timestamptz `json:"created_at"`
	UpdatedAt                pgtype.Timestamptz `json:"updated_at"`
	DeletedAt                pgtype.Timestamptz `json:"deleted_at"`
	PreferredChatModelID     pgtype.UUID        `json:"preferred_chat_model_id"`
	PreferredReasoningEffort pgtype.Text        `json:"preferred_reasoning_effort"`
	PreferredExternalModelID pgtype.Text        `json:"preferred_external_model_id"`
	ModelPreferenceRevision  pgtype.UUID        `json:"model_preference_revision"`
}

type ListSessionsByBotPagedParams

type ListSessionsByBotPagedParams struct {
	BotID             pgtype.UUID        `json:"bot_id"`
	Types             []string           `json:"types"`
	UseParentSession  bool               `json:"use_parent_session"`
	ParentSessionID   pgtype.UUID        `json:"parent_session_id"`
	UseWorkdir        bool               `json:"use_workdir"`
	WorkdirUnassigned bool               `json:"workdir_unassigned"`
	WorkdirID         pgtype.UUID        `json:"workdir_id"`
	UseVisibility     bool               `json:"use_visibility"`
	Visibility        string             `json:"visibility"`
	HideScheduleRuns  bool               `json:"hide_schedule_runs"`
	UseCursor         bool               `json:"use_cursor"`
	CursorUpdatedAt   pgtype.Timestamptz `json:"cursor_updated_at"`
	CursorID          pgtype.UUID        `json:"cursor_id"`
	LimitCount        int32              `json:"limit_count"`
}

type ListSessionsByBotPagedRow

type ListSessionsByBotPagedRow struct {
	ID                       pgtype.UUID        `json:"id"`
	BotID                    pgtype.UUID        `json:"bot_id"`
	BotAgentID               pgtype.UUID        `json:"bot_agent_id"`
	RouteID                  pgtype.UUID        `json:"route_id"`
	ChannelType              pgtype.Text        `json:"channel_type"`
	Type                     string             `json:"type"`
	SessionMode              string             `json:"session_mode"`
	RuntimeType              string             `json:"runtime_type"`
	Visibility               string             `json:"visibility"`
	RuntimeMetadata          []byte             `json:"runtime_metadata"`
	Title                    string             `json:"title"`
	Metadata                 []byte             `json:"metadata"`
	ParentSessionID          pgtype.UUID        `json:"parent_session_id"`
	CreatedByUserID          pgtype.UUID        `json:"created_by_user_id"`
	WorkdirID                pgtype.UUID        `json:"workdir_id"`
	CreatedAt                pgtype.Timestamptz `json:"created_at"`
	UpdatedAt                pgtype.Timestamptz `json:"updated_at"`
	DeletedAt                pgtype.Timestamptz `json:"deleted_at"`
	PreferredChatModelID     pgtype.UUID        `json:"preferred_chat_model_id"`
	PreferredReasoningEffort pgtype.Text        `json:"preferred_reasoning_effort"`
	PreferredExternalModelID pgtype.Text        `json:"preferred_external_model_id"`
	ModelPreferenceRevision  pgtype.UUID        `json:"model_preference_revision"`
}

type ListSessionsByBotRow

type ListSessionsByBotRow struct {
	ID                       pgtype.UUID        `json:"id"`
	BotID                    pgtype.UUID        `json:"bot_id"`
	BotAgentID               pgtype.UUID        `json:"bot_agent_id"`
	RouteID                  pgtype.UUID        `json:"route_id"`
	ChannelType              pgtype.Text        `json:"channel_type"`
	Type                     string             `json:"type"`
	SessionMode              string             `json:"session_mode"`
	RuntimeType              string             `json:"runtime_type"`
	Visibility               string             `json:"visibility"`
	RuntimeMetadata          []byte             `json:"runtime_metadata"`
	Title                    string             `json:"title"`
	Metadata                 []byte             `json:"metadata"`
	ParentSessionID          pgtype.UUID        `json:"parent_session_id"`
	CreatedByUserID          pgtype.UUID        `json:"created_by_user_id"`
	WorkdirID                pgtype.UUID        `json:"workdir_id"`
	CreatedAt                pgtype.Timestamptz `json:"created_at"`
	UpdatedAt                pgtype.Timestamptz `json:"updated_at"`
	DeletedAt                pgtype.Timestamptz `json:"deleted_at"`
	PreferredChatModelID     pgtype.UUID        `json:"preferred_chat_model_id"`
	PreferredReasoningEffort pgtype.Text        `json:"preferred_reasoning_effort"`
	PreferredExternalModelID pgtype.Text        `json:"preferred_external_model_id"`
	ModelPreferenceRevision  pgtype.UUID        `json:"model_preference_revision"`
}

type ListSnapshotsWithVersionByContainerIDRow

type ListSnapshotsWithVersionByContainerIDRow struct {
	ID                        pgtype.UUID        `json:"id"`
	ContainerID               string             `json:"container_id"`
	RuntimeSnapshotName       string             `json:"runtime_snapshot_name"`
	DisplayName               pgtype.Text        `json:"display_name"`
	ParentRuntimeSnapshotName pgtype.Text        `json:"parent_runtime_snapshot_name"`
	Snapshotter               string             `json:"snapshotter"`
	Source                    string             `json:"source"`
	CreatedAt                 pgtype.Timestamptz `json:"created_at"`
	Version                   pgtype.Int4        `json:"version"`
}

type ListSpeechModelsRow

type ListSpeechModelsRow struct {
	ID           pgtype.UUID        `json:"id"`
	ModelID      string             `json:"model_id"`
	Name         pgtype.Text        `json:"name"`
	ProviderID   pgtype.UUID        `json:"provider_id"`
	Type         string             `json:"type"`
	Enable       bool               `json:"enable"`
	Config       []byte             `json:"config"`
	CreatedAt    pgtype.Timestamptz `json:"created_at"`
	UpdatedAt    pgtype.Timestamptz `json:"updated_at"`
	TeamID       pgtype.UUID        `json:"team_id"`
	ProviderType string             `json:"provider_type"`
}

type ListStaleGenerationSessionRunsParams

type ListStaleGenerationSessionRunsParams struct {
	CurrentGeneration pgtype.Text `json:"current_generation"`
	CursorGeneration  pgtype.Text `json:"cursor_generation"`
	CursorRunID       pgtype.UUID `json:"cursor_run_id"`
	BatchSize         int32       `json:"batch_size"`
}

type ListSubagentForkContextRow

type ListSubagentForkContextRow struct {
	Role    string `json:"role"`
	Content []byte `json:"content"`
}

type ListTerminalSessionRunsNeedingContextLifecycleRow

type ListTerminalSessionRunsNeedingContextLifecycleRow struct {
	RunID        pgtype.UUID `json:"run_id"`
	BotID        pgtype.UUID `json:"bot_id"`
	SessionID    pgtype.UUID `json:"session_id"`
	FencingToken int64       `json:"fencing_token"`
	State        string      `json:"state"`
	ErrorCode    pgtype.Text `json:"error_code"`
}

type ListTokenUsageRecordsParams

type ListTokenUsageRecordsParams struct {
	BotID       pgtype.UUID        `json:"bot_id"`
	FromTime    pgtype.Timestamptz `json:"from_time"`
	ToTime      pgtype.Timestamptz `json:"to_time"`
	ModelID     pgtype.UUID        `json:"model_id"`
	SessionType pgtype.Text        `json:"session_type"`
	PageOffset  int32              `json:"page_offset"`
	PageLimit   int32              `json:"page_limit"`
}

type ListTokenUsageRecordsRow

type ListTokenUsageRecordsRow struct {
	ID              pgtype.UUID        `json:"id"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
	SessionID       pgtype.UUID        `json:"session_id"`
	Harness         string             `json:"harness"`
	SessionType     string             `json:"session_type"`
	ModelID         pgtype.UUID        `json:"model_id"`
	ModelSlug       string             `json:"model_slug"`
	ModelName       string             `json:"model_name"`
	ProviderName    string             `json:"provider_name"`
	InputTokens     int64              `json:"input_tokens"`
	OutputTokens    int64              `json:"output_tokens"`
	CacheReadTokens int64              `json:"cache_read_tokens"`
	ReasoningTokens int64              `json:"reasoning_tokens"`
}

type ListToolApprovalsByBotIDsParams added in v1.0.0

type ListToolApprovalsByBotIDsParams struct {
	BotID pgtype.UUID   `json:"bot_id"`
	Ids   []pgtype.UUID `json:"ids"`
}

type ListToolApprovalsBySessionParams

type ListToolApprovalsBySessionParams struct {
	BotID     pgtype.UUID `json:"bot_id"`
	SessionID pgtype.UUID `json:"session_id"`
}

type ListToolApprovalsBySessionToolCallsParams

type ListToolApprovalsBySessionToolCallsParams struct {
	BotID       pgtype.UUID `json:"bot_id"`
	SessionID   pgtype.UUID `json:"session_id"`
	ToolCallIds []string    `json:"tool_call_ids"`
}

type ListTranscriptionModelsRow

type ListTranscriptionModelsRow struct {
	ID           pgtype.UUID        `json:"id"`
	ModelID      string             `json:"model_id"`
	Name         pgtype.Text        `json:"name"`
	ProviderID   pgtype.UUID        `json:"provider_id"`
	Type         string             `json:"type"`
	Enable       bool               `json:"enable"`
	Config       []byte             `json:"config"`
	CreatedAt    pgtype.Timestamptz `json:"created_at"`
	UpdatedAt    pgtype.Timestamptz `json:"updated_at"`
	TeamID       pgtype.UUID        `json:"team_id"`
	ProviderType string             `json:"provider_type"`
}

type ListTurnResponseSourcesAfterWithinBytesParams added in v1.0.0

type ListTurnResponseSourcesAfterWithinBytesParams struct {
	SessionID           pgtype.UUID `json:"session_id"`
	AfterTurnPosition   int64       `json:"after_turn_position"`
	AfterTurnMessageSeq int64       `json:"after_turn_message_seq"`
	MaxBytes            int64       `json:"max_bytes"`
}

type ListTurnResponseSourcesAfterWithinBytesRow added in v1.0.0

type ListTurnResponseSourcesAfterWithinBytesRow struct {
	ID          pgtype.UUID        `json:"id"`
	Role        string             `json:"role"`
	Content     []byte             `json:"content"`
	CreatedAt   pgtype.Timestamptz `json:"created_at"`
	Interrupted bool               `json:"interrupted"`
	DiscussStep bool               `json:"discuss_step"`
	Truncated   bool               `json:"truncated"`
}

type ListTurnResponseSourcesByIDsParams added in v1.0.0

type ListTurnResponseSourcesByIDsParams struct {
	SessionID pgtype.UUID   `json:"session_id"`
	Ids       []pgtype.UUID `json:"ids"`
}

type ListTurnResponseSourcesByIDsRow added in v1.0.0

type ListTurnResponseSourcesByIDsRow struct {
	ID                pgtype.UUID        `json:"id"`
	Role              string             `json:"role"`
	Content           []byte             `json:"content"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	Interrupted       bool               `json:"interrupted"`
	DiscussStep       bool               `json:"discuss_step"`
	ExternalMessageID pgtype.Text        `json:"external_message_id"`
}

type ListUserInputsByBotIDsParams added in v1.0.0

type ListUserInputsByBotIDsParams struct {
	BotID pgtype.UUID   `json:"bot_id"`
	Ids   []pgtype.UUID `json:"ids"`
}

type ListUserInputsBySessionParams

type ListUserInputsBySessionParams struct {
	BotID     pgtype.UUID `json:"bot_id"`
	SessionID pgtype.UUID `json:"session_id"`
}

type ListUserInputsBySessionToolCallsParams

type ListUserInputsBySessionToolCallsParams struct {
	BotID       pgtype.UUID `json:"bot_id"`
	SessionID   pgtype.UUID `json:"session_id"`
	ToolCallIds []string    `json:"tool_call_ids"`
}

type ListVersionsByContainerIDRow

type ListVersionsByContainerIDRow struct {
	ID                  pgtype.UUID        `json:"id"`
	ContainerID         string             `json:"container_id"`
	SnapshotID          pgtype.UUID        `json:"snapshot_id"`
	Version             int32              `json:"version"`
	CreatedAt           pgtype.Timestamptz `json:"created_at"`
	RuntimeSnapshotName string             `json:"runtime_snapshot_name"`
	DisplayName         pgtype.Text        `json:"display_name"`
}

type ListVideoModelsRow

type ListVideoModelsRow struct {
	ID           pgtype.UUID        `json:"id"`
	ModelID      string             `json:"model_id"`
	Name         pgtype.Text        `json:"name"`
	ProviderID   pgtype.UUID        `json:"provider_id"`
	Type         string             `json:"type"`
	Enable       bool               `json:"enable"`
	Config       []byte             `json:"config"`
	CreatedAt    pgtype.Timestamptz `json:"created_at"`
	UpdatedAt    pgtype.Timestamptz `json:"updated_at"`
	TeamID       pgtype.UUID        `json:"team_id"`
	ProviderType string             `json:"provider_type"`
}

type ListVisibleMessagesFromBySessionParams

type ListVisibleMessagesFromBySessionParams struct {
	SessionID pgtype.UUID `json:"session_id"`
	MessageID pgtype.UUID `json:"message_id"`
}

type ListVisibleMessagesFromBySessionRow

type ListVisibleMessagesFromBySessionRow struct {
	ID                      pgtype.UUID        `json:"id"`
	BotID                   pgtype.UUID        `json:"bot_id"`
	SessionID               pgtype.UUID        `json:"session_id"`
	SenderChannelIdentityID pgtype.UUID        `json:"sender_channel_identity_id"`
	SenderUserID            pgtype.UUID        `json:"sender_user_id"`
	ExternalMessageID       pgtype.Text        `json:"external_message_id"`
	SourceReplyToMessageID  pgtype.Text        `json:"source_reply_to_message_id"`
	Role                    string             `json:"role"`
	Content                 []byte             `json:"content"`
	Metadata                []byte             `json:"metadata"`
	TurnID                  pgtype.UUID        `json:"turn_id"`
	Usage                   []byte             `json:"usage"`
	SessionMode             string             `json:"session_mode"`
	RuntimeType             string             `json:"runtime_type"`
	EventID                 pgtype.UUID        `json:"event_id"`
	DisplayText             pgtype.Text        `json:"display_text"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	SenderDisplayName       pgtype.Text        `json:"sender_display_name"`
	SenderAvatarUrl         pgtype.Text        `json:"sender_avatar_url"`
	Platform                pgtype.Text        `json:"platform"`
}

type LocateMessagesWindowByExternalIDBySessionParams

type LocateMessagesWindowByExternalIDBySessionParams struct {
	SessionID         pgtype.UUID `json:"session_id"`
	ExternalMessageID pgtype.Text `json:"external_message_id"`
	BeforeLimit       int32       `json:"before_limit"`
	AfterLimit        int32       `json:"after_limit"`
}

type LocateMessagesWindowByExternalIDBySessionRow

type LocateMessagesWindowByExternalIDBySessionRow struct {
	TargetID                pgtype.UUID        `json:"target_id"`
	TargetTurnMessageSeq    pgtype.Int8        `json:"target_turn_message_seq"`
	ID                      pgtype.UUID        `json:"id"`
	BotID                   pgtype.UUID        `json:"bot_id"`
	SessionID               pgtype.UUID        `json:"session_id"`
	SenderChannelIdentityID pgtype.UUID        `json:"sender_channel_identity_id"`
	SenderUserID            pgtype.UUID        `json:"sender_user_id"`
	ExternalMessageID       pgtype.Text        `json:"external_message_id"`
	SourceReplyToMessageID  pgtype.Text        `json:"source_reply_to_message_id"`
	Role                    string             `json:"role"`
	Content                 []byte             `json:"content"`
	Metadata                []byte             `json:"metadata"`
	TurnID                  pgtype.UUID        `json:"turn_id"`
	TurnPosition            pgtype.Int8        `json:"turn_position"`
	Usage                   []byte             `json:"usage"`
	SessionMode             string             `json:"session_mode"`
	RuntimeType             string             `json:"runtime_type"`
	EventID                 pgtype.UUID        `json:"event_id"`
	DisplayText             pgtype.Text        `json:"display_text"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	SenderDisplayName       pgtype.Text        `json:"sender_display_name"`
	SenderAvatarUrl         pgtype.Text        `json:"sender_avatar_url"`
	Platform                pgtype.Text        `json:"platform"`
}

type LockActiveSessionRunForHistoryResetParams

type LockActiveSessionRunForHistoryResetParams struct {
	RunID        pgtype.UUID `json:"run_id"`
	BotID        pgtype.UUID `json:"bot_id"`
	SessionID    pgtype.UUID `json:"session_id"`
	FencingToken int64       `json:"fencing_token"`
}

type LockHistoryTurnAppendByRequestParams

type LockHistoryTurnAppendByRequestParams struct {
	SessionID        pgtype.UUID `json:"session_id"`
	RequestMessageID pgtype.UUID `json:"request_message_id"`
}

type LockHistoryTurnReplacementSessionParams added in v1.0.0

type LockHistoryTurnReplacementSessionParams struct {
	SessionID pgtype.UUID `json:"session_id"`
	BotID     pgtype.UUID `json:"bot_id"`
}

type LockSessionDecisionSequenceParams

type LockSessionDecisionSequenceParams struct {
	SessionID pgtype.UUID `json:"session_id"`
	BotID     pgtype.UUID `json:"bot_id"`
}

type LockSessionForCommitReconciliationParams

type LockSessionForCommitReconciliationParams struct {
	SessionID pgtype.UUID `json:"session_id"`
	BotID     pgtype.UUID `json:"bot_id"`
}

type LockSessionRunForAgentStepCommitParams

type LockSessionRunForAgentStepCommitParams struct {
	RunID        pgtype.UUID `json:"run_id"`
	BotID        pgtype.UUID `json:"bot_id"`
	SessionID    pgtype.UUID `json:"session_id"`
	FencingToken int64       `json:"fencing_token"`
	Interrupted  bool        `json:"interrupted"`
}

type LockSessionRuntimeFenceForActivationParams

type LockSessionRuntimeFenceForActivationParams struct {
	SessionID pgtype.UUID `json:"session_id"`
	BotID     pgtype.UUID `json:"bot_id"`
}

type LockSessionRuntimeFenceParams

type LockSessionRuntimeFenceParams struct {
	SessionID           pgtype.UUID `json:"session_id"`
	BotID               pgtype.UUID `json:"bot_id"`
	RuntimeFencingToken int64       `json:"runtime_fencing_token"`
}

type MarkChannelLinkCodeConsumedParams

type MarkChannelLinkCodeConsumedParams struct {
	Token                     string      `json:"token"`
	ConsumedChannelIdentityID pgtype.UUID `json:"consumed_channel_identity_id"`
}

type MarkSessionRunDecisionExecutingParams added in v0.21.0

type MarkSessionRunDecisionExecutingParams struct {
	DecisionID   string      `json:"decision_id"`
	BotID        pgtype.UUID `json:"bot_id"`
	SessionID    pgtype.UUID `json:"session_id"`
	RunID        pgtype.UUID `json:"run_id"`
	FencingToken int64       `json:"fencing_token"`
}

type McpConnection

type McpConnection struct {
	ID            pgtype.UUID        `json:"id"`
	BotID         pgtype.UUID        `json:"bot_id"`
	Name          string             `json:"name"`
	Type          string             `json:"type"`
	Config        []byte             `json:"config"`
	IsActive      bool               `json:"is_active"`
	Status        string             `json:"status"`
	ToolsCache    []byte             `json:"tools_cache"`
	LastProbedAt  pgtype.Timestamptz `json:"last_probed_at"`
	StatusMessage string             `json:"status_message"`
	AuthType      string             `json:"auth_type"`
	CreatedAt     pgtype.Timestamptz `json:"created_at"`
	UpdatedAt     pgtype.Timestamptz `json:"updated_at"`
	TeamID        pgtype.UUID        `json:"team_id"`
}

type McpOauthToken

type McpOauthToken struct {
	ID                     pgtype.UUID        `json:"id"`
	ConnectionID           pgtype.UUID        `json:"connection_id"`
	ResourceMetadataUrl    string             `json:"resource_metadata_url"`
	AuthorizationServerUrl string             `json:"authorization_server_url"`
	AuthorizationEndpoint  string             `json:"authorization_endpoint"`
	TokenEndpoint          string             `json:"token_endpoint"`
	RegistrationEndpoint   string             `json:"registration_endpoint"`
	ScopesSupported        []string           `json:"scopes_supported"`
	ClientID               string             `json:"client_id"`
	ClientSecret           string             `json:"client_secret"`
	AccessToken            string             `json:"access_token"`
	RefreshToken           string             `json:"refresh_token"`
	TokenType              string             `json:"token_type"`
	ExpiresAt              pgtype.Timestamptz `json:"expires_at"`
	Scope                  string             `json:"scope"`
	PkceCodeVerifier       string             `json:"pkce_code_verifier"`
	StateParam             string             `json:"state_param"`
	ResourceUri            string             `json:"resource_uri"`
	RedirectUri            string             `json:"redirect_uri"`
	CreatedAt              pgtype.Timestamptz `json:"created_at"`
	UpdatedAt              pgtype.Timestamptz `json:"updated_at"`
	TeamID                 pgtype.UUID        `json:"team_id"`
}

type MeasureHistoryMessagesAfterParams added in v1.0.0

type MeasureHistoryMessagesAfterParams struct {
	SessionID           pgtype.UUID `json:"session_id"`
	AfterTurnPosition   int64       `json:"after_turn_position"`
	AfterTurnMessageSeq int64       `json:"after_turn_message_seq"`
}

type MeasureHistoryMessagesAfterRow added in v1.0.0

type MeasureHistoryMessagesAfterRow struct {
	MessageCount int64 `json:"message_count"`
	ContentBytes int64 `json:"content_bytes"`
}

type MediaAsset

type MediaAsset struct {
	ID                pgtype.UUID        `json:"id"`
	BotID             pgtype.UUID        `json:"bot_id"`
	StorageProviderID pgtype.UUID        `json:"storage_provider_id"`
	ContentHash       string             `json:"content_hash"`
	MediaType         string             `json:"media_type"`
	Mime              string             `json:"mime"`
	SizeBytes         int64              `json:"size_bytes"`
	StorageKey        string             `json:"storage_key"`
	OriginalName      pgtype.Text        `json:"original_name"`
	Width             pgtype.Int4        `json:"width"`
	Height            pgtype.Int4        `json:"height"`
	DurationMs        pgtype.Int8        `json:"duration_ms"`
	Metadata          []byte             `json:"metadata"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	TeamID            pgtype.UUID        `json:"team_id"`
}

type MemoryEdge

type MemoryEdge struct {
	ID        int64              `json:"id"`
	BotID     pgtype.UUID        `json:"bot_id"`
	SrcNode   string             `json:"src_node"`
	DstNode   string             `json:"dst_node"`
	Rel       string             `json:"rel"`
	Weight    float32            `json:"weight"`
	Metadata  []byte             `json:"metadata"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	TeamID    pgtype.UUID        `json:"team_id"`
}

type MemoryNode

type MemoryNode struct {
	ID               string             `json:"id"`
	BotID            pgtype.UUID        `json:"bot_id"`
	Body             string             `json:"body"`
	Hash             string             `json:"hash"`
	Layer            string             `json:"layer"`
	FactType         string             `json:"fact_type"`
	Subject          string             `json:"subject"`
	Confidence       float32            `json:"confidence"`
	Metadata         []byte             `json:"metadata"`
	SourceMessageIds []byte             `json:"source_message_ids"`
	ProfileRef       string             `json:"profile_ref"`
	Topic            string             `json:"topic"`
	CapturedAt       pgtype.Timestamptz `json:"captured_at"`
	ExpiresAt        pgtype.Timestamptz `json:"expires_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	TeamID           pgtype.UUID        `json:"team_id"`
}

type MemoryProvider

type MemoryProvider struct {
	ID        pgtype.UUID        `json:"id"`
	Name      string             `json:"name"`
	Provider  string             `json:"provider"`
	Config    []byte             `json:"config"`
	IsDefault bool               `json:"is_default"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
	TeamID    pgtype.UUID        `json:"team_id"`
}

type Model

type Model struct {
	ID         pgtype.UUID        `json:"id"`
	ModelID    string             `json:"model_id"`
	Name       pgtype.Text        `json:"name"`
	ProviderID pgtype.UUID        `json:"provider_id"`
	Type       string             `json:"type"`
	Enable     bool               `json:"enable"`
	Config     []byte             `json:"config"`
	CreatedAt  pgtype.Timestamptz `json:"created_at"`
	UpdatedAt  pgtype.Timestamptz `json:"updated_at"`
	TeamID     pgtype.UUID        `json:"team_id"`
}

type ModelVariant

type ModelVariant struct {
	ID        pgtype.UUID        `json:"id"`
	ModelUuid pgtype.UUID        `json:"model_uuid"`
	VariantID string             `json:"variant_id"`
	Weight    int32              `json:"weight"`
	Metadata  []byte             `json:"metadata"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
	TeamID    pgtype.UUID        `json:"team_id"`
}

type PrepareSessionRunFinishParams added in v0.20.0

type PrepareSessionRunFinishParams struct {
	ProposedTerminalState string      `json:"proposed_terminal_state"`
	ProposedErrorCode     pgtype.Text `json:"proposed_error_code"`
	ProposedErrorMessage  pgtype.Text `json:"proposed_error_message"`
	RunID                 pgtype.UUID `json:"run_id"`
	FencingToken          int64       `json:"fencing_token"`
	AllowWaitingDecision  bool        `json:"allow_waiting_decision"`
}

type Provider

type Provider struct {
	ID                 pgtype.UUID        `json:"id"`
	ProviderTemplateID pgtype.UUID        `json:"provider_template_id"`
	Name               string             `json:"name"`
	ClientType         string             `json:"client_type"`
	Icon               pgtype.Text        `json:"icon"`
	Enable             bool               `json:"enable"`
	Config             []byte             `json:"config"`
	Metadata           []byte             `json:"metadata"`
	CreatedAt          pgtype.Timestamptz `json:"created_at"`
	UpdatedAt          pgtype.Timestamptz `json:"updated_at"`
	TeamID             pgtype.UUID        `json:"team_id"`
}

type ProviderOauthToken

type ProviderOauthToken struct {
	ID               pgtype.UUID        `json:"id"`
	ProviderID       pgtype.UUID        `json:"provider_id"`
	AccessToken      string             `json:"access_token"`
	RefreshToken     string             `json:"refresh_token"`
	ExpiresAt        pgtype.Timestamptz `json:"expires_at"`
	Scope            string             `json:"scope"`
	TokenType        string             `json:"token_type"`
	State            string             `json:"state"`
	PkceCodeVerifier string             `json:"pkce_code_verifier"`
	Metadata         []byte             `json:"metadata"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
	TeamID           pgtype.UUID        `json:"team_id"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AcceptSessionRunDecisionContinuation added in v0.21.0

func (q *Queries) AcceptSessionRunDecisionContinuation(ctx context.Context, arg AcceptSessionRunDecisionContinuationParams) (SessionRun, error)

Called in the same fenced transaction that accepts the decision. A committed answer is executing work, even before the resumed producer's agent_start.

func (*Queries) AcquireLockedBotRuntimeReset

func (q *Queries) AcquireLockedBotRuntimeReset(ctx context.Context, arg AcquireLockedBotRuntimeResetParams) (pgtype.Timestamptz, error)

func (*Queries) AcquireLockedBotSessionRuntimeReset

func (q *Queries) AcquireLockedBotSessionRuntimeReset(ctx context.Context, arg AcquireLockedBotSessionRuntimeResetParams) (pgtype.Timestamptz, error)

func (*Queries) AcquireProviderTemplateSyncLock

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

func (*Queries) ActivateSessionRuntimeFence

func (q *Queries) ActivateSessionRuntimeFence(ctx context.Context, arg ActivateSessionRuntimeFenceParams) (int64, error)

func (*Queries) ActivateUserRuntime

func (q *Queries) ActivateUserRuntime(ctx context.Context, arg ActivateUserRuntimeParams) (UserRuntime, error)

The first ready connection consumes the short-lived pending state. Existing activated credentials remain reusable for later reconnects.

func (*Queries) AdmitLockedSessionRun

func (q *Queries) AdmitLockedSessionRun(ctx context.Context, arg AdmitLockedSessionRunParams) (SessionRun, error)

Durable admission. There is no queue: SR-OWN-001 permits answering busy, so a second concurrent invocation is rejected rather than parked.

Busy is rejected in two layers. The adapter's indexed pre-read catches the common case before this statement runs at all, so contended submissions never reach the write path. This statement handles only what slipped through that unlocked read: session_runs_single_active raises, and because the adapter runs this after a separate parent lock in one transaction, rollback takes the allocated turn position with it and leaves nothing for the caller to clean up.

Returns no rows when this invocation_id was already admitted — ON CONFLICT keeps the ordinary retry path free of errors, which matters because channel redelivery makes it a routine event — or when the session does not exist. The caller re-selects by invocation to tell those two apart.

A position is allocated only for an admission that can still succeed: never for a known duplicate (the NOT EXISTS guard below) and never for a rejected one (the rollback). The single exception is two callers racing on the *same* invocation_id, where both pass the guard against the statement snapshot and the loser's increment commits with no row. That leaves a gap in turn_position, which is ordering-only and never read as a count.

func (*Queries) AllocateSessionTurnPosition

func (q *Queries) AllocateSessionTurnPosition(ctx context.Context, sessionID pgtype.UUID) (int64, error)

func (*Queries) AppendMessageToHistoryTurnByRequest

func (q *Queries) AppendMessageToHistoryTurnByRequest(ctx context.Context, arg AppendMessageToHistoryTurnByRequestParams) (pgtype.UUID, error)

func (*Queries) AppendMessageToLatestHistoryTurn

func (q *Queries) AppendMessageToLatestHistoryTurn(ctx context.Context, arg AppendMessageToLatestHistoryTurnParams) (pgtype.UUID, error)

func (*Queries) ApproveToolApprovalRequest

func (q *Queries) ApproveToolApprovalRequest(ctx context.Context, arg ApproveToolApprovalRequestParams) (ToolApprovalRequest, error)

func (*Queries) ArchiveBotWorkdir

func (q *Queries) ArchiveBotWorkdir(ctx context.Context, arg ArchiveBotWorkdirParams) (pgtype.UUID, error)

func (*Queries) BackfillUserRuntimeName

func (q *Queries) BackfillUserRuntimeName(ctx context.Context, arg BackfillUserRuntimeNameParams) (int64, error)

Fills the display name from the connecting machine, but ONLY while the row still carries its creation-time default (or an empty name): a user-chosen name is never overwritten by a later handshake.

func (*Queries) BotAgentIsDefault

func (q *Queries) BotAgentIsDefault(ctx context.Context, arg BotAgentIsDefaultParams) (bool, error)

func (*Queries) BumpBotRuntimeConfigEpoch

func (q *Queries) BumpBotRuntimeConfigEpoch(ctx context.Context, botID pgtype.UUID) (int64, error)

func (*Queries) CacheWorkspaceDependencyCatalog added in v0.20.0

func (q *Queries) CacheWorkspaceDependencyCatalog(ctx context.Context, arg CacheWorkspaceDependencyCatalogParams) (int64, error)

func (*Queries) CacheWorkspaceDependencyDefinition added in v0.20.0

func (q *Queries) CacheWorkspaceDependencyDefinition(ctx context.Context, arg CacheWorkspaceDependencyDefinitionParams) (int64, error)

func (*Queries) CancelBotWorkspaceRemoval added in v0.22.0

func (q *Queries) CancelBotWorkspaceRemoval(ctx context.Context, arg CancelBotWorkspaceRemovalParams) (BotWorkspace, error)

Withdraw a removal that failed: the workspace is desired again and recorded as the backend reports it, in one write. Split in two, a pass in between would see a present workspace observed as failed and provision over one that is still there. Matches nothing unless a removal failed and is settled.

func (*Queries) CancelPendingToolApprovalsBySession

func (q *Queries) CancelPendingToolApprovalsBySession(ctx context.Context, arg CancelPendingToolApprovalsBySessionParams) ([]ToolApprovalRequest, error)

func (*Queries) CancelPendingUserInputsByRun added in v0.20.0

func (q *Queries) CancelPendingUserInputsByRun(ctx context.Context, arg CancelPendingUserInputsByRunParams) ([]UserInputRequest, error)

A lost run must only invalidate decisions it created. Session-wide cancellation would also expire a newer run's ask_user request after a stale owner is reaped.

func (*Queries) CancelPendingUserInputsBySession

func (q *Queries) CancelPendingUserInputsBySession(ctx context.Context, arg CancelPendingUserInputsBySessionParams) ([]UserInputRequest, error)

func (*Queries) CancelToolApprovalRequest added in v1.0.0

func (q *Queries) CancelToolApprovalRequest(ctx context.Context, arg CancelToolApprovalRequestParams) (ToolApprovalRequest, error)

func (*Queries) CancelUserInputRequest

func (q *Queries) CancelUserInputRequest(ctx context.Context, arg CancelUserInputRequestParams) (UserInputRequest, error)

func (*Queries) ClaimBotDependencyOperation added in v0.20.0

func (q *Queries) ClaimBotDependencyOperation(ctx context.Context, arg ClaimBotDependencyOperationParams) (BotDependencyInstallation, error)

func (*Queries) ClaimBotWorkspace added in v0.21.0

func (q *Queries) ClaimBotWorkspace(ctx context.Context, arg ClaimBotWorkspaceParams) (BotWorkspace, error)

Claim one specific row (for an on-demand observation after a user action) when nobody else holds its lease.

func (*Queries) ClaimBotWorkspaces added in v0.21.0

func (q *Queries) ClaimBotWorkspaces(ctx context.Context, arg ClaimBotWorkspacesParams) ([]BotWorkspace, error)

Claim due rows for one reconcile pass. A row is due when it has not yet responded to its latest intent, is stuck in a transitional state whose lease expired, or is a failed provisioning whose backoff elapsed. A failed removal is not due: it waits for a new intent. SKIP LOCKED keeps concurrent Server instances from claiming the same row; an expired lease lets another instance take over a crashed pass. A desired state, when given, limits the pass to the rows that want it: removals can have slots of their own.

The due rows are picked by an array subquery, which PostgreSQL runs once. Written as bot_id IN (subquery), the planner may pick a nested loop semi join that runs the subquery again for every row it scans; each run skips the rows this statement already locked and returns the next ones, so the claim takes more rows than the limit, more than the free slots.

func (*Queries) ClaimLockedSessionRun

func (q *Queries) ClaimLockedSessionRun(ctx context.Context, arg ClaimLockedSessionRunParams) (SessionRun, error)

Ownership change: the only write that touches owner_id, fencing_token, owner_since and live_generation. live_generation is stamped once here and never updated, which keeps idx_session_runs_recovery a stable keyset cursor. Fencing tokens come from a monotonic sequence, so a newer claim always carries a strictly larger token than the one it replaces.

func (*Queries) ClaimToolApprovalRequestForRuntime

func (q *Queries) ClaimToolApprovalRequestForRuntime(ctx context.Context, arg ClaimToolApprovalRequestForRuntimeParams) (ToolApprovalRequest, error)

func (*Queries) ClaimUserInputRequestForRuntime

func (q *Queries) ClaimUserInputRequestForRuntime(ctx context.Context, arg ClaimUserInputRequestForRuntimeParams) (UserInputRequest, error)

func (*Queries) ClassifyHistoryCheckpointMessages added in v1.0.0

How a checkpoint stands for each inbound message that has context rows: kept when one of its rows is after the checkpoint's position or is a row the checkpoint keeps by reference, folded otherwise. event_cursor is the cursor of the event its rows were written from, 0 when unknown: a summary reads rows, so it knows the message as of that event. A message without context rows returns nothing.

func (*Queries) ClearAppConnectorRefConnection added in v0.20.0

func (q *Queries) ClearAppConnectorRefConnection(ctx context.Context, connectionID string) (int64, error)

func (*Queries) ClearBotAgentCredential added in v0.20.0

func (q *Queries) ClearBotAgentCredential(ctx context.Context, arg ClearBotAgentCredentialParams) (pgtype.UUID, error)

func (*Queries) ClearBotRemoteRuntimePrimary

func (q *Queries) ClearBotRemoteRuntimePrimary(ctx context.Context, botID pgtype.UUID) error

func (*Queries) ClearBotRuntimeData

func (q *Queries) ClearBotRuntimeData(ctx context.Context, botID pgtype.UUID) error

func (*Queries) ClearHistoryByBot

func (q *Queries) ClearHistoryByBot(ctx context.Context, targetBotID pgtype.UUID) error

Runs go with the history they belong to. A turn interrupted by a graceful shutdown loses its resume intent. A run that ended before it was ever claimed has no fencing token to order against the reset, so it is marked history_reset; the reset holds new admissions out, so every such run here predates it. One statement does both, as a row updated twice in a statement keeps only one of the updates.

func (*Queries) ClearHistoryBySession

func (q *Queries) ClearHistoryBySession(ctx context.Context, targetSessionID pgtype.UUID) error

Runs go with the history they belong to. A turn interrupted by a graceful shutdown loses its resume intent. A run that ended before it was ever claimed has no fencing token to order against the reset, so it is marked history_reset; the reset holds new admissions out, so every such run here predates it. One statement does both, as a row updated twice in a statement keeps only one of the updates.

func (*Queries) ClearMCPOAuthTokens

func (q *Queries) ClearMCPOAuthTokens(ctx context.Context, connectionID pgtype.UUID) error

func (*Queries) CloneHistoryTurnRequestForRetry added in v1.0.0

func (q *Queries) CloneHistoryTurnRequestForRetry(ctx context.Context, arg CloneHistoryTurnRequestForRetryParams) (pgtype.UUID, error)

A request row belongs to exactly one attempt. Copy its payload and attachment links instead of moving the original row out of the superseded turn.

func (*Queries) CompareAndSetSessionModelPreference added in v0.20.0

func (q *Queries) CompareAndSetSessionModelPreference(ctx context.Context, arg CompareAndSetSessionModelPreferenceParams) (int64, error)

A picker may not overwrite a send or a newer picker operation. Nullable revisions allow existing sessions to upgrade without a table backfill.

func (*Queries) CompleteCompactionLog

func (q *Queries) CompleteCompactionLog(ctx context.Context, arg CompleteCompactionLogParams) (BotHistoryMessageCompact, error)

Settles a pending pass. A pass that commits does it in the transaction that makes its checkpoint the session's active one; no row comes back for a log that is no longer pending.

func (*Queries) CompleteScheduleLog

func (q *Queries) CompleteScheduleLog(ctx context.Context, arg CompleteScheduleLogParams) (ScheduleLog, error)

func (*Queries) CopyCompactionSummary added in v1.0.0

func (q *Queries) CopyCompactionSummary(ctx context.Context, arg CopyCompactionSummaryParams) (pgtype.UUID, error)

A fork carries a summary of its source as its own: the text the copy gives it, which names the fork's rows where the source's named the source's, the same model, count and timing, and no usage, so the summarizer call that wrote it is counted once.

func (*Queries) CountAccounts

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

func (*Queries) CountAgentAuthorizations added in v0.20.0

func (q *Queries) CountAgentAuthorizations(ctx context.Context, ownerUserID pgtype.UUID) (int64, error)

func (*Queries) CountBotAgentCredentialRefs added in v0.20.0

func (q *Queries) CountBotAgentCredentialRefs(ctx context.Context, agentCredentialID pgtype.UUID) (int64, error)

func (*Queries) CountBotWorkspacesByObservedState added in v0.21.0

func (q *Queries) CountBotWorkspacesByObservedState(ctx context.Context) ([]CountBotWorkspacesByObservedStateRow, error)

func (*Queries) CountCompactionLogsByBot

func (q *Queries) CountCompactionLogsByBot(ctx context.Context, botID pgtype.UUID) (int64, error)

func (*Queries) CountHistoryCheckpointCandidates added in v1.0.0

func (q *Queries) CountHistoryCheckpointCandidates(ctx context.Context, arg CountHistoryCheckpointCandidatesParams) (int64, error)

Metadata-only companion of ListHistoryCheckpointCandidatesWithinBytes over the same candidates. It never returns payloads: it counts them, which tells a read that took nothing whether rows are left.

func (*Queries) CountMemoryEdgesByBot

func (q *Queries) CountMemoryEdgesByBot(ctx context.Context, botID pgtype.UUID) (int64, error)

func (*Queries) CountMemoryNodesByBot

func (q *Queries) CountMemoryNodesByBot(ctx context.Context, botID pgtype.UUID) (int64, error)

func (*Queries) CountMemoryProvidersByDefault

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

func (*Queries) CountMessageAssetsByBot

func (q *Queries) CountMessageAssetsByBot(ctx context.Context, botID pgtype.UUID) (int64, error)

func (*Queries) CountMessagesByBot

func (q *Queries) CountMessagesByBot(ctx context.Context, botID pgtype.UUID) (int64, error)

func (*Queries) CountMessagesBySession

func (q *Queries) CountMessagesBySession(ctx context.Context, sessionID pgtype.UUID) (int64, error)

func (*Queries) CountModels

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

func (*Queries) CountModelsByType

func (q *Queries) CountModelsByType(ctx context.Context, type_ string) (int64, error)

func (*Queries) CountProviders

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

func (*Queries) CountScheduleLogsByBot

func (q *Queries) CountScheduleLogsByBot(ctx context.Context, botID pgtype.UUID) (int64, error)

func (*Queries) CountScheduleLogsBySchedule

func (q *Queries) CountScheduleLogsBySchedule(ctx context.Context, scheduleID pgtype.UUID) (int64, error)

func (*Queries) CountSessionEvents

func (q *Queries) CountSessionEvents(ctx context.Context, sessionID pgtype.UUID) (int64, error)

func (*Queries) CountTokenUsageRecords

func (q *Queries) CountTokenUsageRecords(ctx context.Context, arg CountTokenUsageRecordsParams) (int64, error)

func (*Queries) CreateAccount

func (q *Queries) CreateAccount(ctx context.Context, arg CreateAccountParams) (CreateAccountRow, error)

func (*Queries) CreateAgentAuthorization added in v0.20.0

func (q *Queries) CreateAgentAuthorization(ctx context.Context, arg CreateAgentAuthorizationParams) (AgentAuthorization, error)

func (*Queries) CreateAgentCredential added in v0.20.0

func (q *Queries) CreateAgentCredential(ctx context.Context, arg CreateAgentCredentialParams) (AgentCredential, error)

func (*Queries) CreateBot

func (q *Queries) CreateBot(ctx context.Context, arg CreateBotParams) (CreateBotRow, error)

func (*Queries) CreateBotACLRule

func (q *Queries) CreateBotACLRule(ctx context.Context, arg CreateBotACLRuleParams) (BotAclRule, error)

func (*Queries) CreateBotAgent

func (q *Queries) CreateBotAgent(ctx context.Context, arg CreateBotAgentParams) (BotAgent, error)

func (*Queries) CreateBotUserGrant

func (q *Queries) CreateBotUserGrant(ctx context.Context, arg CreateBotUserGrantParams) (BotUserGrant, error)

func (*Queries) CreateBotWorkdir

func (q *Queries) CreateBotWorkdir(ctx context.Context, arg CreateBotWorkdirParams) (BotWorkdir, error)

func (*Queries) CreateChannelIdentity

func (q *Queries) CreateChannelIdentity(ctx context.Context, arg CreateChannelIdentityParams) (ChannelIdentity, error)

func (*Queries) CreateChannelLinkCode

func (q *Queries) CreateChannelLinkCode(ctx context.Context, arg CreateChannelLinkCodeParams) (ChannelLinkCode, error)

func (*Queries) CreateChatRoute

func (q *Queries) CreateChatRoute(ctx context.Context, arg CreateChatRouteParams) (CreateChatRouteRow, error)

func (*Queries) CreateCompactionLog

func (q *Queries) CreateCompactionLog(ctx context.Context, arg CreateCompactionLogParams) (BotHistoryMessageCompact, error)

A compaction event records each pass here before its summarizer call. The log is pending until the pass commits its summary or fails.

func (*Queries) CreateConnector

func (q *Queries) CreateConnector(ctx context.Context, arg CreateConnectorParams) (Connector, error)

func (*Queries) CreateContextLifecycle

func (q *Queries) CreateContextLifecycle(ctx context.Context, arg CreateContextLifecycleParams) (CreateContextLifecycleRow, error)

func (*Queries) CreateFetchProvider

func (q *Queries) CreateFetchProvider(ctx context.Context, arg CreateFetchProviderParams) (FetchProvider, error)

func (*Queries) CreateHistoryCheckpoint added in v1.0.0

func (q *Queries) CreateHistoryCheckpoint(ctx context.Context, arg CreateHistoryCheckpointParams) (BotHistoryCheckpoint, error)

Writes a checkpoint after parent only while parent is the session's active one, locking the session as the rewind that would move it does: a rewind deletes the checkpoints it moves back past, parent among them. No row when the session moved on.

func (*Queries) CreateHistoryTurn

func (q *Queries) CreateHistoryTurn(ctx context.Context, arg CreateHistoryTurnParams) (CreateHistoryTurnRow, error)

func (*Queries) CreateHistoryTurnWithID

func (q *Queries) CreateHistoryTurnWithID(ctx context.Context, arg CreateHistoryTurnWithIDParams) (CreateHistoryTurnWithIDRow, error)

func (*Queries) CreateMCPConnection

func (q *Queries) CreateMCPConnection(ctx context.Context, arg CreateMCPConnectionParams) (McpConnection, error)

func (*Queries) CreateMemoryProvider

func (q *Queries) CreateMemoryProvider(ctx context.Context, arg CreateMemoryProviderParams) (MemoryProvider, error)

func (*Queries) CreateMemoryUsage added in v0.21.0

func (q *Queries) CreateMemoryUsage(ctx context.Context, arg CreateMemoryUsageParams) error

func (*Queries) CreateMessage

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

func (*Queries) CreateMessageAsset

func (q *Queries) CreateMessageAsset(ctx context.Context, arg CreateMessageAssetParams) (CreateMessageAssetRow, error)

func (*Queries) CreateMessageWithHistoryTurn

Writes the request message of a turn.

The turn position is allocated here only when the caller did not bring one. A run admitted through session_runs already drew turn_id and turn_position from this same counter (SR-TURN-001, SR-DUR-002), so bumping again would spend a second position and file the message under a turn the client was never told about. Entry points with no admission — channel inbound, schedules — pass NULL and keep allocating here.

func (*Queries) CreateMessageWithTurn

func (q *Queries) CreateMessageWithTurn(ctx context.Context, arg CreateMessageWithTurnParams) (CreateMessageWithTurnRow, error)

func (*Queries) CreateModel

func (q *Queries) CreateModel(ctx context.Context, arg CreateModelParams) (Model, error)

func (*Queries) CreateModelVariant

func (q *Queries) CreateModelVariant(ctx context.Context, arg CreateModelVariantParams) (ModelVariant, error)

func (*Queries) CreateOrUpdateBotRemoteRuntimeMount

func (q *Queries) CreateOrUpdateBotRemoteRuntimeMount(ctx context.Context, arg CreateOrUpdateBotRemoteRuntimeMountParams) (pgtype.UUID, error)

func (*Queries) CreateProvider

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

func (*Queries) CreateProviderFromTemplate

func (q *Queries) CreateProviderFromTemplate(ctx context.Context, arg CreateProviderFromTemplateParams) (Provider, error)

func (*Queries) CreateSchedule

func (q *Queries) CreateSchedule(ctx context.Context, arg CreateScheduleParams) (Schedule, error)

func (*Queries) CreateScheduleLog

func (q *Queries) CreateScheduleLog(ctx context.Context, arg CreateScheduleLogParams) (CreateScheduleLogRow, error)

func (*Queries) CreateSearchProvider

func (q *Queries) CreateSearchProvider(ctx context.Context, arg CreateSearchProviderParams) (SearchProvider, error)

func (*Queries) CreateSession

func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) (BotSession, error)

func (*Queries) CreateSessionEvent

func (q *Queries) CreateSessionEvent(ctx context.Context, arg CreateSessionEventParams) (pgtype.UUID, error)

func (*Queries) CreateStorageProvider

func (q *Queries) CreateStorageProvider(ctx context.Context, arg CreateStorageProviderParams) (StorageProvider, error)

func (*Queries) CreateSubagentConfig

func (q *Queries) CreateSubagentConfig(ctx context.Context, arg CreateSubagentConfigParams) (SubagentConfig, error)

func (*Queries) CreateToolApprovalRequest

func (q *Queries) CreateToolApprovalRequest(ctx context.Context, arg CreateToolApprovalRequestParams) (ToolApprovalRequest, error)

func (*Queries) CreateToolTailRound

func (q *Queries) CreateToolTailRound(ctx context.Context, arg CreateToolTailRoundParams) ([]CreateToolTailRoundRow, error)

As in CreateMessageWithHistoryTurn: a run admitted through session_runs already drew this turn's position, so bumping again would spend a second one and file the round under a turn the client was never told about.

func (*Queries) CreateUser

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

func (*Queries) CreateUserInputRequest

func (q *Queries) CreateUserInputRequest(ctx context.Context, arg CreateUserInputRequestParams) (UserInputRequest, error)

func (*Queries) CreateUserRuntime

func (q *Queries) CreateUserRuntime(ctx context.Context, arg CreateUserRuntimeParams) (UserRuntime, error)

func (*Queries) DeleteAgentAuthorization added in v0.20.0

func (q *Queries) DeleteAgentAuthorization(ctx context.Context, arg DeleteAgentAuthorizationParams) error

func (*Queries) DeleteAllMemoryEdgesByBot

func (q *Queries) DeleteAllMemoryEdgesByBot(ctx context.Context, botID pgtype.UUID) error

func (*Queries) DeleteAllMemoryNodesByBot

func (q *Queries) DeleteAllMemoryNodesByBot(ctx context.Context, botID pgtype.UUID) error

func (*Queries) DeleteAppConnectorRef added in v0.20.0

func (q *Queries) DeleteAppConnectorRef(ctx context.Context, arg DeleteAppConnectorRefParams) (int64, error)

func (*Queries) DeleteAppDependencyRef added in v0.20.0

func (q *Queries) DeleteAppDependencyRef(ctx context.Context, arg DeleteAppDependencyRefParams) (int64, error)

func (*Queries) DeleteBotACLRuleByID

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

func (*Queries) DeleteBotAppInstallation added in v0.20.0

func (q *Queries) DeleteBotAppInstallation(ctx context.Context, arg DeleteBotAppInstallationParams) (BotAppInstallation, error)

func (*Queries) DeleteBotByID

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

Runtime-fenced writers lock the bot parent before a child session. Keep the same parent-before-child order here so deletion cannot deadlock with them.

func (*Queries) DeleteBotChannelAdmin

func (q *Queries) DeleteBotChannelAdmin(ctx context.Context, arg DeleteBotChannelAdminParams) error

func (*Queries) DeleteBotChannelConfig

func (q *Queries) DeleteBotChannelConfig(ctx context.Context, arg DeleteBotChannelConfigParams) error

func (*Queries) DeleteBotDependencyInstallation added in v0.20.0

func (q *Queries) DeleteBotDependencyInstallation(ctx context.Context, arg DeleteBotDependencyInstallationParams) (int64, error)

func (*Queries) DeleteBotDependencyOperation added in v0.20.0

func (q *Queries) DeleteBotDependencyOperation(ctx context.Context, arg DeleteBotDependencyOperationParams) (BotDependencyInstallation, error)

func (*Queries) DeleteBotRemoteRuntimeMount

func (q *Queries) DeleteBotRemoteRuntimeMount(ctx context.Context, arg DeleteBotRemoteRuntimeMountParams) (pgtype.UUID, error)

func (*Queries) DeleteBotRemoteRuntimeMountsByRuntime

func (q *Queries) DeleteBotRemoteRuntimeMountsByRuntime(ctx context.Context, runtimeID pgtype.UUID) error

Revoking a runtime kills every bot mount of it in the same transaction: dead bindings would otherwise linger as ghost rows on every surface.

func (*Queries) DeleteBotUserGrantByID

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

func (*Queries) DeleteChatRoute

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

func (*Queries) DeleteConnector

func (q *Queries) DeleteConnector(ctx context.Context, arg DeleteConnectorParams) error

Keep the local binding until every App reference and status change commits. Any failure rolls back the entire statement, leaving a retryable binding.

func (*Queries) DeleteContainerByBotID

func (q *Queries) DeleteContainerByBotID(ctx context.Context, botID pgtype.UUID) error

func (*Queries) DeleteFetchProvider

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

func (*Queries) DeleteMCPConnection

func (q *Queries) DeleteMCPConnection(ctx context.Context, arg DeleteMCPConnectionParams) error

func (*Queries) DeleteMCPOAuthToken

func (q *Queries) DeleteMCPOAuthToken(ctx context.Context, connectionID pgtype.UUID) error

func (*Queries) DeleteMemoryEdgesByRelForBot

func (q *Queries) DeleteMemoryEdgesByRelForBot(ctx context.Context, arg DeleteMemoryEdgesByRelForBotParams) error

func (*Queries) DeleteMemoryEdgesForNode

func (q *Queries) DeleteMemoryEdgesForNode(ctx context.Context, arg DeleteMemoryEdgesForNodeParams) error

func (*Queries) DeleteMemoryNode

func (q *Queries) DeleteMemoryNode(ctx context.Context, arg DeleteMemoryNodeParams) error

func (*Queries) DeleteMessageAssets

func (q *Queries) DeleteMessageAssets(ctx context.Context, messageID pgtype.UUID) error

func (*Queries) DeleteMessagesByIDs

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

Deleting context rows rewinds their session to the newest checkpoint that does not depend on them.

func (*Queries) DeleteModel

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

func (*Queries) DeleteModelByModelID

func (q *Queries) DeleteModelByModelID(ctx context.Context, modelID string) error

func (*Queries) DeleteModelByProviderAndType

func (q *Queries) DeleteModelByProviderAndType(ctx context.Context, arg DeleteModelByProviderAndTypeParams) error

func (*Queries) DeleteModelByProviderIDAndModelID

func (q *Queries) DeleteModelByProviderIDAndModelID(ctx context.Context, arg DeleteModelByProviderIDAndModelIDParams) error

func (*Queries) DeleteProvider

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

func (*Queries) DeleteProviderOAuthToken

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

func (*Queries) DeleteRuntimeDecisionProjectionsByRun added in v0.20.0

func (q *Queries) DeleteRuntimeDecisionProjectionsByRun(ctx context.Context, arg DeleteRuntimeDecisionProjectionsByRunParams) (int64, error)

Decision cards are temporary stream projections. Delete by their stable run marker as well as by returned IDs so an insert whose COMMIT ack was lost cannot survive the final canonical round as a duplicate assistant message. Deleting context rows rewinds the session, locked before its rows as every history mutation locks them, to the newest checkpoint that does not depend on them.

func (*Queries) DeleteSchedule

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

func (*Queries) DeleteScheduleLogsByBot

func (q *Queries) DeleteScheduleLogsByBot(ctx context.Context, botID pgtype.UUID) error

func (*Queries) DeleteScheduleLogsBySchedule

func (q *Queries) DeleteScheduleLogsBySchedule(ctx context.Context, scheduleID pgtype.UUID) error

func (*Queries) DeleteSearchProvider

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

func (*Queries) DeleteSessionDiscussCursorsByBot

func (q *Queries) DeleteSessionDiscussCursorsByBot(ctx context.Context, botID pgtype.UUID) error

func (*Queries) DeleteSessionEventsByBot

func (q *Queries) DeleteSessionEventsByBot(ctx context.Context, botID pgtype.UUID) error

func (*Queries) DeleteSettingsByBotID

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

func (*Queries) DeleteUserChannelIdentityBinding

func (q *Queries) DeleteUserChannelIdentityBinding(ctx context.Context, arg DeleteUserChannelIdentityBindingParams) error

func (*Queries) DeleteUserProviderOAuthToken

func (q *Queries) DeleteUserProviderOAuthToken(ctx context.Context, arg DeleteUserProviderOAuthTokenParams) error

func (*Queries) DisableSchedule

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

func (*Queries) EvaluateBotACLRule

func (q *Queries) EvaluateBotACLRule(ctx context.Context, arg EvaluateBotACLRuleParams) (string, error)

Mode-based ACL: only rules opposite to bots.acl_default_effect can override the default. If no matching override exists, returns bots.acl_default_effect.

func (*Queries) ExpirePendingUserRuntimes

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

Expired attempts can no longer authenticate. Mark them revoked and remove any defensive direct-API mounts so they release names and grant rows too.

func (*Queries) FailUserInputRequest

func (q *Queries) FailUserInputRequest(ctx context.Context, arg FailUserInputRequestParams) (UserInputRequest, error)

func (*Queries) FinalizeSessionRun

func (q *Queries) FinalizeSessionRun(ctx context.Context, arg FinalizeSessionRunParams) (SessionRun, error)

Fenced idempotent terminal write, shared by the owner (completed / aborted / failed) and the reaper (lost). Zero rows affected means the transition was already applied or a newer owner superseded this token; neither is an error.

func (*Queries) FindActiveBotAgentByRuntimeProvider

func (q *Queries) FindActiveBotAgentByRuntimeProvider(ctx context.Context, arg FindActiveBotAgentByRuntimeProviderParams) (BotAgent, error)

func (*Queries) FindChatRoute

func (q *Queries) FindChatRoute(ctx context.Context, arg FindChatRouteParams) (FindChatRouteRow, error)

func (*Queries) FindWorkspaceDependencyIcon added in v0.20.0

func (*Queries) FinishBotDependencyOperation added in v0.20.0

func (q *Queries) FinishBotDependencyOperation(ctx context.Context, arg FinishBotDependencyOperationParams) (BotDependencyInstallation, error)

func (*Queries) ForkSessionFromAssistantTurn

The fork copies the source's visible history through the target turn. It returns the fork's id, the ids of the source rows it copied beside the ids of their copies, in the same order, and the source position of the target turn. The caller gives the fork the history checkpoint that holds for the copy.

func (*Queries) GetAccountByIdentity

func (q *Queries) GetAccountByIdentity(ctx context.Context, identity pgtype.Text) (TeamAccount, error)

func (*Queries) GetAccountByUserID

func (q *Queries) GetAccountByUserID(ctx context.Context, userID pgtype.UUID) (TeamAccount, error)

func (*Queries) GetActiveBotAgentByID

func (q *Queries) GetActiveBotAgentByID(ctx context.Context, arg GetActiveBotAgentByIDParams) (BotAgent, error)

func (*Queries) GetActiveHistoryCheckpoint added in v1.0.0

func (q *Queries) GetActiveHistoryCheckpoint(ctx context.Context, sessionID pgtype.UUID) (BotHistoryCheckpoint, error)

The session's active checkpoint; no row when its whole history is context.

func (*Queries) GetActiveSessionRun

func (q *Queries) GetActiveSessionRun(ctx context.Context, sessionID pgtype.UUID) (SessionRun, error)

func (*Queries) GetAgentAuthorization added in v0.20.0

func (q *Queries) GetAgentAuthorization(ctx context.Context, arg GetAgentAuthorizationParams) (AgentAuthorization, error)

func (*Queries) GetAgentCredential added in v0.20.0

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

func (*Queries) GetBotACLDefaultEffect

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

func (*Queries) GetBotAgentByID

func (q *Queries) GetBotAgentByID(ctx context.Context, arg GetBotAgentByIDParams) (BotAgent, error)

func (*Queries) GetBotAgentCredential added in v0.20.0

func (q *Queries) GetBotAgentCredential(ctx context.Context, arg GetBotAgentCredentialParams) (GetBotAgentCredentialRow, error)

func (*Queries) GetBotAgentRuntime added in v0.20.0

func (q *Queries) GetBotAgentRuntime(ctx context.Context, arg GetBotAgentRuntimeParams) (string, error)

func (*Queries) GetBotAppInstallation added in v0.20.0

func (q *Queries) GetBotAppInstallation(ctx context.Context, arg GetBotAppInstallationParams) (BotAppInstallation, error)

func (*Queries) GetBotAppInstallationByID added in v0.20.0

func (q *Queries) GetBotAppInstallationByID(ctx context.Context, arg GetBotAppInstallationByIDParams) (BotAppInstallation, error)

func (*Queries) GetBotByCreateRequestKey added in v0.21.0

The bot an earlier POST /bots with this Idempotency-Key created for the owner.

func (*Queries) GetBotByID

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

func (*Queries) GetBotByName

func (q *Queries) GetBotByName(ctx context.Context, name string) (GetBotByNameRow, error)

func (*Queries) GetBotChannelAdmin

func (q *Queries) GetBotChannelAdmin(ctx context.Context, arg GetBotChannelAdminParams) (BotChannelAdmin, error)

func (*Queries) GetBotChannelConfig

func (q *Queries) GetBotChannelConfig(ctx context.Context, arg GetBotChannelConfigParams) (BotChannelConfig, error)

func (*Queries) GetBotChannelConfigByExternalIdentity

func (q *Queries) GetBotChannelConfigByExternalIdentity(ctx context.Context, arg GetBotChannelConfigByExternalIdentityParams) (BotChannelConfig, error)

func (*Queries) GetBotDependencyInstallation added in v0.20.0

func (q *Queries) GetBotDependencyInstallation(ctx context.Context, arg GetBotDependencyInstallationParams) (BotDependencyInstallation, error)

func (*Queries) GetBotOverlayConfig

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

func (*Queries) GetBotRemoteRuntimeMount

func (*Queries) GetBotRuntimeReset

func (q *Queries) GetBotRuntimeReset(ctx context.Context, botID pgtype.UUID) (GetBotRuntimeResetRow, error)

func (*Queries) GetBotStorageBinding

func (q *Queries) GetBotStorageBinding(ctx context.Context, botID pgtype.UUID) (BotStorageBinding, error)

func (*Queries) GetBotUserGrantByID

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

func (*Queries) GetBotWorkdir

func (q *Queries) GetBotWorkdir(ctx context.Context, arg GetBotWorkdirParams) (BotWorkdir, error)

Archived rows are returned on purpose: sessions bound to an archived workdir keep resolving their working directory; callers that must refuse archived workdirs (session creation) check archived_at themselves.

func (*Queries) GetBotWorkspace added in v0.21.0

func (q *Queries) GetBotWorkspace(ctx context.Context, botID pgtype.UUID) (BotWorkspace, error)

func (*Queries) GetBotWorkspaceResourceLimits

func (q *Queries) GetBotWorkspaceResourceLimits(ctx context.Context, botID pgtype.UUID) (BotWorkspaceResourceLimit, error)

func (*Queries) GetBuiltinMemoryProvider added in v0.21.0

func (q *Queries) GetBuiltinMemoryProvider(ctx context.Context) (MemoryProvider, error)

The team's Built-in Memory configuration row: the earliest builtin row, matching the one the memory settings page has always edited.

func (*Queries) GetChannelIdentityByChannelSubject

func (q *Queries) GetChannelIdentityByChannelSubject(ctx context.Context, arg GetChannelIdentityByChannelSubjectParams) (ChannelIdentity, error)

func (*Queries) GetChannelIdentityByID

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

func (*Queries) GetChannelIdentityByIDForUpdate

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

func (*Queries) GetChannelLinkCodeByToken

func (q *Queries) GetChannelLinkCodeByToken(ctx context.Context, token string) (ChannelLinkCode, error)

func (*Queries) GetChatRouteByID

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

func (*Queries) GetConnectorByConnectionID

func (q *Queries) GetConnectorByConnectionID(ctx context.Context, arg GetConnectorByConnectionIDParams) (Connector, error)

func (*Queries) GetContainerByBotID

func (q *Queries) GetContainerByBotID(ctx context.Context, botID pgtype.UUID) (Container, error)

func (*Queries) GetContextLifecycleByRunID

func (q *Queries) GetContextLifecycleByRunID(ctx context.Context, runID pgtype.UUID) (GetContextLifecycleByRunIDRow, error)

func (*Queries) GetContextLifecycleSelectionDecisionsByRunID added in v0.20.0

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

func (*Queries) GetEffectiveBotScopeRuntimeReset

func (q *Queries) GetEffectiveBotScopeRuntimeReset(ctx context.Context, botID pgtype.UUID) (GetEffectiveBotScopeRuntimeResetRow, error)

Mirrors effectiveResetLease in internal/agent/runtime/session/types.go: a bot-scope reader is blocked by the bot lease or by ANY active session lease of that bot, because a bot-wide operation must not proceed while one of the bot's sessions is mid-reset.

func (*Queries) GetFetchProviderByID

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

func (*Queries) GetFetchProviderByName

func (q *Queries) GetFetchProviderByName(ctx context.Context, name string) (FetchProvider, error)

func (*Queries) GetForkHistoryPosition added in v1.0.0

func (q *Queries) GetForkHistoryPosition(ctx context.Context, arg GetForkHistoryPositionParams) (GetForkHistoryPositionRow, error)

The fork's position of the newest row it copied from at or before a source position.

func (*Queries) GetHistoryCheckpoint added in v1.0.0

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

func (*Queries) GetHistoryCheckpointKeptBeforeTurn added in v1.0.0

The checkpoint the session keeps once the turn's rows are replaced, which an edit or retry renders before its replacement commits; NULL when none holds. turn_found reports whether the turn has context rows to replace.

func (*Queries) GetHistoryCheckpointKeptThroughTurn added in v1.0.0

func (q *Queries) GetHistoryCheckpointKeptThroughTurn(ctx context.Context, arg GetHistoryCheckpointKeptThroughTurnParams) (BotHistoryCheckpoint, error)

The checkpoint a fork of the session through a turn takes: the newest on the session's active chain that accounts for no history after that turn.

func (*Queries) GetHistoryTurnByID

func (q *Queries) GetHistoryTurnByID(ctx context.Context, arg GetHistoryTurnByIDParams) (GetHistoryTurnByIDRow, error)

func (*Queries) GetInteractiveUserInputRequest added in v0.20.0

func (q *Queries) GetInteractiveUserInputRequest(ctx context.Context, arg GetInteractiveUserInputRequestParams) (UserInputRequest, error)

Channel-native controls may advance the interaction without carrying the runtime fence. The eventual submit remains fence-protected; this lookup only admits a live, pending request in the requested bot scope.

func (*Queries) GetLatestAssistantContextLifecycleByRunID

func (q *Queries) GetLatestAssistantContextLifecycleByRunID(ctx context.Context, runID pgtype.UUID) (GetLatestAssistantContextLifecycleByRunIDRow, error)

func (*Queries) GetLatestAssistantContextLifecycleMetadataByRunID

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

func (*Queries) GetLatestAssistantUsage

func (q *Queries) GetLatestAssistantUsage(ctx context.Context, sessionID pgtype.UUID) (int64, error)

func (*Queries) GetLatestContextLifecycleBySession added in v0.20.0

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

func (*Queries) GetLatestInputEstimateSample added in v1.0.0

The input tokens the provider counted for the latest native step of the session on a model, beside what the run's estimate priced that step's request at. Only the session's latest assistant rows are looked at: a calibration older than them describes content the session moved past.

func (*Queries) GetLatestPendingToolApprovalBySession

func (q *Queries) GetLatestPendingToolApprovalBySession(ctx context.Context, arg GetLatestPendingToolApprovalBySessionParams) (ToolApprovalRequest, error)

func (*Queries) GetLatestPendingUserInputBySession

func (q *Queries) GetLatestPendingUserInputBySession(ctx context.Context, arg GetLatestPendingUserInputBySessionParams) (UserInputRequest, error)

func (*Queries) GetLatestSessionIDByBot

func (q *Queries) GetLatestSessionIDByBot(ctx context.Context, botID pgtype.UUID) (pgtype.UUID, error)

func (*Queries) GetLatestSessionModelID

func (q *Queries) GetLatestSessionModelID(ctx context.Context, sessionID pgtype.UUID) (pgtype.UUID, error)

func (*Queries) GetLatestSessionModelPreference added in v0.20.0

Welcome composer seed: the bot's most recent native user-facing session that has a persisted pair, created by the CURRENT user (multi-member bots must not seed one member's welcome from another member's pick). Native = model runtime, chat/discuss mode, user visibility; subagent/schedule/ACP sessions never seed.

func (*Queries) GetLatestSessionRun

func (q *Queries) GetLatestSessionRun(ctx context.Context, sessionID pgtype.UUID) (SessionRun, error)

The latest run, reported only while it belongs to the session's current runtime generation. Clearing history and deleting the session move bot_sessions.runtime_fencing_token past the token of every run claimed before them, and a run a history reset ended, or retired before it was ever claimed, carries history_reset. Such a run has nothing left to report, and no older run stands in for it; nor has any run of a deleted session.

func (*Queries) GetLatestVisibleHistoryTurnBySession

func (q *Queries) GetLatestVisibleHistoryTurnBySession(ctx context.Context, sessionID pgtype.UUID) (GetLatestVisibleHistoryTurnBySessionRow, error)

func (*Queries) GetMCPConnectionByID

func (q *Queries) GetMCPConnectionByID(ctx context.Context, arg GetMCPConnectionByIDParams) (McpConnection, error)

func (*Queries) GetMCPOAuthToken

func (q *Queries) GetMCPOAuthToken(ctx context.Context, connectionID pgtype.UUID) (McpOauthToken, error)

func (*Queries) GetMCPOAuthTokenByState

func (q *Queries) GetMCPOAuthTokenByState(ctx context.Context, stateParam string) (McpOauthToken, error)

func (*Queries) GetMemoryNode

func (q *Queries) GetMemoryNode(ctx context.Context, arg GetMemoryNodeParams) (MemoryNode, error)

func (*Queries) GetMemoryProviderByID

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

func (*Queries) GetMemoryTokenUsageByDay added in v0.21.0

func (q *Queries) GetMemoryTokenUsageByDay(ctx context.Context, arg GetMemoryTokenUsageByDayParams) ([]GetMemoryTokenUsageByDayRow, error)

func (*Queries) GetMemoryTokenUsageByModel added in v0.21.0

func (q *Queries) GetMemoryTokenUsageByModel(ctx context.Context, arg GetMemoryTokenUsageByModelParams) ([]GetMemoryTokenUsageByModelRow, error)

func (*Queries) GetMessageByIDBySession

func (q *Queries) GetMessageByIDBySession(ctx context.Context, arg GetMessageByIDBySessionParams) (GetMessageByIDBySessionRow, error)

func (*Queries) GetModelByID

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

func (*Queries) GetModelByModelID

func (q *Queries) GetModelByModelID(ctx context.Context, modelID string) (Model, error)

func (*Queries) GetModelByProviderAndModelID

func (q *Queries) GetModelByProviderAndModelID(ctx context.Context, arg GetModelByProviderAndModelIDParams) (Model, error)

func (*Queries) GetPendingToolApprovalByReplyMessage

func (q *Queries) GetPendingToolApprovalByReplyMessage(ctx context.Context, arg GetPendingToolApprovalByReplyMessageParams) (ToolApprovalRequest, error)

func (*Queries) GetPendingToolApprovalBySessionShortID

func (q *Queries) GetPendingToolApprovalBySessionShortID(ctx context.Context, arg GetPendingToolApprovalBySessionShortIDParams) (ToolApprovalRequest, error)

func (*Queries) GetPendingUserInputByReplyMessage

func (q *Queries) GetPendingUserInputByReplyMessage(ctx context.Context, arg GetPendingUserInputByReplyMessageParams) (UserInputRequest, error)

func (*Queries) GetPendingUserInputBySessionShortID

func (q *Queries) GetPendingUserInputBySessionShortID(ctx context.Context, arg GetPendingUserInputBySessionShortIDParams) (UserInputRequest, error)

func (*Queries) GetPrimaryBotRemoteRuntimeMount

func (q *Queries) GetPrimaryBotRemoteRuntimeMount(ctx context.Context, botID pgtype.UUID) (GetPrimaryBotRemoteRuntimeMountRow, error)

func (*Queries) GetProviderByClientType

func (q *Queries) GetProviderByClientType(ctx context.Context, clientType string) (Provider, error)

func (*Queries) GetProviderByID

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

func (*Queries) GetProviderByName

func (q *Queries) GetProviderByName(ctx context.Context, name string) (Provider, error)

func (*Queries) GetProviderOAuthTokenByProvider

func (q *Queries) GetProviderOAuthTokenByProvider(ctx context.Context, providerID pgtype.UUID) (ProviderOauthToken, error)

func (*Queries) GetProviderOAuthTokenByState

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

func (*Queries) GetProviderTemplateByID

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

func (*Queries) GetRespondableUserInputRequest

func (q *Queries) GetRespondableUserInputRequest(ctx context.Context, arg GetRespondableUserInputRequestParams) (UserInputRequest, error)

func (*Queries) GetRunHistoryTurnRequestMessageID added in v1.0.0

func (q *Queries) GetRunHistoryTurnRequestMessageID(ctx context.Context, arg GetRunHistoryTurnRequestMessageIDParams) (pgtype.UUID, error)

Resolve the most recent applied input of this run, including steer turns.

func (*Queries) GetRuntimeConfigEpoch added in v0.20.0

func (q *Queries) GetRuntimeConfigEpoch(ctx context.Context, arg GetRuntimeConfigEpochParams) (GetRuntimeConfigEpochRow, error)

A handle records this pair before its process starts. Bound resolution and every prompt compare it again, so a reset on another server invalidates idle and unbound processes that have no active session_run to route to.

func (*Queries) GetRuntimeLeadingUserMessageID added in v0.20.0

func (q *Queries) GetRuntimeLeadingUserMessageID(ctx context.Context, arg GetRuntimeLeadingUserMessageIDParams) (pgtype.UUID, error)

Reconcile the single eager user row after an uncertain COMMIT. The caller first waits on the session row in a separate statement, so no row here is a definitive rollback rather than an observation racing the old backend.

func (*Queries) GetRuntimeRoundOutcome added in v0.20.0

func (q *Queries) GetRuntimeRoundOutcome(ctx context.Context, arg GetRuntimeRoundOutcomeParams) (string, error)

Read the terminal runtime outcome for commit-unknown reconciliation after the caller has first waited on the session write lock.

func (*Queries) GetScheduleByID

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

func (*Queries) GetSearchProviderByID

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

func (*Queries) GetSearchProviderByName

func (q *Queries) GetSearchProviderByName(ctx context.Context, name string) (SearchProvider, error)

func (*Queries) GetSessionByID

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

func (*Queries) GetSessionCacheStats

func (q *Queries) GetSessionCacheStats(ctx context.Context, sessionID pgtype.UUID) (GetSessionCacheStatsRow, error)

func (*Queries) GetSessionDiscussCursor

func (q *Queries) GetSessionDiscussCursor(ctx context.Context, arg GetSessionDiscussCursorParams) (BotSessionDiscussCursor, error)

func (*Queries) GetSessionRun

func (q *Queries) GetSessionRun(ctx context.Context, runID pgtype.UUID) (SessionRun, error)

func (*Queries) GetSessionRunByInvocation

func (q *Queries) GetSessionRunByInvocation(ctx context.Context, arg GetSessionRunByInvocationParams) (SessionRun, error)

func (*Queries) GetSessionUsedSkills

func (q *Queries) GetSessionUsedSkills(ctx context.Context, sessionID pgtype.UUID) ([]string, error)

func (*Queries) GetSettingsByBotID

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

func (*Queries) GetSnapshotByContainerAndRuntimeName

func (q *Queries) GetSnapshotByContainerAndRuntimeName(ctx context.Context, arg GetSnapshotByContainerAndRuntimeNameParams) (Snapshot, error)

func (*Queries) GetSpeechModelWithProvider

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

func (*Queries) GetStorageProviderByID

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

func (*Queries) GetStorageProviderByName

func (q *Queries) GetStorageProviderByName(ctx context.Context, name string) (StorageProvider, error)

func (*Queries) GetSubagentConfig

func (q *Queries) GetSubagentConfig(ctx context.Context, sessionID pgtype.UUID) (SubagentConfig, error)

func (*Queries) GetTokenUsageByDayAndType

func (q *Queries) GetTokenUsageByDayAndType(ctx context.Context, arg GetTokenUsageByDayAndTypeParams) ([]GetTokenUsageByDayAndTypeRow, error)

func (*Queries) GetTokenUsageByModel

func (q *Queries) GetTokenUsageByModel(ctx context.Context, arg GetTokenUsageByModelParams) ([]GetTokenUsageByModelRow, error)

func (*Queries) GetToolApprovalRequest

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

func (*Queries) GetTranscriptionModelWithProvider

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

func (*Queries) GetTurnAgentTurnID added in v0.20.0

func (q *Queries) GetTurnAgentTurnID(ctx context.Context, arg GetTurnAgentTurnIDParams) (string, error)

The anchor for turn-level runtime operations (codex thread/fork lastTurnId): the newest assistant message of the turn that recorded one.

func (*Queries) GetUserByID

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

func (*Queries) GetUserChannelBinding

func (q *Queries) GetUserChannelBinding(ctx context.Context, arg GetUserChannelBindingParams) (UserChannelBinding, error)

func (*Queries) GetUserInputRequest

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

func (*Queries) GetUserInputRequestBySessionToolCall

func (q *Queries) GetUserInputRequestBySessionToolCall(ctx context.Context, arg GetUserInputRequestBySessionToolCallParams) (UserInputRequest, error)

func (*Queries) GetUserProviderOAuthToken

func (q *Queries) GetUserProviderOAuthToken(ctx context.Context, arg GetUserProviderOAuthTokenParams) (UserProviderOauthToken, error)

func (*Queries) GetUserProviderOAuthTokenByState

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

func (*Queries) GetUserRuntimeByAPIToken

func (q *Queries) GetUserRuntimeByAPIToken(ctx context.Context, apiToken string) (UserRuntime, error)

func (*Queries) GetVersionSnapshotRuntimeName

func (q *Queries) GetVersionSnapshotRuntimeName(ctx context.Context, arg GetVersionSnapshotRuntimeNameParams) (string, error)

func (*Queries) GetVideoModelWithProvider

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

func (*Queries) GetWorkspaceDependencyCatalog added in v0.20.0

func (q *Queries) GetWorkspaceDependencyCatalog(ctx context.Context, sourceUrl string) (WorkspaceDependencyCatalog, error)

func (*Queries) GetWorkspaceDependencyDefinition added in v0.20.0

Renew the retention lease before a caller prepares or recovers an operation. A concurrent prune either observes the renewed lease or wins first and makes this lookup fail, so an accepted preview never loses its definition to GC.

func (*Queries) HasUnmaterializedContextLifecycleMetadataBySession added in v0.20.0

func (q *Queries) HasUnmaterializedContextLifecycleMetadataBySession(ctx context.Context, sessionID pgtype.UUID) (bool, error)

func (*Queries) HideMessagesByHistoryTurn

func (q *Queries) HideMessagesByHistoryTurn(ctx context.Context, turnID pgtype.UUID) error

func (*Queries) IncrementScheduleCalls

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

func (*Queries) InsertLifecycleEvent

func (q *Queries) InsertLifecycleEvent(ctx context.Context, arg InsertLifecycleEventParams) error

func (*Queries) InsertMemoryEdge

func (q *Queries) InsertMemoryEdge(ctx context.Context, arg InsertMemoryEdgeParams) error

func (*Queries) InsertVersion

func (q *Queries) InsertVersion(ctx context.Context, arg InsertVersionParams) (ContainerVersion, error)

func (*Queries) IsInterruptedSessionRunLatest added in v0.21.0

func (q *Queries) IsInterruptedSessionRunLatest(ctx context.Context, runID pgtype.UUID) (bool, error)

Called under the same parent lock as admission. A newer accepted turn must supersede recovery even if it has already completed since discovery.

func (*Queries) LinkMessageToHistoryTurn

func (q *Queries) LinkMessageToHistoryTurn(ctx context.Context, arg LinkMessageToHistoryTurnParams) (pgtype.UUID, error)

func (*Queries) LinkUnassignedMessagesAfterHistoryTurnAssistant

func (q *Queries) LinkUnassignedMessagesAfterHistoryTurnAssistant(ctx context.Context, turnID pgtype.UUID) error

func (*Queries) ListAccessibleBots

func (q *Queries) ListAccessibleBots(ctx context.Context, ownerUserID pgtype.UUID) ([]ListAccessibleBotsRow, error)

func (*Queries) ListAccounts

func (q *Queries) ListAccounts(ctx context.Context) ([]TeamAccount, error)

func (*Queries) ListActiveSessionRunsByBot

func (q *Queries) ListActiveSessionRunsByBot(ctx context.Context, botID pgtype.UUID) ([]SessionRun, error)

func (*Queries) ListAllMessagesForBackup

func (q *Queries) ListAllMessagesForBackup(ctx context.Context, botID pgtype.UUID) ([]ListAllMessagesForBackupRow, error)

func (*Queries) ListAllProviderTemplateModels

func (q *Queries) ListAllProviderTemplateModels(ctx context.Context, providerTemplateID pgtype.UUID) ([]TemplateProviderTemplateModel, error)

func (*Queries) ListAllProviderTemplates

func (q *Queries) ListAllProviderTemplates(ctx context.Context) ([]TemplateProviderTemplate, error)

func (*Queries) ListAppConnectorRefs added in v0.20.0

func (q *Queries) ListAppConnectorRefs(ctx context.Context, installationID pgtype.UUID) ([]BotAppConnectorRef, error)

func (*Queries) ListAppConnectorRefsForBot added in v0.20.0

func (q *Queries) ListAppConnectorRefsForBot(ctx context.Context, botID pgtype.UUID) ([]ListAppConnectorRefsForBotRow, error)

func (*Queries) ListAppDependencyRefs added in v0.20.0

func (q *Queries) ListAppDependencyRefs(ctx context.Context, installationID pgtype.UUID) ([]BotAppDependencyRef, error)

func (*Queries) ListAppDependencyRefsForBot added in v0.20.0

func (q *Queries) ListAppDependencyRefsForBot(ctx context.Context, botID pgtype.UUID) ([]ListAppDependencyRefsForBotRow, error)

func (*Queries) ListAutoStartContainers

func (q *Queries) ListAutoStartContainers(ctx context.Context) ([]Container, error)

func (*Queries) ListBotACLRules

func (q *Queries) ListBotACLRules(ctx context.Context, botID pgtype.UUID) ([]ListBotACLRulesRow, error)

func (*Queries) ListBotAgents

func (q *Queries) ListBotAgents(ctx context.Context, botID pgtype.UUID) ([]BotAgent, error)

func (*Queries) ListBotAppInstallations added in v0.20.0

func (q *Queries) ListBotAppInstallations(ctx context.Context, botID pgtype.UUID) ([]BotAppInstallation, error)

func (*Queries) ListBotChannelAdmins

func (q *Queries) ListBotChannelAdmins(ctx context.Context, botID pgtype.UUID) ([]ListBotChannelAdminsRow, error)

func (*Queries) ListBotChannelConfigsByType

func (q *Queries) ListBotChannelConfigsByType(ctx context.Context, channelType string) ([]BotChannelConfig, error)

func (*Queries) ListBotDependencyInstallations added in v0.20.0

func (q *Queries) ListBotDependencyInstallations(ctx context.Context, botID pgtype.UUID) ([]BotDependencyInstallation, error)

func (*Queries) ListBotDependencyInstallationsByStatus added in v0.20.0

func (q *Queries) ListBotDependencyInstallationsByStatus(ctx context.Context, status string) ([]BotDependencyInstallation, error)

func (*Queries) ListBotRemoteRuntimeGrantsByRuntimeOwner

func (q *Queries) ListBotRemoteRuntimeGrantsByRuntimeOwner(ctx context.Context, ownerUserID pgtype.UUID) ([]ListBotRemoteRuntimeGrantsByRuntimeOwnerRow, error)

Account-level reverse lookup: every live mount held by the owner's bots. A mount can only exist while runtime.user_id = bot.owner_user_id (enforced by CreateOrUpdateBotRemoteRuntimeMount), so scoping by the bot owner covers exactly the grants on the owner's own runtimes.

func (*Queries) ListBotRemoteRuntimeMounts

func (q *Queries) ListBotRemoteRuntimeMounts(ctx context.Context, botID pgtype.UUID) ([]ListBotRemoteRuntimeMountsRow, error)

func (*Queries) ListBotSessionIDs added in v0.22.0

func (q *Queries) ListBotSessionIDs(ctx context.Context, botID pgtype.UUID) ([]pgtype.UUID, error)

Every session a bot-wide runtime reset covers, deleted ones included, as ClearHistoryByBot does.

func (*Queries) ListBotUserGrants

func (q *Queries) ListBotUserGrants(ctx context.Context, botID pgtype.UUID) ([]ListBotUserGrantsRow, error)

func (*Queries) ListBotUserGrantsForUser

func (q *Queries) ListBotUserGrantsForUser(ctx context.Context, arg ListBotUserGrantsForUserParams) ([]ListBotUserGrantsForUserRow, error)

func (*Queries) ListBotWorkdirs

func (q *Queries) ListBotWorkdirs(ctx context.Context, arg ListBotWorkdirsParams) ([]BotWorkdir, error)

func (*Queries) ListBotWorkspacesByObservedState added in v0.21.0

func (q *Queries) ListBotWorkspacesByObservedState(ctx context.Context, arg ListBotWorkspacesByObservedStateParams) ([]BotWorkspace, error)

func (*Queries) ListBotsByOwner

func (q *Queries) ListBotsByOwner(ctx context.Context, ownerUserID pgtype.UUID) ([]ListBotsByOwnerRow, error)

func (*Queries) ListChannelIdentityBindings

func (q *Queries) ListChannelIdentityBindings(ctx context.Context) ([]ListChannelIdentityBindingsRow, error)

func (*Queries) ListChannelIdentityBindingsForBot

func (q *Queries) ListChannelIdentityBindingsForBot(ctx context.Context, botID pgtype.UUID) ([]ListChannelIdentityBindingsForBotRow, error)

func (*Queries) ListChannelIdentityBindingsForUser

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

func (*Queries) ListChatRoutes

func (q *Queries) ListChatRoutes(ctx context.Context, botID pgtype.UUID) ([]ListChatRoutesRow, error)

func (*Queries) ListCompactionLogsByBot

func (q *Queries) ListCompactionLogsByBot(ctx context.Context, arg ListCompactionLogsByBotParams) ([]BotHistoryMessageCompact, error)

func (*Queries) ListConnectorsByBotID

func (q *Queries) ListConnectorsByBotID(ctx context.Context, botID pgtype.UUID) ([]Connector, error)

func (*Queries) ListEnabledModels

func (q *Queries) ListEnabledModels(ctx context.Context) ([]Model, error)

func (*Queries) ListEnabledModelsByProviderClientType

func (q *Queries) ListEnabledModelsByProviderClientType(ctx context.Context, clientType string) ([]Model, error)

func (*Queries) ListEnabledModelsByType

func (q *Queries) ListEnabledModelsByType(ctx context.Context, type_ string) ([]Model, error)

func (*Queries) ListEnabledSchedules

func (q *Queries) ListEnabledSchedules(ctx context.Context) ([]Schedule, error)

func (*Queries) ListFetchProviders

func (q *Queries) ListFetchProviders(ctx context.Context) ([]FetchProvider, error)

func (*Queries) ListFetchProvidersByProvider

func (q *Queries) ListFetchProvidersByProvider(ctx context.Context, provider string) ([]FetchProvider, error)

func (*Queries) ListHistoryCheckpointCandidatesWithinBytes added in v1.0.0

A compaction pass reads its candidates oldest first within a hard content budget: the rows the checkpoint it folds onto keeps by reference and the context rows after that checkpoint's position, before the cutoff position when set. A read takes whole call groups, a row other than a tool's and the tool rows after it that carry its calls' results, so no pass folds a call apart from a result the read left out: every group that ends within the budget, and the group that crosses it when what it reads past the budget fits max_row_bytes, so every pass can read past what it has read. The cumulative filter is evaluated before the payload join, so a read never loads more than max_bytes and max_row_bytes together. CandidateCount reports whether the prefix was truncated.

func (*Queries) ListHistoryCheckpointSpanRows added in v1.0.0

func (q *Queries) ListHistoryCheckpointSpanRows(ctx context.Context, arg ListHistoryCheckpointSpanRowsParams) ([]ListHistoryCheckpointSpanRowsRow, error)

The context rows a fold's checkpoint accounts for: the rows after its parent's position through its own, and the rows named by ids (the rows its parent keeps by reference and the rows it folds), in turn order.

func (*Queries) ListHistoryCheckpointSummaries added in v1.0.0

func (*Queries) ListHistoryMessagesAfterWithinBytes added in v1.0.0

The raw history after a checkpoint (CM-ADM-001): the context rows after its position, before the cutoff position when set, admitted newest-first until their running content byte total crosses max_bytes (the crossing row is kept, so the newest row always loads) and returned in ascending order. The walk follows the visible-session-order index and stops at the budget, so older rows are never measured, however much history the checkpoint leaves raw. truncated reports that the budget, not the window, ended the walk: context rows of the window remain older than the oldest it admitted. Only content is budgeted: full rows, metadata included, still load, so callers that need content alone use ListTurnResponseSourcesAfterWithinBytes.

func (*Queries) ListHistoryMessagesByIDs added in v1.0.0

func (q *Queries) ListHistoryMessagesByIDs(ctx context.Context, arg ListHistoryMessagesByIDsParams) ([]ListHistoryMessagesByIDsRow, error)

The rows a checkpoint keeps by reference, as context rows, in turn order.

func (*Queries) ListHistoryRowsBySources added in v1.0.0

func (q *Queries) ListHistoryRowsBySources(ctx context.Context, arg ListHistoryRowsBySourcesParams) ([]ListHistoryRowsBySourcesRow, error)

The context rows a fold reads, named by row id or by the inbound message they record, at their places in the history.

func (*Queries) ListHistoryTurnsByBot

func (q *Queries) ListHistoryTurnsByBot(ctx context.Context, botID pgtype.UUID) ([]ListHistoryTurnsByBotRow, error)

This legacy aggregate has no runtime caller; keep its diagnostic surface bounded until a concrete consumer can provide a session/keyset cursor.

func (*Queries) ListInterruptedSessionRuns added in v0.21.0

func (q *Queries) ListInterruptedSessionRuns(ctx context.Context, afterRunID pgtype.UUID) ([]SessionRun, error)

A later user turn supersedes the old intent. Admission's existing unique invocation index arbitrates concurrent startup workers without another lease.

func (*Queries) ListMCPConnectionsByBotID

func (q *Queries) ListMCPConnectionsByBotID(ctx context.Context, botID pgtype.UUID) ([]McpConnection, error)

func (*Queries) ListMemoryEdgesByBot

func (q *Queries) ListMemoryEdgesByBot(ctx context.Context, botID pgtype.UUID) ([]MemoryEdge, error)

func (*Queries) ListMemoryEdgesByRel

func (q *Queries) ListMemoryEdgesByRel(ctx context.Context, arg ListMemoryEdgesByRelParams) ([]MemoryEdge, error)

func (*Queries) ListMemoryEdgesFromNode

func (q *Queries) ListMemoryEdgesFromNode(ctx context.Context, arg ListMemoryEdgesFromNodeParams) ([]MemoryEdge, error)

func (*Queries) ListMemoryNodesByBot

func (q *Queries) ListMemoryNodesByBot(ctx context.Context, botID pgtype.UUID) ([]MemoryNode, error)

func (*Queries) ListMemoryNodesByBotLayer

func (q *Queries) ListMemoryNodesByBotLayer(ctx context.Context, arg ListMemoryNodesByBotLayerParams) ([]MemoryNode, error)

func (*Queries) ListMemoryNodesByBotProfile

func (q *Queries) ListMemoryNodesByBotProfile(ctx context.Context, arg ListMemoryNodesByBotProfileParams) ([]MemoryNode, error)

func (*Queries) ListMemoryProviders

func (q *Queries) ListMemoryProviders(ctx context.Context) ([]MemoryProvider, error)

func (*Queries) ListMessageAssets

func (q *Queries) ListMessageAssets(ctx context.Context, messageID pgtype.UUID) ([]ListMessageAssetsRow, error)

func (*Queries) ListMessageAssetsBatch

func (q *Queries) ListMessageAssetsBatch(ctx context.Context, messageIds []pgtype.UUID) ([]ListMessageAssetsBatchRow, error)

func (*Queries) ListMessages

func (q *Queries) ListMessages(ctx context.Context, botID pgtype.UUID) ([]ListMessagesRow, error)

func (*Queries) ListMessagesAfterBySession

func (q *Queries) ListMessagesAfterBySession(ctx context.Context, arg ListMessagesAfterBySessionParams) ([]ListMessagesAfterBySessionRow, error)

func (*Queries) ListMessagesBefore

func (q *Queries) ListMessagesBefore(ctx context.Context, arg ListMessagesBeforeParams) ([]ListMessagesBeforeRow, error)

func (*Queries) ListMessagesBySession

func (q *Queries) ListMessagesBySession(ctx context.Context, sessionID pgtype.UUID) ([]ListMessagesBySessionRow, error)

func (*Queries) ListMessagesLatest

func (q *Queries) ListMessagesLatest(ctx context.Context, arg ListMessagesLatestParams) ([]ListMessagesLatestRow, error)

func (*Queries) ListMessagesSince

func (q *Queries) ListMessagesSince(ctx context.Context, arg ListMessagesSinceParams) ([]ListMessagesSinceRow, error)

func (*Queries) ListMessagesSinceBySession

func (q *Queries) ListMessagesSinceBySession(ctx context.Context, arg ListMessagesSinceBySessionParams) ([]ListMessagesSinceBySessionRow, error)

func (*Queries) ListModelVariantsByModelUUID

func (q *Queries) ListModelVariantsByModelUUID(ctx context.Context, modelUuid pgtype.UUID) ([]ModelVariant, error)

func (*Queries) ListModels

func (q *Queries) ListModels(ctx context.Context) ([]Model, error)

func (*Queries) ListModelsByModelID

func (q *Queries) ListModelsByModelID(ctx context.Context, modelID string) ([]Model, error)

func (*Queries) ListModelsByProviderClientType

func (q *Queries) ListModelsByProviderClientType(ctx context.Context, clientType string) ([]Model, error)

func (*Queries) ListModelsByProviderID

func (q *Queries) ListModelsByProviderID(ctx context.Context, providerID pgtype.UUID) ([]Model, error)

func (*Queries) ListModelsByProviderIDAndType

func (q *Queries) ListModelsByProviderIDAndType(ctx context.Context, arg ListModelsByProviderIDAndTypeParams) ([]Model, error)

func (*Queries) ListModelsByType

func (q *Queries) ListModelsByType(ctx context.Context, type_ string) ([]Model, error)

func (*Queries) ListObservedConversationsByChannelType

Routes on this platform type where the bot has seen at least one message (any sender).

func (*Queries) ListOrphanedSessionRuns

func (q *Queries) ListOrphanedSessionRuns(ctx context.Context, arg ListOrphanedSessionRunsParams) ([]SessionRun, error)

Admission committed but the process died before reserving the run in the live backend. No lease exists, so these never appear as expiry candidates and no generation change implicates them. A single leader reaper reads this, so no row locking is needed.

func (*Queries) ListPendingToolApprovalsByRun added in v0.20.0

func (q *Queries) ListPendingToolApprovalsByRun(ctx context.Context, runID pgtype.UUID) ([]ToolApprovalRequest, error)

func (*Queries) ListPendingToolApprovalsBySession

func (q *Queries) ListPendingToolApprovalsBySession(ctx context.Context, arg ListPendingToolApprovalsBySessionParams) ([]ToolApprovalRequest, error)

func (*Queries) ListPendingUserInputsByRun added in v0.20.0

func (q *Queries) ListPendingUserInputsByRun(ctx context.Context, runID pgtype.UUID) ([]UserInputRequest, error)

func (*Queries) ListPendingUserInputsBySession

func (q *Queries) ListPendingUserInputsBySession(ctx context.Context, arg ListPendingUserInputsBySessionParams) ([]UserInputRequest, error)

func (*Queries) ListProviderTemplateModels

func (q *Queries) ListProviderTemplateModels(ctx context.Context, providerTemplateID pgtype.UUID) ([]TemplateProviderTemplateModel, error)

func (*Queries) ListProviderTemplates

func (q *Queries) ListProviderTemplates(ctx context.Context, domain string) ([]ListProviderTemplatesRow, error)

func (*Queries) ListProviders

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

func (*Queries) ListRunHistoryTurnRequestMessageIDs added in v1.0.0

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

Keep every applied input of a resumed run, including its steer turns.

func (*Queries) ListScheduleLogsByBot

func (q *Queries) ListScheduleLogsByBot(ctx context.Context, arg ListScheduleLogsByBotParams) ([]ListScheduleLogsByBotRow, error)

func (*Queries) ListScheduleLogsBySchedule

func (q *Queries) ListScheduleLogsBySchedule(ctx context.Context, arg ListScheduleLogsByScheduleParams) ([]ListScheduleLogsByScheduleRow, error)

func (*Queries) ListScheduleRunSessions added in v0.22.0

func (q *Queries) ListScheduleRunSessions(ctx context.Context, arg ListScheduleRunSessionsParams) ([]ListScheduleRunSessionsRow, error)

One row per fire of a schedule with the title of the session it ran in, newest first. A fire whose session was soft-deleted is dropped by the join; a hard-deleted session nulls session_id (ON DELETE SET NULL), so a NULL session on a successful fire also means "deleted" and is dropped. A failed fire with no session never got one and is kept so the failure stays visible. The keyset cursor is (started_at, id) of the last row of the previous page.

func (*Queries) ListSchedulesByBot

func (q *Queries) ListSchedulesByBot(ctx context.Context, botID pgtype.UUID) ([]Schedule, error)

func (*Queries) ListSearchProviders

func (q *Queries) ListSearchProviders(ctx context.Context) ([]SearchProvider, error)

func (*Queries) ListSearchProvidersByProvider

func (q *Queries) ListSearchProvidersByProvider(ctx context.Context, provider string) ([]SearchProvider, error)

func (*Queries) ListSessionDiscussCursorsByBot

func (q *Queries) ListSessionDiscussCursorsByBot(ctx context.Context, botID pgtype.UUID) ([]BotSessionDiscussCursor, error)

func (*Queries) ListSessionEventsByBot

func (q *Queries) ListSessionEventsByBot(ctx context.Context, botID pgtype.UUID) ([]BotSessionEvent, error)

func (*Queries) ListSessionEventsBySession

func (q *Queries) ListSessionEventsBySession(ctx context.Context, sessionID pgtype.UUID) ([]BotSessionEvent, error)

func (*Queries) ListSessionEventsBySessionAfter

func (q *Queries) ListSessionEventsBySessionAfter(ctx context.Context, arg ListSessionEventsBySessionAfterParams) ([]BotSessionEvent, error)

func (*Queries) ListSessionEventsBySessionPageBeforeWithinBytes added in v0.20.0

Replay reads newest-first with a stable keyset and a hard page-byte budget. What the session's checkpoint stands for is excluded in SQL before event_data reaches the process: every event of a message whose context rows all lie at or before the checkpoint's position without being kept by reference. A folded message that changed after its rows were written replays whole: its summary read the rows, never the change. The change is the events after the one its rows were written from or, when that cursor is unknown, an edit.

func (*Queries) ListSessionsByBot

func (q *Queries) ListSessionsByBot(ctx context.Context, botID pgtype.UUID) ([]ListSessionsByBotRow, error)

func (*Queries) ListSessionsByBotPaged

func (q *Queries) ListSessionsByBotPaged(ctx context.Context, arg ListSessionsByBotPagedParams) ([]ListSessionsByBotPagedRow, error)

Cursor uses (updated_at, id) so pages stay stable when many rows share an updated_at. Callers always pass an explicit types filter; to opt out of filtering, pass every known type. The workdir filter is three-state: disabled, "sessions of this workdir", or "sessions with no workdir" (workdir_unassigned) for the sidebar's ungrouped bucket. hide_schedule_runs drops the sessions schedule fires created (type 'schedule'), which the sidebar lists under their schedule instead, except one a schedule still runs in (existing_session target): that conversation stays a normal row.

func (*Queries) ListSessionsByRoute

func (q *Queries) ListSessionsByRoute(ctx context.Context, routeID pgtype.UUID) ([]BotSession, error)

func (*Queries) ListSnapshotsByContainerID

func (q *Queries) ListSnapshotsByContainerID(ctx context.Context, containerID string) ([]Snapshot, error)

func (*Queries) ListSnapshotsWithVersionByContainerID

func (q *Queries) ListSnapshotsWithVersionByContainerID(ctx context.Context, containerID string) ([]ListSnapshotsWithVersionByContainerIDRow, error)

func (*Queries) ListSpeechModels

func (q *Queries) ListSpeechModels(ctx context.Context) ([]ListSpeechModelsRow, error)

func (*Queries) ListSpeechModelsByProviderID

func (q *Queries) ListSpeechModelsByProviderID(ctx context.Context, providerID pgtype.UUID) ([]Model, error)

func (*Queries) ListSpeechProviders

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

func (*Queries) ListStaleBotDependencyOperations added in v0.20.0

func (q *Queries) ListStaleBotDependencyOperations(ctx context.Context, olderThanSeconds float64) ([]BotDependencyInstallation, error)

func (*Queries) ListStaleGenerationSessionRuns

func (q *Queries) ListStaleGenerationSessionRuns(ctx context.Context, arg ListStaleGenerationSessionRunsParams) ([]SessionRun, error)

Fail-closed recovery sweep. Matching on "not the current generation" rather than one specific old value means a backend lost twice in quick succession cannot strand rows from the older incarnation. Orphans are excluded by live_generation IS NOT NULL: they were never claimed.

A NULL cursor means "start from the beginning" and must be spelled out: the keyset comparison below is NULL for every row when the cursor is NULL, so without this branch the first batch of every sweep matches nothing, and a sweep that never returns a full batch never advances past it either.

func (*Queries) ListStorageProviders

func (q *Queries) ListStorageProviders(ctx context.Context) ([]StorageProvider, error)

func (*Queries) ListSubagentForkContext

func (q *Queries) ListSubagentForkContext(ctx context.Context, sessionID pgtype.UUID) ([]ListSubagentForkContextRow, error)

func (*Queries) ListSubagentSessionsByParent

func (q *Queries) ListSubagentSessionsByParent(ctx context.Context, parentSessionID pgtype.UUID) ([]BotSession, error)

func (*Queries) ListTerminalSessionRunsNeedingContextLifecycle

func (q *Queries) ListTerminalSessionRunsNeedingContextLifecycle(ctx context.Context, batchSize int32) ([]ListTerminalSessionRunsNeedingContextLifecycleRow, error)

func (*Queries) ListTokenUsageRecords

func (q *Queries) ListTokenUsageRecords(ctx context.Context, arg ListTokenUsageRecordsParams) ([]ListTokenUsageRecordsRow, error)

Memory LLM calls (bot_memory_usage) are not chat messages; they join the list as session_type 'memory' so one page/offset spans both sources.

func (*Queries) ListToolApprovalsByBotIDs added in v1.0.0

func (q *Queries) ListToolApprovalsByBotIDs(ctx context.Context, arg ListToolApprovalsByBotIDsParams) ([]ToolApprovalRequest, error)

func (*Queries) ListToolApprovalsByRun added in v0.20.0

func (q *Queries) ListToolApprovalsByRun(ctx context.Context, runID pgtype.UUID) ([]ToolApprovalRequest, error)

Finalization must also reconcile terminal decisions whose live event was lost.

func (*Queries) ListToolApprovalsBySession

func (q *Queries) ListToolApprovalsBySession(ctx context.Context, arg ListToolApprovalsBySessionParams) ([]ToolApprovalRequest, error)

func (*Queries) ListToolApprovalsBySessionToolCalls

func (q *Queries) ListToolApprovalsBySessionToolCalls(ctx context.Context, arg ListToolApprovalsBySessionToolCallsParams) ([]ToolApprovalRequest, error)

func (*Queries) ListTranscriptionModels

func (q *Queries) ListTranscriptionModels(ctx context.Context) ([]ListTranscriptionModelsRow, error)

func (*Queries) ListTranscriptionModelsByProviderID

func (q *Queries) ListTranscriptionModelsByProviderID(ctx context.Context, providerID pgtype.UUID) ([]Model, error)

func (*Queries) ListTranscriptionProviders

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

func (*Queries) ListTurnResponseSourcesAfterWithinBytes added in v1.0.0

Turn-response (TR) composition, in Discuss and in pipeline chat, only needs content, the interrupted-checkpoint flag and the Discuss step flag. Never return full metadata: legacy context_lifecycle snapshots can dwarf the content budget. Walk as ListHistoryMessagesAfterWithinBytes walks, including its crossing row, turn order and truncated.

func (*Queries) ListTurnResponseSourcesByIDs added in v1.0.0

func (q *Queries) ListTurnResponseSourcesByIDs(ctx context.Context, arg ListTurnResponseSourcesByIDsParams) ([]ListTurnResponseSourcesByIDsRow, error)

The turn-response projection of the rows a checkpoint keeps by reference, with the inbound message a user row records: timeline composition renders that message's segment for it.

func (*Queries) ListUserChannelBindingsByPlatform

func (q *Queries) ListUserChannelBindingsByPlatform(ctx context.Context, channelType string) ([]UserChannelBinding, error)

func (*Queries) ListUserIDsByChannelIdentity

func (q *Queries) ListUserIDsByChannelIdentity(ctx context.Context, channelIdentityID pgtype.UUID) ([]pgtype.UUID, error)

func (*Queries) ListUserInputsByBotIDs added in v1.0.0

func (q *Queries) ListUserInputsByBotIDs(ctx context.Context, arg ListUserInputsByBotIDsParams) ([]UserInputRequest, error)

func (*Queries) ListUserInputsByRun added in v0.20.0

func (q *Queries) ListUserInputsByRun(ctx context.Context, runID pgtype.UUID) ([]UserInputRequest, error)

Include expired and terminal rows when reconciling a finished run's decisions.

func (*Queries) ListUserInputsBySession

func (q *Queries) ListUserInputsBySession(ctx context.Context, arg ListUserInputsBySessionParams) ([]UserInputRequest, error)

func (*Queries) ListUserInputsBySessionToolCalls

func (q *Queries) ListUserInputsBySessionToolCalls(ctx context.Context, arg ListUserInputsBySessionToolCallsParams) ([]UserInputRequest, error)

func (*Queries) ListUserRuntimes

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

func (*Queries) ListVersionsByContainerID

func (q *Queries) ListVersionsByContainerID(ctx context.Context, containerID string) ([]ListVersionsByContainerIDRow, error)

func (*Queries) ListVideoModels

func (q *Queries) ListVideoModels(ctx context.Context) ([]ListVideoModelsRow, error)

func (*Queries) ListVideoModelsByProviderID

func (q *Queries) ListVideoModelsByProviderID(ctx context.Context, providerID pgtype.UUID) ([]Model, error)

func (*Queries) ListVideoProviders

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

func (*Queries) LockActiveSessionRunForHistoryReset

func (q *Queries) LockActiveSessionRunForHistoryReset(ctx context.Context, arg LockActiveSessionRunForHistoryResetParams) (SessionRun, error)

The reset finalizer already holds the bot parent lock. Locking the target run in a fresh statement makes the old fencing token/state an atomic predicate for advancing the session persistence fence and terminalizing it.

func (*Queries) LockAgentAuthorizationOwner added in v0.20.0

func (q *Queries) LockAgentAuthorizationOwner(ctx context.Context, ownerUserID string) error

func (*Queries) LockBotForAgentMutation

func (q *Queries) LockBotForAgentMutation(ctx context.Context, botID pgtype.UUID) (pgtype.UUID, error)

func (*Queries) LockBotForRuntimeReset

func (q *Queries) LockBotForRuntimeReset(ctx context.Context, botID pgtype.UUID) (pgtype.UUID, error)

This is intentionally a separate statement from acquisition. Under READ COMMITTED, a contender that waited here gets a fresh statement snapshot for the child/gate check below after the parent owner commits.

func (*Queries) LockBotForSessionRunClaim

func (q *Queries) LockBotForSessionRunClaim(ctx context.Context, botID pgtype.UUID) (pgtype.UUID, error)

Claim uses a real transaction and a fresh statement after this parent lock. Reset acquisition takes the same lock, so neither can cross the other's committed gate using a statement snapshot captured while waiting.

func (*Queries) LockBotForSessionWrite

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

func (*Queries) LockHistoryTurnAppendByRequest

func (q *Queries) LockHistoryTurnAppendByRequest(ctx context.Context, arg LockHistoryTurnAppendByRequestParams) error

func (*Queries) LockHistoryTurnReplacementSession added in v1.0.0

func (q *Queries) LockHistoryTurnReplacementSession(ctx context.Context, arg LockHistoryTurnReplacementSessionParams) (pgtype.UUID, error)

Serialize target validation and first replacement writes with other history mutations. Deleted sessions cannot accept a new attempt.

func (*Queries) LockSessionDecisionSequence

func (q *Queries) LockSessionDecisionSequence(ctx context.Context, arg LockSessionDecisionSequenceParams) (pgtype.UUID, error)

func (*Queries) LockSessionForCommitReconciliation

func (q *Queries) LockSessionForCommitReconciliation(ctx context.Context, arg LockSessionForCommitReconciliationParams) (pgtype.UUID, error)

Commit-unknown reconciliation must wait for the original writer even when a concurrent reset has soft-deleted the session. A missing row after this lock attempt is terminal (the session was hard-deleted and its history cascaded), not a transient condition to retry forever.

func (*Queries) LockSessionForFork added in v1.0.0

func (q *Queries) LockSessionForFork(ctx context.Context, sessionID pgtype.UUID) error

A fork reads its source under the source's share lock: a fold in flight commits first, and a later one waits, so the rows the fork copies and the checkpoint it takes are one state of the source.

func (*Queries) LockSessionRunForAgentStepCommit

func (q *Queries) LockSessionRunForAgentStepCommit(ctx context.Context, arg LockSessionRunForAgentStepCommitParams) (pgtype.UUID, error)

Complete steps must precede abort intent; interrupted checkpoints only need the same active owner because some cancellation paths do not record intent.

func (*Queries) LockSessionRuntimeFence

func (q *Queries) LockSessionRuntimeFence(ctx context.Context, arg LockSessionRuntimeFenceParams) (int64, error)

func (*Queries) LockSessionRuntimeFenceForActivation

func (q *Queries) LockSessionRuntimeFenceForActivation(ctx context.Context, arg LockSessionRuntimeFenceForActivationParams) (int64, error)

func (*Queries) MarkChannelLinkCodeConsumed

func (q *Queries) MarkChannelLinkCodeConsumed(ctx context.Context, arg MarkChannelLinkCodeConsumedParams) (ChannelLinkCode, error)

func (*Queries) MarkSessionRunDecisionExecuting added in v0.21.0

func (q *Queries) MarkSessionRunDecisionExecuting(ctx context.Context, arg MarkSessionRunDecisionExecutingParams) (int64, error)

Checkpoint before invoking an approved tool; interruption is an uncertain result, never authorization to execute the approved operation a second time.

func (*Queries) MeasureHistoryMessagesAfter added in v1.0.0

Metadata-only context admission measure (CM-ADM-001) of the raw history after a checkpoint: counts and content bytes aggregate on the database side, so admission can size it without shipping any payload.

func (*Queries) NextSessionEventCursor

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

func (*Queries) NextSessionRunFencingToken

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

func (*Queries) NextSessionRuntimeFenceToken

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

func (*Queries) NextVersion

func (q *Queries) NextVersion(ctx context.Context, containerID string) (int32, error)

func (*Queries) PrepareSessionRunFinish added in v0.20.0

func (q *Queries) PrepareSessionRunFinish(ctx context.Context, arg PrepareSessionRunFinishParams) (SessionRun, error)

Persist the terminal proposal before the live projection enters finishing. Replays preserve the first proposal. A concurrent abort intent wins so an owner cannot complete a run after the user has durably requested its stop.

func (*Queries) PruneAgentAuthorizations added in v0.20.0

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

func (*Queries) PruneWorkspaceDependencyDefinitions added in v0.20.0

func (q *Queries) PruneWorkspaceDependencyDefinitions(ctx context.Context, sourceUrl string) (int64, error)

Keep current/retired catalog publications and every revision of dependencies with installation intent: rollback state can refer to an earlier publication from another source after the operator switches registries. The grace period also protects previews and concurrently prepared operations.

func (*Queries) ReclaimWaitingDecisionSessionRun

func (q *Queries) ReclaimWaitingDecisionSessionRun(ctx context.Context, arg ReclaimWaitingDecisionSessionRunParams) (SessionRun, error)

Recovery advances both durable ownership and the backend incarnation while preserving waiting_decision. The previous token is the CAS guard; the new token must be strictly newer so a stale reaper can never move ownership backwards.

func (*Queries) RedeemChannelLinkCode

func (*Queries) RefreshLockedBotRuntimeReset

func (q *Queries) RefreshLockedBotRuntimeReset(ctx context.Context, arg RefreshLockedBotRuntimeResetParams) (pgtype.Timestamptz, error)

The caller holds the bot parent lock and validated this token before a potentially long protected mutation. Token-only CAS may refresh an expiry that elapsed while that same transaction prevented every successor.

func (*Queries) RefreshLockedBotSessionRuntimeReset

func (q *Queries) RefreshLockedBotSessionRuntimeReset(ctx context.Context, arg RefreshLockedBotSessionRuntimeResetParams) (pgtype.Timestamptz, error)

func (*Queries) RejectToolApprovalRequest

func (q *Queries) RejectToolApprovalRequest(ctx context.Context, arg RejectToolApprovalRequestParams) (ToolApprovalRequest, error)

func (*Queries) ReleaseBotRuntimeReset

func (q *Queries) ReleaseBotRuntimeReset(ctx context.Context, arg ReleaseBotRuntimeResetParams) (pgtype.UUID, error)

func (*Queries) ReleaseBotSessionRuntimeReset

func (q *Queries) ReleaseBotSessionRuntimeReset(ctx context.Context, arg ReleaseBotSessionRuntimeResetParams) (pgtype.UUID, error)

func (*Queries) ReleaseBotWorkspaceLease added in v0.21.0

func (q *Queries) ReleaseBotWorkspaceLease(ctx context.Context, arg ReleaseBotWorkspaceLeaseParams) (int64, error)

func (*Queries) ReleasePendingCompactionLogsBySession added in v1.0.0

func (q *Queries) ReleasePendingCompactionLogsBySession(ctx context.Context, arg ReleasePendingCompactionLogsBySessionParams) error

A new runtime owner settles the passes its predecessors left pending: their writes are fenced out, so those passes can never commit.

func (*Queries) RemoveMember

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

func (*Queries) RenameBotWorkdir

func (q *Queries) RenameBotWorkdir(ctx context.Context, arg RenameBotWorkdirParams) (BotWorkdir, error)

func (*Queries) RenewBotRuntimeReset

func (q *Queries) RenewBotRuntimeReset(ctx context.Context, arg RenewBotRuntimeResetParams) (pgtype.Timestamptz, error)

func (*Queries) RenewBotSessionRuntimeReset

func (q *Queries) RenewBotSessionRuntimeReset(ctx context.Context, arg RenewBotSessionRuntimeResetParams) (pgtype.Timestamptz, error)

func (*Queries) RenewBotWorkspaceLease added in v0.21.0

func (q *Queries) RenewBotWorkspaceLease(ctx context.Context, arg RenewBotWorkspaceLeaseParams) (int64, error)

func (*Queries) ReplaceHistoryTurn

func (q *Queries) ReplaceHistoryTurn(ctx context.Context, arg ReplaceHistoryTurnParams) (ReplaceHistoryTurnRow, error)

func (*Queries) RequestSessionRunAbort

func (q *Queries) RequestSessionRunAbort(ctx context.Context, runID pgtype.UUID) (SessionRun, error)

Not fenced: abort is a user intent that may arrive at any instance, and the owner applies it. Repeating it keeps the first request time.

func (*Queries) ResumeSessionRun

func (q *Queries) ResumeSessionRun(ctx context.Context, arg ResumeSessionRunParams) (SessionRun, error)

func (*Queries) RetireInterruptedSessionRun added in v0.21.0

func (q *Queries) RetireInterruptedSessionRun(ctx context.Context, runID pgtype.UUID) (int64, error)

Drops a resume intent that can never continue: its budget expired, its saved context is unsupported, or its credential scope was revoked.

func (*Queries) RetireSupersededInterruptedSessionRuns added in v0.21.0

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

Drops the resume intent of interrupted runs a later turn has answered or whose session was deleted. Interrupted runs stay lost forever; retiring the intent keeps idx_session_runs_resume_pending limited to work that can still continue.

func (*Queries) RevokeAgentCredentialByID added in v0.20.0

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

func (*Queries) RevokeAgentCredentialsForBot added in v0.20.0

func (q *Queries) RevokeAgentCredentialsForBot(ctx context.Context, botID pgtype.UUID) error

func (*Queries) RevokeUserRuntime

func (q *Queries) RevokeUserRuntime(ctx context.Context, arg RevokeUserRuntimeParams) (UserRuntime, error)

func (*Queries) RewindHistoryCheckpointBeforeTurn added in v1.0.0

func (q *Queries) RewindHistoryCheckpointBeforeTurn(ctx context.Context, arg RewindHistoryCheckpointBeforeTurnParams) (bool, error)

An edit or retry that compacts before its first step commits rewinds the session as SelectBoundHistoryTurnReplacement will when that step replaces the turn, so its fold builds on the checkpoint the replacement keeps. It reports whether it rewound.

func (*Queries) SaveMatrixSyncSinceToken

func (q *Queries) SaveMatrixSyncSinceToken(ctx context.Context, arg SaveMatrixSyncSinceTokenParams) (int64, error)

func (*Queries) SaveSessionRunResumeContext added in v0.21.0

func (q *Queries) SaveSessionRunResumeContext(ctx context.Context, arg SaveSessionRunResumeContextParams) (int64, error)

Credentials are represented by verified claim scopes, never bearer tokens.

func (*Queries) SearchAccounts

func (q *Queries) SearchAccounts(ctx context.Context, arg SearchAccountsParams) ([]TeamAccount, error)

func (*Queries) SearchChannelIdentities

func (q *Queries) SearchChannelIdentities(ctx context.Context, arg SearchChannelIdentitiesParams) ([]ChannelIdentity, error)

func (*Queries) SearchMessages

func (q *Queries) SearchMessages(ctx context.Context, arg SearchMessagesParams) ([]SearchMessagesRow, error)

func (*Queries) SelectBoundHistoryTurnReplacement added in v1.0.0

func (q *Queries) SelectBoundHistoryTurnReplacement(ctx context.Context, arg SelectBoundHistoryTurnReplacementParams) (pgtype.UUID, error)

Both attempts already own their messages. Selection never reassigns rows or infers execution order from timestamps or random UUIDs. Hiding the old attempt rewinds the session to the newest checkpoint that does not depend on its context rows.

func (*Queries) SessionLiveForRuntimeReset

func (q *Queries) SessionLiveForRuntimeReset(ctx context.Context, arg SessionLiveForRuntimeResetParams) (bool, error)

Distinguishes "session reset lease is blocked" from "session no longer exists": an acquire loop must retry the former and fail fast on the latter.

func (*Queries) SetAppConnectorRefConnection added in v0.20.0

func (q *Queries) SetAppConnectorRefConnection(ctx context.Context, arg SetAppConnectorRefConnectionParams) (BotAppConnectorRef, error)

func (*Queries) SetBotACLDefaultEffect

func (q *Queries) SetBotACLDefaultEffect(ctx context.Context, arg SetBotACLDefaultEffectParams) error

func (*Queries) SetBotAgentCredential added in v0.20.0

func (q *Queries) SetBotAgentCredential(ctx context.Context, arg SetBotAgentCredentialParams) (pgtype.UUID, error)

func (*Queries) SetBotRemoteRuntimePrimary

func (q *Queries) SetBotRemoteRuntimePrimary(ctx context.Context, arg SetBotRemoteRuntimePrimaryParams) (int64, error)

func (*Queries) SetHistoryCheckpoint added in v1.0.0

func (q *Queries) SetHistoryCheckpoint(ctx context.Context, arg SetHistoryCheckpointParams) (int64, error)

Moves the session's active checkpoint, only from the one the caller read.

func (*Queries) SetProviderTemplateActive

func (q *Queries) SetProviderTemplateActive(ctx context.Context, arg SetProviderTemplateActiveParams) error

func (*Queries) SetProviderTemplateModelActive

func (q *Queries) SetProviderTemplateModelActive(ctx context.Context, arg SetProviderTemplateModelActiveParams) error

func (*Queries) SetRoundAgentTurnID added in v0.20.0

func (q *Queries) SetRoundAgentTurnID(ctx context.Context, arg SetRoundAgentTurnIDParams) (int64, error)

Record the runtime's own turn id on the round's assistant messages, written in the same transaction as the round so an anchor never outlives a round that failed to commit. Message metadata is the anchor's home because a fork copies messages (metadata included) — the anchor follows the turn into the fork with no extra bookkeeping.

func (*Queries) SetRouteActiveSession

func (q *Queries) SetRouteActiveSession(ctx context.Context, arg SetRouteActiveSessionParams) error

func (*Queries) SetSessionNextTurnPosition

func (q *Queries) SetSessionNextTurnPosition(ctx context.Context, arg SetSessionNextTurnPositionParams) error

func (*Queries) SetSessionRunWaitingDecision

func (q *Queries) SetSessionRunWaitingDecision(ctx context.Context, arg SetSessionRunWaitingDecisionParams) (SessionRun, error)

func (*Queries) SoftDeleteBotAgent

func (q *Queries) SoftDeleteBotAgent(ctx context.Context, arg SoftDeleteBotAgentParams) (BotAgent, error)

func (*Queries) SoftDeleteSession

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

The epoch and fencing bumps retire warm runtimes and in-flight runs that still hold the deleted session's previous generation.

func (*Queries) SoftDeleteSessionsByBot

func (q *Queries) SoftDeleteSessionsByBot(ctx context.Context, botID pgtype.UUID) error

Rows are locked in id order, the same order ClearHistoryByBot uses, so the two bot-wide statements cannot deadlock. The epoch and fencing bumps retire warm runtimes and in-flight runs as in SoftDeleteSession.

func (*Queries) SubmitUserInputRequest

func (q *Queries) SubmitUserInputRequest(ctx context.Context, arg SubmitUserInputRequestParams) (UserInputRequest, error)

func (*Queries) SupersedeHistoryTurn

func (q *Queries) SupersedeHistoryTurn(ctx context.Context, arg SupersedeHistoryTurnParams) (SupersedeHistoryTurnRow, error)

func (*Queries) SupersedePendingToolApprovalsBySession

func (q *Queries) SupersedePendingToolApprovalsBySession(ctx context.Context, arg SupersedePendingToolApprovalsBySessionParams) ([]ToolApprovalRequest, error)

func (*Queries) SupersedePendingUserInputsBySession

func (q *Queries) SupersedePendingUserInputsBySession(ctx context.Context, arg SupersedePendingUserInputsBySessionParams) ([]UserInputRequest, error)

func (*Queries) TouchBotActivity

func (q *Queries) TouchBotActivity(ctx context.Context, botID pgtype.UUID) error

func (*Queries) TouchSession

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

func (*Queries) UpdateAccountAdmin

func (q *Queries) UpdateAccountAdmin(ctx context.Context, arg UpdateAccountAdminParams) (UpdateAccountAdminRow, error)

func (*Queries) UpdateAccountLastLogin

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

func (*Queries) UpdateAccountPassword

func (q *Queries) UpdateAccountPassword(ctx context.Context, arg UpdateAccountPasswordParams) (pgtype.UUID, error)

func (*Queries) UpdateAccountProfile

func (q *Queries) UpdateAccountProfile(ctx context.Context, arg UpdateAccountProfileParams) (UpdateAccountProfileRow, error)

func (*Queries) UpdateAgentAuthorization added in v0.20.0

func (q *Queries) UpdateAgentAuthorization(ctx context.Context, arg UpdateAgentAuthorizationParams) (AgentAuthorization, error)

func (*Queries) UpdateBotACLRule

func (q *Queries) UpdateBotACLRule(ctx context.Context, arg UpdateBotACLRuleParams) (BotAclRule, error)

func (*Queries) UpdateBotAgent

func (q *Queries) UpdateBotAgent(ctx context.Context, arg UpdateBotAgentParams) (BotAgent, error)

func (*Queries) UpdateBotAppInstallationCheck added in v0.20.0

func (q *Queries) UpdateBotAppInstallationCheck(ctx context.Context, arg UpdateBotAppInstallationCheckParams) (BotAppInstallation, error)

func (*Queries) UpdateBotAppInstallationRelease added in v0.20.0

func (q *Queries) UpdateBotAppInstallationRelease(ctx context.Context, arg UpdateBotAppInstallationReleaseParams) (BotAppInstallation, error)

func (*Queries) UpdateBotAppInstallationStatus added in v0.20.0

func (q *Queries) UpdateBotAppInstallationStatus(ctx context.Context, arg UpdateBotAppInstallationStatusParams) (BotAppInstallation, error)

func (*Queries) UpdateBotChannelConfigDisabled

func (q *Queries) UpdateBotChannelConfigDisabled(ctx context.Context, arg UpdateBotChannelConfigDisabledParams) (BotChannelConfig, error)

func (*Queries) UpdateBotDependencyInstallationObserved added in v0.20.0

func (q *Queries) UpdateBotDependencyInstallationObserved(ctx context.Context, arg UpdateBotDependencyInstallationObservedParams) (BotDependencyInstallation, error)

func (*Queries) UpdateBotDependencyInstallationStatus added in v0.20.0

func (q *Queries) UpdateBotDependencyInstallationStatus(ctx context.Context, arg UpdateBotDependencyInstallationStatusParams) (BotDependencyInstallation, error)

func (*Queries) UpdateBotOwner

func (q *Queries) UpdateBotOwner(ctx context.Context, arg UpdateBotOwnerParams) (UpdateBotOwnerRow, error)

func (*Queries) UpdateBotProfile

func (q *Queries) UpdateBotProfile(ctx context.Context, arg UpdateBotProfileParams) (UpdateBotProfileRow, error)

The runtime config epoch invalidates warm ACP processes, so it must move only when the ACP launch configuration (the metadata 'acp' subtree) actually changes. A rename, avatar, timezone, or activation toggle must not tear down a mid-conversation runtime.

func (*Queries) UpdateBotRemoteRuntimeMountToolApproval

func (q *Queries) UpdateBotRemoteRuntimeMountToolApproval(ctx context.Context, arg UpdateBotRemoteRuntimeMountToolApprovalParams) (pgtype.UUID, error)

func (*Queries) UpdateBotStatus

func (q *Queries) UpdateBotStatus(ctx context.Context, arg UpdateBotStatusParams) error

func (*Queries) UpdateBotUserGrantPermissions

func (q *Queries) UpdateBotUserGrantPermissions(ctx context.Context, arg UpdateBotUserGrantPermissionsParams) (BotUserGrant, error)

func (*Queries) UpdateBotWorkspaceObserved added in v0.21.0

func (q *Queries) UpdateBotWorkspaceObserved(ctx context.Context, arg UpdateBotWorkspaceObservedParams) (BotWorkspace, error)

Write an observation. The lease must still be held by the caller; the version pins the row the caller read so a concurrent intent bump is not silently overwritten (the caller re-reads and re-decides instead).

func (*Queries) UpdateChatRouteMetadata

func (q *Queries) UpdateChatRouteMetadata(ctx context.Context, arg UpdateChatRouteMetadataParams) error

func (*Queries) UpdateChatRouteReplyTarget

func (q *Queries) UpdateChatRouteReplyTarget(ctx context.Context, arg UpdateChatRouteReplyTargetParams) error

func (*Queries) UpdateConnectorEnabled

func (q *Queries) UpdateConnectorEnabled(ctx context.Context, arg UpdateConnectorEnabledParams) (int64, error)

func (*Queries) UpdateContainerStarted

func (q *Queries) UpdateContainerStarted(ctx context.Context, botID pgtype.UUID) error

func (*Queries) UpdateContainerStatus

func (q *Queries) UpdateContainerStatus(ctx context.Context, arg UpdateContainerStatusParams) error

func (*Queries) UpdateContainerStopped

func (q *Queries) UpdateContainerStopped(ctx context.Context, botID pgtype.UUID) error

func (*Queries) UpdateFetchProvider

func (q *Queries) UpdateFetchProvider(ctx context.Context, arg UpdateFetchProviderParams) (FetchProvider, error)

func (*Queries) UpdateMCPConnection

func (q *Queries) UpdateMCPConnection(ctx context.Context, arg UpdateMCPConnectionParams) (McpConnection, error)

func (*Queries) UpdateMCPConnectionActive

func (q *Queries) UpdateMCPConnectionActive(ctx context.Context, arg UpdateMCPConnectionActiveParams) error

func (*Queries) UpdateMCPConnectionAuthType

func (q *Queries) UpdateMCPConnectionAuthType(ctx context.Context, arg UpdateMCPConnectionAuthTypeParams) error

func (*Queries) UpdateMCPConnectionProbeResult

func (q *Queries) UpdateMCPConnectionProbeResult(ctx context.Context, arg UpdateMCPConnectionProbeResultParams) error

func (*Queries) UpdateMCPOAuthClientSecret

func (q *Queries) UpdateMCPOAuthClientSecret(ctx context.Context, arg UpdateMCPOAuthClientSecretParams) error

func (*Queries) UpdateMCPOAuthPKCEState

func (q *Queries) UpdateMCPOAuthPKCEState(ctx context.Context, arg UpdateMCPOAuthPKCEStateParams) error

func (*Queries) UpdateMCPOAuthTokens

func (q *Queries) UpdateMCPOAuthTokens(ctx context.Context, arg UpdateMCPOAuthTokensParams) error

func (*Queries) UpdateMemoryProvider

func (q *Queries) UpdateMemoryProvider(ctx context.Context, arg UpdateMemoryProviderParams) (MemoryProvider, error)

func (*Queries) UpdateModel

func (q *Queries) UpdateModel(ctx context.Context, arg UpdateModelParams) (Model, error)

func (*Queries) UpdateProvider

func (q *Queries) UpdateProvider(ctx context.Context, arg UpdateProviderParams) (Provider, error)

func (*Queries) UpdateProviderOAuthState

func (q *Queries) UpdateProviderOAuthState(ctx context.Context, arg UpdateProviderOAuthStateParams) error

func (*Queries) UpdateSchedule

func (q *Queries) UpdateSchedule(ctx context.Context, arg UpdateScheduleParams) (Schedule, error)

func (*Queries) UpdateSearchProvider

func (q *Queries) UpdateSearchProvider(ctx context.Context, arg UpdateSearchProviderParams) (SearchProvider, error)

func (*Queries) UpdateSessionMetadata

func (q *Queries) UpdateSessionMetadata(ctx context.Context, arg UpdateSessionMetadataParams) (BotSession, error)

func (*Queries) UpdateSessionMetadataWithRuntimeFence

func (q *Queries) UpdateSessionMetadataWithRuntimeFence(ctx context.Context, arg UpdateSessionMetadataWithRuntimeFenceParams) (BotSession, error)

func (*Queries) UpdateSessionModelPreference added in v0.20.0

func (q *Queries) UpdateSessionModelPreference(ctx context.Context, arg UpdateSessionModelPreferenceParams) error

Preference write-back (issue #879). Deliberately does NOT touch updated_at: sidebar recency must not move on picker changes or per-turn write-backs. The explicit team predicate matches every other query in this file (defense-in-depth under FORCE RLS), and the deleted_at guard keeps late writes out of soft-deleted sessions.

func (*Queries) UpdateSessionRuntimeMetadata added in v0.20.0

func (q *Queries) UpdateSessionRuntimeMetadata(ctx context.Context, arg UpdateSessionRuntimeMetadataParams) (BotSession, error)

The runtime_type guard makes the merge a no-op when the session was concurrently switched to another runtime: driver-owned keys must never be written into a session that no longer belongs to that driver. The fencing guard rejects a superseded owner's late write: after a cluster ownership handoff the old owner's turn still finishes and reports its runtime metadata, and letting it land would point the session at a stale runtime thread. A NULL token skips the guard for callers outside any run.

func (*Queries) UpdateSessionTitle

func (q *Queries) UpdateSessionTitle(ctx context.Context, arg UpdateSessionTitleParams) (BotSession, error)

func (*Queries) UpdateSessionTitleWithRuntimeFence

func (q *Queries) UpdateSessionTitleWithRuntimeFence(ctx context.Context, arg UpdateSessionTitleWithRuntimeFenceParams) (BotSession, error)

func (*Queries) UpdateSessionTypeAndMetadata

func (q *Queries) UpdateSessionTypeAndMetadata(ctx context.Context, arg UpdateSessionTypeAndMetadataParams) (BotSession, error)

A different runtime or Agent owns a different model namespace. Clear the old preference and invalidate pending picker writes when changing it.

func (*Queries) UpdateToolApprovalPromptMessage

func (q *Queries) UpdateToolApprovalPromptMessage(ctx context.Context, arg UpdateToolApprovalPromptMessageParams) (ToolApprovalRequest, error)

func (*Queries) UpdateUserInputAssistantMessage

func (q *Queries) UpdateUserInputAssistantMessage(ctx context.Context, arg UpdateUserInputAssistantMessageParams) (UserInputRequest, error)

func (*Queries) UpdateUserInputInteraction

func (q *Queries) UpdateUserInputInteraction(ctx context.Context, arg UpdateUserInputInteractionParams) (UserInputRequest, error)

func (*Queries) UpdateUserInputPromptMessage

func (q *Queries) UpdateUserInputPromptMessage(ctx context.Context, arg UpdateUserInputPromptMessageParams) (UserInputRequest, error)

func (*Queries) UpdateUserInputToolResultMessage

func (q *Queries) UpdateUserInputToolResultMessage(ctx context.Context, arg UpdateUserInputToolResultMessageParams) (UserInputRequest, error)

func (*Queries) UpdateUserProviderOAuthState

func (q *Queries) UpdateUserProviderOAuthState(ctx context.Context, arg UpdateUserProviderOAuthStateParams) error

func (*Queries) UpgradeModelConfig added in v1.0.0

func (q *Queries) UpgradeModelConfig(ctx context.Context, arg UpgradeModelConfigParams) (int64, error)

Writes back a config upgraded to the current schema version. It only replaces the exact config that was read, so a write made in between wins, and it leaves updated_at alone because nobody edited the model.

func (*Queries) UpsertAccountByUsername

func (q *Queries) UpsertAccountByUsername(ctx context.Context, arg UpsertAccountByUsernameParams) (UpsertAccountByUsernameRow, error)

func (*Queries) UpsertAppConnectorRef added in v0.20.0

func (q *Queries) UpsertAppConnectorRef(ctx context.Context, arg UpsertAppConnectorRefParams) (BotAppConnectorRef, error)

func (*Queries) UpsertAppDependencyRef added in v0.20.0

func (q *Queries) UpsertAppDependencyRef(ctx context.Context, arg UpsertAppDependencyRefParams) (BotAppDependencyRef, error)

func (*Queries) UpsertBotAppInstallation added in v0.20.0

func (q *Queries) UpsertBotAppInstallation(ctx context.Context, arg UpsertBotAppInstallationParams) (BotAppInstallation, error)

func (*Queries) UpsertBotChannelAdmin

func (q *Queries) UpsertBotChannelAdmin(ctx context.Context, arg UpsertBotChannelAdminParams) (BotChannelAdmin, error)

func (*Queries) UpsertBotChannelConfig

func (q *Queries) UpsertBotChannelConfig(ctx context.Context, arg UpsertBotChannelConfigParams) (BotChannelConfig, error)

func (*Queries) UpsertBotDependencyInstallationIntent added in v0.20.0

func (q *Queries) UpsertBotDependencyInstallationIntent(ctx context.Context, arg UpsertBotDependencyInstallationIntentParams) (BotDependencyInstallation, error)

func (*Queries) UpsertBotSettings

func (q *Queries) UpsertBotSettings(ctx context.Context, arg UpsertBotSettingsParams) (UpsertBotSettingsRow, error)

func (*Queries) UpsertBotStorageBinding

func (q *Queries) UpsertBotStorageBinding(ctx context.Context, arg UpsertBotStorageBindingParams) (BotStorageBinding, error)

func (*Queries) UpsertBotWorkspaceIntent added in v0.21.0

func (q *Queries) UpsertBotWorkspaceIntent(ctx context.Context, arg UpsertBotWorkspaceIntentParams) (BotWorkspace, error)

Declarative workspace state. Intent columns are written by the API layer; observation columns and the lease are written by the reconciler only. Record a new intent for the bot's workspace. A new row starts at generation 1; an existing row bumps the generation, keeps the previous image when none is given, resets the retry budget and makes the row due now.

func (*Queries) UpsertChannelIdentityByChannelSubject

func (q *Queries) UpsertChannelIdentityByChannelSubject(ctx context.Context, arg UpsertChannelIdentityByChannelSubjectParams) (ChannelIdentity, error)

func (*Queries) UpsertContainer

func (q *Queries) UpsertContainer(ctx context.Context, arg UpsertContainerParams) error

func (*Queries) UpsertMCPConnectionByName

func (q *Queries) UpsertMCPConnectionByName(ctx context.Context, arg UpsertMCPConnectionByNameParams) (McpConnection, error)

func (*Queries) UpsertMCPOAuthDiscovery

func (q *Queries) UpsertMCPOAuthDiscovery(ctx context.Context, arg UpsertMCPOAuthDiscoveryParams) (McpOauthToken, error)

func (*Queries) UpsertMemoryNode

func (q *Queries) UpsertMemoryNode(ctx context.Context, arg UpsertMemoryNodeParams) (MemoryNode, error)

func (*Queries) UpsertProviderOAuthToken

func (q *Queries) UpsertProviderOAuthToken(ctx context.Context, arg UpsertProviderOAuthTokenParams) (ProviderOauthToken, error)

func (*Queries) UpsertProviderTemplate

func (q *Queries) UpsertProviderTemplate(ctx context.Context, arg UpsertProviderTemplateParams) (TemplateProviderTemplate, error)

func (*Queries) UpsertRegistryModel

func (q *Queries) UpsertRegistryModel(ctx context.Context, arg UpsertRegistryModelParams) (Model, error)

func (*Queries) UpsertRegistryProvider

func (q *Queries) UpsertRegistryProvider(ctx context.Context, arg UpsertRegistryProviderParams) (Provider, error)

func (*Queries) UpsertSessionDiscussCursor

func (q *Queries) UpsertSessionDiscussCursor(ctx context.Context, arg UpsertSessionDiscussCursorParams) (BotSessionDiscussCursor, error)

func (*Queries) UpsertSnapshot

func (q *Queries) UpsertSnapshot(ctx context.Context, arg UpsertSnapshotParams) (Snapshot, error)

func (*Queries) UpsertUserChannelBinding

func (q *Queries) UpsertUserChannelBinding(ctx context.Context, arg UpsertUserChannelBindingParams) (UserChannelBinding, error)

func (*Queries) UpsertUserProviderOAuthToken

func (q *Queries) UpsertUserProviderOAuthToken(ctx context.Context, arg UpsertUserProviderOAuthTokenParams) (UserProviderOauthToken, error)

Legacy per-user OAuth storage retained for rollback compatibility. Active provider OAuth flows do not read or write these rows.

func (*Queries) ValidateLockedBotRuntimeReset

func (q *Queries) ValidateLockedBotRuntimeReset(ctx context.Context, arg ValidateLockedBotRuntimeResetParams) (pgtype.UUID, error)

func (*Queries) ValidateLockedBotSessionRuntimeReset

func (q *Queries) ValidateLockedBotSessionRuntimeReset(ctx context.Context, arg ValidateLockedBotSessionRuntimeResetParams) (pgtype.UUID, error)

func (*Queries) WithTx

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

type ReclaimWaitingDecisionSessionRunParams

type ReclaimWaitingDecisionSessionRunParams struct {
	OwnerID              pgtype.Text `json:"owner_id"`
	NewFencingToken      int64       `json:"new_fencing_token"`
	LiveGeneration       pgtype.Text `json:"live_generation"`
	RunID                pgtype.UUID `json:"run_id"`
	PreviousFencingToken int64       `json:"previous_fencing_token"`
}

type RedeemChannelLinkCodeParams

type RedeemChannelLinkCodeParams struct {
	Token             string      `json:"token"`
	ChannelIdentityID pgtype.UUID `json:"channel_identity_id"`
}

type RefreshLockedBotRuntimeResetParams

type RefreshLockedBotRuntimeResetParams struct {
	LeaseMilliseconds int64       `json:"lease_milliseconds"`
	BotID             pgtype.UUID `json:"bot_id"`
	ResetToken        pgtype.UUID `json:"reset_token"`
}

type RefreshLockedBotSessionRuntimeResetParams

type RefreshLockedBotSessionRuntimeResetParams struct {
	LeaseMilliseconds int64       `json:"lease_milliseconds"`
	SessionID         pgtype.UUID `json:"session_id"`
	BotID             pgtype.UUID `json:"bot_id"`
	ResetToken        pgtype.UUID `json:"reset_token"`
}

type RejectToolApprovalRequestParams

type RejectToolApprovalRequestParams struct {
	Reason                     string      `json:"reason"`
	SelectedOptionID           string      `json:"selected_option_id"`
	DecidedByChannelIdentityID pgtype.UUID `json:"decided_by_channel_identity_id"`
	ResponseControlID          pgtype.Text `json:"response_control_id"`
	ResponsePayloadHash        pgtype.Text `json:"response_payload_hash"`
	ID                         pgtype.UUID `json:"id"`
	RuntimeFencingToken        pgtype.Int8 `json:"runtime_fencing_token"`
}

type ReleaseBotRuntimeResetParams

type ReleaseBotRuntimeResetParams struct {
	BotID      pgtype.UUID `json:"bot_id"`
	ResetToken pgtype.UUID `json:"reset_token"`
}

type ReleaseBotSessionRuntimeResetParams

type ReleaseBotSessionRuntimeResetParams struct {
	SessionID  pgtype.UUID `json:"session_id"`
	BotID      pgtype.UUID `json:"bot_id"`
	ResetToken pgtype.UUID `json:"reset_token"`
}

type ReleaseBotWorkspaceLeaseParams added in v0.21.0

type ReleaseBotWorkspaceLeaseParams struct {
	BotID      pgtype.UUID `json:"bot_id"`
	LeaseOwner string      `json:"lease_owner"`
}

type ReleasePendingCompactionLogsBySessionParams added in v1.0.0

type ReleasePendingCompactionLogsBySessionParams struct {
	BotID     pgtype.UUID `json:"bot_id"`
	SessionID pgtype.UUID `json:"session_id"`
}

type RenameBotWorkdirParams

type RenameBotWorkdirParams struct {
	Name      string      `json:"name"`
	BotID     pgtype.UUID `json:"bot_id"`
	WorkdirID pgtype.UUID `json:"workdir_id"`
}

type RenewBotRuntimeResetParams

type RenewBotRuntimeResetParams struct {
	LeaseMilliseconds int64       `json:"lease_milliseconds"`
	BotID             pgtype.UUID `json:"bot_id"`
	ResetToken        pgtype.UUID `json:"reset_token"`
}

type RenewBotSessionRuntimeResetParams

type RenewBotSessionRuntimeResetParams struct {
	LeaseMilliseconds int64       `json:"lease_milliseconds"`
	SessionID         pgtype.UUID `json:"session_id"`
	BotID             pgtype.UUID `json:"bot_id"`
	ResetToken        pgtype.UUID `json:"reset_token"`
}

type RenewBotWorkspaceLeaseParams added in v0.21.0

type RenewBotWorkspaceLeaseParams struct {
	LeaseSeconds float64     `json:"lease_seconds"`
	BotID        pgtype.UUID `json:"bot_id"`
	LeaseOwner   string      `json:"lease_owner"`
}

type ReplaceHistoryTurnParams

type ReplaceHistoryTurnParams struct {
	SessionID           pgtype.UUID        `json:"session_id"`
	OldTurnID           pgtype.UUID        `json:"old_turn_id"`
	RequestMessageID    pgtype.UUID        `json:"request_message_id"`
	AssistantMessageID  pgtype.UUID        `json:"assistant_message_id"`
	ReplacementTurnID   pgtype.UUID        `json:"replacement_turn_id"`
	ReplacementPosition int64              `json:"replacement_position"`
	SupersededAt        pgtype.Timestamptz `json:"superseded_at"`
	SupersededReason    pgtype.Text        `json:"superseded_reason"`
}

type ReplaceHistoryTurnRow

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

type ResumeSessionRunParams

type ResumeSessionRunParams struct {
	RunID        pgtype.UUID `json:"run_id"`
	FencingToken int64       `json:"fencing_token"`
}

type RevokeUserRuntimeParams

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

type RewindHistoryCheckpointBeforeTurnParams added in v1.0.0

type RewindHistoryCheckpointBeforeTurnParams struct {
	SessionID pgtype.UUID `json:"session_id"`
	BotID     pgtype.UUID `json:"bot_id"`
	TurnID    pgtype.UUID `json:"turn_id"`
}

type SaveMatrixSyncSinceTokenParams

type SaveMatrixSyncSinceTokenParams struct {
	ID         pgtype.UUID `json:"id"`
	SinceToken string      `json:"since_token"`
}

type SaveSessionRunResumeContextParams added in v0.21.0

type SaveSessionRunResumeContextParams struct {
	ResumeContext []byte      `json:"resume_context"`
	RunID         pgtype.UUID `json:"run_id"`
	FencingToken  int64       `json:"fencing_token"`
}

type Schedule

type Schedule struct {
	MaxRunSeconds   int32              `json:"max_run_seconds"`
	ID              pgtype.UUID        `json:"id"`
	Name            string             `json:"name"`
	Description     string             `json:"description"`
	Pattern         string             `json:"pattern"`
	MaxCalls        pgtype.Int4        `json:"max_calls"`
	CurrentCalls    int32              `json:"current_calls"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
	UpdatedAt       pgtype.Timestamptz `json:"updated_at"`
	Enabled         bool               `json:"enabled"`
	Command         string             `json:"command"`
	BotID           pgtype.UUID        `json:"bot_id"`
	RunTarget       string             `json:"run_target"`
	TargetSessionID pgtype.UUID        `json:"target_session_id"`
	RuntimeType     pgtype.Text        `json:"runtime_type"`
	BotAgentID      pgtype.UUID        `json:"bot_agent_id"`
	AcpAgentID      pgtype.Text        `json:"acp_agent_id"`
	ModelID         pgtype.UUID        `json:"model_id"`
	AcpModelID      pgtype.Text        `json:"acp_model_id"`
	ReasoningEffort pgtype.Text        `json:"reasoning_effort"`
	WorkdirID       pgtype.UUID        `json:"workdir_id"`
	TeamID          pgtype.UUID        `json:"team_id"`
}

type ScheduleLog

type ScheduleLog struct {
	ID           pgtype.UUID        `json:"id"`
	ScheduleID   pgtype.UUID        `json:"schedule_id"`
	BotID        pgtype.UUID        `json:"bot_id"`
	SessionID    pgtype.UUID        `json:"session_id"`
	Status       string             `json:"status"`
	ResultText   string             `json:"result_text"`
	ErrorMessage string             `json:"error_message"`
	ErrorCode    string             `json:"error_code"`
	Usage        []byte             `json:"usage"`
	ModelID      pgtype.UUID        `json:"model_id"`
	StartedAt    pgtype.Timestamptz `json:"started_at"`
	CompletedAt  pgtype.Timestamptz `json:"completed_at"`
	TeamID       pgtype.UUID        `json:"team_id"`
}

type SearchAccountsParams

type SearchAccountsParams struct {
	Query      string `json:"query"`
	LimitCount int32  `json:"limit_count"`
}

type SearchChannelIdentitiesParams

type SearchChannelIdentitiesParams struct {
	Query      string `json:"query"`
	LimitCount int32  `json:"limit_count"`
}

type SearchMessagesParams

type SearchMessagesParams struct {
	BotID      pgtype.UUID        `json:"bot_id"`
	SessionIds []pgtype.UUID      `json:"session_ids"`
	SessionID  pgtype.UUID        `json:"session_id"`
	ContactID  pgtype.UUID        `json:"contact_id"`
	StartTime  pgtype.Timestamptz `json:"start_time"`
	EndTime    pgtype.Timestamptz `json:"end_time"`
	Role       pgtype.Text        `json:"role"`
	Keyword    pgtype.Text        `json:"keyword"`
	MaxCount   int32              `json:"max_count"`
}

type SearchMessagesRow

type SearchMessagesRow struct {
	ID                      pgtype.UUID        `json:"id"`
	BotID                   pgtype.UUID        `json:"bot_id"`
	SessionID               pgtype.UUID        `json:"session_id"`
	SenderChannelIdentityID pgtype.UUID        `json:"sender_channel_identity_id"`
	Role                    string             `json:"role"`
	Content                 []byte             `json:"content"`
	CreatedAt               pgtype.Timestamptz `json:"created_at"`
	SenderDisplayName       pgtype.Text        `json:"sender_display_name"`
	Platform                pgtype.Text        `json:"platform"`
}

type SearchProvider

type SearchProvider struct {
	ID        pgtype.UUID        `json:"id"`
	Name      string             `json:"name"`
	Provider  string             `json:"provider"`
	Config    []byte             `json:"config"`
	Enable    bool               `json:"enable"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
	TeamID    pgtype.UUID        `json:"team_id"`
}

type SelectBoundHistoryTurnReplacementParams added in v1.0.0

type SelectBoundHistoryTurnReplacementParams struct {
	BotID               pgtype.UUID `json:"bot_id"`
	SessionID           pgtype.UUID `json:"session_id"`
	ReplacementTurnID   pgtype.UUID `json:"replacement_turn_id"`
	ReplacementPosition int64       `json:"replacement_position"`
	RunID               pgtype.UUID `json:"run_id"`
	OldTurnID           pgtype.UUID `json:"old_turn_id"`
	Reason              pgtype.Text `json:"reason"`
}

type SessionLiveForRuntimeResetParams

type SessionLiveForRuntimeResetParams struct {
	SessionID pgtype.UUID `json:"session_id"`
	BotID     pgtype.UUID `json:"bot_id"`
}

type SessionRun

type SessionRun struct {
	RunID                 pgtype.UUID        `json:"run_id"`
	TeamID                pgtype.UUID        `json:"team_id"`
	BotID                 pgtype.UUID        `json:"bot_id"`
	SessionID             pgtype.UUID        `json:"session_id"`
	InvocationID          string             `json:"invocation_id"`
	TurnID                pgtype.UUID        `json:"turn_id"`
	TurnPosition          int64              `json:"turn_position"`
	State                 string             `json:"state"`
	InputJson             []byte             `json:"input_json"`
	InputFingerprint      string             `json:"input_fingerprint"`
	OwnerID               pgtype.Text        `json:"owner_id"`
	FencingToken          int64              `json:"fencing_token"`
	OwnerSince            pgtype.Timestamptz `json:"owner_since"`
	LiveGeneration        pgtype.Text        `json:"live_generation"`
	AbortRequestedAt      pgtype.Timestamptz `json:"abort_requested_at"`
	ProposedTerminalState pgtype.Text        `json:"proposed_terminal_state"`
	ProposedErrorCode     pgtype.Text        `json:"proposed_error_code"`
	ProposedErrorMessage  pgtype.Text        `json:"proposed_error_message"`
	FinishProposedAt      pgtype.Timestamptz `json:"finish_proposed_at"`
	ErrorCode             pgtype.Text        `json:"error_code"`
	ErrorMessage          pgtype.Text        `json:"error_message"`
	CreatedAt             pgtype.Timestamptz `json:"created_at"`
	UpdatedAt             pgtype.Timestamptz `json:"updated_at"`
}

type SetAppConnectorRefConnectionParams added in v0.20.0

type SetAppConnectorRefConnectionParams struct {
	ConnectionID   string      `json:"connection_id"`
	InstallationID pgtype.UUID `json:"installation_id"`
	ConnectorType  string      `json:"connector_type"`
}

type SetBotACLDefaultEffectParams

type SetBotACLDefaultEffectParams struct {
	ID               pgtype.UUID `json:"id"`
	AclDefaultEffect string      `json:"acl_default_effect"`
}

type SetBotAgentCredentialParams added in v0.20.0

type SetBotAgentCredentialParams struct {
	BotID        pgtype.UUID `json:"bot_id"`
	CredentialID pgtype.UUID `json:"credential_id"`
	BotAgentID   pgtype.UUID `json:"bot_agent_id"`
}

type SetBotRemoteRuntimePrimaryParams

type SetBotRemoteRuntimePrimaryParams struct {
	BotID    pgtype.UUID `json:"bot_id"`
	TargetID pgtype.UUID `json:"target_id"`
}

type SetHistoryCheckpointParams added in v1.0.0

type SetHistoryCheckpointParams struct {
	CheckpointID         pgtype.UUID `json:"checkpoint_id"`
	SessionID            pgtype.UUID `json:"session_id"`
	ExpectedCheckpointID pgtype.UUID `json:"expected_checkpoint_id"`
}

type SetProviderTemplateActiveParams

type SetProviderTemplateActiveParams struct {
	Active bool        `json:"active"`
	ID     pgtype.UUID `json:"id"`
}

type SetProviderTemplateModelActiveParams

type SetProviderTemplateModelActiveParams struct {
	Active bool        `json:"active"`
	ID     pgtype.UUID `json:"id"`
}

type SetRoundAgentTurnIDParams added in v0.20.0

type SetRoundAgentTurnIDParams struct {
	AgentTurnID string      `json:"agent_turn_id"`
	BotID       pgtype.UUID `json:"bot_id"`
	SessionID   pgtype.UUID `json:"session_id"`
	RunID       pgtype.UUID `json:"run_id"`
}

type SetRouteActiveSessionParams

type SetRouteActiveSessionParams struct {
	ActiveSessionID pgtype.UUID `json:"active_session_id"`
	ID              pgtype.UUID `json:"id"`
}

type SetSessionNextTurnPositionParams

type SetSessionNextTurnPositionParams struct {
	NextTurnPosition int64       `json:"next_turn_position"`
	SessionID        pgtype.UUID `json:"session_id"`
}

type SetSessionRunWaitingDecisionParams

type SetSessionRunWaitingDecisionParams struct {
	RunID        pgtype.UUID `json:"run_id"`
	FencingToken int64       `json:"fencing_token"`
}

type Snapshot

type Snapshot struct {
	ID                        pgtype.UUID        `json:"id"`
	ContainerID               string             `json:"container_id"`
	RuntimeSnapshotName       string             `json:"runtime_snapshot_name"`
	DisplayName               pgtype.Text        `json:"display_name"`
	ParentRuntimeSnapshotName pgtype.Text        `json:"parent_runtime_snapshot_name"`
	Snapshotter               string             `json:"snapshotter"`
	Source                    string             `json:"source"`
	CreatedAt                 pgtype.Timestamptz `json:"created_at"`
	TeamID                    pgtype.UUID        `json:"team_id"`
}

type SoftDeleteBotAgentParams

type SoftDeleteBotAgentParams struct {
	BotID pgtype.UUID `json:"bot_id"`
	ID    pgtype.UUID `json:"id"`
}

type StorageProvider

type StorageProvider struct {
	ID        pgtype.UUID        `json:"id"`
	Name      string             `json:"name"`
	Provider  string             `json:"provider"`
	Config    []byte             `json:"config"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
	TeamID    pgtype.UUID        `json:"team_id"`
}

type SubagentConfig

type SubagentConfig struct {
	TeamID       pgtype.UUID        `json:"team_id"`
	SessionID    pgtype.UUID        `json:"session_id"`
	ModelUuid    pgtype.UUID        `json:"model_uuid"`
	ModelID      string             `json:"model_id"`
	ProviderName string             `json:"provider_name"`
	Forked       bool               `json:"forked"`
	CreatedAt    pgtype.Timestamptz `json:"created_at"`
	UpdatedAt    pgtype.Timestamptz `json:"updated_at"`
}

type SubmitUserInputRequestParams

type SubmitUserInputRequestParams struct {
	ResultJson                   []byte      `json:"result_json"`
	RespondedByChannelIdentityID pgtype.UUID `json:"responded_by_channel_identity_id"`
	ResponseControlID            pgtype.Text `json:"response_control_id"`
	ResponsePayloadHash          pgtype.Text `json:"response_payload_hash"`
	ID                           pgtype.UUID `json:"id"`
	RuntimeFencingToken          pgtype.Int8 `json:"runtime_fencing_token"`
}

type SupersedeHistoryTurnParams

type SupersedeHistoryTurnParams struct {
	SessionID          pgtype.UUID        `json:"session_id"`
	OldTurnID          pgtype.UUID        `json:"old_turn_id"`
	SupersededByTurnID pgtype.UUID        `json:"superseded_by_turn_id"`
	SupersededAt       pgtype.Timestamptz `json:"superseded_at"`
	SupersededReason   pgtype.Text        `json:"superseded_reason"`
}

type SupersedeHistoryTurnRow

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

type SupersedePendingToolApprovalsBySessionParams

type SupersedePendingToolApprovalsBySessionParams struct {
	Reason      string        `json:"reason"`
	BotID       pgtype.UUID   `json:"bot_id"`
	SessionID   pgtype.UUID   `json:"session_id"`
	PreserveIds []pgtype.UUID `json:"preserve_ids"`
}

type SupersedePendingUserInputsBySessionParams

type SupersedePendingUserInputsBySessionParams struct {
	ResultJson  []byte        `json:"result_json"`
	BotID       pgtype.UUID   `json:"bot_id"`
	SessionID   pgtype.UUID   `json:"session_id"`
	PreserveIds []pgtype.UUID `json:"preserve_ids"`
}

type Task

type Task struct {
	ID        string             `json:"id"`
	BotID     string             `json:"bot_id"`
	Name      string             `json:"name"`
	Command   string             `json:"command"`
	Status    string             `json:"status"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
	ExecID    pgtype.Text        `json:"exec_id"`
	Pid       pgtype.Int4        `json:"pid"`
	TeamID    pgtype.UUID        `json:"team_id"`
}

type Team

type Team struct {
	ID        pgtype.UUID        `json:"id"`
	Slug      pgtype.Text        `json:"slug"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
	Metadata  []byte             `json:"metadata"`
}

type TeamAccount

type TeamAccount struct {
	ID                  pgtype.UUID        `json:"id"`
	Username            pgtype.Text        `json:"username"`
	Email               pgtype.Text        `json:"email"`
	PasswordHash        pgtype.Text        `json:"password_hash"`
	Role                string             `json:"role"`
	DisplayName         pgtype.Text        `json:"display_name"`
	AvatarUrl           pgtype.Text        `json:"avatar_url"`
	Timezone            string             `json:"timezone"`
	DataRoot            pgtype.Text        `json:"data_root"`
	LastLoginAt         pgtype.Timestamptz `json:"last_login_at"`
	IsActive            pgtype.Bool        `json:"is_active"`
	Metadata            []byte             `json:"metadata"`
	CreatedAt           pgtype.Timestamptz `json:"created_at"`
	UpdatedAt           pgtype.Timestamptz `json:"updated_at"`
	TeamID              pgtype.UUID        `json:"team_id"`
	PrincipalIsActive   bool               `json:"principal_is_active"`
	MembershipIsActive  bool               `json:"membership_is_active"`
	JoinedAt            pgtype.Timestamptz `json:"joined_at"`
	MembershipUpdatedAt pgtype.Timestamptz `json:"membership_updated_at"`
	TitleModelID        pgtype.UUID        `json:"title_model_id"`
}

type TeamMember

type TeamMember struct {
	TeamID       pgtype.UUID        `json:"team_id"`
	UserID       pgtype.UUID        `json:"user_id"`
	Role         string             `json:"role"`
	IsActive     bool               `json:"is_active"`
	DataRoot     pgtype.Text        `json:"data_root"`
	TitleModelID pgtype.UUID        `json:"title_model_id"`
	Metadata     []byte             `json:"metadata"`
	CreatedAt    pgtype.Timestamptz `json:"created_at"`
	UpdatedAt    pgtype.Timestamptz `json:"updated_at"`
}

type TemplateProviderTemplate

type TemplateProviderTemplate struct {
	ID            pgtype.UUID        `json:"id"`
	Key           string             `json:"key"`
	Domain        string             `json:"domain"`
	Name          string             `json:"name"`
	Description   string             `json:"description"`
	Icon          pgtype.Text        `json:"icon"`
	Driver        string             `json:"driver"`
	ConfigSchema  []byte             `json:"config_schema"`
	DefaultConfig []byte             `json:"default_config"`
	Metadata      []byte             `json:"metadata"`
	Source        string             `json:"source"`
	ContentHash   string             `json:"content_hash"`
	SortOrder     int32              `json:"sort_order"`
	Active        bool               `json:"active"`
	CreatedAt     pgtype.Timestamptz `json:"created_at"`
	UpdatedAt     pgtype.Timestamptz `json:"updated_at"`
}

type TemplateProviderTemplateModel

type TemplateProviderTemplateModel struct {
	ID                 pgtype.UUID        `json:"id"`
	ProviderTemplateID pgtype.UUID        `json:"provider_template_id"`
	ModelID            string             `json:"model_id"`
	Name               string             `json:"name"`
	Type               string             `json:"type"`
	Config             []byte             `json:"config"`
	Metadata           []byte             `json:"metadata"`
	SortOrder          int32              `json:"sort_order"`
	Active             bool               `json:"active"`
	CreatedAt          pgtype.Timestamptz `json:"created_at"`
	UpdatedAt          pgtype.Timestamptz `json:"updated_at"`
}

type ToolApprovalRequest

type ToolApprovalRequest struct {
	ID                           pgtype.UUID        `json:"id"`
	BotID                        pgtype.UUID        `json:"bot_id"`
	SessionID                    pgtype.UUID        `json:"session_id"`
	RouteID                      pgtype.UUID        `json:"route_id"`
	ChannelIdentityID            pgtype.UUID        `json:"channel_identity_id"`
	WorkspaceTargetID            string             `json:"workspace_target_id"`
	ToolCallID                   string             `json:"tool_call_id"`
	ToolName                     string             `json:"tool_name"`
	Operation                    string             `json:"operation"`
	ToolInput                    []byte             `json:"tool_input"`
	Options                      []byte             `json:"options"`
	SelectedOptionID             string             `json:"selected_option_id"`
	ShortID                      int32              `json:"short_id"`
	Status                       string             `json:"status"`
	RuntimeFencingToken          pgtype.Int8        `json:"runtime_fencing_token"`
	ResponseControlID            pgtype.Text        `json:"response_control_id"`
	ResponsePayloadHash          pgtype.Text        `json:"response_payload_hash"`
	DecisionReason               string             `json:"decision_reason"`
	RequestedByChannelIdentityID pgtype.UUID        `json:"requested_by_channel_identity_id"`
	DecidedByChannelIdentityID   pgtype.UUID        `json:"decided_by_channel_identity_id"`
	RequestedMessageID           pgtype.UUID        `json:"requested_message_id"`
	PromptMessageID              pgtype.UUID        `json:"prompt_message_id"`
	PromptExternalMessageID      string             `json:"prompt_external_message_id"`
	SourcePlatform               string             `json:"source_platform"`
	ReplyTarget                  string             `json:"reply_target"`
	ConversationType             string             `json:"conversation_type"`
	CreatedAt                    pgtype.Timestamptz `json:"created_at"`
	DecidedAt                    pgtype.Timestamptz `json:"decided_at"`
	TeamID                       pgtype.UUID        `json:"team_id"`
	RunID                        pgtype.UUID        `json:"run_id"`
	TurnID                       pgtype.UUID        `json:"turn_id"`
}

type TtsModel

type TtsModel struct {
	ID            pgtype.UUID        `json:"id"`
	ModelID       string             `json:"model_id"`
	Name          pgtype.Text        `json:"name"`
	TtsProviderID pgtype.UUID        `json:"tts_provider_id"`
	Config        []byte             `json:"config"`
	CreatedAt     pgtype.Timestamptz `json:"created_at"`
	UpdatedAt     pgtype.Timestamptz `json:"updated_at"`
	TeamID        pgtype.UUID        `json:"team_id"`
}

type TtsProvider

type TtsProvider struct {
	ID        pgtype.UUID        `json:"id"`
	Name      string             `json:"name"`
	Provider  string             `json:"provider"`
	Config    []byte             `json:"config"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	UpdatedAt pgtype.Timestamptz `json:"updated_at"`
	Enable    bool               `json:"enable"`
	TeamID    pgtype.UUID        `json:"team_id"`
}

type UpdateAbortedContextLifecycleSnapshotParams

type UpdateAbortedContextLifecycleSnapshotParams struct {
	Snapshot  []byte      `json:"snapshot"`
	RunID     pgtype.UUID `json:"run_id"`
	BotID     pgtype.UUID `json:"bot_id"`
	SessionID pgtype.UUID `json:"session_id"`
}

type UpdateAbortedContextLifecycleSnapshotRow added in v0.20.0

type UpdateAbortedContextLifecycleSnapshotRow struct {
	RunID     pgtype.UUID        `json:"run_id"`
	BotID     pgtype.UUID        `json:"bot_id"`
	SessionID pgtype.UUID        `json:"session_id"`
	Status    string             `json:"status"`
	ErrorCode pgtype.Text        `json:"error_code"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type UpdateAccountAdminParams

type UpdateAccountAdminParams struct {
	Role     string      `json:"role"`
	IsActive pgtype.Bool `json:"is_active"`
	UserID   pgtype.UUID `json:"user_id"`
}

type UpdateAccountAdminRow

type UpdateAccountAdminRow struct {
	ID                  pgtype.UUID        `json:"id"`
	Username            pgtype.Text        `json:"username"`
	Email               pgtype.Text        `json:"email"`
	PasswordHash        pgtype.Text        `json:"password_hash"`
	Role                string             `json:"role"`
	DisplayName         pgtype.Text        `json:"display_name"`
	AvatarUrl           pgtype.Text        `json:"avatar_url"`
	Timezone            string             `json:"timezone"`
	DataRoot            pgtype.Text        `json:"data_root"`
	LastLoginAt         pgtype.Timestamptz `json:"last_login_at"`
	IsActive            pgtype.Bool        `json:"is_active"`
	Metadata            []byte             `json:"metadata"`
	CreatedAt           pgtype.Timestamptz `json:"created_at"`
	UpdatedAt           pgtype.Timestamptz `json:"updated_at"`
	TeamID              pgtype.UUID        `json:"team_id"`
	PrincipalIsActive   bool               `json:"principal_is_active"`
	MembershipIsActive  bool               `json:"membership_is_active"`
	JoinedAt            pgtype.Timestamptz `json:"joined_at"`
	MembershipUpdatedAt pgtype.Timestamptz `json:"membership_updated_at"`
	TitleModelID        pgtype.UUID        `json:"title_model_id"`
}

type UpdateAccountPasswordParams

type UpdateAccountPasswordParams struct {
	PasswordHash pgtype.Text `json:"password_hash"`
	UserID       pgtype.UUID `json:"user_id"`
}

type UpdateAccountProfileParams

type UpdateAccountProfileParams struct {
	DisplayName  pgtype.Text `json:"display_name"`
	AvatarUrl    pgtype.Text `json:"avatar_url"`
	Timezone     string      `json:"timezone"`
	Metadata     []byte      `json:"metadata"`
	UserID       pgtype.UUID `json:"user_id"`
	TitleModelID pgtype.UUID `json:"title_model_id"`
}

type UpdateAccountProfileRow

type UpdateAccountProfileRow struct {
	ID                  pgtype.UUID        `json:"id"`
	Username            pgtype.Text        `json:"username"`
	Email               pgtype.Text        `json:"email"`
	PasswordHash        pgtype.Text        `json:"password_hash"`
	Role                string             `json:"role"`
	DisplayName         pgtype.Text        `json:"display_name"`
	AvatarUrl           pgtype.Text        `json:"avatar_url"`
	Timezone            string             `json:"timezone"`
	DataRoot            pgtype.Text        `json:"data_root"`
	LastLoginAt         pgtype.Timestamptz `json:"last_login_at"`
	IsActive            pgtype.Bool        `json:"is_active"`
	Metadata            []byte             `json:"metadata"`
	CreatedAt           pgtype.Timestamptz `json:"created_at"`
	UpdatedAt           pgtype.Timestamptz `json:"updated_at"`
	TeamID              pgtype.UUID        `json:"team_id"`
	PrincipalIsActive   bool               `json:"principal_is_active"`
	MembershipIsActive  bool               `json:"membership_is_active"`
	JoinedAt            pgtype.Timestamptz `json:"joined_at"`
	MembershipUpdatedAt pgtype.Timestamptz `json:"membership_updated_at"`
	TitleModelID        pgtype.UUID        `json:"title_model_id"`
}

type UpdateAgentAuthorizationParams added in v0.20.0

type UpdateAgentAuthorizationParams struct {
	ID               pgtype.UUID        `json:"id"`
	Status           string             `json:"status"`
	EncryptedPayload []byte             `json:"encrypted_payload"`
	EncryptionNonce  []byte             `json:"encryption_nonce"`
	ExpiresAt        pgtype.Timestamptz `json:"expires_at"`
	PollAfter        pgtype.Timestamptz `json:"poll_after"`
	ClaimedAgentID   pgtype.UUID        `json:"claimed_agent_id"`
}

type UpdateBotACLRuleParams

type UpdateBotACLRuleParams struct {
	ID                     pgtype.UUID `json:"id"`
	Enabled                bool        `json:"enabled"`
	Effect                 string      `json:"effect"`
	Description            pgtype.Text `json:"description"`
	ChannelIdentityID      pgtype.UUID `json:"channel_identity_id"`
	SubjectChannelType     pgtype.Text `json:"subject_channel_type"`
	SourceChannel          pgtype.Text `json:"source_channel"`
	SourceConversationType pgtype.Text `json:"source_conversation_type"`
	SourceConversationID   pgtype.Text `json:"source_conversation_id"`
	SourceThreadID         pgtype.Text `json:"source_thread_id"`
}

type UpdateBotAgentParams

type UpdateBotAgentParams struct {
	Name        string      `json:"name"`
	Enabled     bool        `json:"enabled"`
	MetadataSet bool        `json:"metadata_set"`
	Metadata    []byte      `json:"metadata"`
	BotID       pgtype.UUID `json:"bot_id"`
	ID          pgtype.UUID `json:"id"`
}

type UpdateBotAppInstallationCheckParams added in v0.20.0

type UpdateBotAppInstallationCheckParams struct {
	AvailableRevision string             `json:"available_revision"`
	AvailableVersion  string             `json:"available_version"`
	LastCheckedAt     pgtype.Timestamptz `json:"last_checked_at"`
	BotID             pgtype.UUID        `json:"bot_id"`
	ID                pgtype.UUID        `json:"id"`
}

type UpdateBotAppInstallationReleaseParams added in v0.20.0

type UpdateBotAppInstallationReleaseParams struct {
	Revision string      `json:"revision"`
	Version  string      `json:"version"`
	Release  []byte      `json:"release"`
	BotID    pgtype.UUID `json:"bot_id"`
	ID       pgtype.UUID `json:"id"`
}

type UpdateBotAppInstallationStatusParams added in v0.20.0

type UpdateBotAppInstallationStatusParams struct {
	Status        string      `json:"status"`
	LastErrorCode string      `json:"last_error_code"`
	BotID         pgtype.UUID `json:"bot_id"`
	ID            pgtype.UUID `json:"id"`
}

type UpdateBotChannelConfigDisabledParams

type UpdateBotChannelConfigDisabledParams struct {
	BotID       pgtype.UUID `json:"bot_id"`
	ChannelType string      `json:"channel_type"`
	Disabled    bool        `json:"disabled"`
}

type UpdateBotDependencyInstallationObservedParams added in v0.20.0

type UpdateBotDependencyInstallationObservedParams struct {
	Source             pgtype.Text        `json:"source"`
	InstalledVersion   pgtype.Text        `json:"installed_version"`
	LatestVersion      pgtype.Text        `json:"latest_version"`
	LastCheckedAt      pgtype.Timestamptz `json:"last_checked_at"`
	LastError          pgtype.Text        `json:"last_error"`
	LastErrorCode      pgtype.Text        `json:"last_error_code"`
	ManifestDigest     pgtype.Text        `json:"manifest_digest"`
	SourceUrl          pgtype.Text        `json:"source_url"`
	RegistryID         pgtype.Text        `json:"registry_id"`
	DefinitionRevision pgtype.Text        `json:"definition_revision"`
	BotID              pgtype.UUID        `json:"bot_id"`
	DependencyID       string             `json:"dependency_id"`
}

type UpdateBotDependencyInstallationStatusParams added in v0.20.0

type UpdateBotDependencyInstallationStatusParams struct {
	Status        string      `json:"status"`
	LastErrorCode string      `json:"last_error_code"`
	BotID         pgtype.UUID `json:"bot_id"`
	DependencyID  string      `json:"dependency_id"`
}

type UpdateBotOwnerParams

type UpdateBotOwnerParams struct {
	ID          pgtype.UUID `json:"id"`
	OwnerUserID pgtype.UUID `json:"owner_user_id"`
}

type UpdateBotOwnerRow

type UpdateBotOwnerRow struct {
	ID               pgtype.UUID        `json:"id"`
	OwnerUserID      pgtype.UUID        `json:"owner_user_id"`
	Name             string             `json:"name"`
	DisplayName      pgtype.Text        `json:"display_name"`
	AvatarUrl        pgtype.Text        `json:"avatar_url"`
	Timezone         pgtype.Text        `json:"timezone"`
	IsActive         bool               `json:"is_active"`
	Status           string             `json:"status"`
	ReasoningEffort  string             `json:"reasoning_effort"`
	ChatModelID      pgtype.UUID        `json:"chat_model_id"`
	SearchProviderID pgtype.UUID        `json:"search_provider_id"`
	MemoryProviderID pgtype.UUID        `json:"memory_provider_id"`
	Metadata         []byte             `json:"metadata"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
}

type UpdateBotProfileParams

type UpdateBotProfileParams struct {
	ID          pgtype.UUID `json:"id"`
	Name        string      `json:"name"`
	DisplayName pgtype.Text `json:"display_name"`
	AvatarUrl   pgtype.Text `json:"avatar_url"`
	Timezone    pgtype.Text `json:"timezone"`
	IsActive    bool        `json:"is_active"`
	Metadata    []byte      `json:"metadata"`
}

type UpdateBotProfileRow

type UpdateBotProfileRow struct {
	ID               pgtype.UUID        `json:"id"`
	OwnerUserID      pgtype.UUID        `json:"owner_user_id"`
	Name             string             `json:"name"`
	DisplayName      pgtype.Text        `json:"display_name"`
	AvatarUrl        pgtype.Text        `json:"avatar_url"`
	Timezone         pgtype.Text        `json:"timezone"`
	IsActive         bool               `json:"is_active"`
	Status           string             `json:"status"`
	ReasoningEffort  string             `json:"reasoning_effort"`
	ChatModelID      pgtype.UUID        `json:"chat_model_id"`
	SearchProviderID pgtype.UUID        `json:"search_provider_id"`
	MemoryProviderID pgtype.UUID        `json:"memory_provider_id"`
	Metadata         []byte             `json:"metadata"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
}

type UpdateBotRemoteRuntimeMountToolApprovalParams

type UpdateBotRemoteRuntimeMountToolApprovalParams struct {
	ToolApprovalConfig []byte      `json:"tool_approval_config"`
	BotID              pgtype.UUID `json:"bot_id"`
	TargetID           pgtype.UUID `json:"target_id"`
}

type UpdateBotStatusParams

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

type UpdateBotUserGrantPermissionsParams

type UpdateBotUserGrantPermissionsParams struct {
	ID          pgtype.UUID `json:"id"`
	Permissions []byte      `json:"permissions"`
}

type UpdateBotWorkspaceObservedParams added in v0.21.0

type UpdateBotWorkspaceObservedParams struct {
	ObservedState      string             `json:"observed_state"`
	ObservedGeneration int64              `json:"observed_generation"`
	MarkReady          bool               `json:"mark_ready"`
	LastError          string             `json:"last_error"`
	LastErrorCode      string             `json:"last_error_code"`
	LastErrorPhase     string             `json:"last_error_phase"`
	Attempts           int32              `json:"attempts"`
	NextAttemptAt      pgtype.Timestamptz `json:"next_attempt_at"`
	ReleaseLease       bool               `json:"release_lease"`
	BotID              pgtype.UUID        `json:"bot_id"`
	LeaseOwner         string             `json:"lease_owner"`
	ExpectedVersion    int64              `json:"expected_version"`
}

type UpdateChatRouteMetadataParams

type UpdateChatRouteMetadataParams struct {
	Metadata []byte      `json:"metadata"`
	ID       pgtype.UUID `json:"id"`
}

type UpdateChatRouteReplyTargetParams

type UpdateChatRouteReplyTargetParams struct {
	ReplyTarget pgtype.Text `json:"reply_target"`
	ID          pgtype.UUID `json:"id"`
}

type UpdateConnectorEnabledParams

type UpdateConnectorEnabledParams struct {
	BotID        pgtype.UUID `json:"bot_id"`
	ConnectionID string      `json:"connection_id"`
	Enabled      bool        `json:"enabled"`
}

type UpdateContainerStatusParams

type UpdateContainerStatusParams struct {
	Status string      `json:"status"`
	BotID  pgtype.UUID `json:"bot_id"`
}

type UpdateFetchProviderParams

type UpdateFetchProviderParams struct {
	Name     string      `json:"name"`
	Provider string      `json:"provider"`
	Config   []byte      `json:"config"`
	Enable   bool        `json:"enable"`
	ID       pgtype.UUID `json:"id"`
}

type UpdateMCPConnectionActiveParams

type UpdateMCPConnectionActiveParams struct {
	BotID    pgtype.UUID `json:"bot_id"`
	ID       pgtype.UUID `json:"id"`
	IsActive bool        `json:"is_active"`
}

type UpdateMCPConnectionAuthTypeParams

type UpdateMCPConnectionAuthTypeParams struct {
	ID       pgtype.UUID `json:"id"`
	AuthType string      `json:"auth_type"`
}

type UpdateMCPConnectionParams

type UpdateMCPConnectionParams struct {
	BotID    pgtype.UUID `json:"bot_id"`
	ID       pgtype.UUID `json:"id"`
	Name     string      `json:"name"`
	Type     string      `json:"type"`
	Config   []byte      `json:"config"`
	IsActive bool        `json:"is_active"`
	AuthType string      `json:"auth_type"`
}

type UpdateMCPConnectionProbeResultParams

type UpdateMCPConnectionProbeResultParams struct {
	BotID         pgtype.UUID `json:"bot_id"`
	ID            pgtype.UUID `json:"id"`
	Status        string      `json:"status"`
	ToolsCache    []byte      `json:"tools_cache"`
	StatusMessage string      `json:"status_message"`
}

type UpdateMCPOAuthClientSecretParams

type UpdateMCPOAuthClientSecretParams struct {
	ConnectionID pgtype.UUID `json:"connection_id"`
	ClientSecret string      `json:"client_secret"`
}

type UpdateMCPOAuthPKCEStateParams

type UpdateMCPOAuthPKCEStateParams struct {
	ConnectionID     pgtype.UUID `json:"connection_id"`
	PkceCodeVerifier string      `json:"pkce_code_verifier"`
	StateParam       string      `json:"state_param"`
	ClientID         string      `json:"client_id"`
	RedirectUri      string      `json:"redirect_uri"`
}

type UpdateMCPOAuthTokensParams

type UpdateMCPOAuthTokensParams struct {
	ConnectionID pgtype.UUID        `json:"connection_id"`
	AccessToken  string             `json:"access_token"`
	RefreshToken string             `json:"refresh_token"`
	TokenType    string             `json:"token_type"`
	ExpiresAt    pgtype.Timestamptz `json:"expires_at"`
	Scope        string             `json:"scope"`
}

type UpdateMemoryProviderParams

type UpdateMemoryProviderParams struct {
	ID     pgtype.UUID `json:"id"`
	Name   string      `json:"name"`
	Config []byte      `json:"config"`
}

type UpdateModelParams

type UpdateModelParams struct {
	ModelID    string      `json:"model_id"`
	Name       pgtype.Text `json:"name"`
	ProviderID pgtype.UUID `json:"provider_id"`
	Type       string      `json:"type"`
	Enable     bool        `json:"enable"`
	Config     []byte      `json:"config"`
	ID         pgtype.UUID `json:"id"`
}

type UpdateProviderOAuthStateParams

type UpdateProviderOAuthStateParams struct {
	ProviderID       pgtype.UUID `json:"provider_id"`
	State            string      `json:"state"`
	PkceCodeVerifier string      `json:"pkce_code_verifier"`
	Metadata         []byte      `json:"metadata"`
}

type UpdateProviderParams

type UpdateProviderParams struct {
	Name       string      `json:"name"`
	ClientType string      `json:"client_type"`
	Icon       pgtype.Text `json:"icon"`
	Enable     bool        `json:"enable"`
	Config     []byte      `json:"config"`
	Metadata   []byte      `json:"metadata"`
	ID         pgtype.UUID `json:"id"`
}

type UpdateScheduleParams

type UpdateScheduleParams struct {
	ID              pgtype.UUID `json:"id"`
	Name            string      `json:"name"`
	Description     string      `json:"description"`
	Pattern         string      `json:"pattern"`
	MaxCalls        pgtype.Int4 `json:"max_calls"`
	Enabled         bool        `json:"enabled"`
	Command         string      `json:"command"`
	RunTarget       string      `json:"run_target"`
	TargetSessionID pgtype.UUID `json:"target_session_id"`
	RuntimeType     pgtype.Text `json:"runtime_type"`
	BotAgentID      pgtype.UUID `json:"bot_agent_id"`
	AcpAgentID      pgtype.Text `json:"acp_agent_id"`
	ModelID         pgtype.UUID `json:"model_id"`
	AcpModelID      pgtype.Text `json:"acp_model_id"`
	ReasoningEffort pgtype.Text `json:"reasoning_effort"`
	WorkdirID       pgtype.UUID `json:"workdir_id"`
	MaxRunSeconds   int32       `json:"max_run_seconds"`
}

type UpdateSearchProviderParams

type UpdateSearchProviderParams struct {
	Name     string      `json:"name"`
	Provider string      `json:"provider"`
	Config   []byte      `json:"config"`
	Enable   bool        `json:"enable"`
	ID       pgtype.UUID `json:"id"`
}

type UpdateSessionMetadataParams

type UpdateSessionMetadataParams struct {
	Metadata []byte      `json:"metadata"`
	ID       pgtype.UUID `json:"id"`
}

type UpdateSessionMetadataWithRuntimeFenceParams

type UpdateSessionMetadataWithRuntimeFenceParams struct {
	Metadata            []byte      `json:"metadata"`
	ID                  pgtype.UUID `json:"id"`
	BotID               pgtype.UUID `json:"bot_id"`
	RuntimeFencingToken int64       `json:"runtime_fencing_token"`
}

type UpdateSessionModelPreferenceParams added in v0.20.0

type UpdateSessionModelPreferenceParams struct {
	ID                       pgtype.UUID `json:"id"`
	PreferredChatModelID     pgtype.UUID `json:"preferred_chat_model_id"`
	PreferredReasoningEffort pgtype.Text `json:"preferred_reasoning_effort"`
	PreferredExternalModelID pgtype.Text `json:"preferred_external_model_id"`
}

type UpdateSessionRuntimeMetadataParams added in v0.20.0

type UpdateSessionRuntimeMetadataParams struct {
	RuntimeMetadata []byte      `json:"runtime_metadata"`
	ID              pgtype.UUID `json:"id"`
	RuntimeType     string      `json:"runtime_type"`
	FencingToken    pgtype.Int8 `json:"fencing_token"`
}

type UpdateSessionTitleParams

type UpdateSessionTitleParams struct {
	Title string      `json:"title"`
	ID    pgtype.UUID `json:"id"`
}

type UpdateSessionTitleWithRuntimeFenceParams

type UpdateSessionTitleWithRuntimeFenceParams struct {
	Title               string      `json:"title"`
	ID                  pgtype.UUID `json:"id"`
	BotID               pgtype.UUID `json:"bot_id"`
	RuntimeFencingToken int64       `json:"runtime_fencing_token"`
}

type UpdateSessionTypeAndMetadataParams

type UpdateSessionTypeAndMetadataParams struct {
	Type            string      `json:"type"`
	SessionMode     string      `json:"session_mode"`
	RuntimeType     string      `json:"runtime_type"`
	BotAgentID      pgtype.UUID `json:"bot_agent_id"`
	RuntimeMetadata []byte      `json:"runtime_metadata"`
	Metadata        []byte      `json:"metadata"`
	ID              pgtype.UUID `json:"id"`
}

type UpdateToolApprovalPromptMessageParams

type UpdateToolApprovalPromptMessageParams struct {
	PromptMessageID         pgtype.UUID `json:"prompt_message_id"`
	PromptExternalMessageID string      `json:"prompt_external_message_id"`
	ID                      pgtype.UUID `json:"id"`
}

type UpdateUserInputAssistantMessageParams

type UpdateUserInputAssistantMessageParams struct {
	AssistantMessageID pgtype.UUID `json:"assistant_message_id"`
	ID                 pgtype.UUID `json:"id"`
}

type UpdateUserInputInteractionParams

type UpdateUserInputInteractionParams struct {
	InteractionJson     []byte      `json:"interaction_json"`
	ID                  pgtype.UUID `json:"id"`
	InteractionRevision int32       `json:"interaction_revision"`
}

type UpdateUserInputPromptMessageParams

type UpdateUserInputPromptMessageParams struct {
	PromptMessageID         pgtype.UUID `json:"prompt_message_id"`
	PromptExternalMessageID string      `json:"prompt_external_message_id"`
	ID                      pgtype.UUID `json:"id"`
}

type UpdateUserInputToolResultMessageParams

type UpdateUserInputToolResultMessageParams struct {
	ToolResultMessageID pgtype.UUID `json:"tool_result_message_id"`
	ID                  pgtype.UUID `json:"id"`
}

type UpdateUserProviderOAuthStateParams

type UpdateUserProviderOAuthStateParams struct {
	ProviderID       pgtype.UUID `json:"provider_id"`
	UserID           pgtype.UUID `json:"user_id"`
	State            string      `json:"state"`
	PkceCodeVerifier string      `json:"pkce_code_verifier"`
	Metadata         []byte      `json:"metadata"`
}

type UpgradeModelConfigParams added in v1.0.0

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

type UpsertAbortedContextLifecycleParams

type UpsertAbortedContextLifecycleParams struct {
	RunID     pgtype.UUID `json:"run_id"`
	BotID     pgtype.UUID `json:"bot_id"`
	SessionID pgtype.UUID `json:"session_id"`
	Snapshot  []byte      `json:"snapshot"`
}

type UpsertAbortedContextLifecycleRow added in v0.20.0

type UpsertAbortedContextLifecycleRow struct {
	RunID     pgtype.UUID        `json:"run_id"`
	BotID     pgtype.UUID        `json:"bot_id"`
	SessionID pgtype.UUID        `json:"session_id"`
	Status    string             `json:"status"`
	ErrorCode pgtype.Text        `json:"error_code"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type UpsertAccountByUsernameParams

type UpsertAccountByUsernameParams struct {
	UserID       pgtype.UUID `json:"user_id"`
	Username     pgtype.Text `json:"username"`
	Email        pgtype.Text `json:"email"`
	PasswordHash pgtype.Text `json:"password_hash"`
	DisplayName  pgtype.Text `json:"display_name"`
	AvatarUrl    pgtype.Text `json:"avatar_url"`
	IsActive     bool        `json:"is_active"`
	Role         string      `json:"role"`
	DataRoot     pgtype.Text `json:"data_root"`
}

type UpsertAccountByUsernameRow

type UpsertAccountByUsernameRow struct {
	ID                  pgtype.UUID        `json:"id"`
	Username            pgtype.Text        `json:"username"`
	Email               pgtype.Text        `json:"email"`
	PasswordHash        pgtype.Text        `json:"password_hash"`
	Role                string             `json:"role"`
	DisplayName         pgtype.Text        `json:"display_name"`
	AvatarUrl           pgtype.Text        `json:"avatar_url"`
	Timezone            string             `json:"timezone"`
	DataRoot            pgtype.Text        `json:"data_root"`
	LastLoginAt         pgtype.Timestamptz `json:"last_login_at"`
	IsActive            pgtype.Bool        `json:"is_active"`
	Metadata            []byte             `json:"metadata"`
	CreatedAt           pgtype.Timestamptz `json:"created_at"`
	UpdatedAt           pgtype.Timestamptz `json:"updated_at"`
	TeamID              pgtype.UUID        `json:"team_id"`
	PrincipalIsActive   bool               `json:"principal_is_active"`
	MembershipIsActive  bool               `json:"membership_is_active"`
	JoinedAt            pgtype.Timestamptz `json:"joined_at"`
	MembershipUpdatedAt pgtype.Timestamptz `json:"membership_updated_at"`
	TitleModelID        pgtype.UUID        `json:"title_model_id"`
}

type UpsertAppConnectorRefParams added in v0.20.0

type UpsertAppConnectorRefParams struct {
	InstallationID pgtype.UUID `json:"installation_id"`
	ConnectorType  string      `json:"connector_type"`
	ConnectionID   string      `json:"connection_id"`
	Required       bool        `json:"required"`
}

type UpsertAppDependencyRefParams added in v0.20.0

type UpsertAppDependencyRefParams struct {
	InstallationID pgtype.UUID `json:"installation_id"`
	DependencyID   string      `json:"dependency_id"`
}

type UpsertBotAppInstallationParams added in v0.20.0

type UpsertBotAppInstallationParams struct {
	BotID      pgtype.UUID `json:"bot_id"`
	RegistryID string      `json:"registry_id"`
	AppID      string      `json:"app_id"`
	Revision   string      `json:"revision"`
	Version    string      `json:"version"`
	Status     string      `json:"status"`
	Reason     string      `json:"reason"`
	Release    []byte      `json:"release"`
}

type UpsertBotChannelAdminParams

type UpsertBotChannelAdminParams struct {
	BotID             pgtype.UUID `json:"bot_id"`
	ChannelIdentityID pgtype.UUID `json:"channel_identity_id"`
	Granted           bool        `json:"granted"`
	CreatedByUserID   pgtype.UUID `json:"created_by_user_id"`
}

type UpsertBotChannelConfigParams

type UpsertBotChannelConfigParams struct {
	BotID            pgtype.UUID        `json:"bot_id"`
	ChannelType      string             `json:"channel_type"`
	Credentials      []byte             `json:"credentials"`
	ExternalIdentity pgtype.Text        `json:"external_identity"`
	SelfIdentity     []byte             `json:"self_identity"`
	Routing          []byte             `json:"routing"`
	Capabilities     []byte             `json:"capabilities"`
	Disabled         bool               `json:"disabled"`
	VerifiedAt       pgtype.Timestamptz `json:"verified_at"`
}

type UpsertBotDependencyInstallationIntentParams added in v0.20.0

type UpsertBotDependencyInstallationIntentParams struct {
	BotID              pgtype.UUID `json:"bot_id"`
	DependencyID       string      `json:"dependency_id"`
	Source             string      `json:"source"`
	Status             string      `json:"status"`
	InstalledVersion   string      `json:"installed_version"`
	ManifestDigest     string      `json:"manifest_digest"`
	SourceUrl          string      `json:"source_url"`
	RegistryID         string      `json:"registry_id"`
	DefinitionRevision string      `json:"definition_revision"`
}

type UpsertBotSettingsParams

type UpsertBotSettingsParams struct {
	ReasoningEffort         string      `json:"reasoning_effort"`
	Timezone                pgtype.Text `json:"timezone"`
	ChatModelIDSet          bool        `json:"chat_model_id_set"`
	ChatModelID             pgtype.UUID `json:"chat_model_id"`
	DefaultBotAgentIDSet    bool        `json:"default_bot_agent_id_set"`
	DefaultBotAgentID       pgtype.UUID `json:"default_bot_agent_id"`
	ChatRuntime             string      `json:"chat_runtime"`
	ChatAcpAgentID          pgtype.Text `json:"chat_acp_agent_id"`
	ChatAcpProjectPath      string      `json:"chat_acp_project_path"`
	ChatAcpProjectMode      string      `json:"chat_acp_project_mode"`
	MemoryLlmModelIDSet     bool        `json:"memory_llm_model_id_set"`
	MemoryLlmModelID        pgtype.UUID `json:"memory_llm_model_id"`
	SearchProviderIDSet     bool        `json:"search_provider_id_set"`
	SearchProviderID        pgtype.UUID `json:"search_provider_id"`
	FetchProviderIDSet      bool        `json:"fetch_provider_id_set"`
	FetchProviderID         pgtype.UUID `json:"fetch_provider_id"`
	MemoryProviderIDSet     bool        `json:"memory_provider_id_set"`
	MemoryProviderID        pgtype.UUID `json:"memory_provider_id"`
	ImageModelIDSet         bool        `json:"image_model_id_set"`
	ImageModelID            pgtype.UUID `json:"image_model_id"`
	TtsModelIDSet           bool        `json:"tts_model_id_set"`
	TtsModelID              pgtype.UUID `json:"tts_model_id"`
	TranscriptionModelIDSet bool        `json:"transcription_model_id_set"`
	TranscriptionModelID    pgtype.UUID `json:"transcription_model_id"`
	VideoModelIDSet         bool        `json:"video_model_id_set"`
	VideoModelID            pgtype.UUID `json:"video_model_id"`
	PersistFullToolResults  bool        `json:"persist_full_tool_results"`
	ShowToolCallsInIm       bool        `json:"show_tool_calls_in_im"`
	ToolApprovalConfig      []byte      `json:"tool_approval_config"`
	DisplayEnabled          bool        `json:"display_enabled"`
	OverlayProvider         string      `json:"overlay_provider"`
	OverlayEnabled          bool        `json:"overlay_enabled"`
	OverlayConfig           []byte      `json:"overlay_config"`
	CommandUiLanguage       string      `json:"command_ui_language"`
	ID                      pgtype.UUID `json:"id"`
}

type UpsertBotSettingsRow

type UpsertBotSettingsRow struct {
	BotID                  pgtype.UUID `json:"bot_id"`
	ReasoningEffort        string      `json:"reasoning_effort"`
	Timezone               pgtype.Text `json:"timezone"`
	ChatModelID            pgtype.UUID `json:"chat_model_id"`
	DefaultBotAgentID      pgtype.UUID `json:"default_bot_agent_id"`
	ChatRuntime            string      `json:"chat_runtime"`
	ChatAcpAgentID         pgtype.Text `json:"chat_acp_agent_id"`
	ChatAcpProjectPath     string      `json:"chat_acp_project_path"`
	ChatAcpProjectMode     string      `json:"chat_acp_project_mode"`
	MemoryLlmModelID       pgtype.UUID `json:"memory_llm_model_id"`
	SearchProviderID       pgtype.UUID `json:"search_provider_id"`
	FetchProviderID        pgtype.UUID `json:"fetch_provider_id"`
	MemoryProviderID       pgtype.UUID `json:"memory_provider_id"`
	ImageModelID           pgtype.UUID `json:"image_model_id"`
	TtsModelID             pgtype.UUID `json:"tts_model_id"`
	TranscriptionModelID   pgtype.UUID `json:"transcription_model_id"`
	VideoModelID           pgtype.UUID `json:"video_model_id"`
	PersistFullToolResults bool        `json:"persist_full_tool_results"`
	ShowToolCallsInIm      bool        `json:"show_tool_calls_in_im"`
	ToolApprovalConfig     []byte      `json:"tool_approval_config"`
	DisplayEnabled         bool        `json:"display_enabled"`
	OverlayProvider        string      `json:"overlay_provider"`
	OverlayEnabled         bool        `json:"overlay_enabled"`
	OverlayConfig          []byte      `json:"overlay_config"`
	CommandUiLanguage      string      `json:"command_ui_language"`
}

type UpsertBotStorageBindingParams

type UpsertBotStorageBindingParams struct {
	BotID             pgtype.UUID `json:"bot_id"`
	StorageProviderID pgtype.UUID `json:"storage_provider_id"`
	BasePath          string      `json:"base_path"`
}

type UpsertBotWorkspaceIntentParams added in v0.21.0

type UpsertBotWorkspaceIntentParams struct {
	BotID        pgtype.UUID `json:"bot_id"`
	DesiredState string      `json:"desired_state"`
	Image        string      `json:"image"`
	PreserveData bool        `json:"preserve_data"`
}

type UpsertBotWorkspaceResourceLimitsParams

type UpsertBotWorkspaceResourceLimitsParams struct {
	BotID         pgtype.UUID `json:"bot_id"`
	CpuMillicores int64       `json:"cpu_millicores"`
	MemoryBytes   int64       `json:"memory_bytes"`
	StorageBytes  int64       `json:"storage_bytes"`
}

type UpsertChannelIdentityByChannelSubjectParams

type UpsertChannelIdentityByChannelSubjectParams struct {
	ChannelType      string      `json:"channel_type"`
	ChannelSubjectID string      `json:"channel_subject_id"`
	DisplayName      pgtype.Text `json:"display_name"`
	AvatarUrl        pgtype.Text `json:"avatar_url"`
	Metadata         []byte      `json:"metadata"`
}

type UpsertContainerParams

type UpsertContainerParams struct {
	BotID            pgtype.UUID        `json:"bot_id"`
	ContainerID      string             `json:"container_id"`
	ContainerName    string             `json:"container_name"`
	Image            string             `json:"image"`
	Status           string             `json:"status"`
	Namespace        string             `json:"namespace"`
	AutoStart        bool               `json:"auto_start"`
	ContainerPath    string             `json:"container_path"`
	WorkspaceBackend string             `json:"workspace_backend"`
	LastStartedAt    pgtype.Timestamptz `json:"last_started_at"`
	LastStoppedAt    pgtype.Timestamptz `json:"last_stopped_at"`
}

type UpsertMCPConnectionByNameParams

type UpsertMCPConnectionByNameParams struct {
	BotID  pgtype.UUID `json:"bot_id"`
	Name   string      `json:"name"`
	Type   string      `json:"type"`
	Config []byte      `json:"config"`
}

type UpsertMCPOAuthDiscoveryParams

type UpsertMCPOAuthDiscoveryParams struct {
	ConnectionID           pgtype.UUID `json:"connection_id"`
	ResourceMetadataUrl    string      `json:"resource_metadata_url"`
	AuthorizationServerUrl string      `json:"authorization_server_url"`
	AuthorizationEndpoint  string      `json:"authorization_endpoint"`
	TokenEndpoint          string      `json:"token_endpoint"`
	RegistrationEndpoint   string      `json:"registration_endpoint"`
	ScopesSupported        []string    `json:"scopes_supported"`
	ResourceUri            string      `json:"resource_uri"`
}

type UpsertMemoryNodeParams

type UpsertMemoryNodeParams struct {
	ID               string             `json:"id"`
	BotID            pgtype.UUID        `json:"bot_id"`
	Body             string             `json:"body"`
	Hash             string             `json:"hash"`
	Layer            string             `json:"layer"`
	FactType         string             `json:"fact_type"`
	Subject          string             `json:"subject"`
	Confidence       float32            `json:"confidence"`
	Metadata         []byte             `json:"metadata"`
	SourceMessageIds []byte             `json:"source_message_ids"`
	ProfileRef       string             `json:"profile_ref"`
	Topic            string             `json:"topic"`
	CapturedAt       pgtype.Timestamptz `json:"captured_at"`
	ExpiresAt        pgtype.Timestamptz `json:"expires_at"`
}

type UpsertProviderOAuthTokenParams

type UpsertProviderOAuthTokenParams struct {
	ProviderID       pgtype.UUID        `json:"provider_id"`
	AccessToken      string             `json:"access_token"`
	RefreshToken     string             `json:"refresh_token"`
	ExpiresAt        pgtype.Timestamptz `json:"expires_at"`
	Scope            string             `json:"scope"`
	TokenType        string             `json:"token_type"`
	State            string             `json:"state"`
	PkceCodeVerifier string             `json:"pkce_code_verifier"`
	Metadata         []byte             `json:"metadata"`
}

type UpsertProviderTemplateModelParams

type UpsertProviderTemplateModelParams struct {
	ProviderTemplateID pgtype.UUID `json:"provider_template_id"`
	ModelID            string      `json:"model_id"`
	Name               string      `json:"name"`
	Type               string      `json:"type"`
	Config             []byte      `json:"config"`
	Metadata           []byte      `json:"metadata"`
	SortOrder          int32       `json:"sort_order"`
}

type UpsertProviderTemplateParams

type UpsertProviderTemplateParams struct {
	Key           string      `json:"key"`
	Domain        string      `json:"domain"`
	Name          string      `json:"name"`
	Description   string      `json:"description"`
	Icon          pgtype.Text `json:"icon"`
	Driver        string      `json:"driver"`
	ConfigSchema  []byte      `json:"config_schema"`
	DefaultConfig []byte      `json:"default_config"`
	Metadata      []byte      `json:"metadata"`
	Source        string      `json:"source"`
	ContentHash   string      `json:"content_hash"`
	SortOrder     int32       `json:"sort_order"`
}

type UpsertRegistryModelParams

type UpsertRegistryModelParams struct {
	ModelID    string      `json:"model_id"`
	Name       pgtype.Text `json:"name"`
	ProviderID pgtype.UUID `json:"provider_id"`
	Type       string      `json:"type"`
	Config     []byte      `json:"config"`
}

type UpsertRegistryProviderParams

type UpsertRegistryProviderParams struct {
	Name       string      `json:"name"`
	ClientType string      `json:"client_type"`
	Icon       pgtype.Text `json:"icon"`
	Config     []byte      `json:"config"`
}

type UpsertSessionDiscussCursorParams

type UpsertSessionDiscussCursorParams struct {
	SessionID           pgtype.UUID `json:"session_id"`
	ScopeKey            string      `json:"scope_key"`
	RouteID             pgtype.UUID `json:"route_id"`
	Source              string      `json:"source"`
	ConsumedCursor      int64       `json:"consumed_cursor"`
	ConsumedEventCursor int64       `json:"consumed_event_cursor"`
}

type UpsertSnapshotParams

type UpsertSnapshotParams struct {
	ContainerID               string      `json:"container_id"`
	RuntimeSnapshotName       string      `json:"runtime_snapshot_name"`
	DisplayName               pgtype.Text `json:"display_name"`
	ParentRuntimeSnapshotName pgtype.Text `json:"parent_runtime_snapshot_name"`
	Snapshotter               string      `json:"snapshotter"`
	Source                    string      `json:"source"`
}

type UpsertTerminalContextLifecycleParams

type UpsertTerminalContextLifecycleParams struct {
	RunID            pgtype.UUID `json:"run_id"`
	BotID            pgtype.UUID `json:"bot_id"`
	SessionID        pgtype.UUID `json:"session_id"`
	Status           string      `json:"status"`
	ErrorCode        pgtype.Text `json:"error_code"`
	Snapshot         []byte      `json:"snapshot"`
	ReplaceErrorCode bool        `json:"replace_error_code"`
	ReplaceSnapshot  bool        `json:"replace_snapshot"`
}

type UpsertTerminalContextLifecycleRow added in v0.20.0

type UpsertTerminalContextLifecycleRow struct {
	RunID     pgtype.UUID        `json:"run_id"`
	BotID     pgtype.UUID        `json:"bot_id"`
	SessionID pgtype.UUID        `json:"session_id"`
	Status    string             `json:"status"`
	ErrorCode pgtype.Text        `json:"error_code"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

type UpsertUserChannelBindingParams

type UpsertUserChannelBindingParams struct {
	UserID      pgtype.UUID `json:"user_id"`
	ChannelType string      `json:"channel_type"`
	Config      []byte      `json:"config"`
}

type UpsertUserChannelIdentityBindingParams

type UpsertUserChannelIdentityBindingParams struct {
	UserID            pgtype.UUID `json:"user_id"`
	ChannelIdentityID pgtype.UUID `json:"channel_identity_id"`
}

type UpsertUserProviderOAuthTokenParams

type UpsertUserProviderOAuthTokenParams struct {
	ProviderID       pgtype.UUID        `json:"provider_id"`
	UserID           pgtype.UUID        `json:"user_id"`
	AccessToken      string             `json:"access_token"`
	RefreshToken     string             `json:"refresh_token"`
	ExpiresAt        pgtype.Timestamptz `json:"expires_at"`
	Scope            string             `json:"scope"`
	TokenType        string             `json:"token_type"`
	State            string             `json:"state"`
	PkceCodeVerifier string             `json:"pkce_code_verifier"`
	Metadata         []byte             `json:"metadata"`
}

type User

type User struct {
	ID           pgtype.UUID        `json:"id"`
	Username     pgtype.Text        `json:"username"`
	Email        pgtype.Text        `json:"email"`
	PasswordHash pgtype.Text        `json:"password_hash"`
	DisplayName  pgtype.Text        `json:"display_name"`
	AvatarUrl    pgtype.Text        `json:"avatar_url"`
	Timezone     string             `json:"timezone"`
	LastLoginAt  pgtype.Timestamptz `json:"last_login_at"`
	IsActive     bool               `json:"is_active"`
	Metadata     []byte             `json:"metadata"`
	CreatedAt    pgtype.Timestamptz `json:"created_at"`
	UpdatedAt    pgtype.Timestamptz `json:"updated_at"`
}

type UserChannelBinding

type UserChannelBinding struct {
	ID          pgtype.UUID        `json:"id"`
	UserID      pgtype.UUID        `json:"user_id"`
	ChannelType string             `json:"channel_type"`
	Config      []byte             `json:"config"`
	CreatedAt   pgtype.Timestamptz `json:"created_at"`
	UpdatedAt   pgtype.Timestamptz `json:"updated_at"`
	TeamID      pgtype.UUID        `json:"team_id"`
}

type UserChannelIdentityBinding

type UserChannelIdentityBinding struct {
	ID                pgtype.UUID        `json:"id"`
	UserID            pgtype.UUID        `json:"user_id"`
	ChannelIdentityID pgtype.UUID        `json:"channel_identity_id"`
	CreatedAt         pgtype.Timestamptz `json:"created_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
	TeamID            pgtype.UUID        `json:"team_id"`
}

type UserInputRequest

type UserInputRequest struct {
	ID                           pgtype.UUID        `json:"id"`
	BotID                        pgtype.UUID        `json:"bot_id"`
	SessionID                    pgtype.UUID        `json:"session_id"`
	RouteID                      pgtype.UUID        `json:"route_id"`
	ChannelIdentityID            pgtype.UUID        `json:"channel_identity_id"`
	WorkspaceTargetID            string             `json:"workspace_target_id"`
	ToolCallID                   string             `json:"tool_call_id"`
	ToolName                     string             `json:"tool_name"`
	ShortID                      int32              `json:"short_id"`
	Status                       string             `json:"status"`
	RuntimeFencingToken          pgtype.Int8        `json:"runtime_fencing_token"`
	ResponseControlID            pgtype.Text        `json:"response_control_id"`
	ResponsePayloadHash          pgtype.Text        `json:"response_payload_hash"`
	InputJson                    []byte             `json:"input_json"`
	UiPayloadJson                []byte             `json:"ui_payload_json"`
	InteractionJson              []byte             `json:"interaction_json"`
	InteractionRevision          int32              `json:"interaction_revision"`
	ResultJson                   []byte             `json:"result_json"`
	ProviderMetadata             []byte             `json:"provider_metadata"`
	RequestedByChannelIdentityID pgtype.UUID        `json:"requested_by_channel_identity_id"`
	RespondedByChannelIdentityID pgtype.UUID        `json:"responded_by_channel_identity_id"`
	AssistantMessageID           pgtype.UUID        `json:"assistant_message_id"`
	ToolResultMessageID          pgtype.UUID        `json:"tool_result_message_id"`
	PromptMessageID              pgtype.UUID        `json:"prompt_message_id"`
	PromptExternalMessageID      string             `json:"prompt_external_message_id"`
	SourcePlatform               string             `json:"source_platform"`
	ReplyTarget                  string             `json:"reply_target"`
	ConversationType             string             `json:"conversation_type"`
	ExpiresAt                    pgtype.Timestamptz `json:"expires_at"`
	CreatedAt                    pgtype.Timestamptz `json:"created_at"`
	RespondedAt                  pgtype.Timestamptz `json:"responded_at"`
	CanceledAt                   pgtype.Timestamptz `json:"canceled_at"`
	UpdatedAt                    pgtype.Timestamptz `json:"updated_at"`
	TeamID                       pgtype.UUID        `json:"team_id"`
	RunID                        pgtype.UUID        `json:"run_id"`
	TurnID                       pgtype.UUID        `json:"turn_id"`
}

type UserProviderOauthToken

type UserProviderOauthToken struct {
	ID               pgtype.UUID        `json:"id"`
	ProviderID       pgtype.UUID        `json:"provider_id"`
	UserID           pgtype.UUID        `json:"user_id"`
	AccessToken      string             `json:"access_token"`
	RefreshToken     string             `json:"refresh_token"`
	ExpiresAt        pgtype.Timestamptz `json:"expires_at"`
	Scope            string             `json:"scope"`
	TokenType        string             `json:"token_type"`
	State            string             `json:"state"`
	PkceCodeVerifier string             `json:"pkce_code_verifier"`
	Metadata         []byte             `json:"metadata"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
	TeamID           pgtype.UUID        `json:"team_id"`
}

type UserRuntime

type UserRuntime struct {
	ID               pgtype.UUID        `json:"id"`
	UserID           pgtype.UUID        `json:"user_id"`
	Name             string             `json:"name"`
	ApiToken         string             `json:"api_token"`
	RevokedAt        pgtype.Timestamptz `json:"revoked_at"`
	ActivatedAt      pgtype.Timestamptz `json:"activated_at"`
	PendingExpiresAt pgtype.Timestamptz `json:"pending_expires_at"`
	CreatedAt        pgtype.Timestamptz `json:"created_at"`
	UpdatedAt        pgtype.Timestamptz `json:"updated_at"`
	TeamID           pgtype.UUID        `json:"team_id"`
}

type ValidateLockedBotRuntimeResetParams

type ValidateLockedBotRuntimeResetParams struct {
	BotID      pgtype.UUID `json:"bot_id"`
	ResetToken pgtype.UUID `json:"reset_token"`
}

type ValidateLockedBotSessionRuntimeResetParams

type ValidateLockedBotSessionRuntimeResetParams struct {
	BotID      pgtype.UUID `json:"bot_id"`
	SessionID  pgtype.UUID `json:"session_id"`
	ResetToken pgtype.UUID `json:"reset_token"`
}

type WorkspaceDependencyCatalog added in v0.20.0

type WorkspaceDependencyCatalog struct {
	TeamID       pgtype.UUID        `json:"team_id"`
	SourceUrl    string             `json:"source_url"`
	CatalogBytes []byte             `json:"catalog_bytes"`
	Generation   int64              `json:"generation"`
	FetchedAt    pgtype.Timestamptz `json:"fetched_at"`
}

type WorkspaceDependencyDefinition added in v0.20.0

type WorkspaceDependencyDefinition struct {
	TeamID         pgtype.UUID        `json:"team_id"`
	SourceUrl      string             `json:"source_url"`
	RegistryID     string             `json:"registry_id"`
	DependencyID   string             `json:"dependency_id"`
	Revision       string             `json:"revision"`
	ReleaseBytes   []byte             `json:"release_bytes"`
	ArtifactBytes  []byte             `json:"artifact_bytes"`
	CreatedAt      pgtype.Timestamptz `json:"created_at"`
	IconDigest     string             `json:"icon_digest"`
	LastAccessedAt pgtype.Timestamptz `json:"last_accessed_at"`
}

Jump to

Keyboard shortcuts

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