Skip to content

Commit 0df06f5

Browse files
committed
refactor: remove Default companion object from Configuration and simplify StreamableHttpServerTransport constructor
1 parent f649ff0 commit 0df06f5

2 files changed

Lines changed: 2 additions & 14 deletions

File tree

kotlin-sdk-server/api/kotlin-sdk-server.api

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,7 @@ public final class io/modelcontextprotocol/kotlin/sdk/server/StdioServerTranspor
194194

195195
public final class io/modelcontextprotocol/kotlin/sdk/server/StreamableHttpServerTransport : io/modelcontextprotocol/kotlin/sdk/shared/AbstractTransport {
196196
public static final field STANDALONE_SSE_STREAM_ID Ljava/lang/String;
197-
public fun <init> ()V
198197
public fun <init> (Lio/modelcontextprotocol/kotlin/sdk/server/StreamableHttpServerTransport$Configuration;)V
199-
public synthetic fun <init> (Lio/modelcontextprotocol/kotlin/sdk/server/StreamableHttpServerTransport$Configuration;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
200198
public fun <init> (ZZLjava/util/List;Ljava/util/List;Lio/modelcontextprotocol/kotlin/sdk/server/EventStore;Ljava/lang/Long;)V
201199
public synthetic fun <init> (ZZLjava/util/List;Ljava/util/List;Lio/modelcontextprotocol/kotlin/sdk/server/EventStore;Ljava/lang/Long;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
202200
public fun close (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
@@ -214,7 +212,6 @@ public final class io/modelcontextprotocol/kotlin/sdk/server/StreamableHttpServe
214212
}
215213

216214
public final class io/modelcontextprotocol/kotlin/sdk/server/StreamableHttpServerTransport$Configuration {
217-
public static final field Companion Lio/modelcontextprotocol/kotlin/sdk/server/StreamableHttpServerTransport$Configuration$Companion;
218215
public synthetic fun <init> (ZZLjava/util/List;Ljava/util/List;Lio/modelcontextprotocol/kotlin/sdk/server/EventStore;Lkotlin/time/Duration;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
219216
public synthetic fun <init> (ZZLjava/util/List;Ljava/util/List;Lio/modelcontextprotocol/kotlin/sdk/server/EventStore;Lkotlin/time/Duration;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
220217
public final fun getAllowedHosts ()Ljava/util/List;
@@ -225,10 +222,6 @@ public final class io/modelcontextprotocol/kotlin/sdk/server/StreamableHttpServe
225222
public final fun getRetryInterval-FghU774 ()Lkotlin/time/Duration;
226223
}
227224

228-
public final class io/modelcontextprotocol/kotlin/sdk/server/StreamableHttpServerTransport$Configuration$Companion {
229-
public final fun getDefault ()Lio/modelcontextprotocol/kotlin/sdk/server/StreamableHttpServerTransport$Configuration;
230-
}
231-
232225
public final class io/modelcontextprotocol/kotlin/sdk/server/WebSocketMcpKtorServerExtensionsKt {
233226
public static final fun mcpWebSocket (Lio/ktor/server/application/Application;Ljava/lang/String;Lkotlin/jvm/functions/Function0;)V
234227
public static final fun mcpWebSocket (Lio/ktor/server/application/Application;Lkotlin/jvm/functions/Function0;)V

kotlin-sdk-server/src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/server/StreamableHttpServerTransport.kt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ private data class SessionContext(val session: ServerSSESession?, val call: Appl
7272
*/
7373
@OptIn(ExperimentalUuidApi::class, ExperimentalAtomicApi::class)
7474
@Suppress("TooManyFunctions")
75-
public class StreamableHttpServerTransport(private val configuration: Configuration = Configuration.Default) :
76-
AbstractTransport() {
75+
public class StreamableHttpServerTransport(private val configuration: Configuration) : AbstractTransport() {
7776

7877
/**
7978
* Secondary constructor for `StreamableHttpServerTransport` that simplifies initialization by directly taking the
@@ -142,11 +141,7 @@ public class StreamableHttpServerTransport(private val configuration: Configurat
142141
public val allowedOrigins: List<String>? = null,
143142
public val eventStore: EventStore? = null,
144143
public val retryInterval: Duration? = null,
145-
) {
146-
public companion object {
147-
public val Default: Configuration = Configuration()
148-
}
149-
}
144+
)
150145

151146
public var sessionId: String? = null
152147
private set

0 commit comments

Comments
 (0)