Package-level declarations

Types

Link copied to clipboard

Default used on jvm/ios. ponytail: assumes online and lets the HTTP call fail-and-retry rather than probing reachability — upgrade to NWPathMonitor (ios) / a real jvm probe if false-positives ever cost a bad UX.

Link copied to clipboard

Real reachability via ConnectivityManager — validated internet capability, not just an up interface.

Link copied to clipboard
fun interface BaseUrlProvider

Resolves the server base URL at call time (backed by DataStore in core:data; defaults to localhost).

Link copied to clipboard

Cheap online check for the offline-first sync (gate a refresh() before hitting the network). An interface, not expect/actual, because only the Android/iOS/jvm impls need a platform dependency (ConnectivityManager / Konnection); wasmJs uses the naive default. Koin binds the right one.

Link copied to clipboard

Real reachability via Konnection (NWPathMonitor-backed on iOS 12+, SCNetworkReachability fallback below that). Replaces AlwaysOnlineConnectivityChecker for consumers that want an actual signal — Konnection self-initializes on first Konnection.instance access, no manual createInstance() call needed on this platform.

Real reachability via Konnection (periodic network-interface probe on jvm — no Context needed, unlike Android). Replaces AlwaysOnlineConnectivityChecker for consumers that want an actual signal instead of an always-true stub.

Link copied to clipboard
actual class LanAdvertiser(serviceType: String)

Advertises a service on the local network so nearby peers can discover it.

expect class LanAdvertiser(serviceType: String)

Advertises a service on the local network so nearby peers can discover it.

actual class LanAdvertiser(serviceType: String)

Advertises a service on the local network so nearby peers can discover it.

actual class LanAdvertiser(serviceType: String)

Advertises a service on the local network so nearby peers can discover it.

actual class LanAdvertiser(serviceType: String)

Advertises a service on the local network so nearby peers can discover it.

Link copied to clipboard
actual class LanDiscoverer(serviceType: String)

Discovers services of serviceType advertised on the local network.

expect class LanDiscoverer(serviceType: String)

Discovers services of serviceType advertised on the local network.

actual class LanDiscoverer(serviceType: String)

Discovers services of serviceType advertised on the local network.

actual class LanDiscoverer(serviceType: String)

Discovers services of serviceType advertised on the local network.

actual class LanDiscoverer(serviceType: String)

Discovers services of serviceType advertised on the local network.

Link copied to clipboard
data class LanHost(val host: String, val port: Int, val payload: String, val name: String)

A service advertised on the local network, as seen by a discovering peer.

Link copied to clipboard
fun interface TokenProvider

Optional bearer token for authenticated deployments — returns null when the server is open.

Link copied to clipboard
fun interface UnauthorizedHandler

Invoked when any authenticated call comes back 401 (token expired/revoked). The core:data SessionManager binds this to clear the stored token and flip the shell into re-login. Kept as a seam (like TokenProvider) so core:network needn't depend on core:data. Default = no-op.

Properties

Link copied to clipboard
const val LAN_UDP_PORT: Int

The UDP port the JVM/desktop broadcast beacon advertises and listens on.

Link copied to clipboard
val networkJson: Json

Lenient JSON matching the server: unknown keys ignored (forward-compat with a newer server), defaults encoded so partial DTOs round-trip.

Functions

Link copied to clipboard
fun createHttpClient(engine: HttpClientEngine = httpClientEngine(), onUnauthorized: suspend () -> Unit = {}, logger: Logger = Logger.DEFAULT, expectSuccess: Boolean = true, retry: Boolean = true, requestTimeoutMillis: Long?): HttpClient

The shared client: content negotiation, INFO logging, a bounded exponential-backoff retry on transient (5xx / IO) failures, and a request timeout. Base URL and auth are applied per-call by the consumer's typed API layer (they change at runtime, so they can't live in a static defaultRequest).

Link copied to clipboard
actual fun httpClientEngine(): HttpClientEngine

The platform HTTP engine: OkHttp (android), Darwin (ios), CIO (jvm/desktop), Js (wasmJs). Public so a consumer can build a bare HttpClient with its own config (e.g. a WebSocket client) instead of going through createHttpClient.

expect fun httpClientEngine(): HttpClientEngine

The platform HTTP engine: OkHttp (android), Darwin (ios), CIO (jvm/desktop), Js (wasmJs). Public so a consumer can build a bare HttpClient with its own config (e.g. a WebSocket client) instead of going through createHttpClient.

actual fun httpClientEngine(): HttpClientEngine

The platform HTTP engine: OkHttp (android), Darwin (ios), CIO (jvm/desktop), Js (wasmJs). Public so a consumer can build a bare HttpClient with its own config (e.g. a WebSocket client) instead of going through createHttpClient.

actual fun httpClientEngine(): HttpClientEngine

The platform HTTP engine: OkHttp (android), Darwin (ios), CIO (jvm/desktop), Js (wasmJs). Public so a consumer can build a bare HttpClient with its own config (e.g. a WebSocket client) instead of going through createHttpClient.

actual fun httpClientEngine(): HttpClientEngine

The platform HTTP engine: OkHttp (android), Darwin (ios), CIO (jvm/desktop), Js (wasmJs). Public so a consumer can build a bare HttpClient with its own config (e.g. a WebSocket client) instead of going through createHttpClient.

Link copied to clipboard

Install the application Context used by the Android NSD actuals. Call once from Application.onCreate() (or the compose entrypoint) BEFORE advertising/discovering.