Push tool input to the app (sent after initialization).
(self, arguments: dict[str, Any])
| 288 | logger.warning("Failed to push tool result, queued: %s", e) |
| 289 | |
| 290 | async def push_tool_input(self, arguments: dict[str, Any]) -> None: |
| 291 | """Push tool input to the app (sent after initialization).""" |
| 292 | if not self._ws: |
| 293 | return |
| 294 | |
| 295 | notification = json.dumps( |
| 296 | { |
| 297 | "jsonrpc": "2.0", |
| 298 | "method": "ui/notifications/tool-input", |
| 299 | "params": {"arguments": arguments}, |
| 300 | } |
| 301 | ) |
| 302 | |
| 303 | try: |
| 304 | await self._ws.send(notification) |
| 305 | except Exception as e: |
| 306 | logger.warning("Failed to push tool input: %s", e) |
| 307 | |
| 308 | # ------------------------------------------------------------------ # |
| 309 | # Helpers # |