(event: AgentEvent)
| 18 | }; |
| 19 | |
| 20 | function eventData(event: AgentEvent): ConfirmationEventData { |
| 21 | if (!event.data) return {}; |
| 22 | try { |
| 23 | return JSON.parse(event.data) as ConfirmationEventData; |
| 24 | } catch { |
| 25 | return {}; |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | async function pendingByToolId(session: Session, toolId?: string | null): Promise<PendingConfirmation | null> { |
| 30 | const pending = await session.pendingConfirmations(); |