Interface: WireSessionConfig
Makaio Framework / ai-adapters-core / WireSessionConfig
Interface: WireSessionConfig
Section titled “Interface: 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.
Properties
Section titled “Properties”onTurnFinished?
Section titled “onTurnFinished?”
optionalonTurnFinished?: (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.
Parameters
Section titled “Parameters”drainQueue
Section titled “drainQueue”() => Promise<void>
Callback that processes the queue or goes idle
Returns
Section titled “Returns”Promise<void>
onTurnStarted?
Section titled “onTurnStarted?”
optionalonTurnStarted?: () =>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.
Returns
Section titled “Returns”void | Promise<void>