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

syntax = "proto3";

package personal_context.proto;

import "components/personal_context/proto/features/common_data.proto";

option optimize_for = LITE_RUNTIME;

message FetchContextRequest {
  // The feature that this request is for.
  ContextMemoryFeature feature = 1;

  // The metadata associated with this request.
  Any request_metadata = 2;
}

message FetchContextResponse {
  oneof response {
    // The metadata for the response returned for the feature.
    Any response_metadata = 1;
  }

  // UUID generated by the service for the request.
  string server_request_id = 2;
}

message FetchPiiEntitiesRequest {
  // The feature that this request is for.
  ContextMemoryFeature feature = 1;

  // The list of masked entities that are requested to be unmasked.
  repeated Entity masked_entities = 2;
}

message FetchPiiEntitiesResponse {
  // Entity containing the unmasked SPII identified by the masked_entities.
  repeated Entity entities = 1;

  // UUID generated by the service for the request.
  string server_request_id = 2;
}

// Enum for features that are supported by the service.
enum ContextMemoryFeature {
  reserved 2;

  CONTEXT_MEMORY_FEATURE_UNSPECIFIED = 0;
  CONTEXT_MEMORY_FEATURE_AMBIENT_AUTOFILL = 1;
  CONTEXT_MEMORY_FEATURE_AT_MEMORY = 3;
  CONTEXT_MEMORY_FEATURE_AUTO_TODOS = 4;
  CONTEXT_MEMORY_FEATURE_SMART_SEARCH = 5;
}

message Any {
  // A URL/resource name that uniquely identifies the type of the serialized
  // protocol buffer message.
  string type_url = 1;

  // Must be a valid serialized protocol buffer of the above specified type.
  bytes value = 2;
}