sqlc

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 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 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 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"`
	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"`
	CompactionEnabled       bool               `json:"compaction_enabled"`
	CompactionThreshold     int32              `json:"compaction_threshold"`
	CompactionTargetPercent pgtype.Int4        `json:"compaction_target_percent"`
	CompactionModelID       pgtype.UUID        `json:"compaction_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"`
}

type BotAgentIsDefaultParams

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

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 BotEmailBinding

type BotEmailBinding struct {
	ID              pgtype.UUID        `json:"id"`
	BotID           pgtype.UUID        `json:"bot_id"`
	EmailProviderID pgtype.UUID        `json:"email_provider_id"`
	EmailAddress    string             `json:"email_address"`
	CanRead         bool               `json:"can_read"`
	CanWrite        bool               `json:"can_write"`
	CanDelete       bool               `json:"can_delete"`
	Config          []byte             `json:"config"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
	UpdatedAt       pgtype.Timestamptz `json:"updated_at"`
	TeamID          pgtype.UUID        `json:"team_id"`
}

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"`
	CompactID               pgtype.UUID        `json:"compact_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"`
	ArtifactVersion int32              `json:"artifact_version"`
	Coverage        []byte             `json:"coverage"`
	AnchorStartMs   int64              `json:"anchor_start_ms"`
	AnchorEndMs     int64              `json:"anchor_end_ms"`
	ArtifactLevel   int32              `json:"artifact_level"`
	ParentIds       []pgtype.UUID      `json:"parent_ids"`
	SupersededBy    pgtype.UUID        `json:"superseded_by"`
	SupersededAt    pgtype.Timestamptz `json:"superseded_at"`
	CompactionEpoch int64              `json:"compaction_epoch"`
	StartedAt       pgtype.Timestamptz `json:"started_at"`
	CompletedAt     pgtype.Timestamptz `json:"completed_at"`
	TeamID          pgtype.UUID        `json:"team_id"`
}

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"`
	Visibility            string             `json:"visibility"`
	Title                 string             `json:"title"`
	Metadata              []byte             `json:"metadata"`
	NextTurnPosition      int64              `json:"next_turn_position"`
	CompactionEpoch       int64              `json:"compaction_epoch"`
	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 BotSkillPackageInstallation

type BotSkillPackageInstallation struct {
	ID                pgtype.UUID        `json:"id"`
	TeamID            pgtype.UUID        `json:"team_id"`
	BotID             pgtype.UUID        `json:"bot_id"`
	WorkspaceTargetID string             `json:"workspace_target_id"`
	RegistryID        string             `json:"registry_id"`
	PackageID         string             `json:"package_id"`
	Revision          string             `json:"revision"`
	InstalledAt       pgtype.Timestamptz `json:"installed_at"`
	UpdatedAt         pgtype.Timestamptz `json:"updated_at"`
}

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"`
	CompactID               pgtype.UUID        `json:"compact_id"`
	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 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 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 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 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 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 CompleteCompactionLogParams

type CompleteCompactionLogParams struct {
	ID            pgtype.UUID `json:"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"`
	Coverage      []byte      `json:"coverage"`
	AnchorStartMs int64       `json:"anchor_start_ms"`
	AnchorEndMs   int64       `json:"anchor_end_ms"`
}

type CompleteCompactionRollupParams

type CompleteCompactionRollupParams 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"`
	Coverage      []byte        `json:"coverage"`
	AnchorStartMs int64         `json:"anchor_start_ms"`
	AnchorEndMs   int64         `json:"anchor_end_ms"`
	Level         int32         `json:"level"`
	Parents       []pgtype.UUID `json:"parents"`
	ID            pgtype.UUID   `json:"id"`
}

type CompleteScheduleLogParams

type CompleteScheduleLogParams struct {
	ID           pgtype.UUID `json:"id"`
	Status       string      `json:"status"`
	ResultText   string      `json:"result_text"`
	ErrorMessage string      `json:"error_message"`
	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"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
}

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 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 CreateBotEmailBindingParams

type CreateBotEmailBindingParams struct {
	BotID           pgtype.UUID `json:"bot_id"`
	EmailProviderID pgtype.UUID `json:"email_provider_id"`
	EmailAddress    string      `json:"email_address"`
	CanRead         bool        `json:"can_read"`
	CanWrite        bool        `json:"can_write"`
	CanDelete       bool        `json:"can_delete"`
	Config          []byte      `json:"config"`
}

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

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"`
	Language         string             `json:"language"`
	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 {
	BotID         pgtype.UUID `json:"bot_id"`
	SessionID     pgtype.UUID `json:"session_id"`
	ExpectedEpoch int64       `json:"expected_epoch"`
}

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 CreateEmailOutboxParams

type CreateEmailOutboxParams struct {
	ProviderID  pgtype.UUID `json:"provider_id"`
	BotID       pgtype.UUID `json:"bot_id"`
	FromAddress string      `json:"from_address"`
	ToAddresses []byte      `json:"to_addresses"`
	Subject     string      `json:"subject"`
	BodyText    string      `json:"body_text"`
	BodyHtml    string      `json:"body_html"`
	Attachments []byte      `json:"attachments"`
	Status      string      `json:"status"`
}

type CreateEmailProviderParams

type CreateEmailProviderParams struct {
	UserID   pgtype.UUID `json:"user_id"`
	Name     string      `json:"name"`
	Provider string      `json:"provider"`
	Config   []byte      `json:"config"`
}

type CreateFetchProviderParams

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

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 CreateMessageAssetParams

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

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

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

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

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

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 DeleteACPDecisionProjectionsByRunParams

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

type DeleteACPSessionStateLineFilesNotInParams

type DeleteACPSessionStateLineFilesNotInParams struct {
	SessionID pgtype.UUID `json:"session_id"`
	KeptPaths []byte      `json:"kept_paths"`
}

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 DeleteBotRemoteRuntimeMountParams

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

type DeleteBotSkillPackageInstallationParams

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

type DeleteConnectorParams

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

type DeleteEmailProviderByIDAndUserParams

type DeleteEmailProviderByIDAndUserParams struct {
	ID     pgtype.UUID `json:"id"`
	UserID pgtype.UUID `json:"user_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 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 EmailOauthToken

type EmailOauthToken struct {
	ID              pgtype.UUID        `json:"id"`
	EmailProviderID pgtype.UUID        `json:"email_provider_id"`
	EmailAddress    string             `json:"email_address"`
	AccessToken     string             `json:"access_token"`
	RefreshToken    string             `json:"refresh_token"`
	ExpiresAt       pgtype.Timestamptz `json:"expires_at"`
	Scope           string             `json:"scope"`
	State           string             `json:"state"`
	CreatedAt       pgtype.Timestamptz `json:"created_at"`
	UpdatedAt       pgtype.Timestamptz `json:"updated_at"`
	TeamID          pgtype.UUID        `json:"team_id"`
}

type EmailOutbox

type EmailOutbox struct {
	ID          pgtype.UUID        `json:"id"`
	ProviderID  pgtype.UUID        `json:"provider_id"`
	BotID       pgtype.UUID        `json:"bot_id"`
	MessageID   string             `json:"message_id"`
	FromAddress string             `json:"from_address"`
	ToAddresses []byte             `json:"to_addresses"`
	Subject     string             `json:"subject"`
	BodyText    string             `json:"body_text"`
	BodyHtml    string             `json:"body_html"`
	Attachments []byte             `json:"attachments"`
	Status      string             `json:"status"`
	Error       string             `json:"error"`
	SentAt      pgtype.Timestamptz `json:"sent_at"`
	CreatedAt   pgtype.Timestamptz `json:"created_at"`
	TeamID      pgtype.UUID        `json:"team_id"`
}

type EmailProvider

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

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 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"`
	Title           string      `json:"title"`
	CreatedByUserID pgtype.UUID `json:"created_by_user_id"`
}

type ForkSessionFromAssistantTurnRow

type ForkSessionFromAssistantTurnRow 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"`
	Visibility            string             `json:"visibility"`
	Title                 string             `json:"title"`
	Metadata              []byte             `json:"metadata"`
	NextTurnPosition      int64              `json:"next_turn_position"`
	CompactionEpoch       int64              `json:"compaction_epoch"`
	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 GetACPCanonicalStateShapeParams

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

type GetACPCanonicalStateShapeRow

type GetACPCanonicalStateShapeRow struct {
	ThroughRunID pgtype.UUID `json:"through_run_id"`
	FileShapes   []byte      `json:"file_shapes"`
}

type GetACPLeadingUserMessageIDParams

type GetACPLeadingUserMessageIDParams 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 GetACPRoundOutcomeParams

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

type GetACPRuntimeConfigEpochParams

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

type GetACPRuntimeConfigEpochRow

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

type GetACPSessionPublicationHeadParams

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

type GetACPSessionPublicationHeadRow

type GetACPSessionPublicationHeadRow struct {
	RunID           pgtype.UUID `json:"run_id"`
	CheckpointReset bool        `json:"checkpoint_reset"`
}

type GetACPSessionStateParams

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

type GetACPSessionStateRow

type GetACPSessionStateRow struct {
	ThroughRunID        pgtype.UUID `json:"through_run_id"`
	StagedThroughRunID  pgtype.UUID `json:"staged_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"`
}

type GetActiveBotAgentByIDParams

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

type GetBotAgentByIDParams

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

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"`
	Language                string             `json:"language"`
	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"`
	CompactionEnabled       bool               `json:"compaction_enabled"`
	CompactionThreshold     int32              `json:"compaction_threshold"`
	CompactionTargetPercent pgtype.Int4        `json:"compaction_target_percent"`
	CompactionModelID       pgtype.UUID        `json:"compaction_model_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"`
	Language                string             `json:"language"`
	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"`
	CompactionEnabled       bool               `json:"compaction_enabled"`
	CompactionThreshold     int32              `json:"compaction_threshold"`
	CompactionTargetPercent pgtype.Int4        `json:"compaction_target_percent"`
	CompactionModelID       pgtype.UUID        `json:"compaction_model_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 GetBotEmailBindingByBotAndProviderParams

type GetBotEmailBindingByBotAndProviderParams struct {
	BotID           pgtype.UUID `json:"bot_id"`
	EmailProviderID pgtype.UUID `json:"email_provider_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 GetBotSkillPackageInstallationByIDParams

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

type GetBotSkillPackageInstallationParams

type GetBotSkillPackageInstallationParams struct {
	BotID             pgtype.UUID `json:"bot_id"`
	WorkspaceTargetID string      `json:"workspace_target_id"`
	RegistryID        string      `json:"registry_id"`
	PackageID         string      `json:"package_id"`
}

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 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 GetEmailProviderByIDAndUserParams

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

type GetEmailProviderByNameAndUserParams

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

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 GetLatestAssistantContextLifecycleByRunIDRow

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

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 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 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"`
	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 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"`
	Language                string      `json:"language"`
	ReasoningEffort         string      `json:"reasoning_effort"`
	CompactionEnabled       bool        `json:"compaction_enabled"`
	CompactionThreshold     int32       `json:"compaction_threshold"`
	CompactionTargetPercent pgtype.Int4 `json:"compaction_target_percent"`
	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"`
	CompactionModelID       pgtype.UUID `json:"compaction_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 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 InsertACPSessionStateLinesParams

type InsertACPSessionStateLinesParams struct {
	SessionID    pgtype.UUID `json:"session_id"`
	ThroughRunID pgtype.UUID `json:"through_run_id"`
	StateLines   []byte      `json:"state_lines"`
}

type InsertACPSessionStateLinesRow

type InsertACPSessionStateLinesRow struct {
	RowsWritten int64 `json:"rows_written"`
	JsonlBytes  int64 `json:"jsonl_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 ListACPSessionStateLinePageParams

type ListACPSessionStateLinePageParams struct {
	SessionID       pgtype.UUID `json:"session_id"`
	FileBounds      []byte      `json:"file_bounds"`
	BotID           pgtype.UUID `json:"bot_id"`
	AfterFilePath   string      `json:"after_file_path"`
	AfterLineNumber int64       `json:"after_line_number"`
	MaxResults      int32       `json:"max_results"`
	MaxPageBytes    int64       `json:"max_page_bytes"`
}

type ListACPSessionStateLinePageRow

type ListACPSessionStateLinePageRow struct {
	FilePath   string `json:"file_path"`
	LineNumber int64  `json:"line_number"`
	Content    string `json:"content"`
}

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"`
	Language         string             `json:"language"`
	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"`
	CompactID               pgtype.UUID        `json:"compact_id"`
	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 ListActiveMessagesSinceBySessionWithinBytesParams

type ListActiveMessagesSinceBySessionWithinBytesParams struct {
	SessionID pgtype.UUID        `json:"session_id"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	MaxBytes  int64              `json:"max_bytes"`
}

type ListActiveMessagesSinceBySessionWithinBytesRow

type ListActiveMessagesSinceBySessionWithinBytesRow 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"`
	CompactID               pgtype.UUID        `json:"compact_id"`
	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 ListActiveMessagesSinceParams

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

type ListActiveMessagesSinceRow

type ListActiveMessagesSinceRow 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"`
	CompactID               pgtype.UUID        `json:"compact_id"`
	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 ListActiveMessagesSinceWithinBytesParams

type ListActiveMessagesSinceWithinBytesParams struct {
	BotID     pgtype.UUID        `json:"bot_id"`
	CreatedAt pgtype.Timestamptz `json:"created_at"`
	MaxBytes  int64              `json:"max_bytes"`
}

type ListActiveMessagesSinceWithinBytesRow

type ListActiveMessagesSinceWithinBytesRow 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"`
	CompactID               pgtype.UUID        `json:"compact_id"`
	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 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 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"`
	Language         string             `json:"language"`
	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 ListCompactionArtifactParentIDsBySuccessorParams

type ListCompactionArtifactParentIDsBySuccessorParams struct {
	SessionID   pgtype.UUID `json:"session_id"`
	BotID       pgtype.UUID `json:"bot_id"`
	SuccessorID pgtype.UUID `json:"successor_id"`
}

type ListCompactionLogsByBotParams

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

type ListEmailOutboxByBotParams

type ListEmailOutboxByBotParams struct {
	BotID pgtype.UUID `json:"bot_id"`
	Off   int32       `json:"off"`
	Lim   int32       `json:"lim"`
}

type ListEmailProvidersByUserAndProviderParams

type ListEmailProvidersByUserAndProviderParams struct {
	UserID   pgtype.UUID `json:"user_id"`
	Provider string      `json:"provider"`
}

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 ListMessageRefsByCompactIDRow

type ListMessageRefsByCompactIDRow struct {
	ID        pgtype.UUID `json:"id"`
	BotID     pgtype.UUID `json:"bot_id"`
	SessionID pgtype.UUID `json:"session_id"`
}

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 ListMessagesByCompactIDRow

type ListMessagesByCompactIDRow 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"`
	EventID                 pgtype.UUID        `json:"event_id"`
	DisplayText             pgtype.Text        `json:"display_text"`
	CompactID               pgtype.UUID        `json:"compact_id"`
	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"`
	CompactionEpoch         int64              `json:"compaction_epoch"`
	ConversationType        pgtype.Text        `json:"conversation_type"`
	ConversationName        string             `json:"conversation_name"`
	ReplyTarget             pgtype.Text        `json:"reply_target"`
}

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 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"`
	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"`
	Usage        []byte             `json:"usage"`
	StartedAt    pgtype.Timestamptz `json:"started_at"`
	CompletedAt  pgtype.Timestamptz `json:"completed_at"`
}

type ListSessionEventsBySessionAfterParams

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

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

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

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

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

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

type ListUncompactedMessagesBySessionRow 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"`
	EventID                 pgtype.UUID        `json:"event_id"`
	DisplayText             pgtype.Text        `json:"display_text"`
	CompactID               pgtype.UUID        `json:"compact_id"`
	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"`
	CompactionEpoch         int64              `json:"compaction_epoch"`
	ConversationType        pgtype.Text        `json:"conversation_type"`
	ConversationName        string             `json:"conversation_name"`
	ReplyTarget             pgtype.Text        `json:"reply_target"`
}

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"`
	CompactID               pgtype.UUID        `json:"compact_id"`
	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 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 MarkMessagesCompactedParams

type MarkMessagesCompactedParams struct {
	MessageIds         []pgtype.UUID `json:"message_ids"`
	ExpectedCompactIds []pgtype.UUID `json:"expected_compact_ids"`
	CompactID          pgtype.UUID   `json:"compact_id"`
}

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 MeasureActiveMessagesBySessionParams

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

type MeasureActiveMessagesBySessionRow

type MeasureActiveMessagesBySessionRow 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 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 PruneACPSessionStateVersionsParams

type PruneACPSessionStateVersionsParams struct {
	SessionID    pgtype.UUID `json:"session_id"`
	ThroughRunID pgtype.UUID `json:"through_run_id"`
}

type Queries

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

func New

func New(db DBTX) *Queries

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

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

func (*Queries) CancelPendingUserInputsBySession

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

func (*Queries) CancelUserInputRequest

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

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

func (*Queries) ClearHistoryBySession

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

func (*Queries) ClearMCPOAuthTokens

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

func (*Queries) CompleteCompactionLog

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

func (*Queries) CompleteCompactionRollup

func (q *Queries) CompleteCompactionRollup(ctx context.Context, arg CompleteCompactionRollupParams) (BotHistoryMessageCompact, error)

func (*Queries) CompleteScheduleLog

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

func (*Queries) CountAccounts

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

func (*Queries) CountCompactionLogsByBot

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

func (*Queries) CountEmailOutboxByBot

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

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

func (q *Queries) CreateBotEmailBinding(ctx context.Context, arg CreateBotEmailBindingParams) (BotEmailBinding, 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)

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) (ContextLifecycle, error)

func (*Queries) CreateEmailOutbox

func (q *Queries) CreateEmailOutbox(ctx context.Context, arg CreateEmailOutboxParams) (EmailOutbox, error)

func (*Queries) CreateEmailProvider

func (q *Queries) CreateEmailProvider(ctx context.Context, arg CreateEmailProviderParams) (EmailProvider, error)

func (*Queries) CreateFetchProvider

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

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

func (q *Queries) DeleteACPDecisionProjectionsByRun(ctx context.Context, arg DeleteACPDecisionProjectionsByRunParams) (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.

func (*Queries) DeleteACPSessionPublicationsBySession

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

func (*Queries) DeleteACPSessionStateLineFilesNotIn

func (q *Queries) DeleteACPSessionStateLineFilesNotIn(ctx context.Context, arg DeleteACPSessionStateLineFilesNotInParams) (int64, error)

Remove files the incoming version no longer contains, including files a crashed candidate introduced that neither the canonical nor the incoming version knows about. kept_paths is a JSONB array of file path strings.

func (*Queries) DeleteACPSessionStateLinesBySession

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

func (*Queries) DeleteACPSessionStatesBySession

func (q *Queries) DeleteACPSessionStatesBySession(ctx context.Context, sessionID pgtype.UUID) (int64, 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) DeleteBotACLRuleByID

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

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

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

func (*Queries) DeleteConnector

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

func (*Queries) DeleteContainerByBotID

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

func (*Queries) DeleteEmailOAuthToken

func (q *Queries) DeleteEmailOAuthToken(ctx context.Context, emailProviderID pgtype.UUID) error

func (*Queries) DeleteEmailProvider

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

func (*Queries) DeleteEmailProviderByIDAndUser

func (q *Queries) DeleteEmailProviderByIDAndUser(ctx context.Context, arg DeleteEmailProviderByIDAndUserParams) 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) DeleteMemoryProvider

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

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

The committed head version's per-file shapes: the authoritative read bound for Load and the append-only baseline for the next staging. Reset heads have no state row, so this returns no rows for them.

func (*Queries) GetACPLeadingUserMessageID

func (q *Queries) GetACPLeadingUserMessageID(ctx context.Context, arg GetACPLeadingUserMessageIDParams) (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) GetACPRoundOutcome

func (q *Queries) GetACPRoundOutcome(ctx context.Context, arg GetACPRoundOutcomeParams) (string, error)

Read the terminal ACP outcome for commit-unknown reconciliation after the caller has first waited on the session write lock in a separate statement.

func (*Queries) GetACPRuntimeConfigEpoch

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

Return the canonical ACP publication head independently from snapshot availability. Warm runtimes use this small watermark before every native prompt so another server instance (or a history clear) cannot leave two process-local conversations advancing from different canonical heads.

func (*Queries) GetACPSessionState

func (q *Queries) GetACPSessionState(ctx context.Context, arg GetACPSessionStateParams) (GetACPSessionStateRow, error)

A staged snapshot becomes readable only after its run owns the session's canonical publication head. Returning the head even when the LEFT JOIN misses lets the adapter distinguish "no ACP history yet" from "history committed but its snapshot is missing".

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

func (q *Queries) GetActiveSessionRun(ctx context.Context, sessionID pgtype.UUID) (SessionRun, 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) 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) GetBotEmailBindingByBotAndProvider

func (q *Queries) GetBotEmailBindingByBotAndProvider(ctx context.Context, arg GetBotEmailBindingByBotAndProviderParams) (BotEmailBinding, error)

func (*Queries) GetBotEmailBindingByID

func (q *Queries) GetBotEmailBindingByID(ctx context.Context, id pgtype.UUID) (BotEmailBinding, 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) GetBotWorkspaceResourceLimits

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

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

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

func (*Queries) GetDefaultMemoryProvider

func (q *Queries) GetDefaultMemoryProvider(ctx context.Context) (MemoryProvider, 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) GetEmailOAuthTokenByProvider

func (q *Queries) GetEmailOAuthTokenByProvider(ctx context.Context, emailProviderID pgtype.UUID) (EmailOauthToken, error)

func (*Queries) GetEmailOAuthTokenByState

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

func (*Queries) GetEmailOutboxByID

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

func (*Queries) GetEmailProviderByID

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

func (*Queries) GetEmailProviderByIDAndUser

func (q *Queries) GetEmailProviderByIDAndUser(ctx context.Context, arg GetEmailProviderByIDAndUserParams) (EmailProvider, error)

func (*Queries) GetEmailProviderByNameAndUser

func (q *Queries) GetEmailProviderByNameAndUser(ctx context.Context, arg GetEmailProviderByNameAndUserParams) (EmailProvider, error)

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

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

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

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

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

func (q *Queries) GetPendingToolApprovalByRun(ctx context.Context, runID pgtype.UUID) (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) GetPendingUserInputByRun

func (q *Queries) GetPendingUserInputByRun(ctx context.Context, runID pgtype.UUID) (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) 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) 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) 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) InsertACPSessionStateLines

content travels as a JSON string inside the envelope and lands verbatim in the TEXT column, so the stored bytes are exactly the capture's compacted bytes and every digest survives the database round trip.

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

func (q *Queries) ListACPSessionStateLinePage(ctx context.Context, arg ListACPSessionStateLinePageParams) ([]ListACPSessionStateLinePageRow, error)

Keyset pagination keeps the Go result bounded independently of snapshot size. The cumulative byte guard normally limits a page to max_page_bytes; ordinal 1 guarantees progress when one valid JSONL record is larger than that target (the adapter applies the stricter per-record hard limit). file_bounds is the requested version's shape as a {path: records} object: it is the version-membership filter, hiding lines beyond the version's per- file record counts (a crashed candidate's dangling tail) and files the version never contained.

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

func (q *Queries) ListActiveMessagesSince(ctx context.Context, arg ListActiveMessagesSinceParams) ([]ListActiveMessagesSinceRow, error)

func (*Queries) ListActiveMessagesSinceBySessionWithinBytes

Byte-budgeted variant of ListActiveMessagesSinceBySession (CM-ADM-001): rows are admitted newest-first until their running content byte total crosses max_bytes (the crossing row is kept, so the newest row always loads), then returned in ascending order. Process memory is bounded by max_bytes regardless of total history size.

func (*Queries) ListActiveMessagesSinceWithinBytes

Byte-budgeted variant of ListActiveMessagesSince (CM-ADM-001), same newest-first admission semantics scoped to a bot instead of a session.

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

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

func (*Queries) ListBotEmailBindingsByProvider

func (q *Queries) ListBotEmailBindingsByProvider(ctx context.Context, emailProviderID pgtype.UUID) ([]BotEmailBinding, 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) ListBotSkillPackageInstallations

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

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

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

func (*Queries) ListCompactionArtifactParentIDsBySuccessor

func (q *Queries) ListCompactionArtifactParentIDsBySuccessor(ctx context.Context, arg ListCompactionArtifactParentIDsBySuccessorParams) ([]pgtype.UUID, 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) ListEmailOutboxByBot

func (q *Queries) ListEmailOutboxByBot(ctx context.Context, arg ListEmailOutboxByBotParams) ([]EmailOutbox, error)

func (*Queries) ListEmailProviders

func (q *Queries) ListEmailProviders(ctx context.Context) ([]EmailProvider, error)

func (*Queries) ListEmailProvidersByProvider

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

func (*Queries) ListEmailProvidersByUser

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

func (*Queries) ListEmailProvidersByUserAndProvider

func (q *Queries) ListEmailProvidersByUserAndProvider(ctx context.Context, arg ListEmailProvidersByUserAndProviderParams) ([]EmailProvider, 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) ListHistoryTurnsByBot

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

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

func (q *Queries) ListMessageRefsByCompactID(ctx context.Context, compactID pgtype.UUID) ([]ListMessageRefsByCompactIDRow, error)

Backfills coverage for summaries that predate persisted artifact coverage without pulling every compacted row's full content/usage.

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

func (q *Queries) ListMessagesByCompactID(ctx context.Context, compactID pgtype.UUID) ([]ListMessagesByCompactIDRow, 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) ListPendingToolApprovalsBySession

func (q *Queries) ListPendingToolApprovalsBySession(ctx context.Context, arg ListPendingToolApprovalsBySessionParams) ([]ToolApprovalRequest, 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) ListReadableBindingsByProvider

func (q *Queries) ListReadableBindingsByProvider(ctx context.Context, emailProviderID pgtype.UUID) ([]BotEmailBinding, error)

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

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

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

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

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

func (q *Queries) MarkMessagesCompacted(ctx context.Context, arg MarkMessagesCompactedParams) (int64, error)

func (*Queries) MeasureActiveMessagesBySession

Metadata-only context admission measure (CM-ADM-001): counts and content bytes aggregate on the database side, so admission can size a session's history without shipping any payload into the process.

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

func (q *Queries) PruneACPSessionStateVersions(ctx context.Context, arg PruneACPSessionStateVersionsParams) (int64, error)

Bound normal storage to the incoming staged candidate plus the current canonical head. A failed candidate can survive only until the next stage; a crash before this statement rolls the entire replacement back.

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

func (q *Queries) RevokeUserRuntime(ctx context.Context, arg RevokeUserRuntimeParams) (UserRuntime, error)

func (*Queries) SaveMatrixSyncSinceToken

func (q *Queries) SaveMatrixSyncSinceToken(ctx context.Context, arg SaveMatrixSyncSinceTokenParams) (int64, error)

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

func (q *Queries) SetBotACLDefaultEffect(ctx context.Context, arg SetBotACLDefaultEffectParams) error

func (*Queries) SetBotRemoteRuntimePrimary

func (q *Queries) SetBotRemoteRuntimePrimary(ctx context.Context, arg SetBotRemoteRuntimePrimaryParams) (int64, error)

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

ACP state is removed in full: soft delete never fires the hard-delete FK cascades, so headers, the shared line set, and the publication head must all be dropped here or they orphan forever.

func (*Queries) SoftDeleteSessionsByBot

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

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

func (q *Queries) TrimACPSessionStateLines(ctx context.Context, arg TrimACPSessionStateLinesParams) (int64, error)

Delete one file's lines beyond keep_records. keep_records = 0 clears the file for a full rewrite; a positive value clears a crashed candidate's dangling tail before the next append.

func (*Queries) UpdateAbortedContextLifecycleSnapshot

func (q *Queries) UpdateAbortedContextLifecycleSnapshot(ctx context.Context, arg UpdateAbortedContextLifecycleSnapshotParams) (ContextLifecycle, 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) 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) UpdateBotChannelConfigDisabled

func (q *Queries) UpdateBotChannelConfigDisabled(ctx context.Context, arg UpdateBotChannelConfigDisabledParams) (BotChannelConfig, error)

func (*Queries) UpdateBotEmailBinding

func (q *Queries) UpdateBotEmailBinding(ctx context.Context, arg UpdateBotEmailBindingParams) (BotEmailBinding, 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) 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) UpdateEmailOAuthState

func (q *Queries) UpdateEmailOAuthState(ctx context.Context, arg UpdateEmailOAuthStateParams) error

func (*Queries) UpdateEmailOutboxFailed

func (q *Queries) UpdateEmailOutboxFailed(ctx context.Context, arg UpdateEmailOutboxFailedParams) error

func (*Queries) UpdateEmailOutboxSent

func (q *Queries) UpdateEmailOutboxSent(ctx context.Context, arg UpdateEmailOutboxSentParams) error

func (*Queries) UpdateEmailProvider

func (q *Queries) UpdateEmailProvider(ctx context.Context, arg UpdateEmailProviderParams) (EmailProvider, error)

func (*Queries) UpdateEmailProviderByIDAndUser

func (q *Queries) UpdateEmailProviderByIDAndUser(ctx context.Context, arg UpdateEmailProviderByIDAndUserParams) (EmailProvider, 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) 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)

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

func (q *Queries) UpsertACPSessionPublication(ctx context.Context, arg UpsertACPSessionPublicationParams) (int64, error)

Written in the same transaction as the round's canonical messages. The run join proves the run belongs to this tenant+session and still owns the session's current fencing generation, so a stale runtime cannot move the head.

func (*Queries) UpsertACPSessionState

func (q *Queries) UpsertACPSessionState(ctx context.Context, arg UpsertACPSessionStateParams) (AcpSessionState, error)

This is deliberately a staging write. Canonical history is committed later by the application; GetACPSessionState is the promotion gate. The run join proves that an arbitrary run id cannot be attached to another session and that this process still owns the run's current fencing generation.

func (*Queries) UpsertAbortedContextLifecycle

func (q *Queries) UpsertAbortedContextLifecycle(ctx context.Context, arg UpsertAbortedContextLifecycleParams) (ContextLifecycle, error)

func (*Queries) UpsertAccountByUsername

func (q *Queries) UpsertAccountByUsername(ctx context.Context, arg UpsertAccountByUsernameParams) (UpsertAccountByUsernameRow, 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) 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) 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) UpsertEmailOAuthToken

func (q *Queries) UpsertEmailOAuthToken(ctx context.Context, arg UpsertEmailOAuthTokenParams) (EmailOauthToken, 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) UpsertTerminalContextLifecycle

func (q *Queries) UpsertTerminalContextLifecycle(ctx context.Context, arg UpsertTerminalContextLifecycleParams) (ContextLifecycle, 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 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 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 SaveMatrixSyncSinceTokenParams

type SaveMatrixSyncSinceTokenParams struct {
	ID         pgtype.UUID `json:"id"`
	SinceToken string      `json:"since_token"`
}

type Schedule

type Schedule struct {
	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"`
	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 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"`
	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 SetBotACLDefaultEffectParams

type SetBotACLDefaultEffectParams struct {
	ID               pgtype.UUID `json:"id"`
	AclDefaultEffect string      `json:"acl_default_effect"`
}

type SetBotRemoteRuntimePrimaryParams

type SetBotRemoteRuntimePrimaryParams struct {
	BotID    pgtype.UUID `json:"bot_id"`
	TargetID pgtype.UUID `json:"target_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 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"`
	SupersededByTurnID pgtype.UUID        `json:"superseded_by_turn_id"`
	SupersededAt       pgtype.Timestamptz `json:"superseded_at"`
	SupersededReason   pgtype.Text        `json:"superseded_reason"`
	OldTurnID          pgtype.UUID        `json:"old_turn_id"`
}

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"`
	PreserveID pgtype.UUID `json:"preserve_id"`
}

type SupersedePendingUserInputsBySessionParams

type SupersedePendingUserInputsBySessionParams struct {
	ResultJson []byte      `json:"result_json"`
	BotID      pgtype.UUID `json:"bot_id"`
	SessionID  pgtype.UUID `json:"session_id"`
	PreserveID pgtype.UUID `json:"preserve_id"`
}

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 TrimACPSessionStateLinesParams

type TrimACPSessionStateLinesParams struct {
	SessionID   pgtype.UUID `json:"session_id"`
	FilePath    string      `json:"file_path"`
	KeepRecords int64       `json:"keep_records"`
}

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

type UpdateBotEmailBindingParams struct {
	EmailAddress string      `json:"email_address"`
	CanRead      bool        `json:"can_read"`
	CanWrite     bool        `json:"can_write"`
	CanDelete    bool        `json:"can_delete"`
	Config       []byte      `json:"config"`
	ID           pgtype.UUID `json:"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"`
	Language         string             `json:"language"`
	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"`
	Language         string             `json:"language"`
	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 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 UpdateEmailOAuthStateParams

type UpdateEmailOAuthStateParams struct {
	EmailProviderID pgtype.UUID `json:"email_provider_id"`
	State           string      `json:"state"`
}

type UpdateEmailOutboxFailedParams

type UpdateEmailOutboxFailedParams struct {
	Error string      `json:"error"`
	ID    pgtype.UUID `json:"id"`
}

type UpdateEmailOutboxSentParams

type UpdateEmailOutboxSentParams struct {
	MessageID string      `json:"message_id"`
	ID        pgtype.UUID `json:"id"`
}

type UpdateEmailProviderByIDAndUserParams

type UpdateEmailProviderByIDAndUserParams struct {
	Name     string      `json:"name"`
	Provider string      `json:"provider"`
	Config   []byte      `json:"config"`
	ID       pgtype.UUID `json:"id"`
	UserID   pgtype.UUID `json:"user_id"`
}

type UpdateEmailProviderParams

type UpdateEmailProviderParams struct {
	Name     string      `json:"name"`
	Provider string      `json:"provider"`
	Config   []byte      `json:"config"`
	ID       pgtype.UUID `json:"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"`
}

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 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 UpsertACPSessionPublicationParams

type UpsertACPSessionPublicationParams struct {
	CheckpointReset bool        `json:"checkpoint_reset"`
	SessionID       pgtype.UUID `json:"session_id"`
	BotID           pgtype.UUID `json:"bot_id"`
	RunID           pgtype.UUID `json:"run_id"`
}

type UpsertACPSessionStateParams

type UpsertACPSessionStateParams struct {
	AgentID        string      `json:"agent_id"`
	AcpSessionID   string      `json:"acp_session_id"`
	Cwd            string      `json:"cwd"`
	TranscriptPath string      `json:"transcript_path"`
	FileCount      int32       `json:"file_count"`
	RecordCount    int64       `json:"record_count"`
	FileShapes     []byte      `json:"file_shapes"`
	SessionID      pgtype.UUID `json:"session_id"`
	BotID          pgtype.UUID `json:"bot_id"`
	ThroughRunID   pgtype.UUID `json:"through_run_id"`
}

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 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 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 UpsertBotSettingsParams

type UpsertBotSettingsParams struct {
	Language                   string      `json:"language"`
	ReasoningEffort            string      `json:"reasoning_effort"`
	CompactionEnabled          bool        `json:"compaction_enabled"`
	CompactionThreshold        int32       `json:"compaction_threshold"`
	CompactionTargetPercentSet bool        `json:"compaction_target_percent_set"`
	CompactionTargetPercent    pgtype.Int4 `json:"compaction_target_percent"`
	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"`
	CompactionModelIDSet       bool        `json:"compaction_model_id_set"`
	CompactionModelID          pgtype.UUID `json:"compaction_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"`
	Language                string      `json:"language"`
	ReasoningEffort         string      `json:"reasoning_effort"`
	CompactionEnabled       bool        `json:"compaction_enabled"`
	CompactionThreshold     int32       `json:"compaction_threshold"`
	CompactionTargetPercent pgtype.Int4 `json:"compaction_target_percent"`
	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"`
	CompactionModelID       pgtype.UUID `json:"compaction_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 UpsertBotSkillPackageInstallationParams

type UpsertBotSkillPackageInstallationParams struct {
	BotID             pgtype.UUID `json:"bot_id"`
	WorkspaceTargetID string      `json:"workspace_target_id"`
	RegistryID        string      `json:"registry_id"`
	PackageID         string      `json:"package_id"`
	Revision          string      `json:"revision"`
}

type UpsertBotStorageBindingParams

type UpsertBotStorageBindingParams struct {
	BotID             pgtype.UUID `json:"bot_id"`
	StorageProviderID pgtype.UUID `json:"storage_provider_id"`
	BasePath          string      `json:"base_path"`
}

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 UpsertEmailOAuthTokenParams

type UpsertEmailOAuthTokenParams struct {
	EmailProviderID pgtype.UUID        `json:"email_provider_id"`
	EmailAddress    string             `json:"email_address"`
	AccessToken     string             `json:"access_token"`
	RefreshToken    string             `json:"refresh_token"`
	ExpiresAt       pgtype.Timestamptz `json:"expires_at"`
	Scope           string             `json:"scope"`
	State           string             `json:"state"`
}

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

Jump to

Keyboard shortcuts

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