Interface: WhenContext<TRoles>
Makaio Framework / contracts / WhenContext
Interface: WhenContext<TRoles>
Section titled “Interface: WhenContext<TRoles>”Defined in: ../../../packages/contracts/src/extension/contributions/session-event-action-types.ts:101
Context passed to a session event action’s when predicate.
Type Parameters
Section titled “Type Parameters”TRoles
Section titled “TRoles”TRoles extends MessageRole[] = MessageRole[]
Properties
Section titled “Properties”bus:
IMakaioBus
Defined in: ../../../packages/contracts/src/extension/contributions/session-event-action-types.ts:107
Bus instance for runtime queries.
message
Section titled “message”message:
object&object
Defined in: ../../../packages/contracts/src/extension/contributions/session-event-action-types.ts:103
The message event that triggered the predicate check.
Type Declaration
Section titled “Type Declaration”adapterMessageId?
Section titled “adapterMessageId?”
optionaladapterMessageId?:string
Adapter’s stable message identifier for fork detection
adapterSessionId?
Section titled “adapterSessionId?”
optionaladapterSessionId?:string
Provider’s session ID for context continuity
agentId?
Section titled “agentId?”
optionalagentId?:string
Agent ID (required for assistant, null for user)
blocks
Section titled “blocks”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"; })[]
Structured blocks (text, reasoning, tool_call, tool_output)
contentText
Section titled “contentText”contentText:
string
Plain text content for FTS5 search
editOf?
Section titled “editOf?”
optionaleditOf?:string
If this is an edit, references the original message
messageId
Section titled “messageId”messageId:
string
Unique message identifier
origin?
Section titled “origin?”
optionalorigin?:"text"|"voice"|"compact"
Origin of the message (e.g. ‘voice’, ‘text’). NULL for messages predating this field.
role:
"user"|"assistant"=SessionMessageRoleSchema
Message role: ‘user’ or ‘assistant’
sessionId
Section titled “sessionId”sessionId:
string
Session this message belongs to
timestamp
Section titled “timestamp”timestamp:
number
Message timestamp (Unix ms)
turnId
Section titled “turnId”turnId:
string|null
Turn this message belongs to. NULL for native imports (no turn tracking).
Type Declaration
Section titled “Type Declaration”role:
TRoles[number]
sessionId
Section titled “sessionId”sessionId:
string
Defined in: ../../../packages/contracts/src/extension/contributions/session-event-action-types.ts:105
Active session identifier.