MCPcopy Index your code
hub / github.com/simstudioai/sim / getCachedCard

Function getCachedCard

apps/sim/lib/a2a/client.ts:52–60  ·  view source on GitHub ↗
(agentUrl: string)

Source from the content-addressed store, hash-verified

50const agentCardCache = new Map<string, { card: AgentCard; expiresAt: number }>()
51
52function getCachedCard(agentUrl: string): AgentCard | undefined {
53 const cached = agentCardCache.get(agentUrl)
54 if (!cached) return undefined
55 if (cached.expiresAt <= Date.now()) {
56 agentCardCache.delete(agentUrl)
57 return undefined
58 }
59 return cached.card
60}
61
62function cacheCard(agentUrl: string, card: AgentCard): void {
63 if (agentCardCache.size >= CARD_CACHE_MAX_ENTRIES) {

Callers 1

resolveAgentCardFunction · 0.85

Calls 2

getMethod · 0.65
deleteMethod · 0.65

Tested by

no test coverage detected