├── utils ├── api │ ├── utils.api │ └── utils.klib.api ├── src │ ├── commonMain │ │ └── kotlin │ │ │ └── kotlinx │ │ │ └── rpc │ │ │ └── internal │ │ │ └── utils │ │ │ ├── ExperimentalRpcApi.kt │ │ │ ├── InternalRpcApi.kt │ │ │ ├── hex │ │ │ └── HexBytes.kt │ │ │ └── deferredUtil.kt │ ├── jvmMain │ │ └── kotlin │ │ │ └── kotlinx │ │ │ └── rpc │ │ │ └── internal │ │ │ └── utils │ │ │ └── thread │ │ │ └── ThreadLocal.jvm.kt │ ├── wasmJsMain │ │ └── kotlin │ │ │ └── kotlinx │ │ │ └── rpc │ │ │ └── internal │ │ │ └── utils │ │ │ ├── map │ │ │ └── ConcurrentHashMap.wasm.kt │ │ │ └── thread │ │ │ └── ThreadLocal.wasm.kt │ ├── wasmWasiMain │ │ └── kotlin │ │ │ └── kotlinx │ │ │ └── rpc │ │ │ └── internal │ │ │ └── utils │ │ │ ├── map │ │ │ └── ConcurrentHashMap.wasi.kt │ │ │ └── thread │ │ │ └── ThreadLocal.wasi.kt │ ├── jsMain │ │ └── kotlin │ │ │ └── kotlinx │ │ │ └── rpc │ │ │ └── internal │ │ │ └── utils │ │ │ ├── map │ │ │ └── ConcurrentHashMap.js.kt │ │ │ └── thread │ │ │ └── ThreadLocal.js.kt │ └── nativeMain │ │ └── kotlin │ │ └── kotlinx │ │ └── rpc │ │ └── internal │ │ └── utils │ │ ├── map │ │ └── ConcurrentHashMap.native.kt │ │ └── thread │ │ └── ThreadLocal.native.kt └── build.gradle.kts ├── docs └── pages │ ├── .gitignore │ ├── kotlinx-rpc │ ├── .idea │ │ ├── .gitignore │ │ ├── vcs.xml │ │ ├── modules.xml │ │ └── kotlinx-rpc.iml │ ├── preview.png │ ├── help-versions.json │ ├── images │ │ ├── icon16.png │ │ ├── icon300.png │ │ ├── icon32.png │ │ ├── icon500.png │ │ └── icon96.png │ ├── c.list │ ├── writerside.cfg │ └── topics │ │ └── service-descriptors.topic │ ├── .idea │ ├── .gitignore │ └── vcs.xml │ └── assets │ └── homepage.svg ├── krpc ├── krpc-logging │ ├── api │ │ ├── krpc-logging.api │ │ └── krpc-logging.klib.api │ └── build.gradle.kts ├── krpc-ktor │ ├── krpc-ktor-core │ │ ├── api │ │ │ ├── krpc-ktor-core.api │ │ │ └── krpc-ktor-core.klib.api │ │ └── src │ │ │ └── jvmTest │ │ │ └── resources │ │ │ └── logback.xml │ ├── gradle.properties │ ├── krpc-ktor-server │ │ ├── src │ │ │ └── commonMain │ │ │ │ └── kotlin │ │ │ │ └── kotlinx │ │ │ │ └── rpc │ │ │ │ └── krpc │ │ │ │ └── ktor │ │ │ │ └── server │ │ │ │ ├── KtorKrpcServer.kt │ │ │ │ └── Krpc.kt │ │ └── build.gradle.kts │ └── krpc-ktor-client │ │ └── build.gradle.kts ├── krpc-test │ ├── src │ │ ├── jvmTest │ │ │ ├── resources │ │ │ │ ├── indexed_enum_dumps │ │ │ │ │ ├── RPCPlugin.gold │ │ │ │ │ ├── CancellationType.gold │ │ │ │ │ ├── RPCPluginKey.gold │ │ │ │ │ ├── KrpcPlugin.gold │ │ │ │ │ └── KrpcPluginKey.gold │ │ │ │ ├── class_dumps │ │ │ │ │ ├── CallType.gold │ │ │ │ │ ├── KrpcPlugin.gold │ │ │ │ │ ├── KrpcPluginKey.gold │ │ │ │ │ ├── StackElement.gold │ │ │ │ │ ├── KrpcGenericMessage.gold │ │ │ │ │ ├── Handshake.gold │ │ │ │ │ ├── CallSuccessString.gold │ │ │ │ │ ├── SerializedException.gold │ │ │ │ │ ├── CallSuccessBinary.gold │ │ │ │ │ ├── Failure.gold │ │ │ │ │ ├── StreamFinished.gold │ │ │ │ │ ├── StreamMessageString.gold │ │ │ │ │ ├── CallException.gold │ │ │ │ │ ├── StreamMessageBinary.gold │ │ │ │ │ ├── KrpcProtocolMessage.gold │ │ │ │ │ ├── StreamCancel.gold │ │ │ │ │ ├── KrpcMessage.gold │ │ │ │ │ ├── CallDataString.gold │ │ │ │ │ ├── CallResult.gold │ │ │ │ │ ├── CallDataBinary.gold │ │ │ │ │ ├── CallSuccess.gold │ │ │ │ │ ├── StreamMessage.gold │ │ │ │ │ ├── CallData.gold │ │ │ │ │ └── KrpcCallMessage.gold │ │ │ │ └── logback.xml │ │ │ └── kotlin │ │ │ │ └── kotlinx │ │ │ │ └── rpc │ │ │ │ └── krpc │ │ │ │ └── test │ │ │ │ ├── TransportTest.jvm.kt │ │ │ │ └── TestLogAppender.kt │ │ ├── jsTest │ │ │ └── kotlin │ │ │ │ └── kotlinx │ │ │ │ └── rpc │ │ │ │ └── krpc │ │ │ │ └── test │ │ │ │ └── TransportTest.js.kt │ │ ├── nativeTest │ │ │ └── kotlin │ │ │ │ └── kotlinx │ │ │ │ └── rpc │ │ │ │ └── krpc │ │ │ │ └── test │ │ │ │ └── TransportTest.native.kt │ │ ├── wasmJsTest │ │ │ └── kotlin │ │ │ │ └── kotlinx │ │ │ │ └── rpc │ │ │ │ └── krpc │ │ │ │ └── test │ │ │ │ └── TransportTest.wasmJs.kt │ │ ├── wasmWasiTest │ │ │ └── kotlin │ │ │ │ └── kotlinx │ │ │ │ └── rpc │ │ │ │ └── krpc │ │ │ │ └── test │ │ │ │ └── TransportTest.wasmWasi.kt │ │ ├── jsMain │ │ │ └── kotlin │ │ │ │ └── kotlinx │ │ │ │ └── rpc │ │ │ │ └── krpc │ │ │ │ └── test │ │ │ │ └── KrpcTransportTestBase.js.kt │ │ ├── jvmMain │ │ │ └── kotlin │ │ │ │ └── kotlinx │ │ │ │ └── rpc │ │ │ │ └── krpc │ │ │ │ └── test │ │ │ │ └── KrpcTransportTestBase.jvm.kt │ │ ├── nativeMain │ │ │ └── kotlin │ │ │ │ └── kotlinx │ │ │ │ └── rpc │ │ │ │ └── krpc │ │ │ │ └── test │ │ │ │ └── KrpcTransportTestBase.native.kt │ │ ├── wasmJsMain │ │ │ └── kotlin │ │ │ │ └── kotlinx │ │ │ │ └── rpc │ │ │ │ └── krpc │ │ │ │ └── test │ │ │ │ └── KrpcTransportTestBase.wasmJs.kt │ │ ├── wasmWasiMain │ │ │ └── kotlin │ │ │ │ └── kotlinx │ │ │ │ └── rpc │ │ │ │ └── krpc │ │ │ │ └── test │ │ │ │ └── KrpcTransportTestBase.wasmWasi.kt │ │ └── commonMain │ │ │ └── kotlin │ │ │ └── kotlinx │ │ │ └── rpc │ │ │ └── krpc │ │ │ └── test │ │ │ ├── KrpcTestServer.kt │ │ │ ├── KrpcTestClient.kt │ │ │ └── Payloads.kt │ └── gradle.properties ├── krpc-core │ └── src │ │ ├── jsTest │ │ └── kotlin │ │ │ └── kotlinx │ │ │ └── rpc │ │ │ └── krpc │ │ │ └── KrpcReceiveHandlerTest.js.kt │ │ ├── jvmTest │ │ └── kotlin │ │ │ └── kotlinx │ │ │ └── rpc │ │ │ └── krpc │ │ │ └── KrpcReceiveHandlerTest.jvm.kt │ │ ├── nativeTest │ │ └── kotlin │ │ │ └── kotlinx │ │ │ └── rpc │ │ │ └── krpc │ │ │ └── KrpcReceiveHandlerTest.native.kt │ │ ├── wasmJsTest │ │ └── kotlin │ │ │ └── kotlinx │ │ │ └── rpc │ │ │ └── krpc │ │ │ └── KrpcReceiveHandlerTest.wasmJs.kt │ │ ├── wasmWasiTest │ │ └── kotlin │ │ │ └── kotlinx │ │ │ └── rpc │ │ │ └── krpc │ │ │ └── KrpcReceiveHandlerTest.wasmWasi.kt │ │ ├── commonMain │ │ └── kotlin │ │ │ └── kotlinx │ │ │ └── rpc │ │ │ └── krpc │ │ │ └── internal │ │ │ ├── KrpcVersion.kt │ │ │ ├── ObjectId.kt │ │ │ ├── StreamSerializer.kt │ │ │ └── SerializedException.kt │ │ ├── wasmWasiMain │ │ └── kotlin │ │ │ └── kotlinx │ │ │ └── rpc │ │ │ └── krpc │ │ │ └── internal │ │ │ └── ExceptionUtils.wasmWasi.kt │ │ ├── jsMain │ │ └── kotlin │ │ │ └── kotlinx │ │ │ └── rpc │ │ │ └── krpc │ │ │ └── internal │ │ │ └── ExceptionUtils.js.kt │ │ ├── nativeMain │ │ └── kotlin │ │ │ └── kotlinx │ │ │ └── rpc │ │ │ └── krpc │ │ │ └── internal │ │ │ └── ExceptionUtils.native.kt │ │ └── wasmJsMain │ │ └── kotlin │ │ └── kotlinx │ │ └── rpc │ │ └── krpc │ │ └── internal │ │ └── ExceptionUtils.wasm.kt ├── krpc-serialization │ ├── krpc-serialization-cbor │ │ ├── api │ │ │ ├── krpc-serialization-cbor.api │ │ │ └── krpc-serialization-cbor.klib.api │ │ └── build.gradle.kts │ ├── krpc-serialization-json │ │ ├── api │ │ │ ├── krpc-serialization-json.api │ │ │ └── krpc-serialization-json.klib.api │ │ └── build.gradle.kts │ ├── krpc-serialization-protobuf │ │ ├── api │ │ │ ├── krpc-serialization-protobuf.api │ │ │ └── krpc-serialization-protobuf.klib.api │ │ └── build.gradle.kts │ └── krpc-serialization-core │ │ └── build.gradle.kts ├── krpc-server │ ├── src │ │ └── commonMain │ │ │ └── kotlin │ │ │ └── kotlinx │ │ │ └── rpc │ │ │ └── krpc │ │ │ └── server │ │ │ └── internal │ │ │ └── StreamCall.kt │ ├── api │ │ └── krpc-server.api │ └── build.gradle.kts └── krpc-client │ ├── src │ └── commonMain │ │ └── kotlin │ │ └── kotlinx │ │ └── rpc │ │ └── krpc │ │ └── client │ │ └── internal │ │ └── StreamCall.kt │ └── build.gradle.kts ├── samples ├── ktor-android-app │ ├── app │ │ ├── .gitignore │ │ ├── src │ │ │ └── main │ │ │ │ ├── res │ │ │ │ ├── values │ │ │ │ │ ├── strings.xml │ │ │ │ │ ├── themes.xml │ │ │ │ │ └── colors.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ └── ic_launcher_round.webp │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ └── ic_launcher_round.webp │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ └── ic_launcher_round.webp │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ └── ic_launcher_round.webp │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ ├── ic_launcher.webp │ │ │ │ │ └── ic_launcher_round.webp │ │ │ │ ├── xml │ │ │ │ │ ├── network_security_config.xml │ │ │ │ │ ├── backup_rules.xml │ │ │ │ │ └── data_extraction_rules.xml │ │ │ │ └── mipmap-anydpi │ │ │ │ │ ├── ic_launcher.xml │ │ │ │ │ └── ic_launcher_round.xml │ │ │ │ └── kotlin │ │ │ │ └── kotlinx │ │ │ │ └── rpc │ │ │ │ └── sample │ │ │ │ ├── ui │ │ │ │ ├── state │ │ │ │ │ └── Welcome.kt │ │ │ │ └── theme │ │ │ │ │ └── Color.kt │ │ │ │ └── data │ │ │ │ └── Client.kt │ │ └── proguard-rules.pro │ ├── common │ │ ├── .gitignore │ │ ├── src │ │ │ └── main │ │ │ │ └── kotlin │ │ │ │ └── kotlinx │ │ │ │ └── rpc │ │ │ │ └── sample │ │ │ │ ├── User.kt │ │ │ │ └── MyService.kt │ │ └── build.gradle.kts │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── .idea │ │ └── .gitignore │ ├── .gitignore │ ├── build.gradle.kts │ ├── server │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ ├── application.conf │ │ │ └── logback.xml │ │ │ └── kotlin │ │ │ └── kotlinx │ │ │ └── rpc │ │ │ └── sample │ │ │ ├── MyServiceImpl.kt │ │ │ └── Application.kt │ ├── README.md │ └── settings.gradle.kts ├── ktor-all-platforms-app │ ├── .fleet │ │ ├── settings.json │ │ └── receipt.json │ ├── composeApp │ │ └── src │ │ │ ├── androidMain │ │ │ ├── kotlin │ │ │ │ ├── App.android.kt │ │ │ │ └── kotlinx │ │ │ │ │ └── rpc │ │ │ │ │ └── sample │ │ │ │ │ └── MainActivity.kt │ │ │ └── res │ │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ │ ├── values │ │ │ │ └── strings.xml │ │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ │ └── xml │ │ │ │ └── network_security_config.xml │ │ │ ├── wasmJsMain │ │ │ ├── kotlin │ │ │ │ ├── App.wasmJs.kt │ │ │ │ └── main.kt │ │ │ └── resources │ │ │ │ ├── styles.css │ │ │ │ └── index.html │ │ │ ├── iosMain │ │ │ └── kotlin │ │ │ │ ├── MainViewController.kt │ │ │ │ └── App.ios.kt │ │ │ └── desktopMain │ │ │ └── kotlin │ │ │ ├── App.desktop.kt │ │ │ └── main.kt │ ├── iosApp │ │ ├── iosApp │ │ │ ├── Assets.xcassets │ │ │ │ ├── Contents.json │ │ │ │ ├── AppIcon.appiconset │ │ │ │ │ ├── app-icon-1024.png │ │ │ │ │ └── Contents.json │ │ │ │ └── AccentColor.colorset │ │ │ │ │ └── Contents.json │ │ │ ├── Preview Content │ │ │ │ └── Preview Assets.xcassets │ │ │ │ │ └── Contents.json │ │ │ ├── iOSApp.swift │ │ │ └── ContentView.swift │ │ └── Configuration │ │ │ └── Config.xcconfig │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── shared │ │ └── src │ │ │ ├── wasmJsMain │ │ │ └── kotlin │ │ │ │ └── Platform.wasmJs.kt │ │ │ ├── androidMain │ │ │ └── kotlin │ │ │ │ └── Platform.android.kt │ │ │ ├── commonMain │ │ │ └── kotlin │ │ │ │ ├── Platform.kt │ │ │ │ └── UserService.kt │ │ │ ├── iosMain │ │ │ └── kotlin │ │ │ │ └── Platform.ios.kt │ │ │ └── jvmMain │ │ │ └── kotlin │ │ │ └── Platform.jvm.kt │ ├── .gitignore │ ├── server │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ ├── application.conf │ │ │ └── logback.xml │ │ │ └── kotlin │ │ │ └── kotlinx │ │ │ └── rpc │ │ │ └── sample │ │ │ └── UserServiceImpl.kt │ ├── gradle.properties │ ├── build.gradle.kts │ └── settings.gradle.kts ├── grpc-app │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradle.properties │ ├── src │ │ └── main │ │ │ ├── proto │ │ │ └── image-recognizer.proto │ │ │ ├── kotlin │ │ │ ├── Server.kt │ │ │ ├── ImageRecognizer.kt │ │ │ └── Client.kt │ │ │ └── resources │ │ │ └── logback.xml │ ├── settings.gradle.kts │ ├── .gitignore │ └── build.gradle.kts ├── ktor-web-app │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── .gitignore │ ├── gradle.properties │ ├── server │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ ├── static │ │ │ │ └── index.html │ │ │ ├── application.conf │ │ │ └── logback.xml │ │ │ └── kotlin │ │ │ └── MyServiceImpl.kt │ ├── frontend │ │ ├── webpack.config.d │ │ │ └── config.js │ │ └── src │ │ │ └── jsMain │ │ │ ├── resources │ │ │ └── index.html │ │ │ └── kotlin │ │ │ ├── Main.kt │ │ │ └── RPC.kt │ ├── settings.gradle.kts │ ├── build.gradle.kts │ ├── common │ │ ├── src │ │ │ └── commonMain │ │ │ │ └── kotlin │ │ │ │ └── Common.kt │ │ └── build.gradle.kts │ └── README.md └── simple-ktor-app │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradle.properties │ ├── settings.gradle.kts │ ├── .gitignore │ └── src │ └── main │ ├── resources │ └── logback.xml │ └── kotlin │ └── Server.kt ├── jpms-check └── .gitignore ├── gradle ├── artifacts │ ├── publishMavenPublicationToBuildRepoRepository.txt │ └── publishBomPublicationToBuildRepoRepository.txt └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── Dockerfile ├── .github ├── images │ ├── logo.png │ ├── logo_dark.png │ └── logo_light.png ├── pull_request_template.md ├── workflows │ ├── platforms.yml │ ├── changelog.yml │ └── readme.yml ├── release.yml └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .idea ├── codeStyles │ └── codeStyleConfig.xml ├── copyright │ ├── profiles_settings.xml │ └── krpc_apache_2.xml ├── detekt.xml ├── kotlinx-rpc.iml └── kotlinTestDataPluginTestDataPaths.xml ├── dokka-plugin ├── src │ └── main │ │ ├── resources │ │ └── META-INF │ │ │ └── services │ │ │ └── org.jetbrains.dokka.plugability.DokkaPlugin │ │ └── kotlin │ │ └── kotlinx │ │ └── rpc │ │ └── dokka │ │ ├── AddDocsLinkPageTransformer.kt │ │ └── RpcDokkaPlugin.kt ├── settings.gradle.kts └── build.gradle.kts ├── .gitattributes ├── gradle-conventions ├── src │ └── main │ │ └── kotlin │ │ ├── empty.gradle.kts │ │ ├── util │ │ ├── other │ │ │ ├── capitalized.kt │ │ │ ├── libs.kt │ │ │ ├── action.kt │ │ │ ├── directoryNames.kt │ │ │ ├── publicModule.kt │ │ │ ├── maybeNamed.kt │ │ │ └── files.kt │ │ ├── kover.kt │ │ ├── forIde.kt │ │ ├── contextParameters.kt │ │ └── kotlinVersion.kt │ │ ├── conventions-dokka-public.gradle.kts │ │ └── conventions-jvm.gradle.kts ├── settings.gradle.kts └── build.gradle.kts ├── CODE_OF_CONDUCT.md ├── tests ├── test-utils │ ├── src │ │ ├── commonMain │ │ │ └── kotlin │ │ │ │ └── kotlinx │ │ │ │ └── rpc │ │ │ │ └── test │ │ │ │ ├── runThreadIfPossible.kt │ │ │ │ └── runTest.kt │ │ ├── jsMain │ │ │ └── kotlin │ │ │ │ └── kotlinx │ │ │ │ └── rpc │ │ │ │ └── test │ │ │ │ ├── runTest.js.kt │ │ │ │ └── runThreadIfPossible.js.kt │ │ ├── nativeMain │ │ │ └── kotlin │ │ │ │ └── kotlinx │ │ │ │ └── rpc │ │ │ │ └── test │ │ │ │ ├── runTest.native.kt │ │ │ │ └── runThreadIfPossible.native.kt │ │ ├── wasmJsMain │ │ │ └── kotlin │ │ │ │ └── kotlinx │ │ │ │ └── rpc │ │ │ │ └── test │ │ │ │ ├── runTest.wasmJs.kt │ │ │ │ └── runThreadIfPossible.wasmJs.kt │ │ ├── wasmWasiMain │ │ │ └── kotlin │ │ │ │ └── kotlinx │ │ │ │ └── rpc │ │ │ │ └── test │ │ │ │ ├── runTest.wasmWasi.kt │ │ │ │ └── runThreadIfPossible.wasmWasi.kt │ │ └── jvmMain │ │ │ └── kotlin │ │ │ └── kotlinx │ │ │ └── rpc │ │ │ └── test │ │ │ ├── runThreadIfPossible.jvm.kt │ │ │ └── runTest.jvm.kt │ ├── api │ │ └── test-utils.api │ └── build.gradle.kts ├── krpc-compatibility-tests │ └── src │ │ ├── main │ │ └── kotlin │ │ │ └── kotlinx │ │ │ └── rpc │ │ │ └── krpc │ │ │ └── compatibility │ │ │ ├── TestApiServer.kt │ │ │ └── CompatibilityTest.kt │ │ ├── oldApi │ │ └── kotlin │ │ │ ├── interfaces │ │ │ ├── Bar.kt │ │ │ ├── Baz.kt │ │ │ └── Foo.kt │ │ │ └── tests │ │ │ └── ApiServer.kt │ │ └── newApi │ │ └── kotlin │ │ ├── interfaces │ │ ├── Bar.kt │ │ ├── Baz.kt │ │ └── Foo.kt │ │ └── tests │ │ └── ApiServer.kt ├── krpc-protocol-compatibility-tests │ ├── test-api │ │ ├── src │ │ │ └── main │ │ │ │ └── kotlin │ │ │ │ └── kotlinx │ │ │ │ └── rpc │ │ │ │ └── krpc │ │ │ │ └── test │ │ │ │ └── compat │ │ │ │ └── CompatWaitCounter.kt │ │ └── build.gradle.kts │ └── src │ │ └── test │ │ ├── kotlin │ │ └── kotlinx │ │ │ └── rpc │ │ │ └── krpc │ │ │ └── test │ │ │ └── compat │ │ │ └── TestLogAppender.kt │ │ └── resources │ │ └── logback.xml └── compiler-plugin-tests │ └── src │ ├── main │ └── kotlin │ │ └── kotlinx │ │ └── rpc │ │ └── codegen │ │ └── test │ │ └── TestRpcClient.kt │ ├── testData │ └── box │ │ ├── simple.kt │ │ ├── flowParameter.kt │ │ ├── multiModule.kt │ │ └── serviceDescriptor.kt │ └── test │ └── kotlin │ └── kotlinx │ └── rpc │ └── codegen │ └── test │ └── GenerateTests.kt ├── compiler-plugin ├── compiler-plugin-cli │ ├── src │ │ └── main │ │ │ ├── kotlin │ │ │ └── kotlinx │ │ │ │ └── rpc │ │ │ │ └── codegen │ │ │ │ └── pluginId.kt │ │ │ ├── resources │ │ │ └── META-INF │ │ │ │ └── services │ │ │ │ ├── org.jetbrains.kotlin.compiler.plugin.CommandLineProcessor │ │ │ │ └── org.jetbrains.kotlin.compiler.plugin.CompilerPluginRegistrar │ │ │ └── templates │ │ │ └── kotlinx │ │ │ └── rpc │ │ │ └── codegen │ │ │ └── CompilerPluginRegistrar.kt │ └── build.gradle.kts ├── compiler-plugin-common │ └── build.gradle.kts ├── compiler-plugin-k2 │ ├── src │ │ └── main │ │ │ ├── kotlin │ │ │ └── kotlinx │ │ │ │ └── rpc │ │ │ │ └── codegen │ │ │ │ ├── checkers │ │ │ │ └── diagnostics │ │ │ │ │ └── RpcKtDiagnosticsContainerCore.kt │ │ │ │ ├── RpcFirCliOptions.kt │ │ │ │ └── FirRpcPredicates.kt │ │ │ └── templates │ │ │ └── kotlinx │ │ │ └── rpc │ │ │ └── codegen │ │ │ └── checkers │ │ │ └── diagnostics │ │ │ └── RpcKtDiagnosticFactoryToRendererMap.kt │ └── build.gradle.kts ├── compiler-plugin-backend │ └── build.gradle.kts ├── settings.gradle.kts └── build.gradle.kts ├── gradle-conventions-settings ├── develocity │ ├── build.gradle.kts │ └── src │ │ └── main │ │ └── kotlin │ │ ├── execute.kt │ │ └── params.kt ├── build.gradle.kts └── src │ └── main │ └── kotlin │ └── includePublic.kt ├── gradle-plugin ├── src │ └── main │ │ └── kotlin │ │ └── kotlinx │ │ └── rpc │ │ ├── RpcDangerousApi.kt │ │ └── RpcGradlePlugin.kt └── settings.gradle.kts ├── core ├── src │ ├── commonMain │ │ └── kotlin │ │ │ └── kotlinx │ │ │ └── rpc │ │ │ ├── internal │ │ │ └── internalServiceDescriptorOf.kt │ │ │ ├── RemoteService.kt │ │ │ └── RpcCall.kt │ ├── jvmMain │ │ └── kotlin │ │ │ └── kotlinx │ │ │ └── rpc │ │ │ └── internal │ │ │ ├── ReflectionUtils.jvm.kt │ │ │ └── internalServiceDescriptorOf.jvm.kt │ ├── jsMain │ │ └── kotlin │ │ │ └── kotlinx │ │ │ └── rpc │ │ │ └── internal │ │ │ └── ReflectionUtils.js.kt │ ├── wasmJsMain │ │ └── kotlin │ │ │ └── kotlinx │ │ │ └── rpc │ │ │ └── internal │ │ │ └── ReflectionUtils.wasm.kt │ ├── nativeMain │ │ └── kotlin │ │ │ └── kotlinx │ │ │ └── rpc │ │ │ └── internal │ │ │ └── ReflectionUtils.native.kt │ └── wasmWasiMain │ │ └── kotlin │ │ └── kotlinx │ │ └── rpc │ │ └── internal │ │ └── ReflectionUtils.wasi.kt └── build.gradle.kts ├── publishLocal.sh ├── .puppeteerrc.cjs ├── updateTestData.sh ├── versions-root └── targets-since-kotlin-lookup.json ├── karma └── chrome_bin.js ├── bom └── build.gradle.kts └── .gitignore /utils/api/utils.api: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/pages/.gitignore: -------------------------------------------------------------------------------- 1 | api/** 2 | -------------------------------------------------------------------------------- /krpc/krpc-logging/api/krpc-logging.api: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /samples/ktor-android-app/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /samples/ktor-android-app/common/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /krpc/krpc-ktor/krpc-ktor-core/api/krpc-ktor-core.api: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /jpms-check/.gitignore: -------------------------------------------------------------------------------- 1 | src/main/java/module-info.java 2 | -------------------------------------------------------------------------------- /gradle/artifacts/publishMavenPublicationToBuildRepoRepository.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # for local ci builds 2 | FROM stl5/ktor-test-image 3 | WORKDIR rpc/ 4 | COPY . . -------------------------------------------------------------------------------- /docs/pages/kotlinx-rpc/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /.github/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/kotlinx-rpc/HEAD/.github/images/logo.png -------------------------------------------------------------------------------- /samples/ktor-all-platforms-app/.fleet/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "gradle.autoImportOnSave": false 3 | } -------------------------------------------------------------------------------- /.github/images/logo_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/kotlinx-rpc/HEAD/.github/images/logo_dark.png -------------------------------------------------------------------------------- /.github/images/logo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/kotlinx-rpc/HEAD/.github/images/logo_light.png -------------------------------------------------------------------------------- /docs/pages/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | pages.iml 5 | modules.xml 6 | -------------------------------------------------------------------------------- /gradle/artifacts/publishBomPublicationToBuildRepoRepository.txt: -------------------------------------------------------------------------------- 1 | org.jetbrains.kotlinx:kotlinx-rpc-bom/javadoc.jar 2 | -------------------------------------------------------------------------------- /docs/pages/kotlinx-rpc/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/kotlinx-rpc/HEAD/docs/pages/kotlinx-rpc/preview.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/kotlinx-rpc/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /krpc/krpc-test/src/jvmTest/resources/indexed_enum_dumps/RPCPlugin.gold: -------------------------------------------------------------------------------- 1 | UNKNOWN - 0 2 | HANDSHAKE - 1 3 | CANCELLATION - 2 -------------------------------------------------------------------------------- /docs/pages/kotlinx-rpc/help-versions.json: -------------------------------------------------------------------------------- 1 | [ 2 | {"version":"0.10.1","url":"/kotlinx-rpc/0.10.1/","isCurrent":true} 3 | ] 4 | -------------------------------------------------------------------------------- /samples/ktor-all-platforms-app/composeApp/src/androidMain/kotlin/App.android.kt: -------------------------------------------------------------------------------- 1 | actual val DEV_SERVER_HOST: String = "10.0.2.2" 2 | -------------------------------------------------------------------------------- /samples/ktor-all-platforms-app/composeApp/src/wasmJsMain/kotlin/App.wasmJs.kt: -------------------------------------------------------------------------------- 1 | actual val DEV_SERVER_HOST: String = "127.0.0.1" 2 | -------------------------------------------------------------------------------- /docs/pages/kotlinx-rpc/images/icon16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/kotlinx-rpc/HEAD/docs/pages/kotlinx-rpc/images/icon16.png -------------------------------------------------------------------------------- /docs/pages/kotlinx-rpc/images/icon300.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/kotlinx-rpc/HEAD/docs/pages/kotlinx-rpc/images/icon300.png -------------------------------------------------------------------------------- /docs/pages/kotlinx-rpc/images/icon32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/kotlinx-rpc/HEAD/docs/pages/kotlinx-rpc/images/icon32.png -------------------------------------------------------------------------------- /docs/pages/kotlinx-rpc/images/icon500.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/kotlinx-rpc/HEAD/docs/pages/kotlinx-rpc/images/icon500.png -------------------------------------------------------------------------------- /docs/pages/kotlinx-rpc/images/icon96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/kotlinx-rpc/HEAD/docs/pages/kotlinx-rpc/images/icon96.png -------------------------------------------------------------------------------- /krpc/krpc-test/src/jvmTest/resources/indexed_enum_dumps/CancellationType.gold: -------------------------------------------------------------------------------- 1 | ENDPOINT - 0 2 | SERVICE - 1 3 | REQUEST - 2 4 | CANCELLATION_ACK - 3 -------------------------------------------------------------------------------- /samples/ktor-android-app/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | KtorApplication 3 | -------------------------------------------------------------------------------- /samples/grpc-app/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/kotlinx-rpc/HEAD/samples/grpc-app/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /samples/ktor-all-platforms-app/iosApp/iosApp/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } -------------------------------------------------------------------------------- /samples/ktor-web-app/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/kotlinx-rpc/HEAD/samples/ktor-web-app/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /samples/ktor-all-platforms-app/iosApp/Configuration/Config.xcconfig: -------------------------------------------------------------------------------- 1 | TEAM_ID= 2 | BUNDLE_ID=kotlinx.rpc.sample.ktor-all-platforms-app 3 | APP_NAME=ktor-all-platforms-app -------------------------------------------------------------------------------- /samples/simple-ktor-app/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/kotlinx-rpc/HEAD/samples/simple-ktor-app/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /samples/ktor-android-app/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/kotlinx-rpc/HEAD/samples/ktor-android-app/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /samples/ktor-web-app/.gitignore: -------------------------------------------------------------------------------- 1 | **/build/** 2 | **/.gradle 3 | 4 | local.properties 5 | server/src/main/resources/static/* 6 | !server/src/main/resources/static/index.html 7 | -------------------------------------------------------------------------------- /samples/ktor-all-platforms-app/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/kotlinx-rpc/HEAD/samples/ktor-all-platforms-app/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /samples/ktor-all-platforms-app/iosApp/iosApp/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } -------------------------------------------------------------------------------- /krpc/krpc-test/src/jvmTest/resources/indexed_enum_dumps/RPCPluginKey.gold: -------------------------------------------------------------------------------- 1 | UNKNOWN - 0 2 | GENERIC_MESSAGE_TYPE - 1 3 | CANCELLATION_TYPE - 2 4 | CANCELLATION_ID - 3 5 | CLIENT_SERVICE_ID - 4 -------------------------------------------------------------------------------- /samples/ktor-android-app/app/src/main/res/mipmap-hdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/kotlinx-rpc/HEAD/samples/ktor-android-app/app/src/main/res/mipmap-hdpi/ic_launcher.webp -------------------------------------------------------------------------------- /samples/ktor-android-app/app/src/main/res/mipmap-mdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/kotlinx-rpc/HEAD/samples/ktor-android-app/app/src/main/res/mipmap-mdpi/ic_launcher.webp -------------------------------------------------------------------------------- /samples/ktor-android-app/app/src/main/res/mipmap-xhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/kotlinx-rpc/HEAD/samples/ktor-android-app/app/src/main/res/mipmap-xhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /samples/ktor-android-app/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/kotlinx-rpc/HEAD/samples/ktor-android-app/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /.idea/codeStyles/codeStyleConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | -------------------------------------------------------------------------------- /samples/ktor-all-platforms-app/composeApp/src/wasmJsMain/resources/styles.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | width: 100%; 3 | height: 100%; 4 | margin: 0; 5 | padding: 0; 6 | overflow: hidden; 7 | } -------------------------------------------------------------------------------- /samples/ktor-android-app/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/kotlinx-rpc/HEAD/samples/ktor-android-app/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /krpc/krpc-test/src/jvmTest/resources/indexed_enum_dumps/KrpcPlugin.gold: -------------------------------------------------------------------------------- 1 | UNKNOWN - 0 2 | HANDSHAKE - 1 3 | CANCELLATION - 2 4 | NON_SUSPENDING_SERVER_FLOWS - 3 5 | NO_ACK_CANCELLATION - 4 6 | BACKPRESSURE - 5 -------------------------------------------------------------------------------- /samples/grpc-app/gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. 3 | # 4 | 5 | kotlin.code.style=official 6 | -------------------------------------------------------------------------------- /samples/ktor-android-app/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/kotlinx-rpc/HEAD/samples/ktor-android-app/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /samples/ktor-android-app/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/kotlinx-rpc/HEAD/samples/ktor-android-app/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /samples/ktor-android-app/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/kotlinx-rpc/HEAD/samples/ktor-android-app/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /krpc/krpc-ktor/gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. 3 | # 4 | 5 | kotlinx.rpc.exclude.wasmWasi=true 6 | -------------------------------------------------------------------------------- /krpc/krpc-test/src/jvmTest/resources/class_dumps/CallType.gold: -------------------------------------------------------------------------------- 1 | org.jetbrains.krpc.internal.transport.RPCMessage.CallType [Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.CallType] 2 | Method 3 | Field -------------------------------------------------------------------------------- /samples/ktor-all-platforms-app/iosApp/iosApp/iOSApp.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | @main 4 | struct iOSApp: App { 5 | var body: some Scene { 6 | WindowGroup { 7 | ContentView() 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /samples/ktor-android-app/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/kotlinx-rpc/HEAD/samples/ktor-android-app/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /samples/ktor-android-app/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/kotlinx-rpc/HEAD/samples/ktor-android-app/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /samples/ktor-web-app/gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. 3 | # 4 | 5 | kotlin.code.style=official 6 | -------------------------------------------------------------------------------- /samples/simple-ktor-app/gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. 3 | # 4 | 5 | kotlin.code.style=official 6 | -------------------------------------------------------------------------------- /samples/ktor-all-platforms-app/composeApp/src/iosMain/kotlin/MainViewController.kt: -------------------------------------------------------------------------------- 1 | import androidx.compose.ui.window.ComposeUIViewController 2 | 3 | fun MainViewController() = ComposeUIViewController { App() } 4 | -------------------------------------------------------------------------------- /krpc/krpc-test/src/jvmTest/resources/class_dumps/KrpcPlugin.gold: -------------------------------------------------------------------------------- 1 | kotlinx.rpc.krpc.internal.KrpcPlugin 2 | UNKNOWN 3 | HANDSHAKE 4 | CANCELLATION 5 | NON_SUSPENDING_SERVER_FLOWS 6 | NO_ACK_CANCELLATION 7 | BACKPRESSURE -------------------------------------------------------------------------------- /samples/simple-ktor-app/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. 3 | */ 4 | 5 | rootProject.name = "simple-ktor-app" 6 | -------------------------------------------------------------------------------- /docs/pages/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /samples/ktor-all-platforms-app/composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/kotlinx-rpc/HEAD/samples/ktor-all-platforms-app/composeApp/src/androidMain/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /samples/ktor-all-platforms-app/composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kotlin/kotlinx-rpc/HEAD/samples/ktor-all-platforms-app/composeApp/src/androidMain/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /samples/ktor-android-app/app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 17 | Back to docs 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /samples/simple-ktor-app/src/main/kotlin/Server.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. 3 | */ 4 | 5 | import io.ktor.server.application.* 6 | import io.ktor.server.engine.* 7 | import io.ktor.server.netty.* 8 | import io.ktor.server.routing.* 9 | import kotlinx.rpc.krpc.ktor.server.Krpc 10 | import kotlinx.rpc.krpc.ktor.server.rpc 11 | import kotlinx.rpc.krpc.serialization.json.json 12 | 13 | fun main() { 14 | embeddedServer(Netty, port = 8080) { 15 | module() 16 | }.start(wait = true) 17 | } 18 | 19 | fun Application.module() { 20 | install(Krpc) 21 | 22 | routing { 23 | rpc("/image-recognizer") { 24 | rpcConfig { 25 | serialization { 26 | json() 27 | } 28 | } 29 | 30 | registerService { ImageRecognizerService() } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /tests/krpc-compatibility-tests/src/newApi/kotlin/tests/ApiServer.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. 3 | */ 4 | 5 | package tests 6 | 7 | import kotlinx.rpc.krpc.compatibility.TestApiServer 8 | import interfaces.BarInterface 9 | import interfaces.BarInterfaceImpl 10 | import interfaces.BazInterface 11 | import interfaces.BazInterfaceImpl 12 | import interfaces.FooInterface 13 | import interfaces.FooInterfaceImpl 14 | import kotlinx.rpc.RpcServer 15 | import kotlinx.rpc.registerService 16 | 17 | @Suppress("unused") 18 | class ApiServer : TestApiServer { 19 | override fun serveAllInterfaces(rpcServer: RpcServer) { 20 | rpcServer.apply { 21 | registerService { FooInterfaceImpl() } 22 | registerService { BarInterfaceImpl() } 23 | registerService { BazInterfaceImpl() } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /tests/krpc-compatibility-tests/src/oldApi/kotlin/tests/ApiServer.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. 3 | */ 4 | 5 | package tests 6 | 7 | import kotlinx.rpc.krpc.compatibility.TestApiServer 8 | import interfaces.BarInterface 9 | import interfaces.BarInterfaceImpl 10 | import interfaces.BazInterface 11 | import interfaces.BazInterfaceImpl 12 | import interfaces.FooInterface 13 | import interfaces.FooInterfaceImpl 14 | import kotlinx.rpc.RpcServer 15 | import kotlinx.rpc.registerService 16 | 17 | @Suppress("unused") 18 | class ApiServer : TestApiServer { 19 | override fun serveAllInterfaces(rpcServer: RpcServer) { 20 | rpcServer.apply { 21 | registerService { FooInterfaceImpl() } 22 | registerService { BarInterfaceImpl() } 23 | registerService { BazInterfaceImpl() } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore Gradle project-specific cache directory 2 | .gradle 3 | 4 | # Ignore Gradle build output directory 5 | build 6 | .kotlin 7 | lib-kotlin 8 | # idea files 9 | .idea/* 10 | !.idea/runConfigurations 11 | !.idea/runConfigurations/* 12 | !.idea/vcs.xml 13 | !.idea/dictionaries 14 | !.idea/dictionaries/* 15 | !.idea/copyright 16 | !.idea/copyright/* 17 | !.idea/codeStyles 18 | !.idea/codeStyles/* 19 | !.idea/icon.svg 20 | !.idea/detekt.xml 21 | !.idea/kotlinTestDataPluginTestDataPaths.xml 22 | !.idea/kotlinx-rpc.iml 23 | !.idea/kotlin-plugins.xml 24 | 25 | samples/**/.idea/* 26 | 27 | .DS_Store 28 | 29 | # Ignore generated Detekt reports 30 | detekt/reports/** 31 | 32 | # tmp files created by tests 33 | *.tmp 34 | 35 | .puppeteer 36 | 37 | # Ignore kover reports 38 | /kover 39 | 40 | local.properties 41 | scan-journal.log 42 | 43 | # krpc compat tests 44 | tests/krpc-protocol-compatibility-tests/v* 45 | gradle-conventions/src/main/kotlin/util/krpc_compat/versions.kt 46 | -------------------------------------------------------------------------------- /gradle-conventions/src/main/kotlin/conventions-jvm.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. 3 | */ 4 | 5 | @file:OptIn(ExperimentalAbiValidation::class) 6 | 7 | import compat.patrouille.configureJavaCompatibility 8 | import compat.patrouille.configureKotlinCompatibility 9 | import org.jetbrains.kotlin.gradle.dsl.abi.ExperimentalAbiValidation 10 | import util.configureAbiFilters 11 | import util.enableAbiValidation 12 | import util.targets.configureJvm 13 | 14 | plugins { 15 | id("conventions-common") 16 | id("org.jetbrains.kotlin.jvm") 17 | } 18 | 19 | java { 20 | withSourcesJar() 21 | } 22 | 23 | configureJavaCompatibility(8) 24 | configureKotlinCompatibility("2.0.0") 25 | 26 | kotlin { 27 | explicitApi() 28 | 29 | abiValidation { 30 | enabled = enableAbiValidation 31 | 32 | configureAbiFilters() 33 | } 34 | } 35 | 36 | configureJvm(isKmp = false) 37 | -------------------------------------------------------------------------------- /compiler-plugin/compiler-plugin-k2/src/main/templates/kotlinx/rpc/codegen/checkers/diagnostics/RpcKtDiagnosticFactoryToRendererMap.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. 3 | */ 4 | 5 | package kotlinx.rpc.codegen.checkers.diagnostics 6 | 7 | import org.jetbrains.kotlin.diagnostics.KtDiagnosticFactoryToRendererMap 8 | 9 | fun RpcKtDiagnosticFactoryToRendererMap( 10 | name: String, 11 | init: (KtDiagnosticFactoryToRendererMap) -> Unit, 12 | ): Lazy { 13 | //##csm RpcKtDiagnosticFactoryToRendererMap 14 | //##csm specific=[2.0.0...2.2.10] 15 | return lazy(LazyThreadSafetyMode.SYNCHRONIZED) { 16 | KtDiagnosticFactoryToRendererMap(name).also(init) 17 | } 18 | //##csm /specific 19 | //##csm default 20 | return KtDiagnosticFactoryToRendererMap(name, init) 21 | //##csm /default 22 | //##csm /RpcKtDiagnosticFactoryToRendererMap 23 | } 24 | -------------------------------------------------------------------------------- /krpc/krpc-serialization/krpc-serialization-cbor/api/krpc-serialization-cbor.klib.api: -------------------------------------------------------------------------------- 1 | // Klib ABI Dump 2 | // Targets: [iosArm64, iosSimulatorArm64, iosX64, js, linuxArm64, linuxX64, macosArm64, macosX64, mingwX64, tvosArm64, tvosSimulatorArm64, tvosX64, wasmJs, wasmWasi, watchosArm32, watchosArm64, watchosDeviceArm64, watchosSimulatorArm64, watchosX64] 3 | // Rendering settings: 4 | // - Signature version: 2 5 | // - Show manifest properties: true 6 | // - Show declarations: true 7 | 8 | // Library unique name: 9 | final fun (kotlinx.rpc.krpc.serialization/KrpcSerialFormatConfiguration).kotlinx.rpc.krpc.serialization.cbor/cbor(kotlinx.serialization.cbor/Cbor = ..., kotlin/Function1 = ...) // kotlinx.rpc.krpc.serialization.cbor/cbor|cbor@kotlinx.rpc.krpc.serialization.KrpcSerialFormatConfiguration(kotlinx.serialization.cbor.Cbor;kotlin.Function1){}[0] 10 | -------------------------------------------------------------------------------- /krpc/krpc-serialization/krpc-serialization-json/api/krpc-serialization-json.klib.api: -------------------------------------------------------------------------------- 1 | // Klib ABI Dump 2 | // Targets: [iosArm64, iosSimulatorArm64, iosX64, js, linuxArm64, linuxX64, macosArm64, macosX64, mingwX64, tvosArm64, tvosSimulatorArm64, tvosX64, wasmJs, wasmWasi, watchosArm32, watchosArm64, watchosDeviceArm64, watchosSimulatorArm64, watchosX64] 3 | // Rendering settings: 4 | // - Signature version: 2 5 | // - Show manifest properties: true 6 | // - Show declarations: true 7 | 8 | // Library unique name: 9 | final fun (kotlinx.rpc.krpc.serialization/KrpcSerialFormatConfiguration).kotlinx.rpc.krpc.serialization.json/json(kotlinx.serialization.json/Json = ..., kotlin/Function1 = ...) // kotlinx.rpc.krpc.serialization.json/json|json@kotlinx.rpc.krpc.serialization.KrpcSerialFormatConfiguration(kotlinx.serialization.json.Json;kotlin.Function1){}[0] 10 | -------------------------------------------------------------------------------- /krpc/krpc-core/src/wasmWasiMain/kotlin/kotlinx/rpc/krpc/internal/ExceptionUtils.wasmWasi.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. 3 | */ 4 | 5 | package kotlinx.rpc.krpc.internal 6 | 7 | internal actual class DeserializedException actual constructor( 8 | private val toStringMessage: String, 9 | actual override val message: String, 10 | stacktrace: List, 11 | cause: SerializedException?, 12 | className: String 13 | ) : Throwable() { 14 | 15 | override val cause: Throwable? = cause?.deserialize() 16 | 17 | override fun toString(): String = toStringMessage 18 | } 19 | 20 | internal actual fun Throwable.stackElements(): List = emptyList() 21 | 22 | internal actual fun SerializedException.deserializeUnsafe(): Throwable { 23 | return cancellationExceptionDeserialize() 24 | ?: DeserializedException(toStringMessage, message, stacktrace, cause, className) 25 | } 26 | -------------------------------------------------------------------------------- /core/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. 3 | */ 4 | 5 | plugins { 6 | alias(libs.plugins.conventions.kmp) 7 | alias(libs.plugins.kotlinx.rpc) 8 | alias(libs.plugins.atomicfu) 9 | } 10 | 11 | kotlin { 12 | sourceSets { 13 | commonMain { 14 | dependencies { 15 | api(projects.utils) 16 | api(libs.coroutines.core) 17 | 18 | // TODO Remove after KRPC-178 19 | implementation(libs.serialization.core) 20 | 21 | implementation(libs.kotlin.reflect) 22 | } 23 | } 24 | 25 | jsMain { 26 | dependencies { 27 | implementation(libs.kotlin.js.wrappers) 28 | } 29 | } 30 | 31 | wasmJsMain { 32 | dependencies { 33 | implementation(libs.kotlinx.browser) 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /krpc/krpc-core/src/commonMain/kotlin/kotlinx/rpc/krpc/internal/SerializedException.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. 3 | */ 4 | 5 | package kotlinx.rpc.krpc.internal 6 | 7 | import kotlinx.rpc.internal.utils.InternalRpcApi 8 | import kotlinx.serialization.SerialName 9 | import kotlinx.serialization.Serializable 10 | 11 | @InternalRpcApi 12 | @Serializable 13 | @SerialName("org.jetbrains.krpc.StackElement") 14 | public data class StackElement( 15 | val clazz: String, 16 | val method: String, 17 | val fileName: String?, 18 | val lineNumber: Int 19 | ) 20 | 21 | @InternalRpcApi 22 | @Serializable 23 | @SerialName("org.jetbrains.krpc.SerializedException") 24 | public data class SerializedException( 25 | public val toStringMessage: String, 26 | public val message: String, 27 | public val stacktrace: List, 28 | public val cause: SerializedException?, 29 | public val className: String 30 | ) 31 | -------------------------------------------------------------------------------- /compiler-plugin/compiler-plugin-cli/src/main/templates/kotlinx/rpc/codegen/CompilerPluginRegistrar.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. 3 | */ 4 | 5 | package kotlinx.rpc.codegen 6 | 7 | import org.jetbrains.kotlin.compiler.plugin.CompilerPluginRegistrar 8 | import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi 9 | import org.jetbrains.kotlin.config.CompilerConfiguration 10 | 11 | @OptIn(ExperimentalCompilerApi::class) 12 | class RpcCompilerPlugin : CompilerPluginRegistrar() { 13 | override val supportsK2: Boolean = true 14 | 15 | //##csm RpcCompilerPlugin.pluginId 16 | //##csm specific=[2.0.0...2.2.99] 17 | //##csm /specific 18 | //##csm default 19 | override val pluginId: String = PLUGIN_ID 20 | //##csm /default 21 | //##csm /RpcCompilerPlugin.pluginId 22 | 23 | override fun ExtensionStorage.registerExtensions(configuration: CompilerConfiguration) { 24 | registerRpcExtensions(configuration) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /krpc/krpc-ktor/krpc-ktor-server/src/commonMain/kotlin/kotlinx/rpc/krpc/ktor/server/Krpc.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. 3 | */ 4 | 5 | package kotlinx.rpc.krpc.ktor.server 6 | 7 | import io.ktor.server.application.* 8 | import io.ktor.server.websocket.* 9 | import io.ktor.util.* 10 | import kotlinx.rpc.krpc.KrpcConfigBuilder 11 | 12 | internal val KrpcServerPluginAttributesKey = AttributeKey("KrpcServerPluginAttributesKey") 13 | 14 | /** 15 | * Ktor server plugin that allows to configure RPC globally for all mounted servers. 16 | */ 17 | public val Krpc: ApplicationPlugin = createApplicationPlugin( 18 | name = "Krpc", 19 | createConfiguration = { KrpcConfigBuilder.Server() }, 20 | ) { 21 | application.pluginOrNull(WebSockets) ?: run { 22 | application.install(WebSockets) 23 | } 24 | 25 | application.attributes.put(KrpcServerPluginAttributesKey, pluginConfig) 26 | } 27 | -------------------------------------------------------------------------------- /dokka-plugin/src/main/kotlin/kotlinx/rpc/dokka/RpcDokkaPlugin.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. 3 | */ 4 | 5 | package kotlinx.rpc.dokka 6 | 7 | import org.jetbrains.dokka.CoreExtensions 8 | import org.jetbrains.dokka.base.DokkaBase 9 | import org.jetbrains.dokka.plugability.DokkaPlugin 10 | import org.jetbrains.dokka.plugability.DokkaPluginApiPreview 11 | import org.jetbrains.dokka.plugability.PluginApiPreviewAcknowledgement 12 | 13 | @Suppress("unused") 14 | class RpcDokkaPlugin : DokkaPlugin() { 15 | @OptIn(DokkaPluginApiPreview::class) 16 | override fun pluginApiPreviewAcknowledgement() = PluginApiPreviewAcknowledgement 17 | 18 | val rpcInternalApiTransformer by extending { 19 | plugin().preMergeDocumentableTransformer providing ::HideInternalRpcApiTransformer 20 | } 21 | 22 | val pageTransformer by extending { 23 | CoreExtensions.pageTransformer providing ::AddDocsLinkPageTransformer 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /krpc/krpc-test/src/jvmTest/resources/class_dumps/KrpcCallMessage.gold: -------------------------------------------------------------------------------- 1 | org.jetbrains.krpc.RPCMessage [Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage] 2 | - callId: kotlin.String 3 | - serviceId: kotlin.Long 4 | - Nullable 5 | - serviceType: kotlin.String 6 | - connectionId: kotlin.Long 7 | - Nullable 8 | - pluginParams: kotlin.collections.Map 9 | - Nullable 10 | 11 | org.jetbrains.krpc.internal.transport.RPCMessage.CallData 12 | - Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.CallData 13 | org.jetbrains.krpc.RPCMessage.CallResult 14 | - Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.CallResult 15 | org.jetbrains.krpc.RPCMessage.StreamCancel 16 | - Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.StreamCancel 17 | org.jetbrains.krpc.RPCMessage.StreamFinished 18 | - Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.StreamFinished 19 | org.jetbrains.krpc.internal.transport.RPCMessage.StreamMessage 20 | - Declared name: kotlinx.rpc.krpc.internal.KrpcCallMessage.StreamMessage -------------------------------------------------------------------------------- /utils/src/commonMain/kotlin/kotlinx/rpc/internal/utils/deferredUtil.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. 3 | */ 4 | 5 | package kotlinx.rpc.internal.utils 6 | 7 | import kotlinx.coroutines.CompletableDeferred 8 | import kotlinx.coroutines.ExperimentalCoroutinesApi 9 | import kotlinx.rpc.internal.utils.map.RpcInternalConcurrentHashMap 10 | 11 | @InternalRpcApi 12 | public fun RpcInternalConcurrentHashMap>.getDeferred( 13 | key: K, 14 | ): CompletableDeferred { 15 | return computeIfAbsent(key) { CompletableDeferred() } 16 | } 17 | 18 | @InternalRpcApi 19 | public operator fun RpcInternalConcurrentHashMap>.set(key: K, value: V) { 20 | getDeferred(key).complete(value) 21 | } 22 | 23 | @InternalRpcApi 24 | @OptIn(ExperimentalCoroutinesApi::class) 25 | public fun CompletableDeferred?.getOrNull(): T? = if (this != null && isCompleted) this.getCompleted() else null 26 | -------------------------------------------------------------------------------- /compiler-plugin/build.gradle.kts: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. 3 | */ 4 | 5 | import util.whenForIde 6 | 7 | plugins { 8 | id("empty") // resolve conventions classpath 9 | } 10 | 11 | val rpcVersion: String = libs.versions.kotlinx.rpc.get() 12 | val kotlinCompilerVersion = libs.versions.kotlin.compiler.get() 13 | val kotlinLangVersion = libs.versions.kotlin.lang.get() 14 | 15 | allprojects { 16 | group = "org.jetbrains.kotlinx" 17 | 18 | version = if (kotlinCompilerVersion != kotlinLangVersion) { 19 | "$kotlinCompilerVersion-$rpcVersion" 20 | } else { 21 | "$kotlinLangVersion-$rpcVersion" 22 | } 23 | } 24 | 25 | logger.lifecycle( 26 | "[Compiler Plugin] kotlinx.rpc project version: $version, " + 27 | "Kotlin version: $kotlinLangVersion, " + 28 | "Compiler version: $kotlinCompilerVersion" 29 | ) 30 | 31 | whenForIde { 32 | logger.lifecycle("[Compiler Plugin] For-ide project mode enabled") 33 | } 34 | -------------------------------------------------------------------------------- /gradle-conventions/src/main/kotlin/util/kotlinVersion.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. 3 | */ 4 | 5 | package util 6 | 7 | import org.gradle.api.plugins.ExtensionAware 8 | import org.gradle.kotlin.dsl.extra 9 | import org.gradle.kotlin.dsl.provideDelegate 10 | import util.other.ActionApplied 11 | 12 | fun String.kotlinVersionParsed(): KotlinVersion { 13 | val (major, minor, patch) = substringBefore('-').split(".").map { it.toInt() } 14 | return KotlinVersion(major, minor, patch) 15 | } 16 | 17 | @Suppress("unused") 18 | inline fun ExtensionAware.whenKotlinCompilerIsAtLeast( 19 | major: Int, 20 | minor: Int, 21 | patch: Int = 0, 22 | action: () -> Unit = {}, 23 | ): ActionApplied { 24 | val kotlinCompilerVersion: KotlinVersion by extra 25 | 26 | if (kotlinCompilerVersion.isAtLeast(major, minor, patch)) { 27 | action() 28 | 29 | return ActionApplied.Applied 30 | } 31 | 32 | return ActionApplied.NotApplied 33 | } 34 | -------------------------------------------------------------------------------- /krpc/krpc-core/src/jsMain/kotlin/kotlinx/rpc/krpc/internal/ExceptionUtils.js.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. 3 | */ 4 | 5 | @file:Suppress("detekt.MatchingDeclarationName") 6 | 7 | package kotlinx.rpc.krpc.internal 8 | 9 | internal actual class DeserializedException actual constructor( 10 | private val toStringMessage: String, 11 | actual override val message: String, 12 | stacktrace: List, 13 | cause: SerializedException?, 14 | className: String 15 | ) : Throwable() { 16 | 17 | override val cause: Throwable? = cause?.deserialize() 18 | 19 | override fun toString(): String = toStringMessage 20 | } 21 | 22 | 23 | internal actual fun Throwable.stackElements(): List = emptyList() 24 | 25 | internal actual fun SerializedException.deserializeUnsafe(): Throwable { 26 | return cancellationExceptionDeserialize() 27 | ?: DeserializedException(toStringMessage, message, stacktrace, cause, className) 28 | } 29 | -------------------------------------------------------------------------------- /krpc/krpc-serialization/krpc-serialization-protobuf/api/krpc-serialization-protobuf.klib.api: -------------------------------------------------------------------------------- 1 | // Klib ABI Dump 2 | // Targets: [iosArm64, iosSimulatorArm64, iosX64, js, linuxArm64, linuxX64, macosArm64, macosX64, mingwX64, tvosArm64, tvosSimulatorArm64, tvosX64, wasmJs, wasmWasi, watchosArm32, watchosArm64, watchosDeviceArm64, watchosSimulatorArm64, watchosX64] 3 | // Rendering settings: 4 | // - Signature version: 2 5 | // - Show manifest properties: true 6 | // - Show declarations: true 7 | 8 | // Library unique name: 9 | final fun (kotlinx.rpc.krpc.serialization/KrpcSerialFormatConfiguration).kotlinx.rpc.krpc.serialization.protobuf/protobuf(kotlinx.serialization.protobuf/ProtoBuf = ..., kotlin/Function1 = ...) // kotlinx.rpc.krpc.serialization.protobuf/protobuf|protobuf@kotlinx.rpc.krpc.serialization.KrpcSerialFormatConfiguration(kotlinx.serialization.protobuf.ProtoBuf;kotlin.Function1){}[0] 10 | -------------------------------------------------------------------------------- /docs/pages/kotlinx-rpc/topics/service-descriptors.topic: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 9 | This API is experimental and may be changed at any time. 10 | 11 |

12 | Service Descriptors allow you to access entities generated by the compiler plugin. 13 | You can access them by using the following code: 14 |

15 | 16 | serviceDescriptorOf<MyService>() 17 | 18 |

19 | For the list of available entities, refer to the source code. 20 |

21 |
22 | -------------------------------------------------------------------------------- /krpc/krpc-core/src/nativeMain/kotlin/kotlinx/rpc/krpc/internal/ExceptionUtils.native.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. 3 | */ 4 | 5 | @file:Suppress("detekt.MatchingDeclarationName") 6 | 7 | package kotlinx.rpc.krpc.internal 8 | 9 | internal actual class DeserializedException actual constructor( 10 | private val toStringMessage: String, 11 | actual override val message: String, 12 | stacktrace: List, 13 | cause: SerializedException?, 14 | className: String 15 | ) : Throwable() { 16 | 17 | override val cause: Throwable? = cause?.deserialize() 18 | 19 | override fun toString(): String = toStringMessage 20 | } 21 | 22 | internal actual fun Throwable.stackElements(): List = emptyList() 23 | 24 | internal actual fun SerializedException.deserializeUnsafe(): Throwable { 25 | return cancellationExceptionDeserialize() 26 | ?: DeserializedException(toStringMessage, message, stacktrace, cause, className) 27 | } 28 | -------------------------------------------------------------------------------- /krpc/krpc-core/src/wasmJsMain/kotlin/kotlinx/rpc/krpc/internal/ExceptionUtils.wasm.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. 3 | */ 4 | 5 | @file:Suppress("detekt.MatchingDeclarationName") 6 | 7 | package kotlinx.rpc.krpc.internal 8 | 9 | internal actual class DeserializedException actual constructor( 10 | private val toStringMessage: String, 11 | actual override val message: String, 12 | stacktrace: List, 13 | cause: SerializedException?, 14 | className: String 15 | ) : Throwable() { 16 | 17 | override val cause: Throwable? = cause?.deserialize() 18 | 19 | override fun toString(): String = toStringMessage 20 | } 21 | 22 | 23 | internal actual fun Throwable.stackElements(): List = emptyList() 24 | 25 | internal actual fun SerializedException.deserializeUnsafe(): Throwable { 26 | return cancellationExceptionDeserialize() 27 | ?: DeserializedException(toStringMessage, message, stacktrace, cause, className) 28 | } 29 | -------------------------------------------------------------------------------- /.github/workflows/readme.yml: -------------------------------------------------------------------------------- 1 | name: Verify Readme 2 | 3 | on: 4 | pull_request: 5 | 6 | permissions: 7 | contents: read 8 | 9 | jobs: 10 | verify-readme: 11 | name: Run Verification 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout Sources 15 | uses: actions/checkout@v5 16 | with: 17 | fetch-depth: 0 18 | 19 | - name: Setup Gradle 20 | uses: gradle/actions/setup-gradle@v4 21 | 22 | - name: Check Platforms Table 23 | run: ./gradlew updateDocsChangelog --info --stacktrace 24 | 25 | - name: Check if readme is changed in a propper branch 26 | run: | 27 | if [[ -n "$(git status --porcelain | grep README.md)" ]]; then 28 | target_branch=${{ github.base_ref }} 29 | pr_branch=${{ github.head_ref }} 30 | if [[ "$target_branch" == "main" && ! "$pr_branch" =~ ^release-.* ]]; then 31 | echo "README.md change targeting main can only be done in release-* branches" 32 | exit 1 33 | fi 34 | fi 35 | --------------------------------------------------------------------------------