Skip to content

Commit f355d3e

Browse files
kthota-ga2a-bot
andauthored
feat: Support for multiple pushNotification config per task (#738)
- Support for list pushNotificationConfig for task - Support for delete pushNotificationConfig - Get pushNotificationConfig by id or by task - update protos to use PushNotificationConfig --------- Co-authored-by: a2a-bot <[email protected]>
1 parent 94a3a00 commit f355d3e

6 files changed

Lines changed: 434 additions & 32 deletions

File tree

docs/specification.md

Lines changed: 63 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -705,11 +705,69 @@ Sets or updates the push notification configuration for a specified task. This a
705705

706706
Retrieves the current push notification configuration for a specified task. Requires the server to have `AgentCard.capabilities.pushNotifications: true`.
707707

708-
- **Request `params` type**: [`TaskIdParams`](#741-taskidparams-object-for-taskscancel-and-taskspushnotificationconfigget)
708+
- **Request `params` type**: [`GetTaskPushNotificationConfigParams`](#761-gettaskpushnotificationconfigparams-object-taskspushnotificationconfigget) | [`TaskIdParams`](#741-taskidparams-object-for-taskscancel-and-taskspushnotificationconfigget)
709+
_(Note: TaskIdParams type is deprecated for this method. Use GetTaskPushNotificationConfigParams instead.)_
709710
- **Response `result` type (on success)**: [`TaskPushNotificationConfig`](#610-taskpushnotificationconfig-object) (The current push notification configuration for the task. Server may return an error if no push notification configuration is associated with the task).
710711
- **Response `error` type (on failure)**: [`JSONRPCError`](#612-jsonrpcerror-object) (e.g., [`PushNotificationNotSupportedError`](#82-a2a-specific-errors), [`TaskNotFoundError`](#82-a2a-specific-errors)).
711712

712-
### 7.7. `tasks/resubscribe`
713+
#### 7.6.1. `GetTaskPushNotificationConfigParams` Object (`tasks/pushNotificationConfig/get`)
714+
715+
A object for fetching the push notification configuration for a task.
716+
717+
```ts { .no-copy }
718+
--8<-- "types/src/types.ts:GetTaskPushNotificationConfigParams"
719+
```
720+
721+
| Field Name | Type | Required | Description |
722+
| :--------- | :-------------------- | :------- | :------------------------- |
723+
| `id` | `string` | Yes | The ID of the task. |
724+
| `pushNotificationConfigId` | `string` | No | Push notification configuration id. Server will return one of the associated configurations if config id is not specified |
725+
| `metadata` | `Record<string, any>` | No | Request-specific metadata. |
726+
727+
### 7.7. `tasks/pushNotificationConfig/list`
728+
729+
Retrieves the associated push notification configurations for a specified task. Requires the server to have `AgentCard.capabilities.pushNotifications: true`.
730+
731+
- **Request `params` type**: [`ListTaskPushNotificationConfigParams`](#771-listtaskpushnotificationconfigparams-object-taskspushnotificationconfiglist)
732+
- **Response `result` type (on success)**: [`TaskPushNotificationConfig[]`](#610-taskpushnotificationconfig-object) (The push notification configurations associated with the task.).
733+
- **Response `error` type (on failure)**: [`JSONRPCError`](#612-jsonrpcerror-object) (e.g., [`PushNotificationNotSupportedError`](#82-a2a-specific-errors), [`TaskNotFoundError`](#82-a2a-specific-errors)).
734+
735+
#### 7.7.1. `ListTaskPushNotificationConfigParams` Object (`tasks/pushNotificationConfig/list`)
736+
737+
A object for fetching the push notification configurations for a task.
738+
739+
```ts { .no-copy }
740+
--8<-- "types/src/types.ts:ListTaskPushNotificationConfigRequest"
741+
```
742+
743+
| Field Name | Type | Required | Description |
744+
| :--------- | :-------------------- | :------- | :------------------------- |
745+
| `id` | `string` | Yes | The ID of the task. |
746+
| `metadata` | `Record<string, any>` | No | Request-specific metadata. |
747+
748+
### 7.8. `tasks/pushNotificationConfig/delete`
749+
750+
Deletes an associated push notification configuration for a task. Requires the server to have `AgentCard.capabilities.pushNotifications: true`.
751+
752+
- **Request `params` type**: [`DeleteTaskPushNotificationConfigParams`](#781-deletetaskpushnotificationconfigparams-object-taskspushnotificationconfigdelete)
753+
- **Response `result` type (on success)**: [`null`]
754+
- **Response `error` type (on failure)**: [`JSONRPCError`](#612-jsonrpcerror-object) (e.g., [`PushNotificationNotSupportedError`](#82-a2a-specific-errors), [`TaskNotFoundError`](#82-a2a-specific-errors)).
755+
756+
#### 7.8.1. `DeleteTaskPushNotificationConfigParams` Object (`tasks/pushNotificationConfig/delete`)
757+
758+
A object for deleting an associated push notification configuration for a task.
759+
760+
```ts { .no-copy }
761+
--8<-- "types/src/types.ts:DeleteTaskPushNotificationConfigParams"
762+
```
763+
764+
| Field Name | Type | Required | Description |
765+
| :--------- | :-------------------- | :------- | :------------------------- |
766+
| `id` | `string` | Yes | The ID of the task. |
767+
| `pushNotificationConfigId` | `string` | Yes | Push notification configuration id |
768+
| `metadata` | `Record<string, any>` | No | Request-specific metadata. |
769+
770+
### 7.9. `tasks/resubscribe`
713771

714772
Allows a client to reconnect to an SSE stream for an ongoing task after a previous connection (from `message/stream` or an earlier `tasks/resubscribe`) was interrupted. Requires the server to have `AgentCard.capabilities.streaming: true`.
715773

@@ -724,7 +782,7 @@ The purpose is to resume receiving _subsequent_ updates. The server's behavior r
724782
- Standard HTTP error code (e.g., 4xx, 5xx).
725783
- The HTTP body MAY contain a standard `JSONRPCResponse` with an `error` object. Failures can occur if the task is no longer active, doesn't exist, or streaming is not supported/enabled for it.
726784

727-
### 7.8. `agent/authenticatedExtendedCard`
785+
### 7.10. `agent/authenticatedExtendedCard`
728786

729787
Retrieves a potentially more detailed version of the Agent Card after the client has authenticated. This endpoint is available only if `AgentCard.supportsAuthenticatedExtendedCard` is `true`. This is an HTTP GET endpoint, not a JSON-RPC method.
730788

@@ -741,11 +799,11 @@ Retrieves a potentially more detailed version of the Agent Card after the client
741799

742800
Clients retrieving this authenticated card **SHOULD** replace their cached public Agent Card with the content received from this endpoint for the duration of their authenticated session or until the card's version changes.
743801

744-
#### 7.8.1. `AuthenticatedExtendedCardParams` Object
802+
#### 7.10.1. `AuthenticatedExtendedCardParams` Object
745803

746804
This endpoint does not use JSON-RPC `params`. Any parameters would be included as HTTP query parameters if needed (though none are defined by the standard).
747805

748-
#### 7.8.2. `AuthenticatedExtendedCardResponse` Object
806+
#### 7.10.2. `AuthenticatedExtendedCardResponse` Object
749807

750808
The successful response body is a JSON object conforming to the `AgentCard` interface.
751809

specification/grpc/a2a.proto

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package a2a.v1;
55
import "google/api/annotations.proto";
66
import "google/api/client.proto";
77
import "google/api/field_behavior.proto";
8+
import "google/protobuf/empty.proto";
89
import "google/protobuf/struct.proto";
910
import "google/protobuf/timestamp.proto";
1011

@@ -17,12 +18,12 @@ option java_package = "com.google.a2a.v1";
1718
// A2AService defines the gRPC version of the A2A protocol. This has a slightly
1819
// different shape than the JSONRPC version to better conform to AIP-127,
1920
// where appropriate. The nouns are AgentCard, Message, Task and
20-
// TaskPushNotification.
21+
// TaskPushNotificationConfig.
2122
// - Messages are not a standard resource so there is no get/delete/update/list
2223
// interface, only a send and stream custom methods.
2324
// - Tasks have a get interface and custom cancel and subscribe methods.
24-
// - TaskPushNotification are a resource whose parent is a task. They have get,
25-
// list and create methods.
25+
// - TaskPushNotificationConfig are a resource whose parent is a task.
26+
// They have get, list and create methods.
2627
// - AgentCard is a static resource with only a get method.
2728
// fields are not present as they don't comply with AIP rules, and the
2829
// optional history_length on the get task method is not present as it also
@@ -72,27 +73,27 @@ service A2AService {
7273
}
7374

7475
// Set a push notification config for a task.
75-
rpc CreateTaskPushNotification(CreateTaskPushNotificationRequest)
76+
rpc CreateTaskPushNotificationConfig(CreateTaskPushNotificationConfigRequest)
7677
returns (TaskPushNotificationConfig) {
7778
option (google.api.http) = {
78-
post: "/v1/{parent=task/*/pushNotifications}"
79+
post: "/v1/{parent=task/*/pushNotificationConfigs}"
7980
body: "config"
8081
};
8182
option (google.api.method_signature) = "parent,config";
8283
}
8384
// Get a push notification config for a task.
84-
rpc GetTaskPushNotification(GetTaskPushNotificationRequest)
85+
rpc GetTaskPushNotificationConfig(GetTaskPushNotificationConfigRequest)
8586
returns (TaskPushNotificationConfig) {
8687
option (google.api.http) = {
87-
get: "/v1/{name=tasks/*/pushNotifications/*}"
88+
get: "/v1/{name=tasks/*/pushNotificationConfigs/*}"
8889
};
8990
option (google.api.method_signature) = "name";
9091
}
9192
// Get a list of push notifications configured for a task.
92-
rpc ListTaskPushNotification(ListTaskPushNotificationRequest)
93-
returns (ListTaskPushNotificationResponse) {
93+
rpc ListTaskPushNotificationConfig(ListTaskPushNotificationConfigRequest)
94+
returns (ListTaskPushNotificationConfigResponse) {
9495
option (google.api.http) = {
95-
get: "/v1/{parent=tasks/*}/pushNotifications"
96+
get: "/v1/{parent=tasks/*}/pushNotificationConfigs"
9697
};
9798
option (google.api.method_signature) = "parent";
9899
}
@@ -102,6 +103,14 @@ service A2AService {
102103
get: "/v1/card"
103104
};
104105
}
106+
// Delete a push notification config for a task.
107+
rpc DeleteTaskPushNotificationConfig(DeleteTaskPushNotificationConfigRequest)
108+
returns (google.protobuf.Empty) {
109+
option (google.api.http) = {
110+
delete: "/v1/{name=tasks/*/pushNotificationConfig/*}"
111+
};
112+
option (google.api.method_signature) = "name";
113+
}
105114
}
106115

107116
///////// Data Model ////////////
@@ -413,7 +422,7 @@ message AgentSkill {
413422
}
414423

415424
message TaskPushNotificationConfig {
416-
// name=tasks/{id}/pushNotifications/{id}
425+
// name=tasks/{id}/pushNotificationConfigs/{id}
417426
string name = 1;
418427
PushNotificationConfig push_notification_config = 2;
419428
}
@@ -553,12 +562,17 @@ message CancelTaskRequest {
553562
string name = 1;
554563
}
555564

556-
message GetTaskPushNotificationRequest {
557-
// name=tasks/{id}/pushNotifications/{push_id}
565+
message GetTaskPushNotificationConfigRequest {
566+
// name=tasks/{id}/pushNotificationConfigs/{push_id}
567+
string name = 1;
568+
}
569+
570+
message DeleteTaskPushNotificationConfigRequest {
571+
// name=tasks/{id}/pushNotificationConfigs/{push_id}
558572
string name = 1;
559573
}
560574

561-
message CreateTaskPushNotificationRequest {
575+
message CreateTaskPushNotificationConfigRequest {
562576
// The task resource for this config.
563577
// Format: tasks/{id}
564578
string parent = 1 [
@@ -575,18 +589,19 @@ message TaskSubscriptionRequest {
575589
string name = 1;
576590
}
577591

578-
message ListTaskPushNotificationRequest {
592+
message ListTaskPushNotificationConfigRequest {
579593
// parent=tasks/{id}
580594
string parent = 1;
581595
// For AIP-158 these fields are present. Usually not used/needed.
582596
// The maximum number of configurations to return.
583597
// If unspecified, all configs will be returned.
584598
int32 page_size = 2;
585599

586-
// A page token, received from a previous `ListTaskPushNotificationRequest
587-
// call. Provide this to retrieve the subsequent page.
600+
// A page token received from a previous
601+
// ListTaskPushNotificationConfigRequest call.
602+
// Provide this to retrieve the subsequent page.
588603
// When paginating, all other parameters provided to
589-
// `ListTaskPushNotificationRequest` must match the call that provided
604+
// `ListTaskPushNotificationConfigRequest` must match the call that provided
590605
// the page token.
591606
string page_token = 3;
592607
}
@@ -622,7 +637,7 @@ message StreamResponse {
622637
}
623638
}
624639

625-
message ListTaskPushNotificationResponse {
640+
message ListTaskPushNotificationConfigResponse {
626641
repeated TaskPushNotificationConfig configs = 1;
627642
// A token, which can be sent as `page_token` to retrieve the next page.
628643
// If this field is omitted, there are no subsequent pages.

0 commit comments

Comments
 (0)