Goal
Introduce a shared :core Gradle module that holds the domain model and HTTP engine used by both :cli and the future TUI module. This is the architectural foundation for #4.
Scope
- New Gradle module
:core (Kotlin/JVM, JDK 21).
:cli depends on :core.
- Add Ktor client to
gradle/libs.versions.toml (engine TBD — likely ktor-client-cio or ktor-client-okhttp).
- Add
kotlinx.serialization for JSON.
- Domain model:
HttpMethod enum (GET/POST/PUT/PATCH/DELETE/HEAD/OPTIONS).
Request data class (method, url, query params, headers, body).
Body sealed class: Raw(text, contentType), Json(value), FormUrlEncoded(fields), Multipart(parts).
Response data class (status, headers, body bytes, elapsed time, content-type).
RequestExecutor interface + Ktor-backed implementation. Coroutine-based.
- Unit tests for body serialization variants.
- Integration test for executor against a small embedded mock server (Ktor server or MockEngine).
Out of scope
Acceptance criteria
:core module builds and tests pass in CI.
:cli can import and call RequestExecutor to send a real HTTP request.
- No CLI/TUI-specific code lives in
:core.
Goal
Introduce a shared
:coreGradle module that holds the domain model and HTTP engine used by both:cliand the future TUI module. This is the architectural foundation for #4.Scope
:core(Kotlin/JVM, JDK 21).:clidepends on:core.gradle/libs.versions.toml(engine TBD — likelyktor-client-cioorktor-client-okhttp).kotlinx.serializationfor JSON.HttpMethodenum (GET/POST/PUT/PATCH/DELETE/HEAD/OPTIONS).Requestdata class (method, url, query params, headers, body).Bodysealed class:Raw(text, contentType),Json(value),FormUrlEncoded(fields),Multipart(parts).Responsedata class (status, headers, body bytes, elapsed time, content-type).RequestExecutorinterface + Ktor-backed implementation. Coroutine-based.Out of scope
Acceptance criteria
:coremodule builds and tests pass in CI.:clican import and callRequestExecutorto send a real HTTP request.:core.