Enable Explicit Api (#21)
This commit is contained in:
parent
a63ee76ff6
commit
852a4a3d5e
2 changed files with 291 additions and 272 deletions
|
|
@ -1,5 +1,3 @@
|
|||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.SupervisorJob
|
||||
import org.jetbrains.kotlinx.mcp.JSONRPCMessage
|
||||
import org.jetbrains.kotlinx.mcp.shared.Transport
|
||||
|
||||
|
|
@ -7,8 +5,6 @@ import org.jetbrains.kotlinx.mcp.shared.Transport
|
|||
* In-memory transport for creating clients and servers that talk to each other within the same process.
|
||||
*/
|
||||
class InMemoryTransport : Transport {
|
||||
private val scope = CoroutineScope(SupervisorJob())
|
||||
|
||||
private var otherTransport: InMemoryTransport? = null
|
||||
private val messageQueue: MutableList<JSONRPCMessage> = mutableListOf()
|
||||
|
||||
|
|
@ -55,4 +51,4 @@ class InMemoryTransport : Transport {
|
|||
other.messageQueue.add(message)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,13 +11,13 @@ import io.ktor.util.AttributeKey
|
|||
import io.ktor.util.Attributes
|
||||
import kotlinx.coroutines.CompletableDeferred
|
||||
import org.jetbrains.kotlinx.mcp.Implementation
|
||||
import org.jetbrains.kotlinx.mcp.LIB_VERSION
|
||||
import org.jetbrains.kotlinx.mcp.ServerCapabilities
|
||||
import org.jetbrains.kotlinx.mcp.server.SESSION_ID_PARAM
|
||||
import org.jetbrains.kotlinx.mcp.server.SSEServerTransport
|
||||
import org.jetbrains.kotlinx.mcp.server.Server
|
||||
import org.jetbrains.kotlinx.mcp.server.ServerOptions
|
||||
import org.jetbrains.kotlinx.mcp.shared.IMPLEMENTATION_NAME
|
||||
import shared.LIB_VERSION
|
||||
|
||||
typealias IncomingHandler = suspend RoutingContext.(forward: suspend () -> Unit) -> Unit
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue