Skip to content

feat: push notification CRUD — full set/get/list/delete implementation#20

Open
zeroasterisk wants to merge 1 commit intoactioncard:mainfrom
zeroasterisk:feat/v1-push-notifications
Open

feat: push notification CRUD — full set/get/list/delete implementation#20
zeroasterisk wants to merge 1 commit intoactioncard:mainfrom
zeroasterisk:feat/v1-push-notifications

Conversation

@zeroasterisk
Copy link
Copy Markdown

Part of #13 (A2A v1.0 Protocol Support)

What This PR Does

Replaces the current -32003 PushNotificationNotSupportedError stubs with a full push notification config CRUD implementation, verified against the A2A proto.

New Structs

  • A2A.PushNotificationConfig — maps to TaskPushNotificationConfig proto message
  • A2A.AuthenticationInfo — authentication details for push notification delivery

TaskStore (behaviour + ETS implementation)

  • set_push_config/2, get_push_config/3, list_push_configs/2, delete_push_config/3
  • Optional callbacks — existing stores continue to work unchanged
  • ETS implementation keys configs by {task_id, config_id} for fast lookup

JSONRPC Handler

  • 4 new optional callbacks: handle_set_push_config/3, handle_get_push_config/4, handle_list_push_configs/3, handle_delete_push_config/4
  • Handlers that don't implement these callbacks still return -32003 (backward compatible)
  • Both v1.0 PascalCase and legacy slash-style method names supported

Server Dispatch

  • CreateTaskPushNotificationConfig → store config, return config
  • GetTaskPushNotificationConfig → fetch by task_id + config_id
  • ListTaskPushNotificationConfigs → list by task_id
  • DeleteTaskPushNotificationConfig → delete by task_id + config_id

Client

  • create_push_config/3, get_push_config/4, list_push_configs/3, delete_push_config/4

Plug Integration

  • Auto-delegates push config CRUD to the agent's TaskStore when configured
  • Auto-generates config IDs when not provided

PushNotificationSender Behaviour

  • New A2A.PushNotificationSender behaviour with send_notification/2 callback
  • Default A2A.PushNotificationSender.HTTP implementation (POSTs JSON with auth headers)

JSON Codec

  • Encode/decode for PushNotificationConfig and AuthenticationInfo
  • Full round-trip support

Tests

  • 37 new tests covering ETS store CRUD, JSON codec, JSONRPC dispatch (with and without handler support), struct creation

424 tests, 0 failures.

Fixes part of #13

Implements the full push notification config lifecycle:

- TaskStore behaviour: set_push_config/2, get_push_config/3,
  list_push_configs/2, delete_push_config/3 (optional callbacks)
- ETS implementation: keyed by {task_id, config_id}
- JSONRPC handler callbacks: handle_set_push_config/3,
  handle_get_push_config/4, handle_list_push_configs/3,
  handle_delete_push_config/4 (optional, falls back to -32003)
- Server dispatch: wires all 4 PascalCase + legacy method names
- Client: create_push_config/3, get_push_config/4,
  list_push_configs/3, delete_push_config/4
- Plug: auto-delegates to TaskStore when configured
- New structs: PushNotificationConfig, AuthenticationInfo
- New behaviour: PushNotificationSender with HTTP default impl
- JSON codec: encode/decode for push notification configs
- 37 new tests covering CRUD, JSON codec, and dispatch

Verified against a2a.proto HEAD (TaskPushNotificationConfig,
AuthenticationInfo, Get/List/Delete request types).

Part of actioncard#13 (A2A v1.0 Protocol Support)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant