syntax = "proto3";
package AICommon;

import "../Protocol/Protocol.proto";
import "../StatusAttributions/StatusAttributions.proto";

message AIHomeState {
    optional int64 lastFetchTime = 1;
    repeated AIHomeOption capabilityOptions = 2;
    repeated AIHomeOption conversationOptions = 3;
    message AIHomeOption {
        optional AIHomeActionType type = 1;
        optional string title = 2;
        optional string promptText = 3;
        optional string sessionId = 4;
        optional string imageWdsIdentifier = 5;
        optional string imageTintColor = 6;
        optional string imageBackgroundColor = 7;
        enum AIHomeActionType {
            PROMPT = 0;
            CREATE_IMAGE = 1;
            ANIMATE_PHOTO = 2;
            ANALYZE_FILE = 3;
        }
    }
}

message BotDocumentMessageMetadata {
    optional DocumentPluginType pluginType = 1;
    enum DocumentPluginType {
        TEXT_EXTRACTION = 0;
        OCR_AND_IMAGES = 1;
    }
}

message SessionTransparencyMetadata {
    optional string disclaimerText = 1;
    optional string hcaId = 2;
    optional SessionTransparencyType sessionTransparencyType = 3;
}

message AIRegenerateMetadata {
    optional Protocol.MessageKey messageKey = 1;
    optional int64 responseTimestampMs = 2;
}

message AIRichResponseSubMessage {
    optional AIRichResponseSubMessageType messageType = 1;
    optional AIRichResponseGridImageMetadata gridImageMetadata = 2;
    optional string messageText = 3;
    optional AIRichResponseInlineImageMetadata imageMetadata = 4;
    optional AIRichResponseCodeMetadata codeMetadata = 5;
    optional AIRichResponseTableMetadata tableMetadata = 6;
    optional AIRichResponseDynamicMetadata dynamicMetadata = 7;
    optional AIRichResponseLatexMetadata latexMetadata = 8;
    optional AIRichResponseMapMetadata mapMetadata = 9;
    optional AIRichResponseContentItemsMetadata contentItemsMetadata = 10;
}

message AIRichResponseContentItemsMetadata {
    repeated AIRichResponseContentItemMetadata itemsMetadata = 1;
    optional ContentType contentType = 2;
    message AIRichResponseContentItemMetadata {
        oneof aIRichResponseContentItem {
            AIRichResponseContentItemsMetadata.AIRichResponseReelItem reelItem = 1;
        }
    }
    message AIRichResponseReelItem {
        optional string title = 1;
        optional string profileIconUrl = 2;
        optional string thumbnailUrl = 3;
        optional string videoUrl = 4;
    }
    enum ContentType {
        DEFAULT = 0;
        CAROUSEL = 1;
    }
}

message AIRichResponseMapMetadata {
    optional double centerLatitude = 1;
    optional double centerLongitude = 2;
    optional double latitudeDelta = 3;
    optional double longitudeDelta = 4;
    repeated AIRichResponseMapAnnotation annotations = 5;
    optional bool showInfoList = 6;
    message AIRichResponseMapAnnotation {
        optional uint32 annotationNumber = 1;
        optional double latitude = 2;
        optional double longitude = 3;
        optional string title = 4;
        optional string body = 5;
    }
}

message AIRichResponseLatexMetadata {
    optional string text = 1;
    repeated AIRichResponseLatexExpression expressions = 2;
    message AIRichResponseLatexExpression {
        optional string latexExpression = 1;
        optional string url = 2;
        optional double width = 3;
        optional double height = 4;
        optional double fontHeight = 5;
        optional double imageTopPadding = 6;
        optional double imageLeadingPadding = 7;
        optional double imageBottomPadding = 8;
        optional double imageTrailingPadding = 9;
    }
}

message AIRichResponseUnifiedResponse {
    optional bytes data = 1;
}

message AIRichResponseDynamicMetadata {
    optional AIRichResponseDynamicMetadataType type = 1;
    optional uint64 version = 2;
    optional string url = 3;
    optional uint32 loopCount = 4;
    enum AIRichResponseDynamicMetadataType {
        AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_UNKNOWN = 0;
        AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_IMAGE = 1;
        AI_RICH_RESPONSE_DYNAMIC_METADATA_TYPE_GIF = 2;
    }
}

message AIRichResponseTableMetadata {
    repeated AIRichResponseTableRow rows = 1;
    optional string title = 2;
    message AIRichResponseTableRow {
        repeated string items = 1;
        optional bool isHeading = 2;
    }
}

message AIRichResponseCodeMetadata {
    optional string codeLanguage = 1;
    repeated AIRichResponseCodeBlock codeBlocks = 2;
    message AIRichResponseCodeBlock {
        optional AIRichResponseCodeMetadata.AIRichResponseCodeHighlightType highlightType = 1;
        optional string codeContent = 2;
    }
    enum AIRichResponseCodeHighlightType {
        AI_RICH_RESPONSE_CODE_HIGHLIGHT_DEFAULT = 0;
        AI_RICH_RESPONSE_CODE_HIGHLIGHT_KEYWORD = 1;
        AI_RICH_RESPONSE_CODE_HIGHLIGHT_METHOD = 2;
        AI_RICH_RESPONSE_CODE_HIGHLIGHT_STRING = 3;
        AI_RICH_RESPONSE_CODE_HIGHLIGHT_NUMBER = 4;
        AI_RICH_RESPONSE_CODE_HIGHLIGHT_COMMENT = 5;
    }
}

message AIRichResponseInlineImageMetadata {
    optional AIRichResponseImageURL imageUrl = 1;
    optional string imageText = 2;
    optional AIRichResponseImageAlignment alignment = 3;
    optional string tapLinkUrl = 4;
    enum AIRichResponseImageAlignment {
        AI_RICH_RESPONSE_IMAGE_LAYOUT_LEADING_ALIGNED = 0;
        AI_RICH_RESPONSE_IMAGE_LAYOUT_TRAILING_ALIGNED = 1;
        AI_RICH_RESPONSE_IMAGE_LAYOUT_CENTER_ALIGNED = 2;
    }
}

message AIRichResponseGridImageMetadata {
    optional AIRichResponseImageURL gridImageUrl = 1;
    repeated AIRichResponseImageURL imageUrls = 2;
}

message AIRichResponseImageURL {
    optional string imagePreviewUrl = 1;
    optional string imageHighResUrl = 2;
    optional string sourceUrl = 3;
}

message BotMessageSharingInfo {
    optional BotMetricsEntryPoint botEntryPointOrigin = 1;
    optional uint32 forwardScore = 2;
}

message ForwardedAIBotMessageInfo {
    optional string botName = 1;
    optional string botJid = 2;
    optional string creatorName = 3;
}

message BotFeedbackMessage {
    optional Protocol.MessageKey messageKey = 1;
    optional BotFeedbackKind kind = 2;
    optional string text = 3;
    optional uint64 kindNegative = 4;
    optional uint64 kindPositive = 5;
    optional ReportKind kindReport = 6;
    optional SideBySideSurveyMetadata sideBySideSurveyMetadata = 7;
    enum BotFeedbackKind {
        BOT_FEEDBACK_POSITIVE = 0;
        BOT_FEEDBACK_NEGATIVE_GENERIC = 1;
        BOT_FEEDBACK_NEGATIVE_HELPFUL = 2;
        BOT_FEEDBACK_NEGATIVE_INTERESTING = 3;
        BOT_FEEDBACK_NEGATIVE_ACCURATE = 4;
        BOT_FEEDBACK_NEGATIVE_SAFE = 5;
        BOT_FEEDBACK_NEGATIVE_OTHER = 6;
        BOT_FEEDBACK_NEGATIVE_REFUSED = 7;
        BOT_FEEDBACK_NEGATIVE_NOT_VISUALLY_APPEALING = 8;
        BOT_FEEDBACK_NEGATIVE_NOT_RELEVANT_TO_TEXT = 9;
        BOT_FEEDBACK_NEGATIVE_PERSONALIZED = 10;
        BOT_FEEDBACK_NEGATIVE_CLARITY = 11;
        BOT_FEEDBACK_NEGATIVE_DOESNT_LOOK_LIKE_THE_PERSON = 12;
        BOT_FEEDBACK_NEGATIVE_HALLUCINATION_INTERNAL_ONLY = 13;
        BOT_FEEDBACK_NEGATIVE = 14;
    }
    enum BotFeedbackKindMultipleNegative {
        BOT_FEEDBACK_MULTIPLE_NEGATIVE_GENERIC = 1;
        BOT_FEEDBACK_MULTIPLE_NEGATIVE_HELPFUL = 2;
        BOT_FEEDBACK_MULTIPLE_NEGATIVE_INTERESTING = 4;
        BOT_FEEDBACK_MULTIPLE_NEGATIVE_ACCURATE = 8;
        BOT_FEEDBACK_MULTIPLE_NEGATIVE_SAFE = 16;
        BOT_FEEDBACK_MULTIPLE_NEGATIVE_OTHER = 32;
        BOT_FEEDBACK_MULTIPLE_NEGATIVE_REFUSED = 64;
        BOT_FEEDBACK_MULTIPLE_NEGATIVE_NOT_VISUALLY_APPEALING = 128;
        BOT_FEEDBACK_MULTIPLE_NEGATIVE_NOT_RELEVANT_TO_TEXT = 256;
    }
    enum BotFeedbackKindMultiplePositive {
        BOT_FEEDBACK_MULTIPLE_POSITIVE_GENERIC = 1;
    }
    enum ReportKind {
        NONE = 0;
        GENERIC = 1;
    }
    message SideBySideSurveyMetadata {
        optional string selectedRequestId = 1;
        optional uint32 surveyId = 2;
        optional string simonSessionFbid = 3;
        optional string responseOtid = 4;
        optional string responseTimestampMsString = 5;
        optional bool isSelectedResponsePrimary = 6;
        optional string messageIdToEdit = 7;
        optional SideBySideSurveyAnalyticsData analyticsData = 8;
        optional SidebySideSurveyMetaAiAnalyticsData metaAiAnalyticsData = 9;
        message SideBySideSurveyAnalyticsData {
            optional string tessaEvent = 1;
            optional string tessaSessionFbid = 2;
            optional string simonSessionFbid = 3;
        }
        message SidebySideSurveyMetaAiAnalyticsData {
            optional uint32 surveyId = 1;
            optional string primaryResponseId = 2;
            optional string testArmName = 3;
            optional string timestampMsString = 4;
            optional SideBySideSurveyCTAImpressionEventData ctaImpressionEvent = 5;
            optional SideBySideSurveyCTAClickEventData ctaClickEvent = 6;
            optional SideBySideSurveyCardImpressionEventData cardImpressionEvent = 7;
            optional SideBySideSurveyResponseEventData responseEvent = 8;
            optional SideBySideSurveyAbandonEventData abandonEvent = 9;
            message SideBySideSurveyAbandonEventData {
                optional string abandonDwellTimeMsString = 1;
            }
            message SideBySideSurveyCTAClickEventData {
                optional bool isSurveyExpired = 1;
                optional string clickDwellTimeMsString = 2;
            }
            message SideBySideSurveyCTAImpressionEventData {
                optional bool isSurveyExpired = 1;
            }
            message SideBySideSurveyCardImpressionEventData {
            }
            message SideBySideSurveyResponseEventData {
                optional string responseDwellTimeMsString = 1;
                optional string selectedResponseId = 2;
            }
        }
    }
}

message BotGroupParticipantMetadata {
    optional string botFbid = 1;
}

message BotGroupMetadata {
    repeated BotGroupParticipantMetadata participantsMetadata = 1;
}

message BotMetadata {
    optional BotAvatarMetadata avatarMetadata = 1;
    optional string personaId = 2;
    optional BotPluginMetadata pluginMetadata = 3;
    optional BotSuggestedPromptMetadata suggestedPromptMetadata = 4;
    optional string invokerJid = 5;
    optional BotSessionMetadata sessionMetadata = 6;
    optional BotMemuMetadata memuMetadata = 7;
    optional string timezone = 8;
    optional BotReminderMetadata reminderMetadata = 9;
    optional BotModelMetadata modelMetadata = 10;
    optional string messageDisclaimerText = 11;
    optional BotProgressIndicatorMetadata progressIndicatorMetadata = 12;
    optional BotCapabilityMetadata capabilityMetadata = 13;
    optional BotImagineMetadata imagineMetadata = 14;
    optional BotMemoryMetadata memoryMetadata = 15;
    optional BotRenderingMetadata renderingMetadata = 16;
    optional BotMetricsMetadata botMetricsMetadata = 17;
    optional BotLinkedAccountsMetadata botLinkedAccountsMetadata = 18;
    optional BotSourcesMetadata richResponseSourcesMetadata = 19;
    optional bytes aiConversationContext = 20;
    optional BotPromotionMessageMetadata botPromotionMessageMetadata = 21;
    optional BotModeSelectionMetadata botModeSelectionMetadata = 22;
    optional BotQuotaMetadata botQuotaMetadata = 23;
    optional BotAgeCollectionMetadata botAgeCollectionMetadata = 24;
    optional string conversationStarterPromptId = 25;
    optional string botResponseId = 26;
    optional BotSignatureVerificationMetadata verificationMetadata = 27;
    optional BotUnifiedResponseMutation unifiedResponseMutation = 28;
    optional BotMessageOriginMetadata botMessageOriginMetadata = 29;
    optional InThreadSurveyMetadata inThreadSurveyMetadata = 30;
    optional AIThreadInfo botThreadInfo = 31;
    optional AIRegenerateMetadata regenerateMetadata = 32;
    optional SessionTransparencyMetadata sessionTransparencyMetadata = 33;
    optional BotDocumentMessageMetadata botDocumentMessageMetadata = 34;
    optional BotGroupMetadata botGroupMetadata = 35;
    optional bytes internalMetadata = 999;
}

message AIThreadInfo {
    optional AIThreadServerInfo serverInfo = 1;
    optional AIThreadClientInfo clientInfo = 2;
    message AIThreadClientInfo {
        optional AIThreadType type = 1;
        enum AIThreadType {
            UNKNOWN = 0;
            DEFAULT = 1;
            INCOGNITO = 2;
        }
    }
    message AIThreadServerInfo {
        optional string title = 1;
    }
}

message BotUnifiedResponseMutation {
    optional SideBySideMetadata sbsMetadata = 1;
    repeated MediaDetailsMetadata mediaDetailsMetadataList = 2;
    message MediaDetailsMetadata {
        optional string id = 1;
        optional BotMediaMetadata highResMedia = 2;
        optional BotMediaMetadata previewMedia = 3;
    }
    message SideBySideMetadata {
        optional string primaryResponseId = 1;
        optional bool surveyCtaHasRendered = 2;
    }
}

message BotMessageOrigin {
    optional BotMessageOriginType type = 1;
    enum BotMessageOriginType {
        BOT_MESSAGE_ORIGIN_TYPE_AI_INITIATED = 0;
    }
}

message BotMessageOriginMetadata {
    repeated BotMessageOrigin origins = 1;
}

message InThreadSurveyMetadata {
    optional string tessaSessionId = 1;
    optional string simonSessionId = 2;
    optional string simonSurveyId = 3;
    optional string tessaRootId = 4;
    optional string requestId = 5;
    optional string tessaEvent = 6;
    optional string invitationHeaderText = 7;
    optional string invitationBodyText = 8;
    optional string invitationCtaText = 9;
    optional string invitationCtaUrl = 10;
    optional string surveyTitle = 11;
    repeated InThreadSurveyQuestion questions = 12;
    optional string surveyContinueButtonText = 13;
    optional string surveySubmitButtonText = 14;
    optional string privacyStatementFull = 15;
    repeated InThreadSurveyPrivacyStatementPart privacyStatementParts = 16;
    optional string feedbackToastText = 17;
    optional int32 startQuestionIndex = 18;
    message InThreadSurveyOption {
        optional string stringValue = 1;
        optional uint32 numericValue = 2;
        optional string textTranslated = 3;
    }
    message InThreadSurveyPrivacyStatementPart {
        optional string text = 1;
        optional string url = 2;
    }
    message InThreadSurveyQuestion {
        optional string questionText = 1;
        optional string questionId = 2;
        repeated InThreadSurveyMetadata.InThreadSurveyOption questionOptions = 3;
    }
}

message BotSourcesMetadata {
    repeated BotSourceItem sources = 1;
    message BotSourceItem {
        optional SourceProvider provider = 1;
        optional string thumbnailCdnUrl = 2;
        optional string sourceProviderUrl = 3;
        optional string sourceQuery = 4;
        optional string faviconCdnUrl = 5;
        optional uint32 citationNumber = 6;
        optional string sourceTitle = 7;
        enum SourceProvider {
            UNKNOWN = 0;
            BING = 1;
            GOOGLE = 2;
            SUPPORT = 3;
            OTHER = 4;
        }
    }
}

message BotAgeCollectionMetadata {
    optional bool ageCollectionEligible = 1;
    optional bool shouldTriggerAgeCollectionOnClient = 2;
    optional AgeCollectionType ageCollectionType = 3;
    enum AgeCollectionType {
        O18_BINARY = 0;
        WAFFLE = 1;
    }
}

message BotImagineMetadata {
    optional ImagineType imagineType = 1;
    enum ImagineType {
        UNKNOWN = 0;
        IMAGINE = 1;
        MEMU = 2;
        FLASH = 3;
        EDIT = 4;
    }
}

message BotQuotaMetadata {
    repeated BotFeatureQuotaMetadata botFeatureQuotaMetadata = 1;
    message BotFeatureQuotaMetadata {
        optional BotFeatureType featureType = 1;
        optional uint32 remainingQuota = 2;
        optional uint64 expirationTimestamp = 3;
        enum BotFeatureType {
            UNKNOWN_FEATURE = 0;
            REASONING_FEATURE = 1;
        }
    }
}

message BotModeSelectionMetadata {
    repeated BotUserSelectionMode mode = 1;
    enum BotUserSelectionMode {
        UNKNOWN_MODE = 0;
        REASONING_MODE = 1;
    }
}

message BotCapabilityMetadata {
    repeated BotCapabilityType capabilities = 1;
    enum BotCapabilityType {
        UNKNOWN = 0;
        PROGRESS_INDICATOR = 1;
        RICH_RESPONSE_HEADING = 2;
        RICH_RESPONSE_NESTED_LIST = 3;
        AI_MEMORY = 4;
        RICH_RESPONSE_THREAD_SURFING = 5;
        RICH_RESPONSE_TABLE = 6;
        RICH_RESPONSE_CODE = 7;
        RICH_RESPONSE_STRUCTURED_RESPONSE = 8;
        RICH_RESPONSE_INLINE_IMAGE = 9;
        WA_IG_1P_PLUGIN_RANKING_CONTROL = 10;
        WA_IG_1P_PLUGIN_RANKING_UPDATE_1 = 11;
        WA_IG_1P_PLUGIN_RANKING_UPDATE_2 = 12;
        WA_IG_1P_PLUGIN_RANKING_UPDATE_3 = 13;
        WA_IG_1P_PLUGIN_RANKING_UPDATE_4 = 14;
        WA_IG_1P_PLUGIN_RANKING_UPDATE_5 = 15;
        WA_IG_1P_PLUGIN_RANKING_UPDATE_6 = 16;
        WA_IG_1P_PLUGIN_RANKING_UPDATE_7 = 17;
        WA_IG_1P_PLUGIN_RANKING_UPDATE_8 = 18;
        WA_IG_1P_PLUGIN_RANKING_UPDATE_9 = 19;
        WA_IG_1P_PLUGIN_RANKING_UPDATE_10 = 20;
        RICH_RESPONSE_SUB_HEADING = 21;
        RICH_RESPONSE_GRID_IMAGE = 22;
        AI_STUDIO_UGC_MEMORY = 23;
        RICH_RESPONSE_LATEX = 24;
        RICH_RESPONSE_MAPS = 25;
        RICH_RESPONSE_INLINE_REELS = 26;
        AGENTIC_PLANNING = 27;
        ACCOUNT_LINKING = 28;
        STREAMING_DISAGGREGATION = 29;
        RICH_RESPONSE_GRID_IMAGE_3P = 30;
        RICH_RESPONSE_LATEX_INLINE = 31;
        QUERY_PLAN = 32;
        PROACTIVE_MESSAGE = 33;
        RICH_RESPONSE_UNIFIED_RESPONSE = 34;
        PROMOTION_MESSAGE = 35;
        SIMPLIFIED_PROFILE_PAGE = 36;
        RICH_RESPONSE_SOURCES_IN_MESSAGE = 37;
        RICH_RESPONSE_SIDE_BY_SIDE_SURVEY = 38;
        RICH_RESPONSE_UNIFIED_TEXT_COMPONENT = 39;
        AI_SHARED_MEMORY = 40;
        RICH_RESPONSE_UNIFIED_SOURCES = 41;
        RICH_RESPONSE_UNIFIED_DOMAIN_CITATIONS = 42;
        RICH_RESPONSE_UR_INLINE_REELS_ENABLED = 43;
        RICH_RESPONSE_UR_MEDIA_GRID_ENABLED = 44;
        RICH_RESPONSE_UR_TIMESTAMP_PLACEHOLDER = 45;
        RICH_RESPONSE_IN_APP_SURVEY = 46;
        AI_RESPONSE_MODEL_BRANDING = 47;
        SESSION_TRANSPARENCY_SYSTEM_MESSAGE = 48;
        RICH_RESPONSE_UR_REASONING = 49;
    }
}

message BotProgressIndicatorMetadata {
    optional string progressDescription = 1;
    repeated BotPlanningStepMetadata stepsMetadata = 2;
    message BotPlanningStepMetadata {
        optional string statusTitle = 1;
        optional string statusBody = 2;
        repeated BotPlanningSearchSourcesMetadata sourcesMetadata = 3;
        optional PlanningStepStatus status = 4;
        optional bool isReasoning = 5;
        optional bool isEnhancedSearch = 6;
        repeated BotPlanningStepSectionMetadata sections = 7;
        message BotPlanningSearchSourceMetadata {
            optional string title = 1;
            optional BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotSearchSourceProvider provider = 2;
            optional string sourceUrl = 3;
            optional string favIconUrl = 4;
        }
        message BotPlanningSearchSourcesMetadata {
            optional string sourceTitle = 1;
            optional BotPlanningSearchSourceProvider provider = 2;
            optional string sourceUrl = 3;
            enum BotPlanningSearchSourceProvider {
                UNKNOWN = 0;
                OTHER = 1;
                GOOGLE = 2;
                BING = 3;
            }
        }
        message BotPlanningStepSectionMetadata {
            optional string sectionTitle = 1;
            optional string sectionBody = 2;
            repeated BotProgressIndicatorMetadata.BotPlanningStepMetadata.BotPlanningSearchSourceMetadata sourcesMetadata = 3;
        }
        enum BotSearchSourceProvider {
            UNKNOWN_PROVIDER = 0;
            OTHER = 1;
            GOOGLE = 2;
            BING = 3;
        }
        enum PlanningStepStatus {
            UNKNOWN = 0;
            PLANNED = 1;
            EXECUTING = 2;
            FINISHED = 3;
        }
    }
}

message BotModelMetadata {
    optional ModelType modelType = 1;
    optional PremiumModelStatus premiumModelStatus = 2;
    optional string modelNameOverride = 3;
    enum ModelType {
        UNKNOWN_TYPE = 0;
        LLAMA_PROD = 1;
        LLAMA_PROD_PREMIUM = 2;
    }
    enum PremiumModelStatus {
        UNKNOWN_STATUS = 0;
        AVAILABLE = 1;
        QUOTA_EXCEED_LIMIT = 2;
    }
}

message BotReminderMetadata {
    optional Protocol.MessageKey requestMessageKey = 1;
    optional ReminderAction action = 2;
    optional string name = 3;
    optional uint64 nextTriggerTimestamp = 4;
    optional ReminderFrequency frequency = 5;
    enum ReminderAction {
        NOTIFY = 1;
        CREATE = 2;
        DELETE = 3;
        UPDATE = 4;
    }
    enum ReminderFrequency {
        ONCE = 1;
        DAILY = 2;
        WEEKLY = 3;
        BIWEEKLY = 4;
        MONTHLY = 5;
    }
}

message BotMemuMetadata {
    repeated BotMediaMetadata faceImages = 1;
}

message BotMediaMetadata {
    optional string fileSha256 = 1;
    optional string mediaKey = 2;
    optional string fileEncSha256 = 3;
    optional string directPath = 4;
    optional int64 mediaKeyTimestamp = 5;
    optional string mimetype = 6;
    optional OrientationType orientationType = 7;
    enum OrientationType {
        CENTER = 1;
        LEFT = 2;
        RIGHT = 3;
    }
}

message BotSessionMetadata {
    optional string sessionId = 1;
    optional BotSessionSource sessionSource = 2;
}

message BotMetricsMetadata {
    optional string destinationId = 1;
    optional BotMetricsEntryPoint destinationEntryPoint = 2;
    optional BotMetricsThreadEntryPoint threadOrigin = 3;
}

message BotRenderingMetadata {
    repeated Keyword keywords = 1;
    message Keyword {
        optional string value = 1;
        repeated string associatedPrompts = 2;
    }
}

message BotPromotionMessageMetadata {
    optional BotPromotionType promotionType = 1;
    optional string buttonTitle = 2;
    enum BotPromotionType {
        UNKNOWN_TYPE = 0;
        C50 = 1;
        SURVEY_PLATFORM = 2;
    }
}

message BotSignatureVerificationUseCaseProof {
    optional int32 version = 1;
    optional BotSignatureUseCase useCase = 2;
    optional bytes signature = 3;
    repeated bytes certificateChain = 4;
    enum BotSignatureUseCase {
        UNSPECIFIED = 0;
        WA_BOT_MSG = 1;
    }
}

message BotSignatureVerificationMetadata {
    repeated BotSignatureVerificationUseCaseProof proofs = 1;
}

message BotMemoryFact {
    optional string fact = 1;
    optional string factId = 2;
}

message BotMemoryMetadata {
    repeated BotMemoryFact addedFacts = 1;
    repeated BotMemoryFact removedFacts = 2;
    optional string disclaimer = 3;
}

message BotLinkedAccount {
    optional BotLinkedAccountType type = 1;
    enum BotLinkedAccountType {
        BOT_LINKED_ACCOUNT_TYPE_1P = 0;
    }
}

message BotLinkedAccountsMetadata {
    repeated BotLinkedAccount accounts = 1;
    optional bytes acAuthTokens = 2;
    optional int32 acErrorCode = 3;
}

message BotPromptSuggestion {
    optional string prompt = 1;
    optional string promptId = 2;
}

message BotPromptSuggestions {
    repeated BotPromptSuggestion suggestions = 1;
}

message BotSuggestedPromptMetadata {
    repeated string suggestedPrompts = 1;
    optional uint32 selectedPromptIndex = 2;
    optional BotPromptSuggestions promptSuggestions = 3;
    optional string selectedPromptId = 4;
}

message BotPluginMetadata {
    optional SearchProvider provider = 1;
    optional PluginType pluginType = 2;
    optional string thumbnailCdnUrl = 3;
    optional string profilePhotoCdnUrl = 4;
    optional string searchProviderUrl = 5;
    optional uint32 referenceIndex = 6;
    optional uint32 expectedLinksCount = 7;
    optional string searchQuery = 9;
    optional Protocol.MessageKey parentPluginMessageKey = 10;
    optional PluginType deprecatedField = 11;
    optional PluginType parentPluginType = 12;
    optional string faviconCdnUrl = 13;
    enum PluginType {
        UNKNOWN_PLUGIN = 0;
        REELS = 1;
        SEARCH = 2;
    }
    enum SearchProvider {
        UNKNOWN = 0;
        BING = 1;
        GOOGLE = 2;
        SUPPORT = 3;
    }
}

message BotAvatarMetadata {
    optional uint32 sentiment = 1;
    optional string behaviorGraph = 2;
    optional uint32 action = 3;
    optional uint32 intensity = 4;
    optional uint32 wordCount = 5;
}

enum SessionTransparencyType {
    UNKNOWN_TYPE = 0;
    NY_AI_SAFETY_DISCLAIMER = 1;
}

enum AIRichResponseSubMessageType {
    AI_RICH_RESPONSE_UNKNOWN = 0;
    AI_RICH_RESPONSE_GRID_IMAGE = 1;
    AI_RICH_RESPONSE_TEXT = 2;
    AI_RICH_RESPONSE_INLINE_IMAGE = 3;
    AI_RICH_RESPONSE_TABLE = 4;
    AI_RICH_RESPONSE_CODE = 5;
    AI_RICH_RESPONSE_DYNAMIC = 6;
    AI_RICH_RESPONSE_MAP = 7;
    AI_RICH_RESPONSE_LATEX = 8;
    AI_RICH_RESPONSE_CONTENT_ITEMS = 9;
}

enum AIRichResponseMessageType {
    AI_RICH_RESPONSE_TYPE_UNKNOWN = 0;
    AI_RICH_RESPONSE_TYPE_STANDARD = 1;
}

enum BotSessionSource {
    NONE = 0;
    NULL_STATE = 1;
    TYPEAHEAD = 2;
    USER_INPUT = 3;
    EMU_FLASH = 4;
    EMU_FLASH_FOLLOWUP = 5;
    VOICE = 6;
}

enum BotMetricsThreadEntryPoint {
    AI_TAB_THREAD = 1;
    AI_HOME_THREAD = 2;
    AI_DEEPLINK_IMMERSIVE_THREAD = 3;
    AI_DEEPLINK_THREAD = 4;
    ASK_META_AI_CONTEXT_MENU_THREAD = 5;
}

enum BotMetricsEntryPoint {
    UNDEFINED_ENTRY_POINT = 0;
    FAVICON = 1;
    CHATLIST = 2;
    AISEARCH_NULL_STATE_PAPER_PLANE = 3;
    AISEARCH_NULL_STATE_SUGGESTION = 4;
    AISEARCH_TYPE_AHEAD_SUGGESTION = 5;
    AISEARCH_TYPE_AHEAD_PAPER_PLANE = 6;
    AISEARCH_TYPE_AHEAD_RESULT_CHATLIST = 7;
    AISEARCH_TYPE_AHEAD_RESULT_MESSAGES = 8;
    AIVOICE_SEARCH_BAR = 9;
    AIVOICE_FAVICON = 10;
    AISTUDIO = 11;
    DEEPLINK = 12;
    NOTIFICATION = 13;
    PROFILE_MESSAGE_BUTTON = 14;
    FORWARD = 15;
    APP_SHORTCUT = 16;
    FF_FAMILY = 17;
    AI_TAB = 18;
    AI_HOME = 19;
    AI_DEEPLINK_IMMERSIVE = 20;
    AI_DEEPLINK = 21;
    META_AI_CHAT_SHORTCUT_AI_STUDIO = 22;
    UGC_CHAT_SHORTCUT_AI_STUDIO = 23;
    NEW_CHAT_AI_STUDIO = 24;
    AIVOICE_FAVICON_CALL_HISTORY = 25;
    ASK_META_AI_CONTEXT_MENU = 26;
    ASK_META_AI_CONTEXT_MENU_1ON1 = 27;
    ASK_META_AI_CONTEXT_MENU_GROUP = 28;
    INVOKE_META_AI_1ON1 = 29;
    INVOKE_META_AI_GROUP = 30;
    META_AI_FORWARD = 31;
    NEW_CHAT_AI_CONTACT = 32;
    MESSAGE_QUICK_ACTION_1_ON_1_CHAT = 33;
    MESSAGE_QUICK_ACTION_GROUP_CHAT = 34;
    ATTACHMENT_TRAY_1_ON_1_CHAT = 35;
    ATTACHMENT_TRAY_GROUP_CHAT = 36;
    ASK_META_AI_MEDIA_VIEWER_1ON1 = 37;
    ASK_META_AI_MEDIA_VIEWER_GROUP = 38;
}