Gateway plugin: - media.upload (chunked binary) -> size/sha256 verify + MIME re-sniff -> cache_*_from_bytes -> media.upload.ack - media.offer / media.pull (chunked) for agent-sent media, delivery-path security re-checked at pull time - send_* overrides mint media_id and emit media.offer - message.send media_refs resolve to cached inbound media - per-send + per-chunk timeouts so a stalled peer can't starve the rest App (Kotlin CMP): - Protocol: media frame types/payloads/builders - GatewayClient: binary session, uploadMedia (chunked + streaming sha256), pullMedia serialized via Mutex so concurrent offers don't interleave - ChatStore/IrisController: MediaItem, attachments, auto-pull on offer - Platform media: SAF picker, ExoPlayer (audio mini-player + video), image loader, FileProvider document open (Android); AWT-free desktop actuals - ChatScreen: attach button + chips, media rendering, keyboard dismiss on send UI polish: - preserve image aspect ratio (no stretching), cap dominant dimension - adjustResize so only chat content squeezes for the keyboard - clear focus (hide keyboard) on send Docs: media.upload.ack in 04-wire-protocol.md + frames.schema.json + 07-media.md; M4 marked complete in 14-milestones.md. Tests: 17-test tests/gateway/test_android.py suite passes.
56 lines
2.1 KiB
Kotlin
56 lines
2.1 KiB
Kotlin
plugins {
|
|
kotlin("multiplatform")
|
|
kotlin("plugin.serialization")
|
|
id("com.android.library")
|
|
id("org.jetbrains.compose")
|
|
id("org.jetbrains.kotlin.plugin.compose")
|
|
}
|
|
|
|
val composeVersion = "1.7.3"
|
|
val coroutinesVersion = "1.9.0"
|
|
val serializationVersion = "1.7.3"
|
|
val okhttpVersion = "4.12.0"
|
|
|
|
kotlin {
|
|
androidTarget()
|
|
jvm("desktop")
|
|
|
|
sourceSets {
|
|
// Both targets are JVM-based (androidTarget + jvm("desktop")), so
|
|
// shared JVM code (File I/O, SHA-256, media cache) lives in jvmMain.
|
|
val jvmMain by creating { dependsOn(commonMain.get()) }
|
|
val androidMain by getting { dependsOn(jvmMain) }
|
|
val desktopMain by getting { dependsOn(jvmMain) }
|
|
|
|
commonMain.dependencies {
|
|
implementation("org.jetbrains.compose.runtime:runtime:$composeVersion")
|
|
implementation("org.jetbrains.compose.foundation:foundation:$composeVersion")
|
|
implementation("org.jetbrains.compose.material3:material3:$composeVersion")
|
|
implementation("org.jetbrains.compose.ui:ui:$composeVersion")
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
|
|
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$serializationVersion")
|
|
// OkHttp is a JVM library; both targets here are JVM-based
|
|
// (androidTarget + jvm("desktop")), so it resolves on both.
|
|
implementation("com.squareup.okhttp3:okhttp:$okhttpVersion")
|
|
}
|
|
// M4: ExoPlayer (Media3) for inline audio/video playback (Android only).
|
|
androidMain.dependencies {
|
|
implementation("androidx.media3:media3-exoplayer:1.3.1")
|
|
implementation("androidx.media3:media3-ui:1.3.1")
|
|
// SAF picker (rememberLauncherForActivityResult).
|
|
implementation("androidx.activity:activity-compose:1.9.2")
|
|
}
|
|
}
|
|
}
|
|
|
|
android {
|
|
namespace = "iris.shared"
|
|
compileSdk = 34
|
|
defaultConfig {
|
|
minSdk = 29
|
|
}
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
} |