Interface: SessionEventTypeMap
Makaio Framework / contracts/session / SessionEventTypeMap
Interface: SessionEventTypeMap
Section titled “Interface: SessionEventTypeMap”Defined in: ../../../packages/contracts/src/session/schemas/event.ts:217
Map of session event types to their payload schemas.
Plugin Extension Pattern: Plugins can extend this interface via TypeScript declaration merging to add custom event types:
Example
Section titled “Example”// In plugin codedeclare module '@makaio/contracts' { interface SessionEventTypeMap { 'timeline.summary': { messageId: string; role: 'user' | 'assistant'; summary: string; }; }}Core event types are defined here to maintain type safety for the base system. Plugins augment this map without modifying source code.
Properties
Section titled “Properties”agent.added
Section titled “agent.added”agent.added:
object
Defined in: ../../../packages/contracts/src/session/schemas/event.ts:230
Agent added to session (correlation link).
adapterId
Section titled “adapterId”adapterId:
string
adapterName
Section titled “adapterName”adapterName:
string
adapterSessionId
Section titled “adapterSessionId”adapterSessionId:
string
agentId
Section titled “agentId”agentId:
string
optionalcwd?:string
model?
Section titled “model?”
optionalmodel?:string
optionalrole?:"lead"|"member"
sessionId
Section titled “sessionId”sessionId:
string
branch.created
Section titled “branch.created”branch.created:
object
Defined in: ../../../packages/contracts/src/session/schemas/event.ts:281
Branch created from parent session.
childSessionId
Section titled “childSessionId”childSessionId:
string
forkPointMessageId?
Section titled “forkPointMessageId?”
optionalforkPointMessageId?:string
kind:
"fork"|"branch"|"aside"|"subagent"|"compress"|"rewrite"|"coordinator"
parentSessionId
Section titled “parentSessionId”parentSessionId:
string
branch.merged
Section titled “branch.merged”branch.merged:
object
Defined in: ../../../packages/contracts/src/session/schemas/event.ts:291
Branch merged into parent session.
childSessionId
Section titled “childSessionId”childSessionId:
string
parentSessionId
Section titled “parentSessionId”parentSessionId:
string
resultJson?
Section titled “resultJson?”
optionalresultJson?:string
resultMessageId?
Section titled “resultMessageId?”
optionalresultMessageId?:string
message
Section titled “message”message:
object
Defined in: ../../../packages/contracts/src/session/schemas/event.ts:221
Message correlation event linking messages table to session events.
messageId
Section titled “messageId”messageId:
string
role:
"user"|"assistant"
turnId
Section titled “turnId”turnId:
string|null
session.compacted
Section titled “session.compacted”session.compacted:
object
Defined in: ../../../packages/contracts/src/session/schemas/event.ts:312
Emitted on the parent session when a Claude Code compaction boundary is imported. Uses the plugin event path — not a core event type.
compressChildSessionId
Section titled “compressChildSessionId”compressChildSessionId:
string
Makaio session ID of the compress child (post-compaction session).
preTokens
Section titled “preTokens”preTokens:
number|null
Approximate token count before compaction.
summary
Section titled “summary”summary:
string|null
Summary text from the isCompactSummary user message when available.
trigger
Section titled “trigger”trigger:
"manual"|"auto"
Whether compaction was triggered manually (/compact) or automatically.
squash
Section titled “squash”squash:
object
Defined in: ../../../packages/contracts/src/session/schemas/event.ts:301
Context compression event.
compressedMessageIds?
Section titled “compressedMessageIds?”
optionalcompressedMessageIds?:string[]
summaryJson
Section titled “summaryJson”summaryJson:
string
tokensAfter?
Section titled “tokensAfter?”
optionaltokensAfter?:number
tokensBefore?
Section titled “tokensBefore?”
optionaltokensBefore?:number
turn.completed
Section titled “turn.completed”turn.completed:
object
Defined in: ../../../packages/contracts/src/session/schemas/event.ts:255
Turn completed event.
error?
Section titled “error?”
optionalerror?:string
initiator?
Section titled “initiator?”
optionalinitiator?:object
initiator.source
Section titled “initiator.source”source:
"user"|"extension"|"system"
Origin category
initiator.sourceId?
Section titled “initiator.sourceId?”
optionalsourceId?:string
Identifier for the specific origin.
Examples: 'routine:validation', 'loop', 'subagent:xyz'.
sessionId
Section titled “sessionId”sessionId:
string
success
Section titled “success”success:
boolean
turnId
Section titled “turnId”turnId:
string
turn.started
Section titled “turn.started”turn.started:
object
Defined in: ../../../packages/contracts/src/session/schemas/event.ts:244
Turn started event.
agentIds
Section titled “agentIds”agentIds:
string[]
initiator?
Section titled “initiator?”
optionalinitiator?:object
initiator.source
Section titled “initiator.source”source:
"user"|"extension"|"system"
Origin category
initiator.sourceId?
Section titled “initiator.sourceId?”
optionalsourceId?:string
Identifier for the specific origin.
Examples: 'routine:validation', 'loop', 'subagent:xyz'.
messageId
Section titled “messageId”messageId:
string
sessionId
Section titled “sessionId”sessionId:
string
turnId
Section titled “turnId”turnId:
string
user_message.acknowledged
Section titled “user_message.acknowledged”user_message.acknowledged:
object
Defined in: ../../../packages/contracts/src/session/schemas/event.ts:271
User message acknowledged by agent.
agentId
Section titled “agentId”agentId:
string
Agent that acknowledged
messageId
Section titled “messageId”messageId:
string
User message identifier
sessionId
Section titled “sessionId”sessionId:
string
Makaio session ID
turnId
Section titled “turnId”turnId:
string
Turn identifier (UUID)
turnNumber
Section titled “turnNumber”turnNumber:
number
Monotonic per-session ordinal (1-based).
user_message.completed
Section titled “user_message.completed”user_message.completed:
object
Defined in: ../../../packages/contracts/src/session/schemas/event.ts:276
User message processing completed.
agentId
Section titled “agentId”agentId:
string
Agent that completed processing
error?
Section titled “error?”
optionalerror?:string
Error message when outcome=‘error’
mergedInto?
Section titled “mergedInto?”
optionalmergedInto?:string
Present when outcome=‘merged’: the messageId this was folded into
messageId
Section titled “messageId”messageId:
string
User message identifier
outcome
Section titled “outcome”outcome:
"error"|"completed"|"superseded"|"merged"|"cancelled"|"rejected"=MessageOutcomeSchema
Processing outcome
sessionId
Section titled “sessionId”sessionId:
string
Makaio session ID
supersededBy?
Section titled “supersededBy?”
optionalsupersededBy?:string
Present when outcome=‘superseded’: the messageId that replaced this one
turnId
Section titled “turnId”turnId:
string
Turn identifier (UUID)
turnNumber
Section titled “turnNumber”turnNumber:
number
Monotonic per-session ordinal (1-based).
user_message.sent
Section titled “user_message.sent”user_message.sent:
object
Defined in: ../../../packages/contracts/src/session/schemas/event.ts:266
User message sent to session.
agentIds
Section titled “agentIds”agentIds:
string[]
Targeted agent IDs
content
Section titled “content”content:
string| {blocks: {content:string;type:"text"; } | {source: {data:string;mimeType:string;type:"base64"; } | {mimeType?:string;type:"url";url:string; };type:"image"; } | {source: {data:string;mimeType:string;type:"base64"; } | {mimeType?:string;type:"url";url:string; };type:"document"; } | {attachmentType:"file"|"directory";displayName?:string;fileName:string;filePath:string;source: {data:string;mimeType:string;type:"base64"; } | {mimeType?:string;type:"url";url:string; };type:"attachment"; } | {content:string;metadata?:Record<string,unknown>;type:"reasoning"; } | {args:Record<string,unknown>;name:string;toolCallId:string;type:"tool_call"; } | {isError?:boolean;output:string;toolCallId:string;type:"tool_output"; } | ({content:string;type:"text"; } | {source: {data:string;mimeType:string;type:"base64"; } | {mimeType?:string;type:"url";url:string; };type:"image"; } | {source: {data:string;mimeType:string;type:"base64"; } | {mimeType?:string;type:"url";url:string; };type:"document"; } | {attachmentType:"file"|"directory";displayName?:string;fileName:string;filePath:string;source: {data:string;mimeType:string;type:"base64"; } | {mimeType?:string;type:"url";url:string; };type:"attachment"; } | {content:string;metadata?:Record<string,unknown>;type:"reasoning"; } | {args:Record<string,unknown>;name:string;toolCallId:string;type:"tool_call"; } | {isError?:boolean;output:string;toolCallId:string;type:"tool_output"; })[];role?:"user"|"assistant"|"system"; } =MessageInputSchema
Message content
messageId
Section titled “messageId”messageId:
string
User message identifier
origin?
Section titled “origin?”
optionalorigin?:"text"|"voice"|"compact"
Message origin (for example, voice input pipeline)
sessionId
Section titled “sessionId”sessionId:
string
Makaio session ID
source?
Section titled “source?”
optionalsource?:"user"|"extension"|"system"
Request source provenance from session.sendMessage payload
turnId
Section titled “turnId”turnId:
string
Turn identifier (UUID)
turnNumber
Section titled “turnNumber”turnNumber:
number
Monotonic per-session ordinal (1-based).