diff --git a/CONTRIBUTING_INTEGRATIONS.md b/CONTRIBUTING_INTEGRATIONS.md new file mode 100644 index 000000000..9fc06a520 --- /dev/null +++ b/CONTRIBUTING_INTEGRATIONS.md @@ -0,0 +1,15 @@ +# Contributing A2A SDK Integrations + +To add your A2A SDK Integration for your chosen runtime to the list of integrations in the [README](README.md#server-integrations), open a pull request adding it to the list. + +The pull request should contain a link to your project page. + +Then the project page itself needs to contain the following information as a minimum: + +* How to use the integration. + * Ideally there should be a sample demonstrating how to use it +* The integration should have tests, extending [AbstractA2AServerTest](tests/server-common/src/test/java/io/a2a/server/apps/common/AbstractA2AServerTest.java) +* The integration should pass the [TCK](https://github.com/a2aproject/a2a-tck), and make it obvious how to see that it has passed. +* Ideally, the integration should be deployed in Maven Central. If that is not possible, provide clear instructions for how to build it. + +If some of the above points are problematic, feel free to point that out in your pull request, and we can discuss further. For example, AbstractA2AServerTest is currently written with only the initial runtimes in mind, and might need some tweaking. \ No newline at end of file diff --git a/README.md b/README.md index 5460f910b..fe7d3bbc0 100644 --- a/README.md +++ b/README.md @@ -33,32 +33,23 @@ The A2A Java SDK provides a Java server implementation of the [Agent2Agent (A2A) - [Add a class that creates an A2A Agent Card](#2-add-a-class-that-creates-an-a2a-agent-card) - [Add a class that creates an A2A Agent Executor](#3-add-a-class-that-creates-an-a2a-agent-executor) -### 1. Add an A2A Java SDK Server Maven dependency to your project +### 1. Add the A2A Java SDK Server Maven dependency to your project Adding a dependency on an A2A Java SDK Server will provide access to the core classes that make up the A2A specification and allow you to run your agentic Java application as an A2A server agent. -The A2A Java SDK provides two A2A server endpoint implementations, one based on Jakarta REST (`a2a-java-sdk-server-jakarta`) and one based on Quarkus Reactive Routes (`a2a-java-sdk-server-quarkus`). You can choose the one that best fits your application. +The A2A Java SDK provides a [reference A2A server implementation](reference-impl/README.md) based on [Quarkus](https://quarkus.io) for use with our tests and examples. However, the project is designed in such a way that it is trivial to integrate with various Java runtimes. -Add **one** of the following dependencies to your project: +[Server Integrations](#server-integrations) contains a list of community contributed integrations of the server with various runtimes. You might be able to use one of these for your target runtime, or you can use them as inspiration to create your own. -> *⚠️ The `io.github.a2asdk` `groupId` below is temporary and will likely change for future releases.* +To use the reference implementation add the following dependency to your project: -```xml - - io.github.a2asdk - a2a-java-sdk-server-jakarta - - ${io.a2a.sdk.version} - -``` - -OR +> *⚠️ The `io.github.a2asdk` `groupId` below is temporary and will likely change for future releases.* ```xml io.github.a2asdk - a2a-java-sdk-server-quarkus + a2a-java-reference-server ${io.a2a.sdk.version} @@ -372,5 +363,13 @@ This project is licensed under the terms of the [Apache 2.0 License](LICENSE). See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution guidelines. +## Server Integrations +The following list contains community contributed integrations with various Java Runtimes. + +To contribute an integration, please see [CONTRIBUTING_INTEGRATIONS.md](CONTRIBUTING_INTEGRATIONS.md). + +* [reference-impl/README.md](reference-impl/README.md) - Reference implementation, based on Quarkus. +* https://github.com/wildfly-extras/a2a-java-sdk-server-jakarta - This integration is based on Jakarta EE, and should work in all runtimes supporting the [Jakarta EE Web Profile](https://jakarta.ee/specifications/webprofile/). + diff --git a/examples/helloworld/pom.xml b/examples/helloworld/pom.xml index 7c9cf8928..3b7bd849d 100644 --- a/examples/helloworld/pom.xml +++ b/examples/helloworld/pom.xml @@ -33,7 +33,7 @@ io.github.a2asdk - a2a-java-sdk-server-quarkus + a2a-java-reference-server ${project.version} diff --git a/examples/helloworld/server/pom.xml b/examples/helloworld/server/pom.xml index 9fce226f5..3f5f74a1e 100644 --- a/examples/helloworld/server/pom.xml +++ b/examples/helloworld/server/pom.xml @@ -18,7 +18,7 @@ io.github.a2asdk - a2a-java-sdk-server-quarkus + a2a-java-reference-server io.quarkus diff --git a/pom.xml b/pom.xml index 5508c0cba..9fd7cfeaf 100644 --- a/pom.xml +++ b/pom.xml @@ -271,8 +271,7 @@ common spec client - sdk-jakarta - sdk-quarkus + reference-impl tck examples/helloworld tests/server-common diff --git a/reference-impl/README.md b/reference-impl/README.md new file mode 100644 index 000000000..2a7f0f902 --- /dev/null +++ b/reference-impl/README.md @@ -0,0 +1,7 @@ +# A2A Java SDK Reference Server Integration + +This is a reference server for the A2A SDK for Java, that we use to run tests, as well as to demonstrate examples. + +It is based on [Quarkus](https://quarkus.io), and makes use of Quarkus's [Reactive Routes](https://quarkus.io/guides/reactive-routes). + +It is a great choice if you use Quarkus! \ No newline at end of file diff --git a/sdk-quarkus/pom.xml b/reference-impl/pom.xml similarity index 92% rename from sdk-quarkus/pom.xml rename to reference-impl/pom.xml index daa9418f2..15a62e8b0 100644 --- a/sdk-quarkus/pom.xml +++ b/reference-impl/pom.xml @@ -9,12 +9,12 @@ a2a-java-sdk-parent 0.2.3.Beta2-SNAPSHOT - a2a-java-sdk-server-quarkus + a2a-java-reference-server jar - Java A2A SDK for Quarkus - Java SDK for the Agent2Agent Protocol (A2A) - SDK - Quarkus + Java A2A Reference Server + Java SDK for the Agent2Agent Protocol (A2A) - A2A Reference Server (based on Quarkus) diff --git a/sdk-quarkus/src/main/java/io/a2a/server/apps/quarkus/A2AServerRoutes.java b/reference-impl/src/main/java/io/a2a/server/apps/quarkus/A2AServerRoutes.java similarity index 100% rename from sdk-quarkus/src/main/java/io/a2a/server/apps/quarkus/A2AServerRoutes.java rename to reference-impl/src/main/java/io/a2a/server/apps/quarkus/A2AServerRoutes.java diff --git a/sdk-quarkus/src/main/resources/META-INF/beans.xml b/reference-impl/src/main/resources/META-INF/beans.xml similarity index 100% rename from sdk-quarkus/src/main/resources/META-INF/beans.xml rename to reference-impl/src/main/resources/META-INF/beans.xml diff --git a/sdk-quarkus/src/test/java/io/a2a/server/apps/quarkus/QuarkusA2AServerTest.java b/reference-impl/src/test/java/io/a2a/server/apps/quarkus/QuarkusA2AServerTest.java similarity index 100% rename from sdk-quarkus/src/test/java/io/a2a/server/apps/quarkus/QuarkusA2AServerTest.java rename to reference-impl/src/test/java/io/a2a/server/apps/quarkus/QuarkusA2AServerTest.java diff --git a/sdk-quarkus/src/test/resources/application.properties b/reference-impl/src/test/resources/application.properties similarity index 100% rename from sdk-quarkus/src/test/resources/application.properties rename to reference-impl/src/test/resources/application.properties diff --git a/sdk-jakarta/pom.xml b/sdk-jakarta/pom.xml deleted file mode 100644 index 394956c24..000000000 --- a/sdk-jakarta/pom.xml +++ /dev/null @@ -1,242 +0,0 @@ - - - 4.0.0 - - - io.github.a2asdk - a2a-java-sdk-parent - 0.2.3.Beta2-SNAPSHOT - - a2a-java-sdk-server-jakarta - - jar - - Java A2A SDK for Jakarta - Java SDK for the Agent2Agent Protocol (A2A) - SDK - Jakarta - - 5.1.0.Beta11 - 1.10.0.Final - - 1.2.6 - 10.0.0.Final - 3.3.4 - ${project.build.directory}${file.separator}wildfly - - 8787 - - - - - org.jboss.shrinkwrap - shrinkwrap-bom - ${version.org.jboss.shrinkwrap.shrinkwrap} - pom - import - - - org.jboss.arquillian - arquillian-bom - ${version.org.jboss.arquillian} - pom - import - - - org.wildfly.arquillian - wildfly-arquillian-bom - ${version.org.wildfly.arquillian} - pom - import - - - - - - ${project.groupId} - a2a-java-sdk-spec - ${project.version} - - - ${project.groupId} - a2a-java-sdk-server-common - ${project.version} - - - ${project.groupId} - a2a-java-sdk-tests-server-common - ${project.version} - provided - - - ${project.groupId} - a2a-java-sdk-tests-server-common - test-jar - test - ${project.version} - - - com.fasterxml.jackson.core - jackson-databind - provided - - - jakarta.enterprise - jakarta.enterprise.cdi-api - provided - - - jakarta.inject - jakarta.inject-api - provided - - - jakarta.json - jakarta.json-api - provided - - - jakarta.ws.rs - jakarta.ws.rs-api - provided - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - test - - - io.rest-assured - rest-assured - test - - - org.jboss.arquillian.junit5 - arquillian-junit5-container - test - - - org.wildfly.arquillian - wildfly-arquillian-container-managed - test - - - org.jboss.shrinkwrap - shrinkwrap-api - test - - - org.junit.jupiter - junit-jupiter - test - - - org.jboss.threads - jboss-threads - 3.9.1 - test - - - org.hamcrest - hamcrest - test - - - - - - org.wildfly.glow - wildfly-glow-arquillian-plugin - 1.4.1.Final - - - - org.wildfly - wildfly-galleon-pack - 36.0.1.Final - - - standalone.xml - - - - scan - - scan - - test-compile - - - - - org.wildfly.plugins - wildfly-maven-plugin - 5.1.3.Final - - ${project.build.directory}/glow-scan/provisioning.xml - ${jboss.home} - ${jboss.home} - - - - - - - - - - - test-provisioning - - package - - test-compile - - - - - org.apache.maven.plugins - maven-surefire-plugin - 3.5.3 - - - ${jboss.home} - arquillian.xml - ${arquillian.java.vm.args} - - - - - org.apache.maven.plugins - maven-dependency-plugin - 3.8.1 - - ${project.build.directory}/lib - - - - copy - generate-test-resources - - copy-dependencies - - - test - provided - - - - - - - - - debug.profile - debug - - -agentlib:jdwp=transport=dt_socket,address=*:${server.debug.port},server=y,suspend=y - - - - \ No newline at end of file diff --git a/sdk-jakarta/src/main/java/io/a2a/server/apps/jakarta/A2ARequestFilter.java b/sdk-jakarta/src/main/java/io/a2a/server/apps/jakarta/A2ARequestFilter.java deleted file mode 100644 index 32e47e783..000000000 --- a/sdk-jakarta/src/main/java/io/a2a/server/apps/jakarta/A2ARequestFilter.java +++ /dev/null @@ -1,68 +0,0 @@ -package io.a2a.server.apps.jakarta; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; - -import io.a2a.spec.CancelTaskRequest; -import io.a2a.spec.GetTaskPushNotificationConfigRequest; -import io.a2a.spec.GetTaskRequest; -import io.a2a.spec.SendMessageRequest; -import io.a2a.spec.SendStreamingMessageRequest; -import io.a2a.spec.SetTaskPushNotificationConfigRequest; -import io.a2a.spec.TaskResubscriptionRequest; -import jakarta.ws.rs.container.ContainerRequestContext; -import jakarta.ws.rs.container.ContainerRequestFilter; -import jakarta.ws.rs.container.PreMatching; -import jakarta.ws.rs.core.MediaType; -import jakarta.ws.rs.ext.Provider; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@Provider -@PreMatching -public class A2ARequestFilter implements ContainerRequestFilter { - private static final Logger LOGGER = LoggerFactory.getLogger(A2ARequestFilter.class); - - @Override - public void filter(ContainerRequestContext requestContext) { - if (requestContext.getMethod().equals("POST") && requestContext.hasEntity()) { - try (InputStream entityInputStream = requestContext.getEntityStream()) { - byte[] requestBodyBytes = entityInputStream.readAllBytes(); - String requestBody = new String(requestBodyBytes); - // ensure the request is treated as a streaming request or a non-streaming request - // based on the method in the request body - if (isStreamingRequest(requestBody)) { - LOGGER.debug("Handling request as streaming: {}", requestBody); - putAcceptHeader(requestContext, MediaType.SERVER_SENT_EVENTS); - } else if (isNonStreamingRequest(requestBody)) { - LOGGER.debug("Handling request as non-streaming: {}", requestBody); - putAcceptHeader(requestContext, MediaType.APPLICATION_JSON); - } - // reset the entity stream - requestContext.setEntityStream(new ByteArrayInputStream(requestBodyBytes)); - } catch(IOException e){ - throw new RuntimeException("Unable to read the request body"); - } - } - } - - private static boolean isStreamingRequest(String requestBody) { - return requestBody.contains(SendStreamingMessageRequest.METHOD) || - requestBody.contains(TaskResubscriptionRequest.METHOD); - } - - private static boolean isNonStreamingRequest(String requestBody) { - return requestBody.contains(GetTaskRequest.METHOD) || - requestBody.contains(CancelTaskRequest.METHOD) || - requestBody.contains(SendMessageRequest.METHOD) || - requestBody.contains(SetTaskPushNotificationConfigRequest.METHOD) || - requestBody.contains(GetTaskPushNotificationConfigRequest.METHOD); - } - - private static void putAcceptHeader(ContainerRequestContext requestContext, String mediaType) { - requestContext.getHeaders().putSingle("Accept", mediaType); - } - -} \ No newline at end of file diff --git a/sdk-jakarta/src/main/java/io/a2a/server/apps/jakarta/A2AServerResource.java b/sdk-jakarta/src/main/java/io/a2a/server/apps/jakarta/A2AServerResource.java deleted file mode 100644 index 1e4db8c39..000000000 --- a/sdk-jakarta/src/main/java/io/a2a/server/apps/jakarta/A2AServerResource.java +++ /dev/null @@ -1,257 +0,0 @@ -package io.a2a.server.apps.jakarta; - -import java.util.concurrent.Executor; -import java.util.concurrent.Flow; - -import jakarta.enterprise.inject.Instance; -import jakarta.inject.Inject; -import jakarta.ws.rs.Consumes; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.POST; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.Context; -import jakarta.ws.rs.core.MediaType; -import jakarta.ws.rs.core.Response; -import jakarta.ws.rs.ext.ExceptionMapper; -import jakarta.ws.rs.ext.Provider; -import jakarta.ws.rs.sse.Sse; -import jakarta.ws.rs.sse.SseEventSink; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JsonMappingException; -import io.a2a.server.ExtendedAgentCard; -import io.a2a.server.requesthandlers.JSONRPCHandler; -import io.a2a.server.util.async.Internal; -import io.a2a.spec.AgentCard; -import io.a2a.spec.CancelTaskRequest; -import io.a2a.spec.GetTaskPushNotificationConfigRequest; -import io.a2a.spec.GetTaskRequest; -import io.a2a.spec.IdJsonMappingException; -import io.a2a.spec.InvalidParamsError; -import io.a2a.spec.InvalidParamsJsonMappingException; -import io.a2a.spec.InvalidRequestError; -import io.a2a.spec.JSONErrorResponse; -import io.a2a.spec.JSONParseError; -import io.a2a.spec.JSONRPCError; -import io.a2a.spec.JSONRPCErrorResponse; -import io.a2a.spec.JSONRPCRequest; -import io.a2a.spec.JSONRPCResponse; -import io.a2a.spec.MethodNotFoundError; -import io.a2a.spec.MethodNotFoundJsonMappingException; -import io.a2a.spec.NonStreamingJSONRPCRequest; -import io.a2a.spec.SendMessageRequest; -import io.a2a.spec.SendStreamingMessageRequest; -import io.a2a.spec.SetTaskPushNotificationConfigRequest; -import io.a2a.spec.StreamingJSONRPCRequest; -import io.a2a.spec.TaskResubscriptionRequest; -import io.a2a.spec.UnsupportedOperationError; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@Path("/") -public class A2AServerResource { - - private static final Logger LOGGER = LoggerFactory.getLogger(A2AServerResource.class); - - @Inject - JSONRPCHandler jsonRpcHandler; - - @Inject - @ExtendedAgentCard - Instance extendedAgentCard; - - // Hook so testing can wait until the async Subscription is subscribed. - private static volatile Runnable streamingIsSubscribedRunnable; - - @Inject - @Internal - Executor executor; - - /** - * Handles incoming POST requests to the main A2A endpoint. Dispatches the - * request to the appropriate JSON-RPC handler method and returns the response. - * - * @param request the JSON-RPC request - * @return the JSON-RPC response which may be an error response - */ - @POST - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - public JSONRPCResponse handleNonStreamingRequests(NonStreamingJSONRPCRequest request) { - LOGGER.debug("Handling non-streaming request"); - try { - return processNonStreamingRequest(request); - } finally { - LOGGER.debug("Completed non-streaming request"); - } - } - - /** - * Handles incoming POST requests to the main A2A endpoint that involve Server-Sent Events (SSE). - * Dispatches the request to the appropriate JSON-RPC handler method and returns the response. - */ - @POST - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.SERVER_SENT_EVENTS) - public void handleStreamingRequests(StreamingJSONRPCRequest request, @Context SseEventSink sseEventSink, @Context Sse sse) { - LOGGER.debug("Handling streaming request"); - executor.execute(() -> processStreamingRequest(request, sseEventSink, sse)); - LOGGER.debug("Submitted streaming request for async processing"); - } - - /** - * Handles incoming GET requests to the agent card endpoint. - * Returns the agent card in JSON format. - * - * @return the agent card - */ - @GET - @Path("/.well-known/agent.json") - @Produces(MediaType.APPLICATION_JSON) - public AgentCard getAgentCard() { - return jsonRpcHandler.getAgentCard(); - } - - /** - * Handles incoming GET requests to the authenticated extended agent card endpoint. - * Returns the agent card in JSON format. - * - * @return the authenticated extended agent card - */ - @GET - @Path("/agent/authenticatedExtendedCard") - @Produces(MediaType.APPLICATION_JSON) - public Response getAuthenticatedExtendedAgentCard() { - // TODO need to add authentication for this endpoint - // https://github.com/a2aproject/a2a-java/issues/77 - if (! jsonRpcHandler.getAgentCard().supportsAuthenticatedExtendedCard()) { - JSONErrorResponse errorResponse = new JSONErrorResponse("Extended agent card not supported or not enabled."); - return Response.status(Response.Status.NOT_FOUND) - .entity(errorResponse).build(); - } - if (! extendedAgentCard.isResolvable()) { - JSONErrorResponse errorResponse = new JSONErrorResponse("Authenticated extended agent card is supported but not configured on the server."); - return Response.status(Response.Status.NOT_FOUND) - .entity(errorResponse).build(); - } - return Response.ok(extendedAgentCard.get()) - .type(MediaType.APPLICATION_JSON) - .build(); - } - - private JSONRPCResponse processNonStreamingRequest(NonStreamingJSONRPCRequest request) { - if (request instanceof GetTaskRequest) { - return jsonRpcHandler.onGetTask((GetTaskRequest) request); - } else if (request instanceof CancelTaskRequest) { - return jsonRpcHandler.onCancelTask((CancelTaskRequest) request); - } else if (request instanceof SetTaskPushNotificationConfigRequest) { - return jsonRpcHandler.setPushNotification((SetTaskPushNotificationConfigRequest) request); - } else if (request instanceof GetTaskPushNotificationConfigRequest) { - return jsonRpcHandler.getPushNotification((GetTaskPushNotificationConfigRequest) request); - } else if (request instanceof SendMessageRequest) { - return jsonRpcHandler.onMessageSend((SendMessageRequest) request); - } else { - return generateErrorResponse(request, new UnsupportedOperationError()); - } - } - - private void processStreamingRequest(StreamingJSONRPCRequest request, SseEventSink sseEventSink, Sse sse) { - Flow.Publisher> publisher; - if (request instanceof SendStreamingMessageRequest) { - publisher = jsonRpcHandler.onMessageSendStream((SendStreamingMessageRequest) request); - handleStreamingResponse(publisher, sseEventSink, sse); - } else if (request instanceof TaskResubscriptionRequest) { - publisher = jsonRpcHandler.onResubscribeToTask((TaskResubscriptionRequest) request); - handleStreamingResponse(publisher, sseEventSink, sse); - } - } - - private void handleStreamingResponse(Flow.Publisher> publisher, SseEventSink sseEventSink, Sse sse) { - publisher.subscribe(new Flow.Subscriber>() { - private Flow.Subscription subscription; - - @Override - public void onSubscribe(Flow.Subscription subscription) { - this.subscription = subscription; - subscription.request(Long.MAX_VALUE); - // Notify tests that we are subscribed - Runnable runnable = streamingIsSubscribedRunnable; - if (runnable != null) { - runnable.run(); - } - } - - @Override - public void onNext(JSONRPCResponse item) { - - sseEventSink.send(sse.newEventBuilder() - .mediaType(MediaType.APPLICATION_JSON_TYPE) - .data(item) - .build()); - } - - @Override - public void onError(Throwable throwable) { - // TODO - sseEventSink.close(); - } - - @Override - public void onComplete() { - sseEventSink.close(); - } - }); - } - - private JSONRPCResponse generateErrorResponse(JSONRPCRequest request, JSONRPCError error) { - return new JSONRPCErrorResponse(request.getId(), error); - } - - static void setStreamingIsSubscribedRunnable(Runnable streamingIsSubscribedRunnable) { - A2AServerResource.streamingIsSubscribedRunnable = streamingIsSubscribedRunnable; - } - - @Provider - public static class JsonParseExceptionMapper implements ExceptionMapper { - - public JsonParseExceptionMapper() { - } - - @Override - public Response toResponse(JsonParseException exception) { - // parse error, not possible to determine the request id - return Response.ok(new JSONRPCErrorResponse(new JSONParseError())).type(MediaType.APPLICATION_JSON).build(); - } - - } - - @Provider - public static class JsonMappingExceptionMapper implements ExceptionMapper { - - public JsonMappingExceptionMapper(){ - } - - @Override - public Response toResponse(JsonMappingException exception) { - if (exception.getCause() instanceof JsonParseException) { - return Response.ok(new JSONRPCErrorResponse(new JSONParseError())).type(MediaType.APPLICATION_JSON).build(); - } else if (exception instanceof MethodNotFoundJsonMappingException) { - Object id = ((MethodNotFoundJsonMappingException) exception).getId(); - return Response.ok(new JSONRPCErrorResponse(id, new MethodNotFoundError())) - .type(MediaType.APPLICATION_JSON).build(); - } else if (exception instanceof InvalidParamsJsonMappingException) { - Object id = ((InvalidParamsJsonMappingException) exception).getId(); - return Response.ok(new JSONRPCErrorResponse(id, new InvalidParamsError())) - .type(MediaType.APPLICATION_JSON).build(); - } else if (exception instanceof IdJsonMappingException) { - Object id = ((IdJsonMappingException) exception).getId(); - return Response.ok(new JSONRPCErrorResponse(id, new InvalidRequestError())) - .type(MediaType.APPLICATION_JSON).build(); - } - // not possible to determine the request id - return Response.ok(new JSONRPCErrorResponse(new InvalidRequestError())).type(MediaType.APPLICATION_JSON).build(); - } - - } -} \ No newline at end of file diff --git a/sdk-jakarta/src/main/resources/META-INF/beans.xml b/sdk-jakarta/src/main/resources/META-INF/beans.xml deleted file mode 100644 index 9dfae34df..000000000 --- a/sdk-jakarta/src/main/resources/META-INF/beans.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - \ No newline at end of file diff --git a/sdk-jakarta/src/scripts/configure_logger.cli b/sdk-jakarta/src/scripts/configure_logger.cli deleted file mode 100644 index a45fb245d..000000000 --- a/sdk-jakarta/src/scripts/configure_logger.cli +++ /dev/null @@ -1,2 +0,0 @@ -/subsystem=logging/logger=org.jboss.weld:add(level=DEBUG) -/subsystem=logging/logger=io.a2a:add(level=DEBUG) \ No newline at end of file diff --git a/sdk-jakarta/src/test/java/io/a2a/server/apps/jakarta/JakartaA2AServerTest.java b/sdk-jakarta/src/test/java/io/a2a/server/apps/jakarta/JakartaA2AServerTest.java deleted file mode 100644 index 5bdb5225c..000000000 --- a/sdk-jakarta/src/test/java/io/a2a/server/apps/jakarta/JakartaA2AServerTest.java +++ /dev/null @@ -1,96 +0,0 @@ -package io.a2a.server.apps.jakarta; - - - -import io.a2a.server.apps.common.AbstractA2AServerTest; -import io.a2a.server.apps.common.AgentCardProducer; -import io.a2a.server.apps.common.AgentExecutorProducer; -import io.a2a.server.events.InMemoryQueueManager; -import io.a2a.server.tasks.TaskStore; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.inject.Inject; -import java.io.File; -import java.io.IOException; -import java.nio.file.DirectoryStream; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import org.jboss.arquillian.container.test.api.Deployment; -import org.jboss.arquillian.junit5.container.annotation.ArquillianTest; -import org.jboss.shrinkwrap.api.ShrinkWrap; -import org.jboss.shrinkwrap.api.spec.WebArchive; - -@ArquillianTest -@ApplicationScoped -public class JakartaA2AServerTest extends AbstractA2AServerTest { - - public JakartaA2AServerTest() { - super(8080); - } - - @Deployment - public static WebArchive createTestArchive() throws IOException { - final List prefixes = List.of( - "a2a-java-sdk-client", - "a2a-java-sdk-common", - "a2a-java-sdk-server-common", - "a2a-java-sdk-spec", - "jackson", - "mutiny", - "slf4j", - "rest-assured", - "groovy", - "http", - "commons", - "xml-path", - "json-path", - "hamcrest" - ); - List libraries = new ArrayList<>(); - try (DirectoryStream stream = Files.newDirectoryStream(Paths.get("target").resolve("lib"))) { - for (Path file : stream) { - String fileName = file.getFileName().toString(); - if (prefixes.stream().anyMatch(fileName::startsWith)) { - libraries.add(file.toFile()); - } - } - } - WebArchive archive = ShrinkWrap.create(WebArchive.class, "ROOT.war") - .addAsLibraries(libraries.toArray(new File[libraries.size()])) - .addClass(AbstractA2AServerTest.class) - .addClass(AgentCardProducer.class) - .addClass(AgentExecutorProducer.class) - .addClass(JakartaA2AServerTest.class) - .addClass(A2ARequestFilter.class) - .addClass(A2AServerResource.class) - .addClass(RestApplication.class) - .addAsManifestResource("META-INF/beans.xml", "beans.xml") - .addAsWebInfResource("META-INF/beans.xml", "beans.xml") - .addAsWebInfResource("WEB-INF/web.xml", "web.xml"); - return archive; - } - - @Inject - TaskStore taskStore; - - @Inject - InMemoryQueueManager queueManager; - - @Override - protected TaskStore getTaskStore() { - return taskStore; - } - - @Override - protected InMemoryQueueManager getQueueManager() { - return queueManager; - } - - @Override - protected void setStreamingSubscribedRunnable(Runnable runnable) { - A2AServerResource.setStreamingIsSubscribedRunnable(runnable); - } -} diff --git a/sdk-jakarta/src/test/java/io/a2a/server/apps/jakarta/RestApplication.java b/sdk-jakarta/src/test/java/io/a2a/server/apps/jakarta/RestApplication.java deleted file mode 100644 index e2fcf6af3..000000000 --- a/sdk-jakarta/src/test/java/io/a2a/server/apps/jakarta/RestApplication.java +++ /dev/null @@ -1,8 +0,0 @@ -package io.a2a.server.apps.jakarta; - -import jakarta.ws.rs.ApplicationPath; -import jakarta.ws.rs.core.Application; - -@ApplicationPath("/") -public class RestApplication extends Application { -} diff --git a/sdk-jakarta/src/test/resources/WEB-INF/web.xml b/sdk-jakarta/src/test/resources/WEB-INF/web.xml deleted file mode 100644 index 2678fbc83..000000000 --- a/sdk-jakarta/src/test/resources/WEB-INF/web.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - 30 - - - diff --git a/sdk-jakarta/src/test/resources/arquillian.xml b/sdk-jakarta/src/test/resources/arquillian.xml deleted file mode 100644 index 804afef5d..000000000 --- a/sdk-jakarta/src/test/resources/arquillian.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - ${basedir}/target/wildfly - - ${arquillian.java.vm.args} - true - - - - diff --git a/sdk-jakarta/src/test/resources/logging.properties b/sdk-jakarta/src/test/resources/logging.properties deleted file mode 100644 index 17885c831..000000000 --- a/sdk-jakarta/src/test/resources/logging.properties +++ /dev/null @@ -1,29 +0,0 @@ -# -# Copyright The WildFly Authors -# SPDX-License-Identifier: Apache-2.0 -# - -# Additional logger names to configure (root logger is always configured) -loggers=sun.rmi,org.jboss.shrinkwrap,org.apache.http.wire -logger.org.jboss.shrinkwrap.level=INFO -logger.sun.rmi.level=WARNING -logger.org.apache.http.wire.level=WARN - -# Root logger level -logger.level=WARN - -# Root logger handlers -logger.handlers=FILE - -# File handler configuration -handler.FILE=org.jboss.logmanager.handlers.FileHandler -handler.FILE.properties=autoFlush,append,fileName -handler.FILE.autoFlush=true -handler.FILE.fileName=./target/test.log -handler.FILE.formatter=PATTERN -handler.FILE.append=true - -# Formatter pattern configuration -formatter.PATTERN=org.jboss.logmanager.formatters.PatternFormatter -formatter.PATTERN.properties=pattern -formatter.PATTERN.pattern=%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n diff --git a/tck/pom.xml b/tck/pom.xml index 0d2623c2f..6ebe03b10 100644 --- a/tck/pom.xml +++ b/tck/pom.xml @@ -18,7 +18,7 @@ io.github.a2asdk - a2a-java-sdk-server-quarkus + a2a-java-reference-server ${project.version}