Skip to content

Function: buildRecoveryContext()

Makaio Framework


Makaio Framework / services-core / buildRecoveryContext

buildRecoveryContext(bus, session): Promise<{ extractedContext?: unknown; hasCompression?: boolean; hasConnectorSwap?: boolean; hasNewTransforms?: boolean; isFirstTurn?: boolean; messageHistory?: object[]; turnContext?: Record<string, JsonValue>; }>

Defined in: ../../../packages/services/core/src/session/utils/recovery-context.ts:16

Build sessionContext with messageHistory for a recovered agent. Uses getFullConversation() to assemble history from stored messages.

This function is framework-safe: it has no host-layer dependencies (no PersonaSubjects, ProfileSubjects, VirtualModelSubjects, etc.).

IMakaioBus

Bus instance

IMakaioSession

Session to build context for

Promise<{ extractedContext?: unknown; hasCompression?: boolean; hasConnectorSwap?: boolean; hasNewTransforms?: boolean; isFirstTurn?: boolean; messageHistory?: object[]; turnContext?: Record<string, JsonValue>; }>

SessionContext with messageHistory and isFirstTurn signal