bodhi-realtime-agent / ToolExecutor
Class: ToolExecutor
Defined in: tools/tool-executor.ts:24
Executes inline tool calls requested by Gemini.
For each tool call: validates arguments via Zod, creates an AbortController, fires onToolCall/onToolResult hooks, publishes EventBus events, and enforces timeouts. Multiple tool calls can run concurrently — each is tracked in the pending map.
Constructors
Constructor
new ToolExecutor(
hooks,eventBus,sessionId,agentName,sendJsonToClient?,setDirective?):ToolExecutor
Defined in: tools/tool-executor.ts:28
Parameters
hooks
eventBus
sessionId
string
agentName
string
sendJsonToClient?
(message) => void
setDirective?
(key, value, scope?) => void
Returns
ToolExecutor
Accessors
pendingCount
Get Signature
get pendingCount():
number
Defined in: tools/tool-executor.ts:182
Returns
number
Methods
cancel()
cancel(
toolCallIds):void
Defined in: tools/tool-executor.ts:159
Abort one or more pending tool executions and fire cancellation hooks/events.
Parameters
toolCallIds
string[]
Returns
void
handleToolCall()
handleToolCall(
call):Promise<ToolResult>
Defined in: tools/tool-executor.ts:44
Execute a tool call: validate args, run with timeout, fire hooks, return result.
Parameters
call
Returns
Promise<ToolResult>
register()
register(
tools):void
Defined in: tools/tool-executor.ts:37
Parameters
tools
Returns
void