Field Notes
    Preparing search index...

    Class LocalAwareness

    Publishes this client's awareness state (identity, pointer in world space, selection, active tool) as full-snapshot frames through send. Sources are a passive primary-pointer listener on the viewport wrapper, the viewport's selection-change event, and the tool manager's change event. Any change marks the state dirty; a leading-edge frame goes out at once when idle, otherwise one trailing frame per intervalMs carries every change made in the window. A heartbeat re-sends the state while idle. dispose sends one cleared frame. Nothing here touches elements, history, or the camera.

    Frames are valid by construction: identity is truncated to the wire caps (name/color to 64 characters, role to 32) so a sender can never publish a frame the wire guard would reject outright; truncation is reported through onError (a RangeError) rather than silent. An invalid id (empty or over 128 characters) throws instead of truncating. tool is never truncated: a tool name over 64 characters is omitted from the frame rather than corrupted. An over-long or empty selection id fails the selection closed (like a non-string filter entry) rather than being sent. intervalMs and heartbeatMs are normalised so a non-finite or out-of-range value (e.g. Infinity) can never arm a near-zero busy-loop timer. The selection filter is re-applied before every frame that carries a selection, so a policy change takes effect on the next frame without a selection event.

    Index
    • Requests a full frame: immediate when idle, otherwise folded into the pending trailing frame (so N simultaneous requests cost one frame). Hosts call it when the connection becomes live or reconnects.

      Returns void