chromium/chromeos/ash/services/libassistant/public/mojom/conversation_controller.mojom

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

module ash.libassistant.mojom;

import "chromeos/ash/services/libassistant/public/mojom/conversation_observer.mojom";
import "chromeos/ash/services/libassistant/public/mojom/notification_delegate.mojom";
import "chromeos/ash/services/libassistant/public/mojom/assistant_notification.mojom";
import "ui/accessibility/mojom/ax_assistant_structure.mojom";

// Interface for controller supporting conversation related functionalities.
interface ConversationController {
  // Sends the specific text query to Libassistant.
  SendTextQuery(string query, AssistantQuerySource source, bool allow_tts);

  // Initiates a voice interaction.
  StartVoiceInteraction();

  // Starts an interaction to edit the reminder uniquely identified by
  // |client_id|. In response to the request, LibAssistant will initiate
  // a user facing interaction with the context pre-populated with details
  // to edit the specified reminder.
  StartEditReminderInteraction(string client_id);

  // Stops the ongoing interaction with a delay to give buffer time to
  // Libassistant when being forcefully stopped.
  StopActiveInteraction(bool cancel_conversation);

  // Retrieves a notification. A voiceless interaction will be sent to server to
  // retrieve the notification of |action_index|, which can trigger other
  // Assistant events such as OnTextResponse to show the result in the UI. The
  // retrieved notification will be removed from the UI.
  // |action_index| is the index of the tapped action. The main UI in the
  // notification contains the top level action, which index is 0. The buttons
  // have the additional actions, which are indexed starting from 1.
  RetrieveNotification(AssistantNotification notification,
                       int32 action_index);

  // Dismisses a notification.
  DismissNotification(AssistantNotification notification);

  // Sends Assistant feedback to Assistant server.
  SendAssistantFeedback(AssistantFeedback feedback);

  // Add a remote observer, which will be informed of set of events
  // related to the ongoing conversation.
  AddRemoteObserver(pending_remote<ConversationObserver> observer);
};

// Models an Assistant feedback. This should be kept in sync with
// |ash::assistant::AssistantFeedback|.
struct AssistantFeedback {
  // User input to be sent with the feedback report.
  string description;

  // Whether user consent to send debug info.
  bool assistant_debug_info_allowed = false;

  // Screenshot if allowed by user.
  // Raw data (non-encoded binary octets)
  array<uint8> screenshot_png;
};

// Models a device setting.
struct DeviceSetting {
  // Unique id to identify a specific setting.
  string setting_id;

  // True if the specific setting is supported.
  bool is_supported;
};