Function: registerAttachHandler()
Makaio Framework / services-core / registerAttachHandler
Function: registerAttachHandler()
Section titled “Function: registerAttachHandler()”registerAttachHandler(
bus,activeTurns,machineId?): () =>void
Defined in: ../../../packages/services/core/src/session/handlers/attach-handler.ts:41
Registers the session.agent.attach RPC handler.
Explicitly attaches a fresh agent to a session with full control over:
- Role assignment (lead vs member)
- Optional initial message
For branching conversations (fork), use session.fork to create a new session with copied history, then attach agents to the new session.
Parameters
Section titled “Parameters”Bus instance for communication
activeTurns
Section titled “activeTurns”Map<string, Turn>
Shared turn state map
machineId?
Section titled “machineId?”string
Optional machine ID for deterministic adapter resolution
Returns
Section titled “Returns”Cleanup function to unsubscribe
() => void