connectedPeers

val connectedPeers: StateFlow<Set<PeerId>>

The set of remote PeerIds with a live connection to this server — every peer whose link has been accepted and handshaked and whose read pump has not yet torn down. A peer appears the moment its connection is admitted and disappears when its link tears (or on close).

Generic loom-level connection observability, independent of any room membership: a peer is in this set as soon as it connects, before it has announced itself into any room. Kept in step with connRecords under lock — a reconnect (same PeerId over a fresh transport) does not perturb the set, and a superseded record's later teardown does not spuriously remove a resumed peer (teardown removes only when the current record still matches).

A single MutableStateFlow read is safe to observe from any collector; per the single-emission contract a downstream that needs to react to appear/disappear collects it once. :kuilt-cluster consumes this via attachConnections to publish each connected player into the overlay's attachment directory — this loom itself depends on nothing in that layer.