Interface: ToolExecutionContext
Makaio Framework / tools-core / ToolExecutionContext
Interface: ToolExecutionContext
Section titled “Interface: ToolExecutionContext”Defined in: ../../../tools/core/src/types.ts:32
Extended execution context for tools that need session and bus access.
Extends MakaioContext with optional sessionId and bus properties for tools that need to:
- Correlate operations with a specific session (sessionId)
- Emit events or make requests during execution (bus)
Example
Section titled “Example”const result = await tool.execute(input, { cwd: '/workspace', env: { NODE_ENV: 'development' }, platform: 'posix', sessionId: 'session-123', bus: makaioBus,});Extends
Section titled “Extends”MakaioContext
Properties
Section titled “Properties”adapterId?
Section titled “adapterId?”
optionaladapterId?:string
Defined in: ../../../tools/core/src/types.ts:49
Adapter identifier for adapter-scoped runtime behavior. Provided when the caller knows the concrete runtime adapter instance.
adapterName?
Section titled “adapterName?”
optionaladapterName?:string
Defined in: ../../../tools/core/src/types.ts:55
Adapter name for adapter-scoped runtime behavior. Preferred when the caller wants stable logical adapter identity.
agentId?
Section titled “agentId?”
optionalagentId?:string
Defined in: ../../../tools/core/src/types.ts:43
Agent identifier for attribution (optional). Provided when tool execution is tied to a specific agent.
optionalbus?:BusLike
Defined in: ../../../tools/core/src/types.ts:81
Bus instance for event communication. Tools can use this to emit events (e.g., task.created, task.updated).
constraints?
Section titled “constraints?”
optionalconstraints?:Record<string,unknown>
Defined in: ../../../packages/makaio-core/src/context/index.ts:38
Optional constraints that tools can check for specific behaviors
Inherited from
Section titled “Inherited from”MakaioContext.constraints
cwd:
string
Defined in: ../../../packages/makaio-core/src/context/index.ts:26
Working directory for tool execution
Inherited from
Section titled “Inherited from”MakaioContext.cwd
env:
Readonly<Record<string,string>>
Defined in: ../../../packages/makaio-core/src/context/index.ts:29
Read-only environment variables available to the tool
Inherited from
Section titled “Inherited from”MakaioContext.env
platform
Section titled “platform”platform:
Platform
Defined in: ../../../packages/makaio-core/src/context/index.ts:32
Platform identifier for cross-platform compatibility
Inherited from
Section titled “Inherited from”MakaioContext.platform
sessionId?
Section titled “sessionId?”
optionalsessionId?:string
Defined in: ../../../tools/core/src/types.ts:37
Session identifier for multi-session task correlation. Tools can use this to associate work with a specific session.
Overrides
Section titled “Overrides”MakaioContext.sessionId
signal?
Section titled “signal?”
optionalsignal?:AbortSignal
Defined in: ../../../packages/makaio-core/src/context/index.ts:35
Optional abort signal for cancellation support
Inherited from
Section titled “Inherited from”MakaioContext.signal
subagentDepth?
Section titled “subagentDepth?”
optionalsubagentDepth?:number
Defined in: ../../../packages/makaio-core/src/context/index.ts:47
Current nesting depth in subagent hierarchy (0 = root)
Inherited from
Section titled “Inherited from”MakaioContext.subagentDepth
subagentId?
Section titled “subagentId?”
optionalsubagentId?:string
Defined in: ../../../packages/makaio-core/src/context/index.ts:44
Subagent ID if running as a subagent
Inherited from
Section titled “Inherited from”MakaioContext.subagentId
toolCallId?
Section titled “toolCallId?”
optionaltoolCallId?:string
Defined in: ../../../tools/core/src/types.ts:75
Tool call ID for the current invocation. Provided when the tool is executed as part of a structured tool call (e.g., from an LLM response). Allows tools to correlate their execution with the originating tool call in the adapter.
turnContext?
Section titled “turnContext?”
optionalturnContext?:Record<string,unknown>
Defined in: ../../../tools/core/src/types.ts:67
Turn-scoped context contributed by PreUserMessage hooks. Toolsets can use this for session-bound execution metadata.
turnId?
Section titled “turnId?”
optionalturnId?:string
Defined in: ../../../tools/core/src/types.ts:61
Turn identifier for attribution (optional). Provided when tool execution occurs within a specific turn.