clawdforge/clients/kotlin/build.gradle.kts
Kayos 8479725513 clients/kotlin: v0.2 multi-turn Session API
- Session : Closeable; AtomicBoolean idempotent close (rollback on transient)
- forge.session(opts) { s -> ... } block helper preferred
- ForgeClient.createSession / listSessions / getSession
- Per-call HTTP timeout on /sessions/{id}/turn (audit-fix 3c77ef5 pattern)
- Per-session Mutex serializes concurrent turns
- TurnResult.text() helper, Session.toString redacts client
- SessionTest.kt: ~14 tests covering block/idempotency/concurrent/timeout/list/state/404/redaction/regression
- README "Multi-turn / Sessions (v0.2)" section

v0.1 surface unchanged. Ktor 2.3.13 preserved.

Spec: memory/spec-clawdforge-v0.2.md
Server core: 940861f
2026-04-29 07:03:54 -07:00

81 lines
2 KiB
Kotlin

plugins {
kotlin("jvm") version "1.9.25"
kotlin("plugin.serialization") version "1.9.25"
`java-library`
`maven-publish`
}
group = "com.clawdforge"
version = "0.2.0"
repositories {
mavenCentral()
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
withSourcesJar()
}
kotlin {
jvmToolchain(17)
explicitApi()
}
val ktorVersion = "2.3.13"
dependencies {
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1")
api("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3")
api("io.ktor:ktor-client-core:$ktorVersion")
api("io.ktor:ktor-client-content-negotiation:$ktorVersion")
api("io.ktor:ktor-serialization-kotlinx-json:$ktorVersion")
implementation("io.ktor:ktor-client-cio:$ktorVersion")
testImplementation(kotlin("test"))
testImplementation("org.junit.jupiter:junit-jupiter:5.10.3")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.8.1")
testImplementation("io.ktor:ktor-client-mock:$ktorVersion")
}
tasks.test {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
compilerOptions {
freeCompilerArgs.addAll(
"-Xjsr305=strict",
"-opt-in=kotlin.RequiresOptIn",
)
}
}
publishing {
publications {
create<MavenPublication>("maven") {
from(components["java"])
artifactId = "clawdforge"
pom {
name.set("clawdforge-kotlin")
description.set(
"Async Kotlin client for the clawdforge HTTP service " +
"(a LAN bearer-token-gated wrapper around `claude -p`).",
)
licenses {
license {
name.set("MIT License")
url.set("https://opensource.org/licenses/MIT")
}
}
}
}
}
}