Skip to content

Commit 7153378

Browse files
committed
fix!: Update a2a.proto changes
- Aligning to the latest version of a2a.proto - Update tests to match a2a.proto changes: Fixes test failures after proto update - adjusts JSON structures and package references to align with new proto definitions. Signed-off-by: Emmanuel Hugonnet <ehugonne@redhat.com>
1 parent c595071 commit 7153378

124 files changed

Lines changed: 4765 additions & 4630 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

client/transport/grpc/src/main/java/io/a2a/client/transport/grpc/GrpcTransport.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ public TaskPushNotificationConfig createTaskPushNotificationConfiguration(TaskPu
238238
io.a2a.grpc.CreateTaskPushNotificationConfigRequest grpcRequest = io.a2a.grpc.CreateTaskPushNotificationConfigRequest.newBuilder()
239239
.setTaskId(request.taskId())
240240
.setConfig(ToProto.taskPushNotificationConfig(request).getPushNotificationConfig())
241-
.setConfigId(configId != null ? configId : request.taskId())
242241
.setTenant(resolveTenant(request.tenant()))
243242
.build();
244243
PayloadAndHeaders payloadAndHeaders = applyInterceptors(SET_TASK_PUSH_NOTIFICATION_CONFIG_METHOD, grpcRequest, agentCard, context);
@@ -281,7 +280,7 @@ public ListTaskPushNotificationConfigResult listTaskPushNotificationConfiguratio
281280
@Nullable ClientCallContext context) throws A2AClientException {
282281
checkNotNullParam("request", request);
283282

284-
io.a2a.grpc.ListTaskPushNotificationConfigRequest grpcRequest = io.a2a.grpc.ListTaskPushNotificationConfigRequest.newBuilder()
283+
io.a2a.grpc.ListTaskPushNotificationConfigsRequest grpcRequest = io.a2a.grpc.ListTaskPushNotificationConfigsRequest.newBuilder()
285284
.setTaskId(request.id())
286285
.setTenant(resolveTenant(request.tenant()))
287286
.setPageSize(request.pageSize())
@@ -292,7 +291,7 @@ public ListTaskPushNotificationConfigResult listTaskPushNotificationConfiguratio
292291

293292
try {
294293
A2AServiceBlockingV2Stub stubWithMetadata = createBlockingStubWithMetadata(context, payloadAndHeaders);
295-
io.a2a.grpc.ListTaskPushNotificationConfigResponse grpcResponse = stubWithMetadata.listTaskPushNotificationConfig(grpcRequest);
294+
io.a2a.grpc.ListTaskPushNotificationConfigsResponse grpcResponse = stubWithMetadata.listTaskPushNotificationConfigs(grpcRequest);
296295
return FromProto.listTaskPushNotificationConfigResult(grpcResponse);
297296
} catch (StatusRuntimeException | StatusException e) {
298297
throw GrpcErrorMapper.mapGrpcError(e, "Failed to list task push notification config: ");

client/transport/jsonrpc/src/main/java/io/a2a/client/transport/jsonrpc/JSONRPCTransport.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
import io.a2a.jsonrpc.common.wrappers.GetExtendedAgentCardResponse;
4040
import io.a2a.jsonrpc.common.wrappers.GetTaskPushNotificationConfigResponse;
4141
import io.a2a.jsonrpc.common.wrappers.GetTaskResponse;
42-
import io.a2a.jsonrpc.common.wrappers.ListTaskPushNotificationConfigResponse;
42+
import io.a2a.jsonrpc.common.wrappers.ListTaskPushNotificationConfigsResponse;
4343
import io.a2a.jsonrpc.common.wrappers.ListTasksResponse;
4444
import io.a2a.jsonrpc.common.wrappers.ListTasksResult;
4545
import io.a2a.jsonrpc.common.wrappers.SendMessageResponse;
@@ -228,7 +228,7 @@ public ListTaskPushNotificationConfigResult listTaskPushNotificationConfiguratio
228228

229229
try {
230230
String httpResponseBody = sendPostRequest(Utils.buildBaseUrl(agentInterface, request.tenant()), payloadAndHeaders, LIST_TASK_PUSH_NOTIFICATION_CONFIG_METHOD);
231-
ListTaskPushNotificationConfigResponse response = unmarshalResponse(httpResponseBody, LIST_TASK_PUSH_NOTIFICATION_CONFIG_METHOD);
231+
ListTaskPushNotificationConfigsResponse response = unmarshalResponse(httpResponseBody, LIST_TASK_PUSH_NOTIFICATION_CONFIG_METHOD);
232232
return response.getResult();
233233
} catch (A2AClientException e) {
234234
throw e;

client/transport/jsonrpc/src/test/java/io/a2a/client/transport/jsonrpc/JsonMessages.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,8 @@ public class JsonMessages {
322322
"id": "cd4c76de-d54c-436c-8b9f-4c2703648d64",
323323
"result": {
324324
"taskId": "de38c76d-d54c-436c-8b9f-4c2703648d64",
325-
"id": "c295ea44-7543-4f78-b524-7a38915ad6e4",
326325
"pushNotificationConfig": {
326+
"id": "c295ea44-7543-4f78-b524-7a38915ad6e4",
327327
"url": "https://example.com/callback",
328328
"authentication": {
329329
"scheme": "jwt"
@@ -339,8 +339,8 @@ public class JsonMessages {
339339
"method":"CreateTaskPushNotificationConfig",
340340
"params":{
341341
"taskId":"de38c76d-d54c-436c-8b9f-4c2703648d64",
342-
"configId":"c295ea44-7543-4f78-b524-7a38915ad6e4",
343342
"config":{
343+
"id":"c295ea44-7543-4f78-b524-7a38915ad6e4",
344344
"url":"https://example.com/callback",
345345
"authentication":{
346346
"scheme":"jwt"
@@ -355,8 +355,8 @@ public class JsonMessages {
355355
"id": "cd4c76de-d54c-436c-8b9f-4c2703648d64",
356356
"result": {
357357
"taskId":"de38c76d-d54c-436c-8b9f-4c2703648d64",
358-
"id":"c295ea44-7543-4f78-b524-7a38915ad6e4",
359358
"pushNotificationConfig": {
359+
"id":"c295ea44-7543-4f78-b524-7a38915ad6e4",
360360
"url": "https://example.com/callback",
361361
"authentication": {
362362
"scheme": "jwt"

client/transport/rest/src/main/java/io/a2a/client/transport/rest/RestTransport.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,6 @@ public TaskPushNotificationConfig createTaskPushNotificationConfiguration(TaskPu
275275
= io.a2a.grpc.CreateTaskPushNotificationConfigRequest.newBuilder();
276276
builder.setConfig(ProtoUtils.ToProto.taskPushNotificationConfig(request).getPushNotificationConfig())
277277
.setTaskId(request.taskId());
278-
if (request.config().id() != null) {
279-
builder.setConfigId(request.config().id());
280-
}
281278
PayloadAndHeaders payloadAndHeaders = applyInterceptors(SET_TASK_PUSH_NOTIFICATION_CONFIG_METHOD, builder, agentCard, context);
282279
try {
283280
String httpResponseBody = sendPostRequest(Utils.buildBaseUrl(agentInterface, request.tenant()) + String.format("/tasks/%1s/pushNotificationConfigs", request.taskId()), payloadAndHeaders);
@@ -333,8 +330,8 @@ public TaskPushNotificationConfig getTaskPushNotificationConfiguration(GetTaskPu
333330
@Override
334331
public ListTaskPushNotificationConfigResult listTaskPushNotificationConfigurations(ListTaskPushNotificationConfigParams request, @Nullable ClientCallContext context) throws A2AClientException {
335332
checkNotNullParam("request", request);
336-
io.a2a.grpc.ListTaskPushNotificationConfigRequest.Builder builder
337-
= io.a2a.grpc.ListTaskPushNotificationConfigRequest.newBuilder();
333+
io.a2a.grpc.ListTaskPushNotificationConfigsRequest.Builder builder
334+
= io.a2a.grpc.ListTaskPushNotificationConfigsRequest.newBuilder();
338335
builder.setTaskId(request.id());
339336
PayloadAndHeaders payloadAndHeaders = applyInterceptors(LIST_TASK_PUSH_NOTIFICATION_CONFIG_METHOD, builder,
340337
agentCard, context);
@@ -351,7 +348,7 @@ public ListTaskPushNotificationConfigResult listTaskPushNotificationConfiguratio
351348
throw RestErrorMapper.mapRestError(response);
352349
}
353350
String httpResponseBody = response.body();
354-
io.a2a.grpc.ListTaskPushNotificationConfigResponse.Builder responseBuilder = io.a2a.grpc.ListTaskPushNotificationConfigResponse.newBuilder();
351+
io.a2a.grpc.ListTaskPushNotificationConfigsResponse.Builder responseBuilder = io.a2a.grpc.ListTaskPushNotificationConfigsResponse.newBuilder();
355352
JsonFormat.parser().merge(httpResponseBody, responseBuilder);
356353
return ProtoUtils.FromProto.listTaskPushNotificationConfigResult(responseBuilder);
357354
} catch (A2AClientException e) {

client/transport/rest/src/test/java/io/a2a/client/transport/rest/JsonRestMessages.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,8 @@ public class JsonRestMessages {
308308
static final String GET_TASK_PUSH_NOTIFICATION_CONFIG_TEST_RESPONSE = """
309309
{
310310
"taskId": "de38c76d-d54c-436c-8b9f-4c2703648d64",
311-
"id": "10",
312311
"pushNotificationConfig": {
312+
"id": "10",
313313
"url": "https://example.com/callback",
314314
"authentication": {
315315
"scheme": "jwt"
@@ -321,8 +321,8 @@ public class JsonRestMessages {
321321
"configs":[
322322
{
323323
"taskId": "de38c76d-d54c-436c-8b9f-4c2703648d64",
324-
"id": "10",
325324
"pushNotificationConfig": {
325+
"id": "10",
326326
"url": "https://example.com/callback",
327327
"authentication": {
328328
"scheme": "jwt"
@@ -331,8 +331,8 @@ public class JsonRestMessages {
331331
},
332332
{
333333
"taskId": "de38c76d-d54c-436c-8b9f-4c2703648d64",
334-
"id": "5",
335334
"pushNotificationConfig": {
335+
"id": "5",
336336
"url": "https://test.com/callback"
337337
}
338338
}
@@ -343,8 +343,8 @@ public class JsonRestMessages {
343343
static final String SET_TASK_PUSH_NOTIFICATION_CONFIG_TEST_REQUEST = """
344344
{
345345
"taskId": "de38c76d-d54c-436c-8b9f-4c2703648d64",
346-
"configId": "default-config-id",
347346
"config": {
347+
"id": "default-config-id",
348348
"url": "https://example.com/callback",
349349
"authentication": {
350350
"scheme": "jwt"
@@ -355,8 +355,8 @@ public class JsonRestMessages {
355355
static final String SET_TASK_PUSH_NOTIFICATION_CONFIG_TEST_RESPONSE = """
356356
{
357357
"taskId": "de38c76d-d54c-436c-8b9f-4c2703648d64",
358-
"id": "10",
359358
"pushNotificationConfig": {
359+
"id": "10",
360360
"url": "https://example.com/callback",
361361
"authentication": {
362362
"scheme": "jwt"

jsonrpc-common/src/main/java/io/a2a/jsonrpc/common/wrappers/A2AResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
* @param <T> the type of the result value returned in successful responses
1212
*/
13-
public abstract sealed class A2AResponse<T> implements A2AMessage permits CancelTaskResponse, DeleteTaskPushNotificationConfigResponse, GetExtendedAgentCardResponse, GetTaskPushNotificationConfigResponse, GetTaskResponse, A2AErrorResponse, ListTaskPushNotificationConfigResponse, ListTasksResponse, SendMessageResponse, SendStreamingMessageResponse, CreateTaskPushNotificationConfigResponse {
13+
public abstract sealed class A2AResponse<T> implements A2AMessage permits CancelTaskResponse, DeleteTaskPushNotificationConfigResponse, GetExtendedAgentCardResponse, GetTaskPushNotificationConfigResponse, GetTaskResponse, A2AErrorResponse, ListTaskPushNotificationConfigsResponse, ListTasksResponse, SendMessageResponse, SendStreamingMessageResponse, CreateTaskPushNotificationConfigResponse {
1414

1515
/** The JSON-RPC protocol version. */
1616
protected String jsonrpc;

jsonrpc-common/src/main/java/io/a2a/jsonrpc/common/wrappers/ListTaskPushNotificationConfigRequest.java renamed to jsonrpc-common/src/main/java/io/a2a/jsonrpc/common/wrappers/ListTaskPushNotificationConfigsRequest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
* <p>
1717
* This class implements the JSON-RPC {@code tasks/pushNotificationConfig/list} method.
1818
*
19-
* @see ListTaskPushNotificationConfigResponse for the response
19+
* @see ListTaskPushNotificationConfigsResponse for the response
2020
* @see ListTaskPushNotificationConfigParams for the parameter structure
2121
* @see TaskPushNotificationConfig for the configuration structure
2222
* @see <a href="https://a2a-protocol.org/latest/">A2A Protocol Specification</a>
2323
*/
24-
public final class ListTaskPushNotificationConfigRequest extends NonStreamingJSONRPCRequest<ListTaskPushNotificationConfigParams> {
24+
public final class ListTaskPushNotificationConfigsRequest extends NonStreamingJSONRPCRequest<ListTaskPushNotificationConfigParams> {
2525

2626
/**
2727
* Constructs request with all parameters.
@@ -30,7 +30,7 @@ public final class ListTaskPushNotificationConfigRequest extends NonStreamingJSO
3030
* @param id the request ID
3131
* @param params the request parameters
3232
*/
33-
public ListTaskPushNotificationConfigRequest(String jsonrpc, Object id, ListTaskPushNotificationConfigParams params) {
33+
public ListTaskPushNotificationConfigsRequest(String jsonrpc, Object id, ListTaskPushNotificationConfigParams params) {
3434
super(jsonrpc, LIST_TASK_PUSH_NOTIFICATION_CONFIG_METHOD, id, params);
3535
}
3636

@@ -40,7 +40,7 @@ public ListTaskPushNotificationConfigRequest(String jsonrpc, Object id, ListTask
4040
* @param id the request ID
4141
* @param params the request parameters
4242
*/
43-
public ListTaskPushNotificationConfigRequest(String id, ListTaskPushNotificationConfigParams params) {
43+
public ListTaskPushNotificationConfigsRequest(String id, ListTaskPushNotificationConfigParams params) {
4444
this(null, id, params);
4545
}
4646

@@ -105,11 +105,11 @@ public Builder params(ListTaskPushNotificationConfigParams params) {
105105
*
106106
* @return a new instance
107107
*/
108-
public ListTaskPushNotificationConfigRequest build() {
108+
public ListTaskPushNotificationConfigsRequest build() {
109109
if (id == null) {
110110
id = UUID.randomUUID().toString();
111111
}
112-
return new ListTaskPushNotificationConfigRequest(jsonrpc, id, params);
112+
return new ListTaskPushNotificationConfigsRequest(jsonrpc, id, params);
113113
}
114114
}
115115
}

jsonrpc-common/src/main/java/io/a2a/jsonrpc/common/wrappers/ListTaskPushNotificationConfigResponse.java renamed to jsonrpc-common/src/main/java/io/a2a/jsonrpc/common/wrappers/ListTaskPushNotificationConfigsResponse.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
* <p>
1414
* If an error occurs, the error field will contain a {@link A2AError}.
1515
*
16-
* @see ListTaskPushNotificationConfigRequest for the corresponding request
16+
* @see ListTaskPushNotificationConfigsRequest for the corresponding request
1717
* @see ListTaskPushNotificationConfigResult for the result structure
1818
* @see TaskPushNotificationConfig for the configuration structure
1919
* @see <a href="https://a2a-protocol.org/latest/">A2A Protocol Specification</a>
2020
*/
21-
public final class ListTaskPushNotificationConfigResponse extends A2AResponse<ListTaskPushNotificationConfigResult> {
21+
public final class ListTaskPushNotificationConfigsResponse extends A2AResponse<ListTaskPushNotificationConfigResult> {
2222

2323
/**
2424
* Constructs response with all parameters.
@@ -28,7 +28,7 @@ public final class ListTaskPushNotificationConfigResponse extends A2AResponse<Li
2828
* @param result the result containing list of push notification configurations and pagination info
2929
* @param error the error (if any)
3030
*/
31-
public ListTaskPushNotificationConfigResponse(String jsonrpc, Object id, ListTaskPushNotificationConfigResult result, A2AError error) {
31+
public ListTaskPushNotificationConfigsResponse(String jsonrpc, Object id, ListTaskPushNotificationConfigResult result, A2AError error) {
3232
super(jsonrpc, id, result, error, ListTaskPushNotificationConfigResult.class);
3333
}
3434

@@ -38,7 +38,7 @@ public ListTaskPushNotificationConfigResponse(String jsonrpc, Object id, ListTas
3838
* @param id the request ID
3939
* @param error the error
4040
*/
41-
public ListTaskPushNotificationConfigResponse(Object id, A2AError error) {
41+
public ListTaskPushNotificationConfigsResponse(Object id, A2AError error) {
4242
this(null, id, null, error);
4343
}
4444

@@ -48,7 +48,7 @@ public ListTaskPushNotificationConfigResponse(Object id, A2AError error) {
4848
* @param id the request ID
4949
* @param result the result containing list of push notification configurations and pagination info
5050
*/
51-
public ListTaskPushNotificationConfigResponse(Object id, ListTaskPushNotificationConfigResult result) {
51+
public ListTaskPushNotificationConfigsResponse(Object id, ListTaskPushNotificationConfigResult result) {
5252
this(null, id, result, null);
5353
}
5454

jsonrpc-common/src/main/java/io/a2a/jsonrpc/common/wrappers/NonStreamingJSONRPCRequest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88
public abstract sealed class NonStreamingJSONRPCRequest<T> extends A2ARequest<T> permits GetTaskRequest,
99
CancelTaskRequest, CreateTaskPushNotificationConfigRequest, GetTaskPushNotificationConfigRequest,
10-
SendMessageRequest, DeleteTaskPushNotificationConfigRequest, ListTaskPushNotificationConfigRequest,
10+
SendMessageRequest, DeleteTaskPushNotificationConfigRequest, ListTaskPushNotificationConfigsRequest,
1111
GetExtendedAgentCardRequest, ListTasksRequest {
1212

1313
NonStreamingJSONRPCRequest(String jsonrpc, String method, Object id, T params) {

reference/jsonrpc/src/main/java/io/a2a/server/apps/quarkus/A2AServerRoutes.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
import io.a2a.jsonrpc.common.wrappers.GetTaskPushNotificationConfigResponse;
4444
import io.a2a.jsonrpc.common.wrappers.GetTaskRequest;
4545
import io.a2a.jsonrpc.common.wrappers.GetTaskResponse;
46-
import io.a2a.jsonrpc.common.wrappers.ListTaskPushNotificationConfigRequest;
47-
import io.a2a.jsonrpc.common.wrappers.ListTaskPushNotificationConfigResponse;
46+
import io.a2a.jsonrpc.common.wrappers.ListTaskPushNotificationConfigsRequest;
47+
import io.a2a.jsonrpc.common.wrappers.ListTaskPushNotificationConfigsResponse;
4848
import io.a2a.jsonrpc.common.wrappers.ListTasksRequest;
4949
import io.a2a.jsonrpc.common.wrappers.ListTasksResponse;
5050
import io.a2a.jsonrpc.common.wrappers.NonStreamingJSONRPCRequest;
@@ -187,7 +187,7 @@ private A2AResponse<?> processNonStreamingRequest(NonStreamingJSONRPCRequest<?>
187187
if (request instanceof SendMessageRequest req) {
188188
return jsonRpcHandler.onMessageSend(req, context);
189189
}
190-
if (request instanceof ListTaskPushNotificationConfigRequest req) {
190+
if (request instanceof ListTaskPushNotificationConfigsRequest req) {
191191
return jsonRpcHandler.listPushNotificationConfig(req, context);
192192
}
193193
if (request instanceof DeleteTaskPushNotificationConfigRequest req) {
@@ -304,7 +304,7 @@ private static com.google.protobuf.MessageOrBuilder convertToProto(A2AResponse<?
304304
return io.a2a.grpc.utils.ProtoUtils.ToProto.createTaskPushNotificationConfigResponse(r.getResult());
305305
} else if (response instanceof GetTaskPushNotificationConfigResponse r) {
306306
return io.a2a.grpc.utils.ProtoUtils.ToProto.getTaskPushNotificationConfigResponse(r.getResult());
307-
} else if (response instanceof ListTaskPushNotificationConfigResponse r) {
307+
} else if (response instanceof ListTaskPushNotificationConfigsResponse r) {
308308
return io.a2a.grpc.utils.ProtoUtils.ToProto.listTaskPushNotificationConfigResponse(r.getResult());
309309
} else if (response instanceof DeleteTaskPushNotificationConfigResponse) {
310310
// DeleteTaskPushNotificationConfig has no result body, just return empty message

0 commit comments

Comments
 (0)