// 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/features/common_quality_data.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 = "ContextualCueingProto";

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

message ContextualCueingLoggingData {
  // The feature request.
  ContextualCueingRequest request = 1 [features = { field_presence: EXPLICIT }];

  // The feature response.
  ContextualCueingResponse response = 2 [features = { field_presence: EXPLICIT }];

  // The model execution info for the feature.
  ModelExecutionInfo model_execution_info = 3 [features = { field_presence: EXPLICIT }];
}

message ContextualCueingRequest {
  // The page context for the active tab.
  PageContext active_tab_page_context = 1 [features = { field_presence: EXPLICIT }];

  // The background tabs.
  //
  // Only the URL and title will be populated for each background tab.
  repeated Tab background_tabs = 2;

  // The surfaces that are supported by the client.
  repeated ContextualCueingSurface supported_surfaces = 3;

  // The history of contextual cueing shown to the user sorted in
  // reverse-chronological order.
  repeated ContextualCueingHistory contextual_cueing_history = 4 [deprecated = true];
}

message ContextualCueingHistory {
  // The user journey the shown cue was for.
  string cuj = 1 [features = { field_presence: EXPLICIT }];
}

// Next ID: 5
message ContextualCueingResponse {
  oneof treatment {
    AnchoredMessageCue anchored_message_cue = 2 [deprecated = true];
  }

  oneof fulfillment_surface {
    GeminiInChromeSurface gemini_in_chrome_surface = 3 [deprecated = true];
  }

  // The suggested user journey to show the cue for.
  string suggested_cuj = 1 [
    deprecated = true,
    features = { field_presence: EXPLICIT }
  ];

  // The contextual cues that are applicable to the request.
  //
  // This list should contain at most one per supported surface and will be
  // in ranked order for what cue is most applicable based on the request.
  repeated ContextualCue contextual_cues = 4;
}

message AnchoredMessageCue {
  // The button text to show to the user.
  string action_text = 1 [features = { field_presence: EXPLICIT }];

  // The message to show to the user.
  string anchored_message_text = 2 [features = { field_presence: EXPLICIT }];

  // The tabs that should be shown to the user in the anchored message.
  repeated Tab tabs_to_show = 3;
}

message GeminiInChromeSurface {
  // The prompt to use for the Gemini in Chrome surface.
  string prompt = 1 [features = { field_presence: EXPLICIT }];

  // The tabs that should be shared with Gemini in Chrome on click.
  repeated Tab tabs_to_share = 2;
}

message ContextualCue {
  oneof treatment {
    AnchoredMessageCue anchored_message_cue = 2;
  }

  oneof fulfillment_surface {
    GeminiInChromeSurface gemini_in_chrome_surface = 3;
  }

  // The suggested user journey to show the cue for.
  string suggested_cuj = 1 [features = { field_presence: EXPLICIT }];
}

enum ContextualCueingSurface {
  CONTEXTUAL_CUEING_SURFACE_UNSPECIFIED = 0;

  CONTEXTUAL_CUEING_SURFACE_GEMINI_IN_CHROME = 1;
}
