Skip to content

Commit 93d6bae

Browse files
authored
feat: Implement the spec updates for v0.2.4 and v0.2.5 (#192)
# Description This PR brings in the updates required to align with the A2A v0.2.4 and v0.2.5 spec versions. - [X] Follow the [`CONTRIBUTING` Guide](../CONTRIBUTING.md). - [X] Make your Pull Request title in the <https://www.conventionalcommits.org/> specification. - Important Prefixes for [release-please](https://github.com/googleapis/release-please): - `fix:` which represents bug fixes, and correlates to a [SemVer](https://semver.org/) patch. - `feat:` represents a new feature, and correlates to a SemVer minor. - `feat!:`, or `fix!:`, `refactor!:`, etc., which represent a breaking change (indicated by the `!`) and will result in a SemVer major. - [X] Ensure the tests pass - [X] Appropriate READMEs were updated (if necessary) Fixes #183 🦕
1 parent d726d0f commit 93d6bae

File tree

58 files changed

+1560
-253
lines changed

Some content is hidden

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

58 files changed

+1560
-253
lines changed

.github/workflows/run-tck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
env:
1313
# Tag of the TCK
14-
TCK_VERSION: v0.2.3
14+
TCK_VERSION: v0.2.5
1515
# Tells uv to not need a venv, and instead use system
1616
UV_SYSTEM_PYTHON: 1
1717

README.md

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public class WeatherAgentCardProducer {
8989
.tags(Collections.singletonList("weather"))
9090
.examples(List.of("weather in LA, CA"))
9191
.build()))
92+
.protocolVersion("0.2.5")
9293
.build();
9394
}
9495
}
@@ -255,18 +256,21 @@ Map<String, Object> metadata = ...
255256
CancelTaskResponse response = client.cancelTask(new TaskIdParams("task-1234", metadata));
256257
```
257258

258-
#### Get the push notification configuration for a task
259+
#### Get a push notification configuration for a task
259260

260261
```java
261262
// Get task push notification configuration
262263
GetTaskPushNotificationConfigResponse response = client.getTaskPushNotificationConfig("task-1234");
263264

264-
// You can also specify additional properties using a map
265+
// The push notification configuration ID can also be optionally specified
266+
GetTaskPushNotificationConfigResponse response = client.getTaskPushNotificationConfig("task-1234", "config-4567");
267+
268+
// Additional properties can be specified using a map
265269
Map<String, Object> metadata = ...
266-
GetTaskPushNotificationConfigResponse response = client.getTaskPushNotificationConfig(new TaskIdParams("task-1234", metadata));
270+
GetTaskPushNotificationConfigResponse response = client.getTaskPushNotificationConfig(new GetTaskPushNotificationConfigParams("task-1234", "config-1234", metadata));
267271
```
268272

269-
#### Set the push notification configuration for a task
273+
#### Set a push notification configuration for a task
270274

271275
```java
272276
// Set task push notification configuration
@@ -277,6 +281,26 @@ PushNotificationConfig pushNotificationConfig = new PushNotificationConfig.Build
277281
SetTaskPushNotificationResponse response = client.setTaskPushNotificationConfig("task-1234", pushNotificationConfig);
278282
```
279283

284+
#### List the push notification configurations for a task
285+
286+
```java
287+
ListTaskPushNotificationConfigResponse response = client.listTaskPushNotificationConfig("task-1234");
288+
289+
// Additional properties can be specified using a map
290+
Map<String, Object> metadata = ...
291+
ListTaskPushNotificationConfigResponse response = client.listTaskPushNotificationConfig(new ListTaskPushNotificationConfigParams("task-123", metadata));
292+
```
293+
294+
#### Delete a push notification configuration for a task
295+
296+
```java
297+
DeleteTaskPushNotificationConfigResponse response = client.deleteTaskPushNotificationConfig("task-1234", "config-4567");
298+
299+
// Additional properties can be specified using a map
300+
Map<String, Object> metadata = ...
301+
DeleteTaskPushNotificationConfigResponse response = client.deleteTaskPushNotificationConfig(new DeleteTaskPushNotificationConfigParams("task-1234", "config-4567", metadata));
302+
```
303+
280304
#### Send a streaming message
281305

282306
```java

client/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>io.github.a2asdk</groupId>
99
<artifactId>a2a-java-sdk-parent</artifactId>
10-
<version>0.2.3.Beta2-SNAPSHOT</version>
10+
<version>0.2.5.Beta1-SNAPSHOT</version>
1111
</parent>
1212
<artifactId>a2a-java-sdk-client</artifactId>
1313

client/src/main/java/io/a2a/client/A2AClient.java

Lines changed: 170 additions & 19 deletions
Large diffs are not rendered by default.

client/src/test/java/io/a2a/client/A2AClientTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import io.a2a.spec.FilePart;
4747
import io.a2a.spec.FileWithBytes;
4848
import io.a2a.spec.FileWithUri;
49+
import io.a2a.spec.GetTaskPushNotificationConfigParams;
4950
import io.a2a.spec.GetTaskPushNotificationConfigResponse;
5051
import io.a2a.spec.GetTaskResponse;
5152
import io.a2a.spec.Message;
@@ -328,7 +329,7 @@ public void testA2AClientGetTaskPushNotificationConfig() throws Exception {
328329

329330
A2AClient client = new A2AClient("http://localhost:4001");
330331
GetTaskPushNotificationConfigResponse response = client.getTaskPushNotificationConfig("1",
331-
new TaskIdParams("de38c76d-d54c-436c-8b9f-4c2703648d64", new HashMap<>()));
332+
new GetTaskPushNotificationConfigParams("de38c76d-d54c-436c-8b9f-4c2703648d64", null, new HashMap<>()));
332333
assertEquals("2.0", response.getJsonrpc());
333334
assertEquals(1, response.getId());
334335
assertInstanceOf(TaskPushNotificationConfig.class, response.getResult());
@@ -442,6 +443,7 @@ public void testA2AClientGetAgentCard() throws Exception {
442443
assertEquals(outputModes, skills.get(1).outputModes());
443444
assertTrue(agentCard.supportsAuthenticatedExtendedCard());
444445
assertEquals("https://georoute-agent.example.com/icon.png", agentCard.iconUrl());
446+
assertEquals("0.2.5", agentCard.protocolVersion());
445447
}
446448

447449
@Test
@@ -514,6 +516,7 @@ public void testA2AClientGetAuthenticatedExtendedAgentCard() throws Exception {
514516
assertEquals(List.of("extended"), skills.get(2).tags());
515517
assertTrue(agentCard.supportsAuthenticatedExtendedCard());
516518
assertEquals("https://georoute-agent.example.com/icon.png", agentCard.iconUrl());
519+
assertEquals("0.2.5", agentCard.protocolVersion());
517520
}
518521

519522
@Test

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ public class JsonMessages {
6767
]
6868
}
6969
],
70-
"supportsAuthenticatedExtendedCard": true
70+
"supportsAuthenticatedExtendedCard": true,
71+
"protocolVersion": "0.2.5"
7172
}""";
7273

7374
static final String AUTHENTICATION_EXTENDED_AGENT_CARD = """
@@ -137,7 +138,8 @@ public class JsonMessages {
137138
"tags": ["extended"]
138139
}
139140
],
140-
"supportsAuthenticatedExtendedCard": true
141+
"supportsAuthenticatedExtendedCard": true,
142+
"protocolVersion": "0.2.5"
141143
}""";
142144

143145

common/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>io.github.a2asdk</groupId>
99
<artifactId>a2a-java-sdk-parent</artifactId>
10-
<version>0.2.3.Beta2-SNAPSHOT</version>
10+
<version>0.2.5.Beta1-SNAPSHOT</version>
1111
</parent>
1212
<artifactId>a2a-java-sdk-common</artifactId>
1313

examples/helloworld/client/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>io.github.a2asdk</groupId>
99
<artifactId>a2a-java-sdk-examples-parent</artifactId>
10-
<version>0.2.3.Beta2-SNAPSHOT</version>
10+
<version>0.2.5.Beta1-SNAPSHOT</version>
1111
</parent>
1212

1313
<artifactId>a2a-java-sdk-examples-client</artifactId>

examples/helloworld/client/src/main/java/io/a2a/examples/helloworld/HelloWorldRunner.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
///usr/bin/env jbang "$0" "$@" ; exit $?
2-
//DEPS io.github.a2asdk:a2a-java-sdk-client:0.2.3.Beta2-SNAPSHOT
2+
//DEPS io.github.a2asdk:a2a-java-sdk-client:0.2.5.Beta2-SNAPSHOT
33
//SOURCES HelloWorldClient.java
44

55
/**

examples/helloworld/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<parent>
88
<groupId>io.github.a2asdk</groupId>
99
<artifactId>a2a-java-sdk-parent</artifactId>
10-
<version>0.2.3.Beta2-SNAPSHOT</version>
10+
<version>0.2.5.Beta1-SNAPSHOT</version>
1111
<relativePath>../../pom.xml</relativePath>
1212
</parent>
1313

0 commit comments

Comments
 (0)