-
Notifications
You must be signed in to change notification settings - Fork 183
[WIP] StreamableHttpServerTransport implementation #449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
d189d4f
4667bf0
a40db1d
e593c2e
02c3c15
04956fb
600850e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -85,6 +85,11 @@ public sealed interface JSONRPCMessage { | |
| public val jsonrpc: String | ||
| } | ||
|
|
||
| @Serializable | ||
| public data object JSONRPCEmptyMessage : JSONRPCMessage { | ||
| override val jsonrpc: String = JSONRPC_VERSION | ||
| } | ||
|
|
||
| // ============================================================================ | ||
| // JSONRPCRequest | ||
| // ============================================================================ | ||
|
|
@@ -197,7 +202,7 @@ public data class JSONRPCResponse(val id: RequestId, val result: RequestResult = | |
| * @property error Details about the error that occurred, including error code and message. | ||
| */ | ||
| @Serializable | ||
| public data class JSONRPCError(val id: RequestId, val error: RPCError) : JSONRPCMessage { | ||
| public data class JSONRPCError(val id: RequestId?, val error: RPCError) : JSONRPCMessage { | ||
|
||
| @EncodeDefault | ||
| override val jsonrpc: String = JSONRPC_VERSION | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,33 @@ | ||||||||||||||||||||
| package io.modelcontextprotocol.kotlin.sdk.server | ||||||||||||||||||||
|
|
||||||||||||||||||||
| import io.modelcontextprotocol.kotlin.sdk.types.JSONRPCMessage | ||||||||||||||||||||
|
|
||||||||||||||||||||
| /** | ||||||||||||||||||||
| * Interface for resumability support via event storage | ||||||||||||||||||||
| */ | ||||||||||||||||||||
| public interface EventStore { | ||||||||||||||||||||
| /** | ||||||||||||||||||||
| * Stores an event for later retrieval | ||||||||||||||||||||
| * @param streamId ID of the stream the event belongs to | ||||||||||||||||||||
| * @param message The JSON-RPC message to store | ||||||||||||||||||||
| * @returns The generated event ID for the stored event | ||||||||||||||||||||
|
||||||||||||||||||||
| * @returns The generated event ID for the stored event | |
| * @return The generated event ID for the stored event |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing KDoc documentation for the getStreamIdForEventId method. The inline comment on line 30 describes it as a "no-op" default implementation, but there's no actual default implementation provided (it's an interface method). Consider either providing a default implementation or clarifying the documentation to explain that implementers may throw NotImplementedError or UnsupportedOperationException to disable this validation.
| * Returns the stream ID associated with [eventId], or null if the event is unknown. | |
| * Default implementation is a no-op which disables extra validation during replay. | |
| * Returns the stream ID associated with the given [eventId], or null if the event is unknown. | |
| * | |
| * Implementers may throw [NotImplementedError] or [UnsupportedOperationException] to disable | |
| * extra validation during replay, as there is no default implementation provided. | |
| * | |
| * @param eventId The event ID to look up. | |
| * @return The stream ID associated with the event, or null if unknown. |
Uh oh!
There was an error while loading. Please reload this page.