Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:A2aproject A2a java Grpc Protobuf Generated Classes

From Leeroopedia
Knowledge Sources
Domains gRPC, Protocol_Types, Code_Generation
Last Updated 2026-10-30 00:00 GMT

Overview

Concrete auto-generated protobuf Java classes for all A2A protocol message types, generated from `a2a.proto` by the protocol buffer compiler.

Description

The `spec-grpc` module contains auto-generated protobuf Java classes produced by the protocol buffer compiler (protoc, version 4.33.1) from the a2a.proto schema. These classes provide immutable, type-safe representations of all A2A protocol messages for the gRPC transport layer. Each message type has a main class (e.g., `AgentCard`), a companion `OrBuilder` interface, and a `Builder` inner class. The A2A class is the root descriptor holder for all proto definitions. A2AServiceGrpc defines the gRPC service stubs (blocking, async, and future stubs).

These files are not hand-written — they are generated at build time and should not be edited directly. They serve as the wire format for gRPC transport, converted to/from the spec module's Java records via the ProtoUtils mapper.

Usage

  • gRPC wire format: These classes are used internally by GrpcTransport for binary serialization over gRPC
  • Proto conversion: ProtoUtils.ToProto and ProtoUtils.FromProto convert between spec records and protobuf classes
  • Service stubs: A2AServiceGrpc provides gRPC stubs used by GrpcTransport to make RPC calls
  • Do not use directly: Application code should use the spec module's Java records (e.g., `org.a2aproject.sdk.spec.AgentCard`) instead of these generated classes

Code Reference

Source Location

  • Repository: a2a-java
  • Directory: `spec-grpc/src/main/java/org/a2aproject/sdk/grpc/`

Generated Message Classes

Class Lines Proto Type
A2A.java 875 Root descriptor holder
A2AServiceGrpc.java 1337 gRPC service stubs
AgentCard.java 4444 Agent capability manifest
AgentCardOrBuilder.java 522 AgentCard read-only interface
AgentCardSignature.java 966 Agent card signature
AgentCapabilities.java 1162 Agent capabilities
AgentExtension.java 1026 Agent extension
AgentInterface.java 1067 Agent interface
AgentProvider.java 716 Agent provider info
AgentSkill.java 2276 Agent skill
Artifact.java 1795 Task artifact
AuthenticationInfo.java 716 Auth info
APIKeySecurityScheme.java 866 API key security
HTTPAuthSecurityScheme.java 887 HTTP auth security
MutualTlsSecurityScheme.java 538 mTLS security
OAuth2SecurityScheme.java 950 OAuth2 security
OAuthFlows.java 1745 OAuth flows container
OpenIdConnectSecurityScheme.java 702 OpenID Connect
SecurityRequirement.java 728 Security requirement
SecurityScheme.java 1733 Sealed security scheme
CancelTaskRequest.java 943 Cancel task request
GetExtendedAgentCardRequest.java 538 Get extended card request
GetTaskRequest.java 835 Get task request
GetTaskPushNotificationConfigRequest.java 866 Get push config request
DeleteTaskPushNotificationConfigRequest.java 866 Delete push config request
ListTaskPushNotificationConfigsRequest.java 948 List push configs request
ListTaskPushNotificationConfigsResponse.java 986 List push configs response
ListTasksRequest.java 1614 List tasks request
ListTasksResponse.java 1148 List tasks response
Message.java 2166 Message type
Part.java 1818 Message part (oneof: text/file/data)
SendMessageConfiguration.java 1110 Send message config
SendMessageRequest.java 1245 Send message request
SendMessageResponse.java 961 Send message response
StreamResponse.java 1473 Streaming response (oneof)
StringList.java 617 String list wrapper
SubscribeToTaskRequest.java 702 Subscribe request
Task.java 2121 Task type
TaskArtifactUpdateEvent.java 1346 Artifact update event
TaskPushNotificationConfig.java 1442 Push notification config

Import

// Application code should NOT import these directly.
// Use spec records instead:
import org.a2aproject.sdk.spec.AgentCard;
import org.a2aproject.sdk.spec.Task;

// These are used internally by GrpcTransport via ProtoUtils:
import org.a2aproject.sdk.grpc.utils.ProtoUtils;

I/O Contract

Inputs

Name Type Required Description
proto builder Builder Yes Generated builder for each message type
wire bytes byte[] Yes (deserialization) Protobuf binary wire format

Outputs

Name Type Description
proto message GeneratedMessage Immutable protobuf message
wire bytes byte[] Binary wire format for gRPC transport

Usage Examples

Internal Conversion (via ProtoUtils)

// GrpcTransport converts spec records to proto and back:
// To proto:
org.a2aproject.sdk.grpc.SendMessageRequest protoRequest =
    ProtoUtils.ToProto.sendMessageRequest(specParams);

// From proto:
EventKind result = ProtoUtils.FromProto.message(protoResponse.getMessage());

gRPC Service Stub Usage

// A2AServiceGrpc provides stubs (used internally by GrpcTransport):
A2AServiceGrpc.A2AServiceBlockingV2Stub stub =
    A2AServiceGrpc.newBlockingV2Stub(channel);
SendMessageResponse response = stub.sendMessage(protoRequest);

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment