Discrete event observed by the agent loop while executing tools. ``kind`` is one of ``tool_use`` (model emitted a tool_use block), ``tool_result`` (tool returned successfully), or ``tool_error`` / ``tool_result`` with ``is_error=True`` (tool failed). The bridge layer maps these to U
| 19 | |
| 20 | @dataclass(frozen=True) |
| 21 | class ToolEvent: |
| 22 | """Discrete event observed by the agent loop while executing tools. |
| 23 | |
| 24 | ``kind`` is one of ``tool_use`` (model emitted a tool_use block), |
| 25 | ``tool_result`` (tool returned successfully), or ``tool_error`` / |
| 26 | ``tool_result`` with ``is_error=True`` (tool failed). The bridge |
| 27 | layer maps these to UI rendering or stream-json events. |
| 28 | """ |
| 29 | kind: str |
| 30 | tool_name: str |
| 31 | tool_input: dict[str, Any] | None = None |
| 32 | tool_output: Any | None = None |
| 33 | tool_use_id: str | None = None |
| 34 | is_error: bool = False |
| 35 | error: str | None = None |
| 36 | |
| 37 | |
| 38 | @dataclass(frozen=True) |
no outgoing calls
no test coverage detected