( event: unknown, )
| 61 | } |
| 62 | |
| 63 | function isReplayableHistoricalSessionEvent( |
| 64 | event: unknown, |
| 65 | ): event is ReplayableHistoricalSessionEvent { |
| 66 | if (!event || typeof event !== 'object') { |
| 67 | return false |
| 68 | } |
| 69 | const candidate = event as { |
| 70 | type?: unknown |
| 71 | session_id?: unknown |
| 72 | } |
| 73 | return ( |
| 74 | typeof candidate.session_id === 'string' && |
| 75 | (candidate.type === 'assistant' || |
| 76 | candidate.type === 'system' || |
| 77 | candidate.type === 'user') |
| 78 | ) |
| 79 | } |
| 80 | |
| 81 | export async function fetchHistoricalSessionEvents( |
| 82 | eventsUrl: string, |
no outgoing calls
no test coverage detected