(agentUrl: string, card: AgentCard)
| 60 | } |
| 61 | |
| 62 | function cacheCard(agentUrl: string, card: AgentCard): void { |
| 63 | if (agentCardCache.size >= CARD_CACHE_MAX_ENTRIES) { |
| 64 | const oldest = agentCardCache.keys().next().value |
| 65 | if (oldest !== undefined) agentCardCache.delete(oldest) |
| 66 | } |
| 67 | agentCardCache.set(agentUrl, { card, expiresAt: Date.now() + CARD_CACHE_TTL_MS }) |
| 68 | } |
| 69 | |
| 70 | /** Attaches the `X-API-Key` header to every outgoing request. */ |
| 71 | class ApiKeyInterceptor implements CallInterceptor { |
no test coverage detected