Skip to content

Commit aed93b4

Browse files
authored
Deprecate the WithElicitationhandler interface (#231)
This extra type wasn't necessary - now this follows the pattern of the other support mixins, just defining the abstract method on the mixin itself.
1 parent 01cf3d4 commit aed93b4

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

pkgs/dart_mcp/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
- Add new `package:dart_mcp/stdio.dart` library with a `stdioChannel` utility
77
for creating a stream channel that separates messages by newlines.
88
- Added more examples.
9+
- Deprecated the `WithElicitationHandler` interface - the method this required
10+
is now defined directly on the `ElicitationSupport` mixin which matches the
11+
pattern used by other mixins in this package.
912
- Change the `schema` parameter for elicitation requests to an `ObjectSchema` to
1013
match the spec.
1114
- Deprecate the `Elicitations` server capability, this doesn't exist in the spec.

pkgs/dart_mcp/lib/src/client/elicitation_support.dart

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,27 @@
44

55
part of 'client.dart';
66

7-
/// The interface for handling elicitation requests.
8-
///
9-
/// Any client using [ElicitationSupport] must implement this interface.
7+
@Deprecated(
8+
'This interface is going away, the method will exist directly on the '
9+
'ElicitationSupport mixin instead',
10+
)
1011
abstract interface class WithElicitationHandler {
1112
FutureOr<ElicitResult> handleElicitation(ElicitRequest request);
1213
}
1314

1415
/// A mixin that adds support for the `elicitation` capability to an
1516
/// [MCPClient].
17+
// ignore: deprecated_member_use_from_same_package
1618
base mixin ElicitationSupport on MCPClient implements WithElicitationHandler {
1719
@override
1820
void initialize() {
1921
capabilities.elicitation ??= ElicitationCapability();
2022
super.initialize();
2123
}
24+
25+
/// The method for handling elicitation requests.
26+
///
27+
/// Any client using [ElicitationSupport] must implement this interface.
28+
@override
29+
FutureOr<ElicitResult> handleElicitation(ElicitRequest request);
2230
}

0 commit comments

Comments
 (0)