Optional injected clock returning epoch-ms (for FloorHeldSince stamps). Defaults to
Date.now. Tests inject a controllable function for determinism.
The ids of all rooms the coordinator currently tracks (those with ≥1 agent member).
Asks whether an agent MAY take the floor (speak) now — the read-only arbitration check an agent
runs before generating speech. Returns true only when no OTHER agent holds the floor, with the
facilitator exception:
FloorFree).AlreadyHolder) — re-asserting is fine.FacilitatorOverride) even if another agent
holds it, so the facilitator can cut in to arbitrate / call on a specific agent.HeldByOtherAgent).NotInRoom).UnknownRoom).This is purely advisory until TakeFloor actually claims the floor — keeping the check (read) and the claim (write) separate lets a caller test-then-act atomically within its own turn.
The shared room id.
The agent asking to speak.
The floor decision (granted + reason).
Returns a snapshot of a room's floor state, or null when the room is unknown. Read-only — for
the realtime dashboard / observer console and tests.
The room to inspect.
The room's floor state snapshot, or null.
Whether a given agent currently holds the floor in a room. An agent that was bumped by a facilitator override checks this to learn it should yield.
The shared room id.
The agent to test.
true when the agent is the current floor holder.
Whether a room currently has more than one agent session — i.e. floor arbitration is meaningful. Single-agent rooms can skip the floor dance entirely.
The room to check.
true when 2+ agents share the room.
Registers an agent session as a participant in a shared room, creating the room on first member. Idempotent — re-registering the same agent updates its facilitator flag without disturbing the floor. Designating an agent as the facilitator records it as the room's arbiter; only one facilitator is tracked (the latest designation wins, mirroring "one chair").
The shared room id (external connection id / ConversationID) all agents key on.
The agent's MJ: AI Agent Sessions row id.
Whether this agent is the room's facilitator (may override the floor).
Releases the floor held by an agent (it finished speaking). A no-op when the agent is not the current holder, so a late/duplicate release can never steal the floor from another agent.
The shared room id.
The agent releasing the floor.
true when this call actually freed the floor (the agent was the holder).
Designates (or re-designates) a room's facilitator at runtime — e.g. when the agent running the Meeting Controls channel is determined after join. The agent must already be a room member.
The shared room id.
The agent to make facilitator (must be a member).
true when the facilitator was set; false when the room/agent is unknown.
Atomically attempts to claim the floor for an agent: runs CanTakeFloor and, when granted, records the agent as the floor holder (stamping the take time) and returns the decision. When a facilitator overrides a sitting holder, the holder is replaced — the facilitator now holds the floor (the prior holder should observe this via IsFloorHolder on its next check and yield).
The shared room id.
The agent claiming the floor.
The decision; on Granted the agent now holds the floor.
Unregisters an agent session from a room (the agent left / its bridge stopped). If the leaving agent held the floor, the floor is released. If it was the facilitator, the facilitator slot is cleared. When the last member leaves, the room record is discarded.
The room the agent is leaving.
The agent session leaving.
Coordinates speaking discipline for multiple agents sharing one room. Construct one per process (the engine holds a single instance) and key everything on the room id — the shared external connection id (or ConversationID) that all co-located agent sessions belong to.
The coordinator is additive: single-agent sessions never register here and are wholly unaffected. Only when 2+ agent sessions share a room does floor arbitration come into play.