Skip to content

Commit f5a8e3a

Browse files
devcrocodkpavlov
authored andcommitted
add missing KDoc comments for public classes, interfaces, and properties
1 parent 8e4b23f commit f5a8e3a

7 files changed

Lines changed: 38 additions & 0 deletions

File tree

config/detekt/detekt.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ empty-blocks:
2323
excludes: *testFolders
2424

2525
comments:
26+
UndocumentedPublicClass:
27+
active: true
28+
excludes: [ '**/test/**', '**/commonTest/**', '**/jvmTest/**', '**/generated-sources/**' ]
29+
ignoreDefaultCompanionObject: true
30+
UndocumentedPublicFunction:
31+
active: true
32+
excludes: [ '**/test/**', '**/commonTest/**', '**/jvmTest/**', '**/generated-sources/**' ]
2633
UndocumentedPublicProperty:
2734
active: true
2835
excludes: [ '**/test/**', '**/commonTest/**', '**/jvmTest/**', '**/generated-sources/**' ]

kotlin-sdk-core/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/shared/Protocol.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,13 @@ public class RequestOptions(
100100
public val onProgress: ProgressCallback? = null,
101101
public val timeout: Duration = DEFAULT_REQUEST_TIMEOUT,
102102
) : TransportSendOptions(relatedRequestId, resumptionToken, onResumptionToken) {
103+
/** Destructuring component for [onProgress]. */
103104
public operator fun component4(): ProgressCallback? = onProgress
105+
106+
/** Destructuring component for [timeout]. */
104107
public operator fun component5(): Duration = timeout
105108

109+
/** Creates a copy of this [RequestOptions] with the specified fields replaced. */
106110
public fun copy(
107111
relatedRequestId: RequestId? = this.relatedRequestId,
108112
resumptionToken: String? = this.resumptionToken,

kotlin-sdk-core/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/shared/TransportSendOptions.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,16 @@ public open class TransportSendOptions(
1717
public val resumptionToken: String? = null,
1818
public val onResumptionToken: ((String) -> Unit)? = null,
1919
) {
20+
/** Destructuring component for [relatedRequestId]. */
2021
public operator fun component1(): RequestId? = relatedRequestId
22+
23+
/** Destructuring component for [resumptionToken]. */
2124
public operator fun component2(): String? = resumptionToken
25+
26+
/** Destructuring component for [onResumptionToken]. */
2227
public operator fun component3(): ((String) -> Unit)? = onResumptionToken
2328

29+
/** Creates a copy of this [TransportSendOptions] with the specified fields replaced. */
2430
public open fun copy(
2531
relatedRequestId: RequestId? = this.relatedRequestId,
2632
resumptionToken: String? = this.resumptionToken,

kotlin-sdk-core/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/types/content.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ public sealed interface ContentBlock : WithMeta {
4141
public val type: ContentTypes
4242
}
4343

44+
/**
45+
* Content block that carries media data such as text, images, or audio.
46+
*/
4447
@Serializable(with = MediaContentPolymorphicSerializer::class)
4548
public sealed interface MediaContent : ContentBlock
4649

kotlin-sdk-core/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/types/jsonRpc.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ public sealed interface JSONRPCMessage {
112112
public val jsonrpc: String
113113
}
114114

115+
/**
116+
* Represents an empty JSON-RPC message used as a placeholder or no-op response.
117+
*/
115118
@Serializable
116119
public data object JSONRPCEmptyMessage : JSONRPCMessage {
117120
override val jsonrpc: String = JSONRPC_VERSION

kotlin-sdk-core/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/types/request.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ public value class RequestMeta(public val json: JsonObject) {
4949
public operator fun get(key: String): JsonElement? = json[key]
5050
}
5151

52+
/**
53+
* Base interface for parameters attached to a [Request].
54+
*/
5255
@Serializable
5356
public sealed interface RequestParams {
5457
/**
@@ -61,6 +64,9 @@ public sealed interface RequestParams {
6164
public val meta: RequestMeta?
6265
}
6366

67+
/**
68+
* Default [RequestParams] implementation carrying only optional metadata.
69+
*/
6470
@Serializable
6571
public data class BaseRequestParams(@SerialName("_meta") override val meta: RequestMeta? = null) : RequestParams
6672

@@ -121,9 +127,15 @@ public sealed interface PaginatedRequest : Request {
121127
@Serializable(with = RequestResultPolymorphicSerializer::class)
122128
public sealed interface RequestResult : WithMeta
123129

130+
/**
131+
* Represents a result returned by the server in response to a [ClientRequest].
132+
*/
124133
@Serializable(with = ClientResultPolymorphicSerializer::class)
125134
public sealed interface ClientResult : RequestResult
126135

136+
/**
137+
* Represents a result returned by the client in response to a [ServerRequest].
138+
*/
127139
@Serializable(with = ServerResultPolymorphicSerializer::class)
128140
public sealed interface ServerResult : RequestResult
129141

kotlin-sdk-core/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/types/resources.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ import kotlinx.serialization.SerialName
88
import kotlinx.serialization.Serializable
99
import kotlinx.serialization.json.JsonObject
1010

11+
/**
12+
* Common interface for resource-like types that share URI, name, and description fields.
13+
*/
1114
@Serializable
1215
public sealed interface ResourceLike : WithMeta
1316

0 commit comments

Comments
 (0)