diff --git a/pkgs/dart_mcp/CHANGELOG.md b/pkgs/dart_mcp/CHANGELOG.md index 84fb23eb..03d99e06 100644 --- a/pkgs/dart_mcp/CHANGELOG.md +++ b/pkgs/dart_mcp/CHANGELOG.md @@ -6,6 +6,9 @@ - Add new `package:dart_mcp/stdio.dart` library with a `stdioChannel` utility for creating a stream channel that separates messages by newlines. - Added more examples. +- Deprecated the `WithElicitationHandler` interface - the method this required + is now defined directly on the `ElicitationSupport` mixin which matches the + pattern used by other mixins in this package. - Change the `schema` parameter for elicitation requests to an `ObjectSchema` to match the spec. - Deprecate the `Elicitations` server capability, this doesn't exist in the spec. diff --git a/pkgs/dart_mcp/lib/src/client/elicitation_support.dart b/pkgs/dart_mcp/lib/src/client/elicitation_support.dart index b847c3d0..72139ab7 100644 --- a/pkgs/dart_mcp/lib/src/client/elicitation_support.dart +++ b/pkgs/dart_mcp/lib/src/client/elicitation_support.dart @@ -4,19 +4,27 @@ part of 'client.dart'; -/// The interface for handling elicitation requests. -/// -/// Any client using [ElicitationSupport] must implement this interface. +@Deprecated( + 'This interface is going away, the method will exist directly on the ' + 'ElicitationSupport mixin instead', +) abstract interface class WithElicitationHandler { FutureOr handleElicitation(ElicitRequest request); } /// A mixin that adds support for the `elicitation` capability to an /// [MCPClient]. +// ignore: deprecated_member_use_from_same_package base mixin ElicitationSupport on MCPClient implements WithElicitationHandler { @override void initialize() { capabilities.elicitation ??= ElicitationCapability(); super.initialize(); } + + /// The method for handling elicitation requests. + /// + /// Any client using [ElicitationSupport] must implement this interface. + @override + FutureOr handleElicitation(ElicitRequest request); }