Implement SEP-1319: Decouple Request Payload from RPC Methods (#617)
* feat: implement SEP-1319 Decouple Request Payload from RPC Methods * test: update tests * fix: update handler trait methods to use new types * fix: update examples * fix: correct deprecation version * fix: update wrapper macros to use new *Params type names
This commit is contained in:
parent
48e989b711
commit
9e881a645b
1 changed files with 913 additions and 278 deletions
|
|
@ -85,7 +85,7 @@ pub trait ClientHandler: Sized + Send + Sync + 'static {
|
|||
|
||||
fn create_message(
|
||||
&self,
|
||||
params: CreateMessageRequestParam,
|
||||
params: CreateMessageRequestParams,
|
||||
context: RequestContext<RoleClient>,
|
||||
) -> impl Future<Output = Result<CreateMessageResult, McpError>> + Send + '_ {
|
||||
std::future::ready(Err(
|
||||
|
|
@ -118,7 +118,7 @@ pub trait ClientHandler: Sized + Send + Sync + 'static {
|
|||
/// Real clients should override this to provide user interaction.
|
||||
fn create_elicitation(
|
||||
&self,
|
||||
request: CreateElicitationRequestParam,
|
||||
request: CreateElicitationRequestParams,
|
||||
context: RequestContext<RoleClient>,
|
||||
) -> impl Future<Output = Result<CreateElicitationResult, McpError>> + Send + '_ {
|
||||
// Default implementation declines all requests - real clients should override this
|
||||
|
|
@ -225,7 +225,7 @@ macro_rules! impl_client_handler_for_wrapper {
|
|||
|
||||
fn create_message(
|
||||
&self,
|
||||
params: CreateMessageRequestParam,
|
||||
params: CreateMessageRequestParams,
|
||||
context: RequestContext<RoleClient>,
|
||||
) -> impl Future<Output = Result<CreateMessageResult, McpError>> + Send + '_ {
|
||||
(**self).create_message(params, context)
|
||||
|
|
@ -240,7 +240,7 @@ macro_rules! impl_client_handler_for_wrapper {
|
|||
|
||||
fn create_elicitation(
|
||||
&self,
|
||||
request: CreateElicitationRequestParam,
|
||||
request: CreateElicitationRequestParams,
|
||||
context: RequestContext<RoleClient>,
|
||||
) -> impl Future<Output = Result<CreateElicitationResult, McpError>> + Send + '_ {
|
||||
(**self).create_elicitation(request, context)
|
||||
|
|
|
|||
Loading…
Reference in a new issue