Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/run-tck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

env:
# Tag of the TCK
TCK_VERSION: v0.2.3
TCK_VERSION: v0.2.5
# Tells uv to not need a venv, and instead use system
UV_SYSTEM_PYTHON: 1

Expand Down
2 changes: 1 addition & 1 deletion impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.wildfly.extras.a2a</groupId>
<artifactId>a2a-java-sdk-server-jakarta-parent</artifactId>
<version>0.2.3.Beta2-SNAPSHOT</version>
<version>0.2.5.Beta1-SNAPSHOT</version>
</parent>

<artifactId>a2a-java-sdk-server-jakarta</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package org.wildfly.extras.a2a.server.apps.jakarta;

import jakarta.ws.rs.ext.ContextResolver;
import jakarta.ws.rs.ext.Provider;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;

import io.a2a.spec.DeleteTaskPushNotificationConfigResponse;
import io.a2a.spec.JSONRPCResponse;
import io.a2a.spec.JSONRPCVoidResponseSerializer;

@Provider
public class A2AContextResolver implements ContextResolver<ObjectMapper> {

private final ObjectMapper mapper;

public A2AContextResolver() {
mapper = new ObjectMapper();
SimpleModule module = new SimpleModule();
module.addSerializer(new JSONRPCVoidResponseSerializer());
mapper.registerModule(module);
}

@Override
public ObjectMapper getContext(Class<?> type) {
if (JSONRPCResponse.class.isAssignableFrom(type) && type.equals(DeleteTaskPushNotificationConfigResponse.class)) {
return mapper;
}
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
import java.io.InputStream;

import io.a2a.spec.CancelTaskRequest;
import io.a2a.spec.DeleteTaskPushNotificationConfigRequest;
import io.a2a.spec.GetTaskPushNotificationConfigRequest;
import io.a2a.spec.GetTaskRequest;
import io.a2a.spec.ListTaskPushNotificationConfigRequest;
import io.a2a.spec.SendMessageRequest;
import io.a2a.spec.SendStreamingMessageRequest;
import io.a2a.spec.SetTaskPushNotificationConfigRequest;
Expand Down Expand Up @@ -67,7 +69,9 @@ private static boolean isNonStreamingRequest(String requestBody) {
requestBody.contains(CancelTaskRequest.METHOD) ||
requestBody.contains(SendMessageRequest.METHOD) ||
requestBody.contains(SetTaskPushNotificationConfigRequest.METHOD) ||
requestBody.contains(GetTaskPushNotificationConfigRequest.METHOD);
requestBody.contains(GetTaskPushNotificationConfigRequest.METHOD) ||
requestBody.contains(ListTaskPushNotificationConfigRequest.METHOD) ||
requestBody.contains(DeleteTaskPushNotificationConfigRequest.METHOD);
}

private static void putAcceptHeader(ContainerRequestContext requestContext, String mediaType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import io.a2a.server.util.async.Internal;
import io.a2a.spec.AgentCard;
import io.a2a.spec.CancelTaskRequest;
import io.a2a.spec.DeleteTaskPushNotificationConfigRequest;
import io.a2a.spec.GetTaskPushNotificationConfigRequest;
import io.a2a.spec.GetTaskRequest;
import io.a2a.spec.IdJsonMappingException;
Expand All @@ -37,6 +38,7 @@
import io.a2a.spec.JSONRPCErrorResponse;
import io.a2a.spec.JSONRPCRequest;
import io.a2a.spec.JSONRPCResponse;
import io.a2a.spec.ListTaskPushNotificationConfigRequest;
import io.a2a.spec.MethodNotFoundError;
import io.a2a.spec.MethodNotFoundJsonMappingException;
import io.a2a.spec.NonStreamingJSONRPCRequest;
Expand Down Expand Up @@ -146,11 +148,15 @@ private JSONRPCResponse<?> processNonStreamingRequest(NonStreamingJSONRPCRequest
} else if (request instanceof CancelTaskRequest) {
return jsonRpcHandler.onCancelTask((CancelTaskRequest) request);
} else if (request instanceof SetTaskPushNotificationConfigRequest) {
return jsonRpcHandler.setPushNotification((SetTaskPushNotificationConfigRequest) request);
return jsonRpcHandler.setPushNotificationConfig((SetTaskPushNotificationConfigRequest) request);
} else if (request instanceof GetTaskPushNotificationConfigRequest) {
return jsonRpcHandler.getPushNotification((GetTaskPushNotificationConfigRequest) request);
return jsonRpcHandler.getPushNotificationConfig((GetTaskPushNotificationConfigRequest) request);
} else if (request instanceof SendMessageRequest) {
return jsonRpcHandler.onMessageSend((SendMessageRequest) request);
} else if (request instanceof ListTaskPushNotificationConfigRequest) {
return jsonRpcHandler.listPushNotificationConfig((ListTaskPushNotificationConfigRequest) request);
} else if (request instanceof DeleteTaskPushNotificationConfigRequest) {
return jsonRpcHandler.deletePushNotificationConfig((DeleteTaskPushNotificationConfigRequest) request);
} else {
return generateErrorResponse(request, new UnsupportedOperationError());
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<groupId>org.wildfly.extras.a2a</groupId>
<artifactId>a2a-java-sdk-server-jakarta-parent</artifactId>
<version>0.2.3.Beta2-SNAPSHOT</version>
<version>0.2.5.Beta1-SNAPSHOT</version>

<packaging>pom</packaging>

Expand Down
2 changes: 1 addition & 1 deletion tck/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.wildfly.extras.a2a</groupId>
<artifactId>a2a-java-sdk-server-jakarta-parent</artifactId>
<version>0.2.3.Beta2-SNAPSHOT</version>
<version>0.2.5.Beta1-SNAPSHOT</version>
</parent>

<artifactId>a2a-java-sdk-server-jakarta-tck-wildfly</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public AgentCard agentCard() {
.tags(Collections.singletonList("hello world"))
.examples(List.of("hi", "hello world"))
.build()))
.protocolVersion("0.2.5")
.build();
}
}
Expand Down
4 changes: 2 additions & 2 deletions tests/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.wildfly.extras.a2a</groupId>
<artifactId>a2a-java-sdk-server-jakarta-test-parent</artifactId>
<version>0.2.3.Beta2-SNAPSHOT</version>
<version>0.2.5.Beta1-SNAPSHOT</version>
</parent>

<artifactId>a2a-java-sdk-server-jakarta-test-common</artifactId>
Expand Down Expand Up @@ -55,4 +55,4 @@
<scope>provided</scope>
</dependency>
</dependencies>
</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import jakarta.ws.rs.core.Response;

import io.a2a.server.apps.common.TestUtilsBean;
import io.a2a.spec.PushNotificationConfig;
import io.a2a.spec.Task;
import io.a2a.spec.TaskArtifactUpdateEvent;
import io.a2a.spec.TaskStatusUpdateEvent;
Expand Down Expand Up @@ -102,4 +103,29 @@ public Response enqueueTaskArtifactUpdateEvent(@PathParam("taskId") String taskI
public Response getStreamingSubscribedCount() {
return Response.ok(String.valueOf(streamingSubscribedCount.get()), TEXT_PLAIN).build();
}

@DELETE
@Path("/task/{taskId}/config/{configId}")
public Response deleteTaskPushNotificationConfig(@PathParam("taskId") String taskId, @PathParam("configId") String configId) {
Task task = testUtilsBean.getTask(taskId);
if (task == null) {
return Response.status(404).build();
}
testUtilsBean.deleteTaskPushNotificationConfig(taskId, configId);
return Response.ok()
.header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)
.build();
}

@POST
@Path("/task/{taskId}")
@Consumes(MediaType.APPLICATION_JSON)
public Response savePushNotificationConfigInStore(@PathParam("taskId") String taskId, String body) throws Exception {
PushNotificationConfig notificationConfig = Utils.OBJECT_MAPPER.readValue(body, PushNotificationConfig.class);
if (notificationConfig == null) {
return Response.status(404).build();
}
testUtilsBean.saveTaskPushNotificationConfig(taskId, notificationConfig);
return Response.ok().build();
}
}
4 changes: 2 additions & 2 deletions tests/impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.wildfly.extras.a2a</groupId>
<artifactId>a2a-java-sdk-server-jakarta-test-parent</artifactId>
<version>0.2.3.Beta2-SNAPSHOT</version>
<version>0.2.5.Beta1-SNAPSHOT</version>
</parent>

<artifactId>a2a-java-sdk-server-jakarta-tests</artifactId>
Expand Down Expand Up @@ -133,4 +133,4 @@
</plugin>
</plugins>
</build>
</project>
</project>
2 changes: 1 addition & 1 deletion tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.wildfly.extras.a2a</groupId>
<artifactId>a2a-java-sdk-server-jakarta-parent</artifactId>
<version>0.2.3.Beta2-SNAPSHOT</version>
<version>0.2.5.Beta1-SNAPSHOT</version>
</parent>

<artifactId>a2a-java-sdk-server-jakarta-test-parent</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions tests/wildfly-jar/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.wildfly.extras.a2a</groupId>
<artifactId>a2a-java-sdk-server-jakarta-test-parent</artifactId>
<version>0.2.3.Beta2-SNAPSHOT</version>
<version>0.2.5.Beta1-SNAPSHOT</version>
</parent>

<artifactId>a2a-java-sdk-server-jakarta-tests-wildfly</artifactId>
Expand Down Expand Up @@ -128,4 +128,4 @@
</plugin>
</plugins>
</build>
</project>
</project>
2 changes: 1 addition & 1 deletion wildfly-jar/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.wildfly.extras.a2a</groupId>
<artifactId>a2a-java-sdk-server-jakarta-parent</artifactId>
<version>0.2.3.Beta2-SNAPSHOT</version>
<version>0.2.5.Beta1-SNAPSHOT</version>
</parent>

<artifactId>a2a-java-sdk-server-jakarta-wildfly</artifactId>
Expand Down