| 43 | }) |
| 44 | |
| 45 | function toolCallEvent( |
| 46 | toolCallId: string, |
| 47 | toolName: string, |
| 48 | args?: Record<string, unknown>, |
| 49 | generating = false |
| 50 | ): StreamEvent { |
| 51 | return { |
| 52 | type: MothershipStreamV1EventType.tool, |
| 53 | payload: { |
| 54 | toolCallId, |
| 55 | toolName, |
| 56 | executor: MothershipStreamV1ToolExecutor.go, |
| 57 | mode: MothershipStreamV1ToolMode.sync, |
| 58 | phase: MothershipStreamV1ToolPhase.call, |
| 59 | ...(generating ? { status: TOOL_CALL_STATUS.generating } : {}), |
| 60 | ...(args ? { arguments: args } : {}), |
| 61 | }, |
| 62 | } satisfies StreamEvent |
| 63 | } |