Skip to content

Function: registerAttachHandler()

Makaio Framework


Makaio Framework / services-core / 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.

IMakaioBus

Bus instance for communication

Map<string, Turn>

Shared turn state map

string

Optional machine ID for deterministic adapter resolution

Cleanup function to unsubscribe

() => void