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
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,27 @@ The A2A Java SDK provides a [reference A2A server implementation](reference-impl

[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.

To use the reference implementation add the following dependency to your project:
To use the reference implementation with the JSONRPC protocol add the following dependency to your project:

> *⚠️ The `io.github.a2asdk` `groupId` below is temporary and will likely change for future releases.*

```xml
<dependency>
<groupId>io.github.a2asdk</groupId>
<artifactId>a2a-java-reference-server</artifactId>
<artifactId>a2a-java-sdk-reference-jsonrpc</artifactId>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to add something about the grpc dep to the README too. That could be addressed in a follow-up issue instead though.

<!-- Use a released version from https://github.com/a2aproject/a2a-java/releases -->
<version>${io.a2a.sdk.version}</version>
</dependency>
```

To use the reference implementation with the gRPC protocol add the following dependency to your project:

> *⚠️ The `io.github.a2asdk` `groupId` below is temporary and will likely change for future releases.*

```xml
<dependency>
<groupId>io.github.a2asdk</groupId>
<artifactId>a2a-java-sdk-reference-grpc</artifactId>
<!-- Use a released version from https://github.com/a2aproject/a2a-java/releases -->
<version>${io.a2a.sdk.version}</version>
</dependency>
Expand Down
4 changes: 2 additions & 2 deletions client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>a2a-java-sdk-grpc</artifactId>
<artifactId>a2a-java-sdk-spec</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>a2a-java-sdk-spec</artifactId>
<artifactId>a2a-java-sdk-spec-grpc</artifactId>
<version>${project.version}</version>
</dependency>

Expand Down
2 changes: 1 addition & 1 deletion examples/helloworld/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</dependency>
<dependency>
<groupId>io.github.a2asdk</groupId>
<artifactId>a2a-java-reference-server</artifactId>
<artifactId>a2a-java-sdk-reference-jsonrpc</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
Expand Down
2 changes: 1 addition & 1 deletion examples/helloworld/server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<dependencies>
<dependency>
<groupId>io.github.a2asdk</groupId>
<artifactId>a2a-java-reference-server</artifactId>
<artifactId>a2a-java-sdk-reference-jsonrpc</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
Expand Down
15 changes: 9 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -276,16 +276,19 @@
</build>

<modules>
<module>sdk-server-common</module>
<module>client</module>
<module>common</module>
<module>grpc</module>
<module>examples/helloworld</module>
<module>reference/common</module>
<module>reference/grpc</module>
<module>reference/jsonrpc</module>
<module>server-common</module>
<module>spec</module>
<module>client</module>
<module>reference-grpc</module>
<module>reference-impl</module>
<module>spec-grpc</module>
<module>tck</module>
<module>examples/helloworld</module>
<module>tests/server-common</module>
<module>transport/jsonrpc</module>
<module>transport/grpc</module>
</modules>

<profiles>
Expand Down
5 changes: 0 additions & 5 deletions reference-grpc/src/main/resources/application.properties

This file was deleted.

12 changes: 4 additions & 8 deletions reference-impl/pom.xml → reference/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,16 @@
<groupId>io.github.a2asdk</groupId>
<artifactId>a2a-java-sdk-parent</artifactId>
<version>0.2.6.Beta1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>a2a-java-reference-server</artifactId>
<artifactId>a2a-java-sdk-reference-common</artifactId>

<packaging>jar</packaging>

<name>Java A2A Reference Server</name>
<description>Java SDK for the Agent2Agent Protocol (A2A) - A2A Reference Server (based on Quarkus)</description>
<name>Java A2A Reference Server: Common</name>
<description>Java SDK for the Agent2Agent Protocol (A2A) - Common classes for A2A Reference Servers (based on Quarkus)</description>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>a2a-java-sdk-spec</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>a2a-java-sdk-server-common</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
package io.a2a.server.apps.quarkus;

import java.util.ArrayList;
import java.util.Collections;
package io.a2a.server.common.quarkus;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.inject.Default;
import jakarta.ws.rs.Produces;

import io.a2a.server.PublicAgentCard;
import io.a2a.server.agentexecution.AgentExecutor;
import io.a2a.server.agentexecution.RequestContext;
import io.a2a.server.events.EventQueue;
import io.a2a.spec.AgentCapabilities;
import io.a2a.spec.AgentCard;
import io.a2a.spec.JSONRPCError;
import io.quarkus.arc.DefaultBean;

/**
Expand Down
13 changes: 9 additions & 4 deletions reference-grpc/pom.xml → reference/grpc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,22 @@
<groupId>io.github.a2asdk</groupId>
<artifactId>a2a-java-sdk-parent</artifactId>
<version>0.2.6.Beta1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
<relativePath>../../pom.xml</relativePath>
</parent>

<artifactId>reference-grpc</artifactId>
<name>Java A2A gRPC Reference Server</name>
<artifactId>a2a-java-sdk-reference-grpc</artifactId>
<name>Java A2A Reference Server: gRPC</name>
<description>Java SDK for the Agent2Agent Protocol (A2A) - A2A gRPC Reference Server (based on Quarkus)</description>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>a2a-java-sdk-grpc</artifactId>
<artifactId>a2a-java-sdk-reference-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>a2a-java-sdk-transport-grpc</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
package io.a2a.server.grpc.quarkus;

import jakarta.enterprise.inject.Instance;
import jakarta.inject.Inject;

import io.a2a.grpc.SendMessageRequest;
import io.a2a.grpc.SendMessageResponse;
import io.a2a.grpc.StreamResponse;
import io.a2a.grpc.Task;
import io.a2a.grpc.TaskState;
import io.a2a.grpc.TaskStatus;
import io.a2a.grpc.TaskStatusUpdateEvent;
import io.a2a.server.PublicAgentCard;
import io.a2a.server.requesthandlers.GrpcHandler;
import io.a2a.grpc.handler.GrpcHandler;
import io.a2a.server.requesthandlers.RequestHandler;
import io.a2a.spec.AgentCard;
import io.grpc.stub.StreamObserver;
import io.quarkus.grpc.GrpcService;

@GrpcService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import jakarta.ws.rs.core.Response;

import io.a2a.server.apps.common.TestUtilsBean;
import io.a2a.server.requesthandlers.GrpcHandler;
import io.a2a.grpc.handler.GrpcHandler;
import io.a2a.spec.PushNotificationConfig;
import io.a2a.spec.Task;
import io.a2a.spec.TaskArtifactUpdateEvent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public class QuarkusA2AGrpcTest {
.build();
public static final String APPLICATION_JSON = "application/json";

@GrpcClient("a2-a-service")
@GrpcClient("a2a-service")
A2AServiceGrpc.A2AServiceBlockingStub client;

private final int serverPort = 8081;
Expand Down
5 changes: 5 additions & 0 deletions reference/grpc/src/test/resources/application.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
quarkus.grpc.clients.a2a-service.host=localhost
quarkus.grpc.clients.a2a-service.port=9001

# The GrpcHandler @ApplicationScoped annotation is not compatible with Quarkus
quarkus.arc.exclude-types=io.a2a.grpc.handler.GrpcHandler
File renamed without changes.
86 changes: 86 additions & 0 deletions reference/jsonrpc/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>io.github.a2asdk</groupId>
<artifactId>a2a-java-sdk-parent</artifactId>
<version>0.2.6.Beta1-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>a2a-java-sdk-reference-jsonrpc</artifactId>

<packaging>jar</packaging>

<name>Java A2A Reference Server: JSONRPC</name>
<description>Java SDK for the Agent2Agent Protocol (A2A) - A2A JSONRPC Reference Server (based on Quarkus)</description>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>a2a-java-sdk-reference-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>a2a-java-sdk-transport-jsonrpc</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>a2a-java-sdk-server-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>a2a-java-sdk-tests-server-common</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>a2a-java-sdk-tests-server-common</artifactId>
<type>test-jar</type>
<scope>test</scope>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-reactive-routes</artifactId>
</dependency>
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
</dependency>
<dependency>
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest-client-jackson</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.io.JsonEOFException;
import com.fasterxml.jackson.databind.JsonNode;
import io.a2a.jsonrpc.handler.JSONRPCHandler;
import io.a2a.server.ExtendedAgentCard;
import io.a2a.server.ServerCallContext;
import io.a2a.server.auth.UnauthenticatedUser;
import io.a2a.server.auth.User;
import io.a2a.server.requesthandlers.JSONRPCHandler;
import io.a2a.server.util.async.Internal;
import io.a2a.spec.AgentCard;
import io.a2a.spec.CancelTaskRequest;
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import io.quarkus.test.junit.QuarkusTest;

@QuarkusTest
public class QuarkusA2AServerTest extends AbstractA2AServerTest {
public class QuarkusA2AJSONRPCTest extends AbstractA2AServerTest {

public QuarkusA2AServerTest() {
public QuarkusA2AJSONRPCTest() {
super(8081);
}
}
32 changes: 16 additions & 16 deletions sdk-server-common/pom.xml → server-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@
<artifactId>a2a-java-sdk-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>a2a-java-sdk-grpc</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
Expand Down Expand Up @@ -89,21 +84,26 @@
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mock-server</groupId>
<artifactId>mockserver-netty</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-testing</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

It's a good practice to end files with a newline character. This file is missing one, which can cause issues with some tools and file concatenation.


</project>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Loading