(event: Any)
| 17 | |
| 18 | |
| 19 | def event_data(event: Any) -> dict[str, Any]: |
| 20 | if not event.data: |
| 21 | return {} |
| 22 | try: |
| 23 | value = json.loads(event.data) |
| 24 | return value if isinstance(value, dict) else {} |
| 25 | except json.JSONDecodeError: |
| 26 | return {} |
| 27 | |
| 28 | |
| 29 | def pending_by_tool_id(session: Any, tool_id: str | None) -> dict[str, Any] | None: |