feat: AG-UI as in-process KMP API with Ktor client/server transports
Model the AG-UI protocol as an in-process API of Java-style interfaces and classes, mirroring the official AG-UI Java SDK, and build it as a Kotlin Multiplatform library with two Ktor transport modules. Modules: - api: BaseEvent sealed hierarchy (all AG-UI event types), messages, state, tool, context, RunAgentInput/Parameters, Agent/AgentSubscriber/ EventDispatcher, AguiJson (kotlinx.serialization, "type" discriminator), plus a SerializersModule registering every event subtype polymorphically. - client: HttpAgent over Ktor SSE (POST RunAgentInput -> stream BaseEvent), implementing the Agent interface. - server: Application.agui()/Route.aguiAgent() exposing an Agent behind a POST + SSE endpoint via SSEServerContent, plus a runnable sample. Tests: api serialization round-trips, client SSE decode against a real test-host server, server endpoint integration.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
[versions]
|
||||
kotlin = "2.2.0"
|
||||
kotlinx-coroutines = "1.10.2"
|
||||
kotlinx-serialization = "1.8.1"
|
||||
ktor = "3.1.3"
|
||||
|
||||
[libraries]
|
||||
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinx-coroutines" }
|
||||
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "kotlinx-coroutines" }
|
||||
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinx-serialization" }
|
||||
|
||||
ktor-server-core = { module = "io.ktor:ktor-server-core", version.ref = "ktor" }
|
||||
ktor-server-sse = { module = "io.ktor:ktor-server-sse", version.ref = "ktor" }
|
||||
ktor-server-netty = { module = "io.ktor:ktor-server-netty", version.ref = "ktor" }
|
||||
ktor-server-content-negotiation = { module = "io.ktor:ktor-server-content-negotiation", version.ref = "ktor" }
|
||||
ktor-server-test-host = { module = "io.ktor:ktor-server-test-host", version.ref = "ktor" }
|
||||
|
||||
ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
|
||||
ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" }
|
||||
ktor-client-content-negotiation = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktor" }
|
||||
ktor-serialization-kotlinx-json = { module = "io.ktor:ktor-serialization-kotlinx-json", version.ref = "ktor" }
|
||||
|
||||
[plugins]
|
||||
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
|
||||
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
|
||||
Vendored
BIN
Binary file not shown.
+7
@@ -0,0 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
Reference in New Issue
Block a user