Class: SessionExtensionContextImpl
Makaio Framework / services-core / SessionExtensionContextImpl
Class: SessionExtensionContextImpl
Section titled “Class: SessionExtensionContextImpl”Defined in: ../../../packages/services/core/src/session/extension-context.ts:15
Implementation of SessionExtensionContext. Routes all actions through bus subjects.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new SessionExtensionContextImpl(
bus,_sessionId,_extensionId,_turnId?,_parentSessionId?,contextTracker?):SessionExtensionContextImpl
Defined in: ../../../packages/services/core/src/session/extension-context.ts:18
Parameters
Section titled “Parameters”_sessionId
Section titled “_sessionId”string
_extensionId
Section titled “_extensionId”string
_turnId?
Section titled “_turnId?”string
_parentSessionId?
Section titled “_parentSessionId?”string
contextTracker?
Section titled “contextTracker?”Returns
Section titled “Returns”SessionExtensionContextImpl
Accessors
Section titled “Accessors”extensionId
Section titled “extensionId”Get Signature
Section titled “Get Signature”get extensionId():
string
Defined in: ../../../packages/services/core/src/session/extension-context.ts:41
Extension’s own ID (for audit trail)
Returns
Section titled “Returns”string
Extension’s own ID (for audit trail)
Implementation of
Section titled “Implementation of”SessionExtensionContext.extensionId
parentSessionId
Section titled “parentSessionId”Get Signature
Section titled “Get Signature”get parentSessionId():
string|undefined
Defined in: ../../../packages/services/core/src/session/extension-context.ts:37
Parent session ID (if this is a forked session)
Returns
Section titled “Returns”string | undefined
Parent session ID (if this is a forked session)
Implementation of
Section titled “Implementation of”SessionExtensionContext.parentSessionId
sessionId
Section titled “sessionId”Get Signature
Section titled “Get Signature”get sessionId():
string
Defined in: ../../../packages/services/core/src/session/extension-context.ts:29
Current session ID
Returns
Section titled “Returns”string
Current session ID
Implementation of
Section titled “Implementation of”SessionExtensionContext.sessionId
turnId
Section titled “turnId”Get Signature
Section titled “Get Signature”get turnId():
string|undefined
Defined in: ../../../packages/services/core/src/session/extension-context.ts:33
Current turn ID (if in a turn)
Returns
Section titled “Returns”string | undefined
Current turn ID (if in a turn)
Implementation of
Section titled “Implementation of”SessionExtensionContext.turnId
Methods
Section titled “Methods”abandon()
Section titled “abandon()”abandon(
childSessionId):Promise<void>
Defined in: ../../../packages/services/core/src/session/extension-context.ts:93
Abandon a child session without merging.
Parameters
Section titled “Parameters”childSessionId
Section titled “childSessionId”string
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”SessionExtensionContext.abandon
contributeContext()
Section titled “contributeContext()”contributeContext(
key,value):void
Defined in: ../../../packages/services/core/src/session/extension-context.ts:60
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
Implementation of
Section titled “Implementation of”SessionExtensionContext.contributeContext
fork()
Section titled “fork()”fork(
options):Promise<string>
Defined in: ../../../packages/services/core/src/session/extension-context.ts:74
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
Implementation of
Section titled “Implementation of”getChildSessions()
Section titled “getChildSessions()”getChildSessions():
Promise<string[]>
Defined in: ../../../packages/services/core/src/session/extension-context.ts:142
Get child sessions of current session.
Returns
Section titled “Returns”Promise<string[]>
Implementation of
Section titled “Implementation of”SessionExtensionContext.getChildSessions
getContextWindowState()
Section titled “getContextWindowState()”getContextWindowState():
Promise<ContextWindowState>
Defined in: ../../../packages/services/core/src/session/extension-context.ts:115
Get current context window state.
Returns
Section titled “Returns”Promise<ContextWindowState>
Implementation of
Section titled “Implementation of”SessionExtensionContext.getContextWindowState
getContributions()
Section titled “getContributions()”getContributions():
Record<string,unknown>
Defined in: ../../../packages/services/core/src/session/extension-context.ts:68
Get all contributions (called by orchestrator at turn boundary).
Returns
Section titled “Returns”Record<string, unknown>
Record of all context contributions
merge()
Section titled “merge()”merge(
childSessionId,summary?):Promise<void>
Defined in: ../../../packages/services/core/src/session/extension-context.ts:83
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>
Implementation of
Section titled “Implementation of”requestCompression()
Section titled “requestCompression()”requestCompression(
reason):Promise<void>
Defined in: ../../../packages/services/core/src/session/extension-context.ts:104
Request compression of the current session.
Parameters
Section titled “Parameters”reason
Section titled “reason”string
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”SessionExtensionContext.requestCompression
sendToAgent()
Section titled “sendToAgent()”sendToAgent(
agentId,message):Promise<void>
Defined in: ../../../packages/services/core/src/session/extension-context.ts:47
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>