MultipeerPeerLinkFactory
Loom backed by Apple's MultipeerConnectivity framework.
Common API only — implementations live in the platform-specific source sets. appleMain provides the real implementation against platform.MultipeerConnectivity.*; jvmMain wraps a libkuilt.dylib over JNA so macOS desktop builds can talk to iPhones.
The factory is stateful — it owns the underlying MCPeerID/MCSession instances and the in-flight discovery map that gives MultipeerAdvertisement.handle its meaning. Construct one per device, share it via DI, and rely on Loom.open / Loom.join to spin up a session.
Parameters
Local display name surfaced to remote peers as the MCPeerID.displayName. Keep it short and recognisable (device name is the conventional choice).
MultipeerConnectivity service-type string. Must be 1–15 ASCII letters, digits, or hyphens (same rules as Bonjour _service._tcp. minus underscores). Callers supply their own value; kuilt does not provide a default.
Properties
Snapshot of advertisements visible to this factory's current browse session. Updated reactively by the browse delegate on both foundPeer and lostPeer events, so the lobby's peer list reflects current reality (a host that stops advertising drops out of the set, even on the same device). Emitted as a StateFlow so the UI can collectAsState.