feat!: capabilities for tasks, elicitation (#732)

closes #544 

Replaces opaque `JsonObject?` modelling of `elicitation` with a typed
`ClientCapabilities.Elicitation` (`form`, `url`), and adds the new
`tasks` capability on both `ClientCapabilities` and `ServerCapabilities`
(with `list`, `cancel`, per-request-type augmentation). Wires capability
assertions for `tasks/*` methods and `notifications/tasks/status` into
`Client` and `ServerSession`

## How Has This Been Tested?
unit tests 

## Breaking Changes
yes
now elicitation is a specific class in capabilities 

## Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [x] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update

## Checklist
- [x] I have read the [MCP
Documentation](https://modelcontextprotocol.io)
- [x] My code follows the repository's style guidelines
- [x] New and existing tests pass locally
- [x] I have added appropriate error handling
- [x] I have added or updated documentation as needed
This commit is contained in:
Pavel Gorgulov 2026-05-18 13:22:26 +02:00 • committed by GitHub
commit ebc53f0ded
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1058,7 +1058,7 @@ class ClientTest {
Implementation(name = "test client", version = "1.0"),
ClientOptions(
capabilities = ClientCapabilities(
elicitation = EmptyJsonObject,
elicitation = ClientCapabilities.Elicitation(),
),
),
)
@ -1270,7 +1270,7 @@ class ClientTest {
): Pair<Client, ServerSession> = kotlinx.coroutines.coroutineScope {
val client = Client(
Implementation(name = "test client", version = "1.0"),
ClientOptions(capabilities = ClientCapabilities(elicitation = EmptyJsonObject)),
ClientOptions(capabilities = ClientCapabilities(elicitation = ClientCapabilities.Elicitation())),
)
client.setElicitationHandler(handler)