Function: mapToSession()
Makaio Framework / services-core / mapToSession
Function: mapToSession()
Section titled “Function: mapToSession()”mapToSession(
sessionRow,agentRows):IMakaioSession
Defined in: ../../../packages/services/core/src/session/storage/drizzle-utils.ts:91
Map a Drizzle session row to the IMakaioSession API type.
Scope fields (projectId, worktreeId, workstreamId) are intentionally
absent from the returned object. They are managed by the host-owned
junction table after the sealed-sessions refactor. Host handlers
composing a scoped query must augment the result with scope data read
from the junction table.
Parameters
Section titled “Parameters”sessionRow
Section titled “sessionRow”The session table row
adapterId
Section titled “adapterId”string | null
adapterName
Section titled “adapterName”string | null
adapterSessionId
Section titled “adapterSessionId”string | null
approvalPolicyOverride
Section titled “approvalPolicyOverride”"always-ask" | "reject" | "full-access" | null
branchKind
Section titled “branchKind”"fork" | "branch" | "aside" | "subagent" | "compress" | "rewrite" | "coordinator" | null
clientAccountId
Section titled “clientAccountId”string | null
clientId
Section titled “clientId”string | null
createdAt
Section titled “createdAt”number
executionTargetId
Section titled “executionTargetId”string | null
forkPointMessageId
Section titled “forkPointMessageId”string | null
forkTransforms
Section titled “forkTransforms”string | null
isImported
Section titled “isImported”boolean | null
isOrchestrated
Section titled “isOrchestrated”boolean | null
lastActivityAt
Section titled “lastActivityAt”number
lastClientIdentityObservation
Section titled “lastClientIdentityObservation”string | null
leadAgentId
Section titled “leadAgentId”string | null
parentSessionId
Section titled “parentSessionId”string | null
rootSessionId
Section titled “rootSessionId”string | null
sessionId
Section titled “sessionId”string
spawningToolCallId
Section titled “spawningToolCallId”string | null
status
Section titled “status”"active" | "closed" | "archived" | "discovered"
summary
Section titled “summary”string | null
summaryUpdatedAt
Section titled “summaryUpdatedAt”number | null
targetWorkingDirectory
Section titled “targetWorkingDirectory”string | null
string | null
agentRows
Section titled “agentRows”object[]
The associated agent rows
Returns
Section titled “Returns”The mapped session object