// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.cloud.ces.v1beta;

import "google/api/field_behavior.proto";

option go_package = "cloud.google.com/go/ces/apiv1beta/cespb;cespb";
option java_multiple_files = true;
option java_outer_classname = "AgentCardProto";
option java_package = "com.google.cloud.ces.v1beta";

// AgentCard conveys key information about a remote agent.
// It is a trimmed version of the AgentCard defined in the A2A protocol
// https://a2a-protocol.org/dev/specification/#441-agentcard
message AgentCard {
  // Required. A human-readable name for the agent.
  string name = 1 [(google.api.field_behavior) = REQUIRED];

  // Required. A description of the agent's domain of action/solution space.
  string description = 2 [(google.api.field_behavior) = REQUIRED];

  // Required. Ordered list of supported interfaces. The first entry is
  // preferred.
  repeated AgentInterface supported_interfaces = 3
      [(google.api.field_behavior) = REQUIRED];

  // Required. The version of the agent.
  string version = 5 [(google.api.field_behavior) = REQUIRED];

  // Required. Skills represent a unit of ability an agent can perform. This may
  // somewhat abstract but represents a more focused set of actions that the
  // agent is highly likely to succeed at.
  repeated AgentSkill skills = 6 [(google.api.field_behavior) = REQUIRED];
}

// Declares a combination of a target URL, transport and protocol version for
// interacting with the agent. This allows agents to expose the same
// functionality over multiple protocol binding mechanisms.
message AgentInterface {
  // Required. The URL where this interface is available. Must be a valid
  // absolute HTTPS URL in production. Example:
  // "https://api.example.com/a2a/v1", "https://grpc.example.com/a2a"
  string url = 1 [(google.api.field_behavior) = REQUIRED];

  // Required. The protocol binding supported at this URL. This is an open form
  // string, to be easily extended for other protocol bindings. The core ones
  // officially supported are `JSONRPC`, `GRPC` and `HTTP+JSON`.
  string protocol_binding = 2 [(google.api.field_behavior) = REQUIRED];

  // Tenant ID to be used in the request when calling the agent.
  string tenant = 3;

  // Required. The version of the A2A protocol this interface exposes.
  // Use the latest supported minor version per major version.
  // Examples: "0.3", "1.0"
  string protocol_version = 4 [(google.api.field_behavior) = REQUIRED];
}

// Represents a distinct capability or function that an agent can perform.
message AgentSkill {
  // Required. A unique identifier for the agent's skill.
  string id = 1 [(google.api.field_behavior) = REQUIRED];

  // Required. A human-readable name for the skill.
  string name = 2 [(google.api.field_behavior) = REQUIRED];

  // Required. A detailed description of the skill.
  string description = 3 [(google.api.field_behavior) = REQUIRED];

  // Required. A set of keywords describing the skill's capabilities.
  repeated string tags = 4 [(google.api.field_behavior) = REQUIRED];

  // Example prompts or scenarios that this skill can handle.
  repeated string examples = 5;

  // The set of supported input media types for this skill, overriding the
  // agent's defaults.
  repeated string input_modes = 6;

  // The set of supported output media types for this skill, overriding the
  // agent's defaults.
  repeated string output_modes = 7;
}

// Represents a tool that allows the agent to call another remote agent.
message RemoteAgentTool {
  // Required. The name of the tool.
  string name = 1 [(google.api.field_behavior) = REQUIRED];

  // Required. The description of the tool.
  string description = 2 [(google.api.field_behavior) = REQUIRED];

  // Required. The agent card of the remote agent that this tool invokes.
  AgentCard agent_card = 3 [(google.api.field_behavior) = REQUIRED];
}
