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

// Do not edit this file manually. See README.chromium for details on
// how to edit this file.

syntax = 'proto2';

option optimize_for = LITE_RUNTIME;
option java_package = 'org.chromium.components.omnibox';
option java_outer_classname = 'SuggestTemplateInfoProto';

package omnibox;

import "chrome_searchbox_stats.proto";
import "formatted_string.proto";
import "input_source.proto";
import "model_mode.proto";
import "suggest_inventory.proto";
import "tool_mode.proto";

// Suggest Template rendering data.
// Next ID: 9
message SuggestTemplateInfo {
  enum StandardSuggestStyle {
    SUGGEST_STYLE_UNSPECIFIED = 0;
    // Suggestions with query text only
    DEFAULT = 1;
    // Suggestions enriched with additional text or image data
    ENRICHED = 2;
    // Suggestion annotated with updated data.
    ANNOTATED = 3;
  }

  // The style of the suggestion.
  optional StandardSuggestStyle style = 1;

  // Next ID: 18
  enum IconType {
    // Unspecified.
    ICON_TYPE_UNSPECIFIED = 0;
    // History clock icon.
    HISTORY = 1;
    // Search loop icon.
    SEARCH_LOOP = 2;
    // Search loop with sparkle icon.
    SEARCH_LOOP_WITH_SPARKLE = 3;
    // Trending icon.
    TRENDING = 4;
    // A sub arrow right icon.
    SUB_ARROW_RIGHT = 5;
    // A globe with a search loop icon, typically used for deep search.
    GLOBE_WITH_SEARCH_LOOP = 6;
    // Banana icon, typically used for nano banana suggestions.
    // Uses the banana emoji.
    BANANA = 7;
    // Indicates the client should use the favicon from the page the suggestion
    // is from.
    FAVICON = 8;
    // Notes spark icon, used for AIM More Threads suggestions.
    NOTES_SPARK = 9;
    // Draft spark icon, typically used for AIM canvas suggestions.
    DRAFT_SPARK = 10;
    // A light bulb icon, used for the Brainstorm suggestions.
    LIGHTBULB = 11;
    // Attach file icon, used in suggestions that ask the user to attach a file.
    ATTACH_FILE = 12;
    // School icon, used in EDU suggestions.
    SCHOOL = 13;
    // Ink pen icon, used for writing suggestions.
    INK_PEN = 14;
    // Tab icon, used for "Ask about tabs" suggestions.
    TAB = 15;
    // Photo spark icon, used for create image suggestions.
    PHOTO_SPARK = 16;
    // Bolt icon, may be used for brainstorm suggestions.
    BOLT = 17;
  }

  // The icon type of the suggestion, this is typically the icon in front of
  // the primary text (i.e. query).
  optional IconType type_icon = 2;

  // The primary text of the suggestion (i.e. query).
  optional FormattedString primary_text = 3;

  // The secondary text of the suggestion (i.e. subtitle).
  optional FormattedString secondary_text = 4;

  message Image {
    // The URL of the image.
    optional string url = 1;

    // Dominant color.
    // Affects how image is rendered.
    optional string dominant_color = 2;

    // Image type.
    optional ImageType type = 3;

    enum ImageType {
      TYPE_UNKNOWN = 0;
      TYPE_LARGE = 1;
      TYPE_SMALL = 2;
    }
  }

  // This image is typically in front of the primary text (i.e. query) and
  // replaces the suggestion icon.
  optional Image image = 5;

  // Additioanl request parameters for SRP fulfillment.
  map<string, string> default_search_parameters = 6;

  // Entity Suggestion Action descriptor.
  message TemplateAction {
    enum ActionType {
      DIRECTIONS = 2;
      CALL = 3;
      REVIEWS = 20;
      CHROME_AIM = 1000;
      CHROME_LENS = 1001;
      CHROME_TAB_SWITCH = 1002;
    }

    // The URI to open when the action is invoked.
    // IMPORTANT: The `action_uri` must be used when non-empty and overrides
    // the default navigation to the SRP.
    optional string action_uri = 1;

    // Action type for logging.
    optional .omnibox.metrics.ActionInfo.ActionType logs_action_type = 2;

    // Action type.
    optional ActionType action_type = 3;

    // If non-empty, the action must result in navigation to the SRP accompanied
    // with these additional request parameters to help force a certain SRP.
    map<string, string> search_parameters = 4;

    // Display text for this action (primarily used for enhancements).
    optional string display_text = 5;

    // Query executed when this action or enhancement is selected. If non-empty,
    // this query should be used instead of the parent suggestion's query.
    optional string query = 6;
  }

  // List of possible actions for the suggestion.
  repeated TemplateAction action_suggestions = 7;

  // This sends information about what the Fusebox action does. For example,
  // it might preselect a tool, a model or something else.
  // Next ID: 7
  message FuseboxAction {
    // Which tool gets preselected when the user clicks on the suggestion.
    optional ToolMode preselected_tool = 1;

    // The inventory of suggestions to show when the user clicks on the
    // suggestion.
    optional SuggestInventory preferred_inventory = 2;

    // Preselect Gemini model mode
    optional ModelMode preselected_model = 3;

    // Picker/Input source to trigger immediately on chip / suggestion click
    // (e.g., tab picker, image picker, file picker).
    optional InputSource preselected_input_source = 4;

    // This changes what the suggestion text (query) does on click.
    enum QueryActionOverride {
      // Default implicit behavior: submits the query immediately.
      QUERY_ACTION_DEFAULT = 0;

      // Opens the searchbox with the provided query.
      QUERY_ACTION_PASTE = 1;

      // Opens the searchbox and displays the suggestion query text as
      // placeholder hint.
      QUERY_ACTION_HINT = 2;
    }
    optional QueryActionOverride query_action_override = 5;

    // This changes which searchbox opens on click.
    enum SearchboxOverride {
      // Unspecified means no searchbox is open on click.
      SEARCHBOX_OVERRIDE_UNSPECIFIED = 0;

      // Opens the realbox.
      SEARCHBOX_OVERRIDE_REALBOX = 1;

      // Opens the composebox.
      SEARCHBOX_OVERRIDE_COMPOSEBOX = 2;
    }
    optional SearchboxOverride searchbox_override = 6;
  }

  optional FuseboxAction fusebox_action = 8;
}
