(toolId: string, args: any)
| 16 | abstract process(message: string, onFirstText?: () => void): Promise<string>; |
| 17 | |
| 18 | protected async executeToolCall(toolId: string, args: any): Promise<any> { |
| 19 | const session = sessionManager.current(); |
| 20 | |
| 21 | emitCliTimelineEvent(createRunningToolEvent(toolId, args || {})); |
| 22 | |
| 23 | await messageBus.publish('tool:execute', { toolId, args }, { |
| 24 | sessionId: session.id, |
| 25 | agentId: this.config.id |
| 26 | }); |
| 27 | |
| 28 | const result = await toolRegistry.execute(toolId, args, { |
| 29 | sessionId: session.id, |
| 30 | agentId: this.config.id, |
| 31 | workingDirectory: process.cwd() |
| 32 | }); |
| 33 | |
| 34 | await messageBus.publish('tool:result', { toolId, result }, { |
| 35 | sessionId: session.id, |
| 36 | agentId: this.config.id |
| 37 | }); |
| 38 | |
| 39 | emitCliTimelineEvent( |
| 40 | result?.success |
| 41 | ? createCompletedToolEvent(toolId, result) |
| 42 | : createFailedToolEvent(toolId, result?.error || result) |
| 43 | ); |
| 44 | |
| 45 | return result; |
| 46 | } |
| 47 | |
| 48 | protected getTools() { |
| 49 | return toolRegistry.getForAgent(this.config.id, this.config.tools); |
nothing calls this directly
no test coverage detected