Package-level declarations
Types
Reason a Seam is being closed. Designed as a forward-compatible sealed hierarchy — new variants can be added without breaking existing when exhaustiveness because the common cases are covered.
Whether a Loom's underlying transport fabric can be attempted on this runtime. A fabric scoped out by target (e.g. WebRTC only present on wasmJs) is simply absent — not Unavailable. Unavailable means present-but-not-usable-now.
What a flush found: whether a close from this end can still throw away the frames you already sent.
Thrown by a Overflow.FAIL delivery buffer when a frame arrives and the buffer is full.
A Tag implementation for the in-memory transport. Since the in-memory factory does not need network discovery, this carries only the session name. The factory itself provides the mesh context.
The default values a Loom factory hands to the knobs that every fabric shares.
A server-side Loom that provides structural per-room isolation over a shared ConnectionSource.
Thrown by an addressed send that is over its limit. A seam's limit is Seam.maxPayloadBytes. A room and its channel views measure the encoded frame instead, because Room.maxPayloadBytes is a promise that holds on every route rather than the refusal threshold, so a payload above that number can still be delivered.
The one place a fabric decides whether a peer-supplied identity may join its roster, and who is allowed to take it away again.
A fabric refused an identity a remote announced for itself.
Thrown by Seam.sendTo when the addressed peer is not in Seam.peers.
A seam or connection whose transport accept carries a host-verified Principal. A fabric that can authenticate a connection (e.g. a Ktor server reading call.principal()) attaches one via a withPrincipal wrapper; admission layers read it at admit time and carry it onto the admitted peer.
An observable PeerId → Principal roster: the landing spot for host-verified identities on paths that have no admit handshake or member objects (the hosted-hub topology).
Which half of a pumpIn pump failed — and, decisively, whether the pump is still running.
Describes the role a Loom peer takes when weaving a session.
Server-side authorization policy for room membership.
Server-side hub Seam for one named room — the structural per-room isolation primitive.
Base for coordinators that launch coroutines into an owned child scope and implement AutoCloseable.
Thrown by raceCollapse when the Seam collapses mid-operation — the work being raced can no longer complete because the peers it needs are gone. A collapse surfaces two distinct ways and this exception covers both:
Terminal-latching holder for a seam's SeamState — the primitive that makes the "lost terminal transition" bug class unrepresentable.
The one sanctioned per-receiver inbound buffer for in-process delivery.
A transport's self-report: the roles it plays and whether its fabric is usable now (availability). Produced pre-connect by Loom.capability and live per-session by Seam.capability.
What role a transport plays. A single fabric may hold several roles at once (Apple Multipeer is WifiDirect + Bluetooth; a Network.framework fabric is Discovery + Data). Sealed so a novel fabric can add a case without editing a closed enum.
A weft is the thread woven in fresh on every pass of the shuttle across a Loom — here, a per-dial value recomputed on every Loom.weave attempt, including every reconnect. Never cached by kuilt: a fabric Loom implementation that needs fresh per-dial data invokes this itself, inside its own weave(), so the caller's C is recomputed on the first dial and on every subsequent redial.
Functions
Mint a fresh, globally-unique PeerId for one peer.
Run body but abort it with a SeamCollapsedException the instant this Seam collapses mid-operation — either the fabric latches SeamState.Torn (transport tear) OR the live peer set satisfies abortWhen (membership drain). Whichever of body, the tear, or the drain resolves first wins; the losers are cancelled.
Like runCatching but never swallows coroutine cancellation: a CancellationException always propagates, so a cancelled coroutine fails fast instead of being reported as a captured failure. Every other Throwable becomes Result.failure.
Returns a Connection that reports principal via PrincipalAttested. When principal is null the receiver is returned unchanged — an unauthenticated connection carries no attestation and is never wrapped.