Interface: SessionEventTypeMap
Makaio Framework / contracts / 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
fork-summary.generated
Section titled “fork-summary.generated”fork-summary.generated:
object
Defined in: ../../../packages/services/core/src/session/session-events/__tests__/shared.ts:68
Fork summary generation event. Matches the UI chat view contract.
fromMessageId
Section titled “fromMessageId”fromMessageId:
string
personaName?
Section titled “personaName?”
optionalpersonaName?:string
summaryText
Section titled “summaryText”summaryText:
string
toMessageId
Section titled “toMessageId”toMessageId:
string
git.checkout
Section titled “git.checkout”git.checkout:
object
Defined in: ../../../packages/services/core/src/session/session-events/__tests__/shared.ts:25
currentBranch
Section titled “currentBranch”currentBranch:
string
previousBranch?
Section titled “previousBranch?”
optionalpreviousBranch?:string
repoPath
Section titled “repoPath”repoPath:
string
worktree?
Section titled “worktree?”
optionalworktree?:string
git.commit
Section titled “git.commit”git.commit:
object
Defined in: ../../../packages/services/core/src/session/session-events/__tests__/shared.ts:15
author
Section titled “author”author:
string
branch
Section titled “branch”branch:
string
commitTimestamp
Section titled “commitTimestamp”commitTimestamp:
string
email:
string
hash:
string
message
Section titled “message”message:
string
repoPath
Section titled “repoPath”repoPath:
string
worktree?
Section titled “worktree?”
optionalworktree?:string
git.merge
Section titled “git.merge”git.merge:
object
Defined in: ../../../packages/services/core/src/session/session-events/__tests__/shared.ts:31
mergeCommit
Section titled “mergeCommit”mergeCommit:
string
repoPath
Section titled “repoPath”repoPath:
string
sourceBranch
Section titled “sourceBranch”sourceBranch:
string
targetBranch
Section titled “targetBranch”targetBranch:
string
worktree?
Section titled “worktree?”
optionalworktree?:string
git.pr.context
Section titled “git.pr.context”git.pr.context:
object
Defined in: ../../../packages/services/core/src/session/session-events/__tests__/shared.ts:38
branch
Section titled “branch”branch:
string
prId:
string
prNumber
Section titled “prNumber”prNumber:
number
prTitle
Section titled “prTitle”prTitle:
string
prUrl:
string
repoPath
Section titled “repoPath”repoPath:
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
question-extractor.result
Section titled “question-extractor.result”question-extractor.result:
object
Defined in: ../../../packages/services/core/src/session/session-events/__tests__/shared.ts:46
questions
Section titled “questions”questions:
object[]
turnId
Section titled “turnId”turnId:
string
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.
skill.activated
Section titled “skill.activated”skill.activated:
object
Defined in: ../../../packages/contracts/src/skill/types.ts:38
Skill activated for a session agent.
agentId
Section titled “agentId”agentId:
string
skillName
Section titled “skillName”skillName:
string
trigger
Section titled “trigger”trigger:
"model"|"user"|"auto"|"reinjection"
turnNumber?
Section titled “turnNumber?”
optionalturnNumber?:number
skill.catalog.built
Section titled “skill.catalog.built”skill.catalog.built:
object
Defined in: ../../../packages/contracts/src/skill/types.ts:31
Skill catalog built for a session agent.
adapterId?
Section titled “adapterId?”
optionaladapterId?:string
agentId
Section titled “agentId”agentId:
string
cwd:
string
skillNames
Section titled “skillNames”skillNames:
string[]
skill.deactivated
Section titled “skill.deactivated”skill.deactivated:
object
Defined in: ../../../packages/contracts/src/skill/types.ts:45
Skill deactivated for a session agent.
agentId
Section titled “agentId”agentId:
string
reason
Section titled “reason”reason:
"user"|"cwd_changed"|"session_end"|"replaced"
skillName
Section titled “skillName”skillName:
string
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
timeline.summary
Section titled “timeline.summary”timeline.summary:
object
Defined in: ../../../packages/services/core/src/session/session-events/__tests__/shared.ts:53
messageId
Section titled “messageId”messageId:
string
role:
"user"|"assistant"
summary
Section titled “summary”summary:
string
tool.tracked
Section titled “tool.tracked”tool.tracked:
object
Defined in: ../../../packages/services/core/src/session/session-events/__tests__/shared.ts:58
operationCount
Section titled “operationCount”operationCount:
number
toolCallId
Section titled “toolCallId”toolCallId:
string
toolName
Section titled “toolName”toolName:
string
trackedCallId
Section titled “trackedCallId”trackedCallId:
string
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).