Skip to content

bodhi-realtime-agent / DirectiveManager

Class: DirectiveManager ​

Defined in: src/core/directive-manager.ts:8

Manages session-scoped and agent-scoped directives.

Extracted from VoiceSession to isolate the directive management concern. Session directives persist across agent transfers; agent directives are cleared on each transfer.

Constructors ​

Constructor ​

new DirectiveManager(): DirectiveManager

Returns ​

DirectiveManager

Methods ​

clearAgent() ​

clearAgent(): void

Defined in: src/core/directive-manager.ts:20

Clear agent-scoped directives (called on agent transfer).

Returns ​

void


getReinforcementText() ​

getReinforcementText(): string

Defined in: src/core/directive-manager.ts:36

Merge both directive maps and return formatted reinforcement text. Agent directives override session directives with the same key. Returns empty string if no directives are set.

Returns ​

string


getSessionSuffix() ​

getSessionSuffix(): string

Defined in: src/core/directive-manager.ts:25

Returns session-scoped directives formatted as a system instruction suffix.

Returns ​

string


set() ​

set(key, value, scope?): void

Defined in: src/core/directive-manager.ts:13

Set or delete a directive. Defaults to agent scope if not specified.

Parameters ​

key ​

string

value ​

string | null

scope? ​

"session" | "agent"

Returns ​

void

Built with VitePress