Interface: SessionExtensionContext
Makaio Framework / contracts / SessionExtensionContext
Interface: SessionExtensionContext
Section titled “Interface: SessionExtensionContext”Defined in: ../../../packages/contracts/src/session/schemas/extension-context.ts:33
Session-specific context provided to extensions during lifecycle events. All actions route through SessionOrchestrator.
Note: This is separate from PluginContext (extensions/core) which is for initialize().
Properties
Section titled “Properties”extensionId
Section titled “extensionId”
readonlyextensionId:string
Defined in: ../../../packages/contracts/src/session/schemas/extension-context.ts:46
Extension’s own ID (for audit trail)
parentSessionId?
Section titled “parentSessionId?”
readonlyoptionalparentSessionId?:string
Defined in: ../../../packages/contracts/src/session/schemas/extension-context.ts:43
Parent session ID (if this is a forked session)
sessionId
Section titled “sessionId”
readonlysessionId:string
Defined in: ../../../packages/contracts/src/session/schemas/extension-context.ts:37
Current session ID
turnId?
Section titled “turnId?”
readonlyoptionalturnId?:string
Defined in: ../../../packages/contracts/src/session/schemas/extension-context.ts:40
Current turn ID (if in a turn)
Methods
Section titled “Methods”abandon()
Section titled “abandon()”abandon(
childSessionId):Promise<void>
Defined in: ../../../packages/contracts/src/session/schemas/extension-context.ts:80
Abandon a child session without merging.
Parameters
Section titled “Parameters”childSessionId
Section titled “childSessionId”string
Returns
Section titled “Returns”Promise<void>
contributeContext()
Section titled “contributeContext()”contributeContext(
key,value):void
Defined in: ../../../packages/contracts/src/session/schemas/extension-context.ts:62
Contribute context for the next turn. Added to SessionContext.context via declaration-merge pattern.
Parameters
Section titled “Parameters”string
unknown
Returns
Section titled “Returns”void
fork()
Section titled “fork()”fork(
options):Promise<string>
Defined in: ../../../packages/contracts/src/session/schemas/extension-context.ts:70
Fork the current session into a child session.
Parameters
Section titled “Parameters”options
Section titled “options”Returns
Section titled “Returns”Promise<string>
Child session ID
getChildSessions()
Section titled “getChildSessions()”getChildSessions():
Promise<string[]>
Defined in: ../../../packages/contracts/src/session/schemas/extension-context.ts:99
Get child sessions of current session.
Returns
Section titled “Returns”Promise<string[]>
getContextWindowState()
Section titled “getContextWindowState()”getContextWindowState():
Promise<ContextWindowState>
Defined in: ../../../packages/contracts/src/session/schemas/extension-context.ts:94
Get current context window state.
Returns
Section titled “Returns”Promise<ContextWindowState>
merge()
Section titled “merge()”merge(
childSessionId,summary?):Promise<void>
Defined in: ../../../packages/contracts/src/session/schemas/extension-context.ts:75
Merge a child session back into this session.
Parameters
Section titled “Parameters”childSessionId
Section titled “childSessionId”string
summary?
Section titled “summary?”string
Returns
Section titled “Returns”Promise<void>
requestCompression()
Section titled “requestCompression()”requestCompression(
reason):Promise<void>
Defined in: ../../../packages/contracts/src/session/schemas/extension-context.ts:87
Request compression of the current session.
Parameters
Section titled “Parameters”reason
Section titled “reason”string
Returns
Section titled “Returns”Promise<void>
sendToAgent()
Section titled “sendToAgent()”sendToAgent(
agentId,message):Promise<void>
Defined in: ../../../packages/contracts/src/session/schemas/extension-context.ts:54
Send a message to an agent. Routes through SessionOrchestrator, not directly to agent.
Parameters
Section titled “Parameters”agentId
Section titled “agentId”string
message
Section titled “message”blocks
Section titled “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"; })[] = ...
"user" | "assistant" | "system" = ...
Returns
Section titled “Returns”Promise<void>