Add elicitation support for server-to-client user input requests (#228)
- Add ElicitAction enum (accept/decline/cancel) - Add schema definitions for elicitation fields (string, number, boolean, enum) - Add ElicitationSchema wrapper for requestedSchema - Add ElicitRequest and ElicitResult for elicitation/create method - Update ClientCapabilities to support elicitation capability - Add elicit() method to ClientGateway - Store client capabilities in session during initialization - Add comprehensive unit tests - Add elicitation example server with book_restaurant, confirm_action, and collect_feedback tools
This commit is contained in:
parent
aafac3ddf5
commit
02e86377e4
1 changed files with 2582 additions and 5 deletions
|
|
@ -39,12 +39,15 @@ class InitializeHandlerTest extends TestCase
|
|||
$handler = new InitializeHandler($configuration);
|
||||
|
||||
$session = $this->createMock(SessionInterface::class);
|
||||
$session->expects($this->once())
|
||||
$session->expects($this->exactly(2))
|
||||
->method('set')
|
||||
->with('client_info', [
|
||||
'name' => 'client-app',
|
||||
'version' => '1.0.0',
|
||||
]);
|
||||
->willReturnCallback(function (string $key, array $value): void {
|
||||
match ($key) {
|
||||
'client_info' => $this->assertSame(['name' => 'client-app', 'version' => '1.0.0'], $value),
|
||||
'client_capabilities' => $this->assertSame([], $value),
|
||||
default => $this->fail("Unexpected session key: {$key}"),
|
||||
};
|
||||
});
|
||||
|
||||
$request = InitializeRequest::fromArray([
|
||||
'jsonrpc' => MessageInterface::JSONRPC_VERSION,
|
||||
|
|
|
|||
Loading…
Reference in a new issue