// Copyright 2026 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

edition = "2023";

package optimization_guide.proto;

import "components/optimization_guide/proto/model_quality_metadata.proto";

option optimize_for = LITE_RUNTIME;
option java_package = "org.chromium.components.optimization_guide.features.proto";

option java_outer_classname = "FindsProto";

// DO NOT EDIT THIS FILE DIRECTLY!
//
// This file is generated in g3 and then synced to Chrome. Instead, please refer to
// http://go/chrome-mqls-onboarding (Google-internal link), and then changes will
// be synced with Chrome automatically.

// Top-level message required by MES.
// Next ID: 4
message FindsLoggingData {
  FindsSuggestionRequest request = 1 [features = { field_presence: EXPLICIT }];

  FindsSuggestionResponse response = 2 [features = { field_presence: EXPLICIT }];

  ModelExecutionInfo model_execution_info = 3 [features = { field_presence: EXPLICIT }];
}

// The request for the Chrome Finds feature.
// Next ID: 2
message FindsSuggestionRequest {
  repeated HistoryEntry entries = 1;

  // Encasulates a history entry.
  message HistoryEntry {
    int64 visit_time_usec = 1 [features = { field_presence: EXPLICIT }];

    string title = 2 [features = { field_presence: EXPLICIT }];

    string url = 3 [features = { field_presence: EXPLICIT }];
  }
}

// The response for the Chrome Finds feature.
// Next ID: 2
message FindsSuggestionResponse {
  repeated SuggestionTheme suggested_themes = 1;

  // A grouped collection of suggestions around a central topic,
  // there can be multiple of these per-request.
  message SuggestionTheme {
    // The "hook" title for the notification (e.g., "Best Mexican in NYC").
    string theme_title = 1 [features = { field_presence: EXPLICIT }];

    // The description of the theme.
    string theme_description = 2 [features = { field_presence: EXPLICIT }];

    // Identifies the theme by a specific type, used for user opt-out.
    ThemeType theme_type = 3 [features = { field_presence: EXPLICIT }];

    // The list of net-new URLs matching this theme.
    repeated SuggestedContent theme_suggested_contents = 4;

    // Score used to prioritize client behavior.
    int64 theme_score = 5 [features = { field_presence: EXPLICIT }];

    // A single entry for suggested content, there can be multiple of
    //  these per-theme.
    message SuggestedContent {
      // The title to display in the notification.
      string content_title = 1 [features = { field_presence: EXPLICIT }];

      // The description to display in the notification.
      string content_description = 2 [features = { field_presence: EXPLICIT }];

      // The destination URL.
      // Must be validated as "live" (200 OK) before showing.
      string content_url = 3 [features = { field_presence: EXPLICIT }];
    }

    // Bucket themes to support "opting-out" of topics on the client.
    enum ThemeType {
      UNKNOWN = 0;

      EVENTS_AND_ACTIVITIES = 1;

      FOOD_AND_DINING = 2;

      ENTERTAINMENT = 3;

      SHOPPING = 4;

      TRAVEL = 5;
    }
  }
}
