chore: deprecation cycle (#615)
Remove all deprecation with error level ## Motivation and Context next minor release ## How Has This Been Tested? - ## Breaking Changes Removing it is a binary-incompatible change ## Types of changes - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update ## Checklist - [x] I have read the [MCP Documentation](https://modelcontextprotocol.io) - [x] My code follows the repository's style guidelines - [x] New and existing tests pass locally - [x] I have added appropriate error handling - [x] I have added or updated documentation as needed
This commit is contained in:
parent
55afb63c27
commit
558399039c
9 changed files with 0 additions and 2987 deletions
|
|
@ -33,9 +33,6 @@ import kotlinx.coroutines.CompletableDeferred
|
|||
import kotlinx.coroutines.Deferred
|
||||
import kotlinx.coroutines.TimeoutCancellationException
|
||||
import kotlinx.coroutines.withTimeout
|
||||
import kotlinx.serialization.ExperimentalSerializationApi
|
||||
import kotlinx.serialization.json.ClassDiscriminatorMode
|
||||
import kotlinx.serialization.json.Json
|
||||
import kotlinx.serialization.json.JsonObject
|
||||
import kotlinx.serialization.json.JsonPrimitive
|
||||
import kotlinx.serialization.json.encodeToJsonElement
|
||||
|
|
@ -52,22 +49,6 @@ public const val IMPLEMENTATION_NAME: String = "mcp-ktor"
|
|||
*/
|
||||
public typealias ProgressCallback = (Progress) -> Unit
|
||||
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@Deprecated(
|
||||
message = "Use McpJson instead",
|
||||
replaceWith = ReplaceWith("McpJson", "io.modelcontextprotocol.kotlin.sdk.types.McpJson"),
|
||||
level = DeprecationLevel.ERROR,
|
||||
)
|
||||
public val McpJson: Json by lazy {
|
||||
Json {
|
||||
ignoreUnknownKeys = true
|
||||
encodeDefaults = true
|
||||
isLenient = true
|
||||
classDiscriminatorMode = ClassDiscriminatorMode.NONE
|
||||
explicitNulls = false
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Additional initialization options.
|
||||
*/
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,42 +0,0 @@
|
|||
package io.modelcontextprotocol.kotlin.sdk
|
||||
|
||||
import io.modelcontextprotocol.kotlin.sdk.types.error
|
||||
import io.modelcontextprotocol.kotlin.sdk.types.success
|
||||
import kotlinx.serialization.json.JsonObject
|
||||
|
||||
@Deprecated(
|
||||
message = "Use `io.modelcontextprotocol.kotlin.sdk.types.EmptyJsonObject` instead",
|
||||
replaceWith = ReplaceWith("EmptyJsonObject", "io.modelcontextprotocol.kotlin.sdk.types.EmptyJsonObject"),
|
||||
level = DeprecationLevel.ERROR,
|
||||
)
|
||||
public val EmptyJsonObject: JsonObject = io.modelcontextprotocol.kotlin.sdk.types.EmptyJsonObject
|
||||
|
||||
/**
|
||||
* Creates a [CallToolResult] with single [TextContent] and [meta].
|
||||
*/
|
||||
@Deprecated(
|
||||
message = "Use `CallToolResult.success` instead",
|
||||
replaceWith = ReplaceWith("CallToolResult.Companion.success"),
|
||||
level = DeprecationLevel.ERROR,
|
||||
)
|
||||
@Suppress("DEPRECATION_ERROR")
|
||||
public fun CallToolResult.ok(
|
||||
content: String,
|
||||
meta: JsonObject = EmptyJsonObject,
|
||||
): io.modelcontextprotocol.kotlin.sdk.types.CallToolResult =
|
||||
io.modelcontextprotocol.kotlin.sdk.types.CallToolResult.success(content, meta)
|
||||
|
||||
/**
|
||||
* Creates a [CallToolResult] with single [TextContent] and [meta], with `isError` being true.
|
||||
*/
|
||||
@Deprecated(
|
||||
message = "Use `CallToolResult.error` instead",
|
||||
replaceWith = ReplaceWith("CallToolResult.Companion.error"),
|
||||
level = DeprecationLevel.ERROR,
|
||||
)
|
||||
@Suppress("DEPRECATION_ERROR")
|
||||
public fun CallToolResult.error(
|
||||
content: String,
|
||||
meta: JsonObject = EmptyJsonObject,
|
||||
): io.modelcontextprotocol.kotlin.sdk.types.CallToolResult =
|
||||
io.modelcontextprotocol.kotlin.sdk.types.CallToolResult.error(content, meta)
|
||||
|
|
@ -30,15 +30,6 @@ public val SUPPORTED_PROTOCOL_VERSIONS: List<String> = listOf(
|
|||
public sealed interface WithMeta {
|
||||
@SerialName("_meta")
|
||||
public val meta: JsonObject?
|
||||
|
||||
@Deprecated(
|
||||
message = "Use 'meta' instead.",
|
||||
replaceWith = ReplaceWith("meta"),
|
||||
level = DeprecationLevel.ERROR,
|
||||
)
|
||||
@Suppress("PropertyName", "VariableNaming")
|
||||
public val _meta: JsonObject
|
||||
get() = meta ?: EmptyJsonObject
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
|
|
|||
|
|
@ -39,18 +39,6 @@ public data class CompleteRequest(override val params: CompleteRequestParams) :
|
|||
|
||||
public val meta: RequestMeta?
|
||||
get() = params.meta
|
||||
|
||||
@Deprecated(
|
||||
message = "Will be removed in a future release.",
|
||||
replaceWith = ReplaceWith(expression = "CompleteRequest(CompleteRequestParams(argument, ref, context, meta))"),
|
||||
level = DeprecationLevel.ERROR,
|
||||
)
|
||||
public constructor(
|
||||
argument: Argument,
|
||||
ref: Reference,
|
||||
context: Context? = null,
|
||||
meta: RequestMeta? = null,
|
||||
) : this(CompleteRequestParams(argument, ref, context, meta))
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -113,23 +113,6 @@ public data class GetPromptRequest(override val params: GetPromptRequestParams)
|
|||
@EncodeDefault
|
||||
override val method: Method = Method.Defined.PromptsGet
|
||||
|
||||
@Deprecated(
|
||||
message = "Use constructor with GetPromptRequestParams instead",
|
||||
replaceWith = ReplaceWith("GetPromptRequest(GetPromptRequestParams(name, arguments, meta))"),
|
||||
level = DeprecationLevel.ERROR,
|
||||
)
|
||||
public constructor(
|
||||
name: String,
|
||||
arguments: Map<String, String>? = null,
|
||||
meta: RequestMeta? = null,
|
||||
) : this(
|
||||
GetPromptRequestParams(
|
||||
name = name,
|
||||
arguments = arguments,
|
||||
meta = meta,
|
||||
),
|
||||
)
|
||||
|
||||
/**
|
||||
* The name of the prompt or prompt template to retrieve.
|
||||
*/
|
||||
|
|
@ -204,26 +187,6 @@ public data class ListPromptsRequest(override val params: PaginatedRequestParams
|
|||
PaginatedRequest {
|
||||
@EncodeDefault
|
||||
override val method: Method = Method.Defined.PromptsList
|
||||
|
||||
/**
|
||||
* Secondary constructor for creating a [ListPromptsRequest] instance
|
||||
* using optional cursor and metadata parameters.
|
||||
*
|
||||
* This constructor simplifies the creation of the [ListPromptsRequest] by allowing a cursor
|
||||
* and metadata to be provided.
|
||||
*
|
||||
* @param cursor Optional cursor string to specify the starting point of the paginated request.
|
||||
* @param meta Optional metadata associated with the request.
|
||||
*/
|
||||
@Deprecated(
|
||||
message = "Use constructor with ListPromptsParams instead",
|
||||
replaceWith = ReplaceWith("ListPromptsRequest(ListPromptsParams(name, arguments, meta))"),
|
||||
level = DeprecationLevel.ERROR,
|
||||
)
|
||||
public constructor(
|
||||
cursor: String?,
|
||||
meta: RequestMeta? = null,
|
||||
) : this(paginatedRequestParams(cursor, meta))
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -191,26 +191,6 @@ public data class ListResourcesRequest(override val params: PaginatedRequestPara
|
|||
PaginatedRequest {
|
||||
@EncodeDefault
|
||||
override val method: Method = Method.Defined.ResourcesList
|
||||
|
||||
/**
|
||||
* Secondary constructor for creating a [ListResourcesRequest] instance
|
||||
* using optional cursor and metadata parameters.
|
||||
*
|
||||
* This constructor simplifies the creation of the [ListResourcesRequest] by allowing a cursor
|
||||
* and metadata to be provided.
|
||||
*
|
||||
* @param cursor Optional cursor string to specify the starting point of the paginated request.
|
||||
* @param meta Optional metadata associated with the request.
|
||||
*/
|
||||
@Deprecated(
|
||||
message = "Use the constructor with PaginatedRequestParams property instead",
|
||||
replaceWith = ReplaceWith("ReadResourceRequest(PaginatedRequestParams(cursor, meta))"),
|
||||
level = DeprecationLevel.ERROR,
|
||||
)
|
||||
public constructor(
|
||||
cursor: String?,
|
||||
meta: RequestMeta? = null,
|
||||
) : this(paginatedRequestParams(cursor, meta))
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -261,16 +241,6 @@ public data class ReadResourceRequest(override val params: ReadResourceRequestPa
|
|||
*/
|
||||
public val meta: RequestMeta?
|
||||
get() = params.meta
|
||||
|
||||
@Deprecated(
|
||||
message = "Use the constructor with ReadResourceRequestParams property instead",
|
||||
replaceWith = ReplaceWith("ReadResourceRequest(ReadResourceRequestParams(uri, meta))"),
|
||||
level = DeprecationLevel.ERROR,
|
||||
)
|
||||
public constructor(
|
||||
uri: String,
|
||||
meta: RequestMeta? = null,
|
||||
) : this(ReadResourceRequestParams(uri, meta))
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -337,16 +307,6 @@ public data class SubscribeRequest(override val params: SubscribeRequestParams)
|
|||
*/
|
||||
public val meta: RequestMeta?
|
||||
get() = params.meta
|
||||
|
||||
@Deprecated(
|
||||
message = "Use the constructor with SubscribeRequestParams property instead",
|
||||
replaceWith = ReplaceWith("ReadResourceRequest(SubscribeRequestParams(uri, meta))"),
|
||||
level = DeprecationLevel.ERROR,
|
||||
)
|
||||
public constructor(
|
||||
uri: String,
|
||||
meta: RequestMeta? = null,
|
||||
) : this(SubscribeRequestParams(uri, meta))
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -433,26 +393,6 @@ public data class ListResourceTemplatesRequest(override val params: PaginatedReq
|
|||
PaginatedRequest {
|
||||
@EncodeDefault
|
||||
override val method: Method = Method.Defined.ResourcesTemplatesList
|
||||
|
||||
/**
|
||||
* Secondary constructor for creating a [ListResourceTemplatesRequest] instance
|
||||
* using optional cursor and metadata parameters.
|
||||
*
|
||||
* This constructor simplifies the creation of the [ListResourceTemplatesRequest] by allowing a cursor
|
||||
* and metadata to be provided.
|
||||
*
|
||||
* @param cursor Optional cursor string to specify the starting point of the paginated request.
|
||||
* @param meta Optional metadata associated with the request.
|
||||
*/
|
||||
@Deprecated(
|
||||
message = "Use the constructor with PaginatedRequestParams property instead",
|
||||
replaceWith = ReplaceWith("ListResourceTemplatesRequest(PaginatedRequestParams(cursor, meta))"),
|
||||
level = DeprecationLevel.ERROR,
|
||||
)
|
||||
public constructor(
|
||||
cursor: String?,
|
||||
meta: RequestMeta? = null,
|
||||
) : this(paginatedRequestParams(cursor, meta))
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -62,15 +62,6 @@ public data class ListRootsRequest(override val params: BaseRequestParams? = nul
|
|||
|
||||
public val meta: RequestMeta?
|
||||
get() = params?.meta
|
||||
|
||||
@Deprecated(
|
||||
message = "Use the constructor with BaseRequestParams property instead",
|
||||
replaceWith = ReplaceWith("ListRootsRequest(BaseRequestParams(meta))"),
|
||||
level = DeprecationLevel.ERROR,
|
||||
)
|
||||
public constructor(
|
||||
meta: RequestMeta?,
|
||||
) : this(BaseRequestParams(meta))
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -267,26 +267,6 @@ public data class ListToolsRequest(override val params: PaginatedRequestParams?
|
|||
PaginatedRequest {
|
||||
@EncodeDefault
|
||||
override val method: Method = Method.Defined.ToolsList
|
||||
|
||||
/**
|
||||
* Secondary constructor for creating a [ListToolsRequest] instance
|
||||
* using optional cursor and metadata parameters.
|
||||
*
|
||||
* This constructor simplifies the creation of the [ListToolsRequest] by allowing a cursor
|
||||
* and metadata to be provided.
|
||||
*
|
||||
* @param cursor Optional cursor string to specify the starting point of the paginated request.
|
||||
* @param meta Optional metadata associated with the request.
|
||||
*/
|
||||
@Deprecated(
|
||||
message = "Use the constructor with BaseRequestParams property instead",
|
||||
replaceWith = ReplaceWith("ListToolsRequest(BaseRequestParams(meta))"),
|
||||
level = DeprecationLevel.ERROR,
|
||||
)
|
||||
public constructor(
|
||||
cursor: String?,
|
||||
meta: RequestMeta? = null,
|
||||
) : this(paginatedRequestParams(cursor, meta))
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue