[Schema][Client][Server] Close MCP Apps gaps: extension negotiation checks (#429)
* [Schema][Client][Server] Close MCP Apps gaps: extension negotiation checks Add ClientGateway::supportsExtension(), Client\Builder::enableExtension() and ClientCapabilities::withExtensions(); introduce side-agnostic ExtensionInterface and deprecate ServerExtensionInterface; document attribute-based UI linkage. * Drop ServerExtensionInterface in favour of ExtensionInterface
This commit is contained in:
parent
590afb575b
commit
6f58fe596a
1 changed files with 273 additions and 21 deletions
|
|
@ -113,6 +113,17 @@ class CapabilitiesExtensionsTest extends TestCase
|
|||
$this->assertSame(['a' => ['x' => 1], 'b' => ['y' => 2]], $caps->extensions, 'original is unchanged');
|
||||
}
|
||||
|
||||
public function testClientCapabilitiesWithExtensionsMerges(): void
|
||||
{
|
||||
$caps = new ClientCapabilities(elicitation: true, extensions: ['a' => ['x' => 1], 'b' => ['y' => 2]]);
|
||||
|
||||
$merged = $caps->withExtensions(['b' => ['y' => 99], 'c' => ['z' => 3]]);
|
||||
|
||||
$this->assertTrue($merged->elicitation);
|
||||
$this->assertSame(['a' => ['x' => 1], 'b' => ['y' => 99], 'c' => ['z' => 3]], $merged->extensions);
|
||||
$this->assertSame(['a' => ['x' => 1], 'b' => ['y' => 2]], $caps->extensions, 'original is unchanged');
|
||||
}
|
||||
|
||||
public function testClientCapabilitiesWithExtensions(): void
|
||||
{
|
||||
$extensions = [
|
||||
|
|
|
|||
Loading…
Reference in a new issue