Very interesting. I maintain the
https://github.com/jillesvangurp/es-kotlin-client and I've actually been thinking of creating a multiplatform client as well lately. My current client piggybacks on the Java client. But with opensearch emerging as a standalone fork that isn't compatible with the ES Java client, it is tempting to invest in multiplatform. Especially now ktor native servers are also becoming a thing. Plus having a client ready to go for kotlin-js and wasm would be nice too.
Looks like we have similar ideas about providing nice DSLs but slightly different approaches. I try to stay close to the json DSL by essentially mirroring that with Kotlin type safe constructs. I rely a lot on interface delegation to Map objects for this.