* Guard: checks if progress data has a `message` field (agent_progress or * skill_progress). Other progress types (e.g. bash_progress forwarded from * sub-agents) lack this field and must be skipped by UI helpers.
(data: Progress)
| 38 | * sub-agents) lack this field and must be skipped by UI helpers. |
| 39 | */ |
| 40 | function hasProgressMessage(data: Progress): data is AgentToolProgress { |
| 41 | if (!('message' in data)) { |
| 42 | return false; |
| 43 | } |
| 44 | const msg = (data as AgentToolProgress).message; |
| 45 | return msg != null && typeof msg === 'object' && 'type' in msg; |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Check if a progress message is a search/read/REPL operation (tool use or result). |
no outgoing calls
no test coverage detected