From e3eb0529084b34a0044b8519dcecfa12ec63afe1 Mon Sep 17 00:00:00 2001 From: Jake Macdonald Date: Wed, 16 Jul 2025 18:26:16 +0000 Subject: [PATCH] Remove the WithElicitationhandler interface --- pkgs/dart_mcp/CHANGELOG.md | 3 +++ .../lib/src/client/elicitation_support.dart | 14 +++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/pkgs/dart_mcp/CHANGELOG.md b/pkgs/dart_mcp/CHANGELOG.md index 52517b7e..31138f87 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. ## 0.3.0 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); }