NwPathState

data class NwPathState(val status: NwPathStatus, val interfaces: Set<NwInterfaceType>, val isExpensive: Boolean, val isConstrained: Boolean, val unsatisfiedReason: NwUnsatisfiedReason?)

A snapshot of the device's current network path, as reported by Apple's NWPathMonitor (nw_path_monitor_*). This is the live environmental signal that turns a seam's us.tractat.kuilt.core.Seam.capability from a once-at-connect seed into a reactive value: as Wi-Fi drops, cellular takes over, or the Local-Network permission is denied, a fresh NwPathState is published and the seam's availability follows.

The real monitor lives in RealNwApi (appleMain); tests drive a controllable MutableStateFlow<NwPathState?> through FakeNwApi, so no code under test touches the OS path monitor. A null path state (the default on a binding that has not wired a monitor — e.g. the JVM bridge) means "unknown": the seam reports FabricAvailability.Unknown rather than guessing, and the loom's static report supplies only the ROLES, never a path verdict (#1712).

Parameters

status

the overall reachability NwPathStatus.

interfaces

which physical interface types the path currently uses (Wi-Fi / cellular / wired…). Wi-Fi is disambiguated into infrastructure (NwInterfaceType.WifiLan) vs peer-to-peer (NwInterfaceType.WifiDirect, AWDL/low-latency Wi-Fi) by the BSD interface-name heuristic in classifyWifiInterface (#1554), so this now feeds the seam's live capability ROLES, not just telemetry.

isExpensive

the OS flags the path as expensive (e.g. cellular, personal hotspot).

isConstrained

the OS flags the path as constrained (Low Data Mode).

unsatisfiedReason

when status is NwPathStatus.Unsatisfied, why — including NwUnsatisfiedReason.LocalNetworkDenied, the Local-Network-permission signal. null otherwise.

Constructors

Link copied to clipboard
constructor(status: NwPathStatus, interfaces: Set<NwInterfaceType>, isExpensive: Boolean, isConstrained: Boolean, unsatisfiedReason: NwUnsatisfiedReason?)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard