Skip to content

bodhi-realtime-agent / InteractionModeManager

Class: InteractionModeManager ​

Defined in: src/core/interaction-mode.ts:28

Manages the FIFO queue for interactive subagent sessions.

  • activate() — makes this subagent the interaction target (or queues it).
  • deactivate() — clears the active interaction and promotes the next queued entry.
  • getMode() — returns the current SessionInteractionMode.

Constructors ​

Constructor ​

new InteractionModeManager(): InteractionModeManager

Returns ​

InteractionModeManager

Accessors ​

queueLength ​

Get Signature ​

get queueLength(): number

Defined in: src/core/interaction-mode.ts:88

Number of subagents waiting in the queue (excluding the active one).

Returns ​

number

Methods ​

activate() ​

activate(toolCallId, prompt?): Promise<void>

Defined in: src/core/interaction-mode.ts:54

Request interaction ownership for the given subagent.

  • If no subagent is currently active, activates immediately (returned Promise resolves).
  • If another subagent is active, enqueues this one (FIFO). The returned Promise resolves when this subagent is promoted to the active interaction target.

Parameters ​

toolCallId ​

string

prompt? ​

string

Returns ​

Promise<void>


deactivate() ​

deactivate(toolCallId): void

Defined in: src/core/interaction-mode.ts:73

Release interaction ownership for the given subagent.

If this subagent is the active one, promotes the next queued entry (if any) or reverts to main_agent mode. If the subagent is queued (not active), removes it from the queue.

Parameters ​

toolCallId ​

string

Returns ​

void


getActiveToolCallId() ​

getActiveToolCallId(): string | null

Defined in: src/core/interaction-mode.ts:43

Returns the active subagent's toolCallId, or null if in main_agent mode.

Returns ​

string | null


getMode() ​

getMode(): SessionInteractionMode

Defined in: src/core/interaction-mode.ts:33

Returns the current interaction mode.

Returns ​

SessionInteractionMode


isSubagentActive() ​

isSubagentActive(): boolean

Defined in: src/core/interaction-mode.ts:38

Shorthand: true when a subagent owns user transcript.

Returns ​

boolean

Built with VitePress