Skip to content

Interface: SessionEventTypeMap

Makaio Framework


Makaio Framework / contracts/session / 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:

// In plugin code
declare 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.

agent.added: object

Defined in: ../../../packages/contracts/src/session/schemas/event.ts:230

Agent added to session (correlation link).

adapterId: string

adapterName: string

adapterSessionId: string

agentId: string

optional cwd?: string

optional model?: string

optional role?: "lead" | "member"

sessionId: string


branch.created: object

Defined in: ../../../packages/contracts/src/session/schemas/event.ts:281

Branch created from parent session.

childSessionId: string

optional forkPointMessageId?: string

kind: "fork" | "branch" | "aside" | "subagent" | "compress" | "rewrite" | "coordinator"

parentSessionId: string


branch.merged: object

Defined in: ../../../packages/contracts/src/session/schemas/event.ts:291

Branch merged into parent session.

childSessionId: string

parentSessionId: string

optional resultJson?: string

optional resultMessageId?: string


message: object

Defined in: ../../../packages/contracts/src/session/schemas/event.ts:221

Message correlation event linking messages table to session events.

messageId: string

role: "user" | "assistant"

turnId: string | null


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: string

Makaio session ID of the compress child (post-compaction session).

preTokens: number | null

Approximate token count before compaction.

summary: string | null

Summary text from the isCompactSummary user message when available.

trigger: "manual" | "auto"

Whether compaction was triggered manually (/compact) or automatically.


squash: object

Defined in: ../../../packages/contracts/src/session/schemas/event.ts:301

Context compression event.

optional compressedMessageIds?: string[]

summaryJson: string

optional tokensAfter?: number

optional tokensBefore?: number


turn.completed: object

Defined in: ../../../packages/contracts/src/session/schemas/event.ts:255

Turn completed event.

optional error?: string

optional initiator?: object

source: "user" | "extension" | "system"

Origin category

optional sourceId?: string

Identifier for the specific origin.

Examples: 'routine:validation', 'loop', 'subagent:xyz'.

sessionId: string

success: boolean

turnId: string


turn.started: object

Defined in: ../../../packages/contracts/src/session/schemas/event.ts:244

Turn started event.

agentIds: string[]

optional initiator?: object

source: "user" | "extension" | "system"

Origin category

optional sourceId?: string

Identifier for the specific origin.

Examples: 'routine:validation', 'loop', 'subagent:xyz'.

messageId: string

sessionId: string

turnId: string


user_message.acknowledged: object

Defined in: ../../../packages/contracts/src/session/schemas/event.ts:271

User message acknowledged by agent.

agentId: string

Agent that acknowledged

messageId: string

User message identifier

sessionId: string

Makaio session ID

turnId: string

Turn identifier (UUID)

turnNumber: number

Monotonic per-session ordinal (1-based).


user_message.completed: object

Defined in: ../../../packages/contracts/src/session/schemas/event.ts:276

User message processing completed.

agentId: string

Agent that completed processing

optional error?: string

Error message when outcome=‘error’

optional mergedInto?: string

Present when outcome=‘merged’: the messageId this was folded into

messageId: string

User message identifier

outcome: "error" | "completed" | "superseded" | "merged" | "cancelled" | "rejected" = MessageOutcomeSchema

Processing outcome

sessionId: string

Makaio session ID

optional supersededBy?: string

Present when outcome=‘superseded’: the messageId that replaced this one

turnId: string

Turn identifier (UUID)

turnNumber: number

Monotonic per-session ordinal (1-based).


user_message.sent: object

Defined in: ../../../packages/contracts/src/session/schemas/event.ts:266

User message sent to session.

agentIds: string[]

Targeted agent IDs

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: string

User message identifier

optional origin?: "text" | "voice" | "compact"

Message origin (for example, voice input pipeline)

sessionId: string

Makaio session ID

optional source?: "user" | "extension" | "system"

Request source provenance from session.sendMessage payload

turnId: string

Turn identifier (UUID)

turnNumber: number

Monotonic per-session ordinal (1-based).