({ toolCall })
| 66 | messages: initialMessages, |
| 67 | transport, |
| 68 | onToolCall({ toolCall }) { |
| 69 | const mode = chat.messages.at(-1)?.metadata?.mode ?? "BUILD"; |
| 70 | |
| 71 | void executeLocalTool(toolCall.toolName, toolCall.input, mode) |
| 72 | .then((output) => |
| 73 | chat.addToolOutput({ |
| 74 | tool: toolCall.toolName as keyof ChatTools, |
| 75 | toolCallId: toolCall.toolCallId, |
| 76 | output, |
| 77 | }), |
| 78 | ) |
| 79 | .catch((error) => |
| 80 | chat.addToolOutput({ |
| 81 | tool: toolCall.toolName as keyof ChatTools, |
| 82 | toolCallId: toolCall.toolCallId, |
| 83 | state: "output-error", |
| 84 | errorText: error instanceof Error ? error.message : String(error), |
| 85 | }), |
| 86 | ); |
| 87 | }, |
| 88 | sendAutomaticallyWhen: lastAssistantMessageIsCompleteWithToolCalls, |
| 89 | }); |
| 90 |
nothing calls this directly
no test coverage detected