The swiftlang/swift-tools-protocols repository provides BSP model types and is specifically intended for third-party tools like sourcekit-bsp. Using the models from that repository seems like a good approach.
It also seems to include types for working with JSON-RPC, such as https://github.com/swiftlang/swift-tools-protocols/blob/main/Sources/LanguageServerProtocolTransport/JSONRPCConnection.swift, though I'm not sure if those are suitable for use as well
The swiftlang/swift-tools-protocols repository provides BSP model types and is specifically intended for third-party tools like sourcekit-bsp. Using the models from that repository seems like a good approach.
It also seems to include types for working with JSON-RPC, such as https://github.com/swiftlang/swift-tools-protocols/blob/main/Sources/LanguageServerProtocolTransport/JSONRPCConnection.swift, though I'm not sure if those are suitable for use as well