import { AgentDiscovery } from '@svantic/sdk';
// 5-minute cache — cards rarely change, and no caller is checking per-request.
const discovery = new AgentDiscovery(5 * 60_000);
// Single lookup — served from cache on subsequent calls within the TTL.
const card = await discovery.discover('https://api.svantic.com/agents/invoice-agent');
console.log(card.name, '—', (card.skills ?? []).map((s) => s.name));
// Parallel lookups; failures are silently dropped.
const cards = await discovery.discover_all([
'https://api.svantic.com/agents/invoice-agent',
'https://api.svantic.com/agents/refund-agent',
'https://api.svantic.com/agents/docs-agent',
]);
// Kick a specific agent out of the cache (e.g. after a deploy).
discovery.invalidate('https://api.svantic.com/agents/invoice-agent');