Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class JsonRestMessages {
"messageId": "message-1234",
"contextId": "context-1234",
"role": "ROLE_USER",
"content": [{
"parts": [{
"text": "tell me a joke"
}],
"metadata": {
Expand All @@ -35,7 +35,7 @@ public class JsonRestMessages {
"contextId": "context-1234",
"taskId": "9b511af4-b27c-47fa-aecf-2a93c08a44f8",
"role": "ROLE_USER",
"content": [
"parts": [
{
"text": "tell me a joke"
}
Expand Down Expand Up @@ -81,7 +81,7 @@ public class JsonRestMessages {
"history": [
{
"role": "ROLE_USER",
"content": [
"parts": [
{
"text": "tell me a joke"
},
Expand Down Expand Up @@ -624,7 +624,7 @@ public class JsonRestMessages {
{
"message": {
"role": "ROLE_USER",
"content": [
"parts": [
{
"text": "tell me some jokes"
}
Expand Down
430 changes: 233 additions & 197 deletions spec-grpc/src/main/java/io/a2a/grpc/A2A.java

Large diffs are not rendered by default.

131 changes: 103 additions & 28 deletions spec-grpc/src/main/java/io/a2a/grpc/A2AServiceGrpc.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
* - TaskPushNotificationConfig are a resource whose parent is a task.
* They have get, list and create methods.
* - AgentCard is a static resource with only a get method.
* fields are not present as they don't comply with AIP rules, and the
* optional history_length on the get task method is not present as it also
* violates AIP-127 and AIP-131.
* </pre>
*/
@javax.annotation.Generated(
Expand Down Expand Up @@ -123,6 +120,37 @@ io.a2a.grpc.Task> getGetTaskMethod() {
return getGetTaskMethod;
}

private static volatile io.grpc.MethodDescriptor<io.a2a.grpc.ListTasksRequest,
io.a2a.grpc.ListTasksResponse> getListTasksMethod;

@io.grpc.stub.annotations.RpcMethod(
fullMethodName = SERVICE_NAME + '/' + "ListTasks",
requestType = io.a2a.grpc.ListTasksRequest.class,
responseType = io.a2a.grpc.ListTasksResponse.class,
methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
public static io.grpc.MethodDescriptor<io.a2a.grpc.ListTasksRequest,
io.a2a.grpc.ListTasksResponse> getListTasksMethod() {
io.grpc.MethodDescriptor<io.a2a.grpc.ListTasksRequest, io.a2a.grpc.ListTasksResponse> getListTasksMethod;
if ((getListTasksMethod = A2AServiceGrpc.getListTasksMethod) == null) {
synchronized (A2AServiceGrpc.class) {
if ((getListTasksMethod = A2AServiceGrpc.getListTasksMethod) == null) {
A2AServiceGrpc.getListTasksMethod = getListTasksMethod =
io.grpc.MethodDescriptor.<io.a2a.grpc.ListTasksRequest, io.a2a.grpc.ListTasksResponse>newBuilder()
.setType(io.grpc.MethodDescriptor.MethodType.UNARY)
.setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListTasks"))
.setSampledToLocalTracing(true)
.setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
io.a2a.grpc.ListTasksRequest.getDefaultInstance()))
.setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
io.a2a.grpc.ListTasksResponse.getDefaultInstance()))
.setSchemaDescriptor(new A2AServiceMethodDescriptorSupplier("ListTasks"))
.build();
}
}
}
return getListTasksMethod;
}

private static volatile io.grpc.MethodDescriptor<io.a2a.grpc.CancelTaskRequest,
io.a2a.grpc.Task> getCancelTaskMethod;

Expand Down Expand Up @@ -411,9 +439,6 @@ public A2AServiceFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions
* - TaskPushNotificationConfig are a resource whose parent is a task.
* They have get, list and create methods.
* - AgentCard is a static resource with only a get method.
* fields are not present as they don't comply with AIP rules, and the
* optional history_length on the get task method is not present as it also
* violates AIP-127 and AIP-131.
* </pre>
*/
public interface AsyncService {
Expand Down Expand Up @@ -450,6 +475,16 @@ default void getTask(io.a2a.grpc.GetTaskRequest request,
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetTaskMethod(), responseObserver);
}

/**
* <pre>
* List tasks with optional filtering and pagination.
* </pre>
*/
default void listTasks(io.a2a.grpc.ListTasksRequest request,
io.grpc.stub.StreamObserver<io.a2a.grpc.ListTasksResponse> responseObserver) {
io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getListTasksMethod(), responseObserver);
}

/**
* <pre>
* Cancel a task from the agent. If supported one should expect no
Expand Down Expand Up @@ -538,9 +573,6 @@ default void deleteTaskPushNotificationConfig(io.a2a.grpc.DeleteTaskPushNotifica
* - TaskPushNotificationConfig are a resource whose parent is a task.
* They have get, list and create methods.
* - AgentCard is a static resource with only a get method.
* fields are not present as they don't comply with AIP rules, and the
* optional history_length on the get task method is not present as it also
* violates AIP-127 and AIP-131.
* </pre>
*/
public static abstract class A2AServiceImplBase
Expand All @@ -564,9 +596,6 @@ public static abstract class A2AServiceImplBase
* - TaskPushNotificationConfig are a resource whose parent is a task.
* They have get, list and create methods.
* - AgentCard is a static resource with only a get method.
* fields are not present as they don't comply with AIP rules, and the
* optional history_length on the get task method is not present as it also
* violates AIP-127 and AIP-131.
* </pre>
*/
public static final class A2AServiceStub
Expand Down Expand Up @@ -617,6 +646,17 @@ public void getTask(io.a2a.grpc.GetTaskRequest request,
getChannel().newCall(getGetTaskMethod(), getCallOptions()), request, responseObserver);
}

/**
* <pre>
* List tasks with optional filtering and pagination.
* </pre>
*/
public void listTasks(io.a2a.grpc.ListTasksRequest request,
io.grpc.stub.StreamObserver<io.a2a.grpc.ListTasksResponse> responseObserver) {
io.grpc.stub.ClientCalls.asyncUnaryCall(
getChannel().newCall(getListTasksMethod(), getCallOptions()), request, responseObserver);
}

/**
* <pre>
* Cancel a task from the agent. If supported one should expect no
Expand Down Expand Up @@ -712,9 +752,6 @@ public void deleteTaskPushNotificationConfig(io.a2a.grpc.DeleteTaskPushNotificat
* - TaskPushNotificationConfig are a resource whose parent is a task.
* They have get, list and create methods.
* - AgentCard is a static resource with only a get method.
* fields are not present as they don't comply with AIP rules, and the
* optional history_length on the get task method is not present as it also
* violates AIP-127 and AIP-131.
* </pre>
*/
public static final class A2AServiceBlockingV2Stub
Expand Down Expand Up @@ -764,6 +801,16 @@ public io.a2a.grpc.Task getTask(io.a2a.grpc.GetTaskRequest request) {
getChannel(), getGetTaskMethod(), getCallOptions(), request);
}

/**
* <pre>
* List tasks with optional filtering and pagination.
* </pre>
*/
public io.a2a.grpc.ListTasksResponse listTasks(io.a2a.grpc.ListTasksRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getListTasksMethod(), getCallOptions(), request);
}

/**
* <pre>
* Cancel a task from the agent. If supported one should expect no
Expand Down Expand Up @@ -854,9 +901,6 @@ public com.google.protobuf.Empty deleteTaskPushNotificationConfig(io.a2a.grpc.De
* - TaskPushNotificationConfig are a resource whose parent is a task.
* They have get, list and create methods.
* - AgentCard is a static resource with only a get method.
* fields are not present as they don't comply with AIP rules, and the
* optional history_length on the get task method is not present as it also
* violates AIP-127 and AIP-131.
* </pre>
*/
public static final class A2AServiceBlockingStub
Expand Down Expand Up @@ -905,6 +949,16 @@ public io.a2a.grpc.Task getTask(io.a2a.grpc.GetTaskRequest request) {
getChannel(), getGetTaskMethod(), getCallOptions(), request);
}

/**
* <pre>
* List tasks with optional filtering and pagination.
* </pre>
*/
public io.a2a.grpc.ListTasksResponse listTasks(io.a2a.grpc.ListTasksRequest request) {
return io.grpc.stub.ClientCalls.blockingUnaryCall(
getChannel(), getListTasksMethod(), getCallOptions(), request);
}

/**
* <pre>
* Cancel a task from the agent. If supported one should expect no
Expand Down Expand Up @@ -994,9 +1048,6 @@ public com.google.protobuf.Empty deleteTaskPushNotificationConfig(io.a2a.grpc.De
* - TaskPushNotificationConfig are a resource whose parent is a task.
* They have get, list and create methods.
* - AgentCard is a static resource with only a get method.
* fields are not present as they don't comply with AIP rules, and the
* optional history_length on the get task method is not present as it also
* violates AIP-127 and AIP-131.
* </pre>
*/
public static final class A2AServiceFutureStub
Expand Down Expand Up @@ -1035,6 +1086,17 @@ public com.google.common.util.concurrent.ListenableFuture<io.a2a.grpc.Task> getT
getChannel().newCall(getGetTaskMethod(), getCallOptions()), request);
}

/**
* <pre>
* List tasks with optional filtering and pagination.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<io.a2a.grpc.ListTasksResponse> listTasks(
io.a2a.grpc.ListTasksRequest request) {
return io.grpc.stub.ClientCalls.futureUnaryCall(
getChannel().newCall(getListTasksMethod(), getCallOptions()), request);
}

/**
* <pre>
* Cancel a task from the agent. If supported one should expect no
Expand Down Expand Up @@ -1106,13 +1168,14 @@ public com.google.common.util.concurrent.ListenableFuture<com.google.protobuf.Em
private static final int METHODID_SEND_MESSAGE = 0;
private static final int METHODID_SEND_STREAMING_MESSAGE = 1;
private static final int METHODID_GET_TASK = 2;
private static final int METHODID_CANCEL_TASK = 3;
private static final int METHODID_TASK_SUBSCRIPTION = 4;
private static final int METHODID_CREATE_TASK_PUSH_NOTIFICATION_CONFIG = 5;
private static final int METHODID_GET_TASK_PUSH_NOTIFICATION_CONFIG = 6;
private static final int METHODID_LIST_TASK_PUSH_NOTIFICATION_CONFIG = 7;
private static final int METHODID_GET_AGENT_CARD = 8;
private static final int METHODID_DELETE_TASK_PUSH_NOTIFICATION_CONFIG = 9;
private static final int METHODID_LIST_TASKS = 3;
private static final int METHODID_CANCEL_TASK = 4;
private static final int METHODID_TASK_SUBSCRIPTION = 5;
private static final int METHODID_CREATE_TASK_PUSH_NOTIFICATION_CONFIG = 6;
private static final int METHODID_GET_TASK_PUSH_NOTIFICATION_CONFIG = 7;
private static final int METHODID_LIST_TASK_PUSH_NOTIFICATION_CONFIG = 8;
private static final int METHODID_GET_AGENT_CARD = 9;
private static final int METHODID_DELETE_TASK_PUSH_NOTIFICATION_CONFIG = 10;

private static final class MethodHandlers<Req, Resp> implements
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
Expand Down Expand Up @@ -1143,6 +1206,10 @@ public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserv
serviceImpl.getTask((io.a2a.grpc.GetTaskRequest) request,
(io.grpc.stub.StreamObserver<io.a2a.grpc.Task>) responseObserver);
break;
case METHODID_LIST_TASKS:
serviceImpl.listTasks((io.a2a.grpc.ListTasksRequest) request,
(io.grpc.stub.StreamObserver<io.a2a.grpc.ListTasksResponse>) responseObserver);
break;
case METHODID_CANCEL_TASK:
serviceImpl.cancelTask((io.a2a.grpc.CancelTaskRequest) request,
(io.grpc.stub.StreamObserver<io.a2a.grpc.Task>) responseObserver);
Expand Down Expand Up @@ -1210,6 +1277,13 @@ public static final io.grpc.ServerServiceDefinition bindService(AsyncService ser
io.a2a.grpc.GetTaskRequest,
io.a2a.grpc.Task>(
service, METHODID_GET_TASK)))
.addMethod(
getListTasksMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
new MethodHandlers<
io.a2a.grpc.ListTasksRequest,
io.a2a.grpc.ListTasksResponse>(
service, METHODID_LIST_TASKS)))
.addMethod(
getCancelTaskMethod(),
io.grpc.stub.ServerCalls.asyncUnaryCall(
Expand Down Expand Up @@ -1310,6 +1384,7 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() {
.addMethod(getSendMessageMethod())
.addMethod(getSendStreamingMessageMethod())
.addMethod(getGetTaskMethod())
.addMethod(getListTasksMethod())
.addMethod(getCancelTaskMethod())
.addMethod(getTaskSubscriptionMethod())
.addMethod(getCreateTaskPushNotificationConfigMethod())
Expand Down
8 changes: 8 additions & 0 deletions spec-grpc/src/main/java/io/a2a/grpc/APIKeySecurityScheme.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading