Skip to content

Interface: WireSessionConfig

Makaio Framework


Makaio Framework / ai-adapters-core / WireSessionConfig

Defined in: ../../../adapters/core/src/connector/procedural-agent-connector.ts:44

Configuration for ProceduralAgentConnector’s wireSessionEvents behavior.

The onTurnStarted and onTurnFinished hooks allow adapters to inject logic at turn boundaries. By default both are no-ops.

optional onTurnFinished?: (drainQueue) => Promise<void>

Defined in: ../../../adapters/core/src/connector/procedural-agent-connector.ts:65

Custom handler for turn_finished events.

When provided, replaces the default turn_finished behavior entirely. The handler receives a callback to process the queue, which it should call when the message is considered complete and the queue should drain.

() => Promise<void>

Callback that processes the queue or goes idle

Promise<void>


optional onTurnStarted?: () => void | Promise<void>

Defined in: ../../../adapters/core/src/connector/procedural-agent-connector.ts:56

Called when a new turn starts (turn_started bus event).

Executes before the default updateProcessingState('turn_started') so the connector state machine is always updated regardless of this hook.

Supports async so that turn-start operations with I/O — such as a pending MCP tool refresh via the bus — can complete before the API call is made. In-memory operations (recordInjection, consumeTurnNumber) are not affected by the async signature.

void | Promise<void>