(entry: LogEntry)
| 49 | |
| 50 | // Listeners run after the tool has already finished; errors here must never reach it. |
| 51 | const onLog = (entry: LogEntry) => { |
| 52 | try { |
| 53 | const { phase, agentId } = snapshot; |
| 54 | if (phase !== 'monitoring' || entry.source !== agentId) return; |
| 55 | const d = entry.details; |
| 56 | if (d?.logType !== 'tool-success') return; |
| 57 | if (NOTIFY_TOOLS.has(d?.content?.tool)) { |
| 58 | clearFallback(); |
| 59 | set({ phase: 'notified' }); |
| 60 | } |
| 61 | } catch { /* observer only */ } |
| 62 | }; |
| 63 | |
| 64 | const wire = () => { |
| 65 | if (wired) return; |
nothing calls this directly
no test coverage detected