Package-level declarations
Types
A chunk of bytes arrived on connectionId. Framing is above this layer.
The connection connectionId closed.
A locally-scoped identifier for one connection managed by NwApi — either an inbound connection accepted while listening, or an outbound connection dialled via NwApi.connect. Opaque and only meaningful to the NwApi instance that produced it.
A connection was established on connectionId.
The current lifecycle state of one NwApi connection, keyed by NwConnectionId in NwApi.connectionStates. A minimal, total sum type: every tracked connection is in exactly one of these three states, and a state map is the single drop-tolerant signal NwSeam reconciles for both the #1478 path-loss grace timer AND the #1522 terminal-teardown backstop (it unifies the former separate connectionViability boolean map and closedConnections reason map into one — #1539).
A remote endpoint discovered while browsing.
Stateful, incremental decoder for the 4-byte-big-endian-length-prefixed frame format produced by encodeFrame (wire-compatible with :kuilt-stream's framed()).
A physical interface type a path can traverse. Cellular/Wired/Loopback/Other mirror nw_interface_type_t directly; Wi-Fi is split into two so a consumer can tell the "same access point" case from a true peer-to-peer link:
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 overall reachability of a network path, mirroring nw_path_status_t.
Network.framework room host — the lobby surface for the peer-to-peer fabric.
Thrown by NwLoom.weave when no peer is reached within the weave timeout — the fabric never wove.
Why a path is NwPathStatus.Unsatisfied, mirroring nw_path_unsatisfied_reason_t. LocalNetworkDenied is the Local-Network-permission denial — the actionable signal a consumer turns into "grant Local Network access" guidance instead of a silent stall.
Functions
Encode payload as [len_be32][payload] — a 4-byte big-endian length prefix followed by the payload bytes. Byte-identical to what :kuilt-stream's framed() writes via sink.writeInt(frame.size), so the two framings are wire-compatible.