Skip to content

bodhi-realtime-agent / InteractionModeManager

Class: InteractionModeManager

Defined in: core/interaction-mode.ts:30

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: core/interaction-mode.ts:90

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

Returns

number

Methods

activate()

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

Defined in: core/interaction-mode.ts:56

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: core/interaction-mode.ts:75

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: core/interaction-mode.ts:45

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

Returns

string | null


getMode()

getMode(): SessionInteractionMode

Defined in: core/interaction-mode.ts:35

Returns the current interaction mode.

Returns

SessionInteractionMode


isSubagentActive()

isSubagentActive(): boolean

Defined in: core/interaction-mode.ts:40

Shorthand: true when a subagent owns user transcript.

Returns

boolean

Built with VitePress