Files
correx/build.gradle
T
kami b95135eb3b refactor(tui): event-loop foundation — actions, reducers, effects, Panel
Tasks 1.1–3.3 of docs/plans/2026-05-17-tui-refactor.md:

- Mosaic 0.13 → 0.18; Kotlin 2.0.21 → 2.2.10 (required by Mosaic).
  Fix MaxLineLength regressions in core/kernel orchestration logs.
- Input: drop raw System.in reader and ANSI escape parser. Wire
  Modifier.onKeyEvent at root; MosaicKeyMapper → KeyResolver → Action.
- State: split TuiState into Connection/Sessions/Input/Approval/Provider
  slices. Add InputMode.SteeringNote; delete handleSteer/System.console.
- Reducers: pure RootReducer composes slice reducers returning
  (state, List<Effect>). Effect is sealed (SendWs, Quit). Single
  dispatch(action) point in TuiApp; one coroutine drains effects.
- TuiWsClient now exposes messages/connection SharedFlows; suspend
  callbacks gone. ConnectionEvent sealed type added.
- Rendering: Panel(title){…} composable with LocalTerminalSize
  composition local; drop BOX_WIDTH and hand-padding from every
  component. Poll stty size every 500ms.
- Tests: KeyResolver (18) + 5 reducer suites (37). 55 total in :apps:tui.

Pending tasks 4.1–5.2 tracked in
docs/plans/2026-05-17-tui-refactor.progress.md.
2026-05-17 03:21:26 +04:00

130 lines
4.1 KiB
Groovy

import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id 'org.jetbrains.kotlin.jvm' version '2.2.10' apply false
id 'org.jetbrains.kotlin.plugin.serialization' version '2.2.10' apply false
id 'org.jetbrains.kotlin.plugin.compose' version '2.2.10' apply false
id "io.gitlab.arturbosch.detekt" version "1.23.7"
id "org.jetbrains.kotlinx.kover" version "0.8.3"
}
ext {
kotlin_version = '2.2.10'
kotlinx_coroutines_version = '1.9.0'
kotlinx_serialization_version = '1.7.3'
kotlinx_datetime_version = '0.6.2'
junit_version = '5.11.0'
sqlite_jdbc_version = '3.47.1.0'
exposed_version = '0.57.0'
ktor_version = '3.0.3'
hoplite_version = '2.8.2'
sqlite_jdbc_version = '3.47.1.0'
}
allprojects {
group = 'com.correx'
version = '0.1.0'
repositories {
mavenCentral()
google()
}
}
subprojects {
pluginManager.withPlugin("org.jetbrains.kotlin.jvm") {
apply plugin: "io.gitlab.arturbosch.detekt"
apply plugin: "org.jetbrains.kotlinx.kover"
detekt {
toolVersion = "1.23.7"
config.setFrom("$rootDir/detekt.yml")
buildUponDefaultConfig = true
ignoreFailures = false
}
kover {
reports {
// verify {
// rule {
// minBound(80)
// }
// }
filters {
excludes {
classes("*Generated*")
}
}
}
}
tasks.named("check") {
dependsOn("test")
dependsOn("detekt")
dependsOn("koverVerify")
}
}
plugins.withId('org.jetbrains.kotlin.jvm') {
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinx_coroutines_version"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinx_serialization_version"
implementation "org.xerial:sqlite-jdbc:$sqlite_jdbc_version"
implementation "org.jetbrains.kotlinx:kotlinx-datetime:$kotlinx_datetime_version"
testImplementation "org.junit.jupiter:junit-jupiter:$junit_version"
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
showStandardStreams = true
exceptionFormat = 'full'
}
afterSuite { desc, result ->
if (!desc.parent) { // Only log for the final root suite
def duration = (result.endTime - result.startTime) / 1000
println """
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
tests: ${result.testCount}
passed: ${result.successfulTestCount}
failed: ${result.failedTestCount}
skipped: ${result.skippedTestCount}
result: ${result.resultType}
time: ${duration}s
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
"""
}
}
}
tasks.withType(Detekt).configureEach {
reports {
html.required.set(true)
xml.required.set(true)
txt.required.set(false)
}
}
tasks.withType(KotlinCompile).configureEach {
compilerOptions {
jvmTarget = JvmTarget.JVM_21
freeCompilerArgs.add("-Xcontext-receivers")
}
}
}
}