mirror of
https://github.com/hanzo-kotlin/sdk.git
synced 2026-10-30 20:02:19 +00:00
This repo carried two clients for the same API: hanzo-kotlin-cloud, generated from the openapi.yaml hanzoai/cloud emits from its own routers, and hanzo-kotlin-core, a second hand-shaped client with its own okhttp transport, umbrella, example and proguard modules. Two clients for one API is two answers to one question, and a caller has no way to tell which answer is current. Only one of them can be. The generated client is a projection of the document at a named ref and digest, so it tracks the API by construction; the other tracked whatever was last typed into it, which is why it no longer compiled. Delete the hand-shaped one. Nothing is published to Maven Central under either name, so no consumer breaks, and java-sdk already ships exactly one client. Removed with it: hanzo-kotlin-client-okhttp (core's transport, and meaningful only as that), hanzo-kotlin (an umbrella that re-exported the transport), hanzo-kotlin-example (a build file with no sources), hanzo-kotlin-proguard-test (it tested core's keep rules), hanzo-kotlin-lib (a .keep), .stats.yml (it recorded the spec the deleted client was cut from), and bin/check-release- environment (it asserted secret names the release lane no longer uses). The build gate had been narrowed to a hand-listed subset of modules, with a comment to widen it back to ./scripts/build the day hanzo-kotlin-core compiles. Every module is now part of the one client, so the gate is the whole build again. The rest is the same principle applied to what described the two: settings.gradle names the one module rather than scanning the root for directories, the group is ai.hanzo everywhere instead of one group per client line, and README, CLAUDE.md and SECURITY.md describe the client that exists. hanzo-kotlin-cloud/README.md goes too -- a second README for one module, already drifted, claiming 263 API classes where the tree has 192. Verified from clean with the build cache off: :hanzo-kotlin-cloud:assemble compiles all 2666 generated sources in 4m 5s, all six examples assemble, and the flow tests pass.
32 lines
1.4 KiB
Kotlin
32 lines
1.4 KiB
Kotlin
// The Hanzo Cloud client: the whole `/v1` surface of the `openapi.yaml`
|
|
// hanzoai/cloud emits, as one API class per tag over okhttp.
|
|
//
|
|
// `src/main/kotlin/ai/hanzo/cloud` belongs to the generator — sdks.yaml maps it
|
|
// there, `scripts/generate.sh` replaces it wholesale, and `--check` fails if it
|
|
// drifted. Everything else in this module, this file included, is the repo's.
|
|
plugins {
|
|
id("hanzo.kotlin")
|
|
id("hanzo.publish")
|
|
}
|
|
|
|
dependencies {
|
|
// `api`, not `implementation`: okhttp and gson are in the generated client's
|
|
// public signatures — every generated class takes a `Call.Factory` and
|
|
// `Serializer` hands back a `Gson` — so a consumer cannot call this without
|
|
// them on the compile classpath.
|
|
api("com.squareup.okhttp3:okhttp:4.12.0")
|
|
api("com.google.code.gson:gson:2.10.1")
|
|
|
|
testImplementation("com.squareup.okhttp3:mockwebserver:4.12.0")
|
|
testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3")
|
|
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.9.3")
|
|
}
|
|
|
|
// ktfmt does not run here. The generated sources have to stay byte-identical to
|
|
// the generator's output — that identity is exactly what `--check` diffs — so
|
|
// formatting them would rewrite all 2666 files and make the drift gate fail on
|
|
// every run.
|
|
tasks.named("formatKotlin") { enabled = false }
|
|
|
|
tasks.named("lintKotlin") { enabled = false }
|