()
| 673 | // ── State Snapshot & Diffing ───────────────────────────────────── |
| 674 | |
| 675 | private async snapshotAgentState(): Promise<Map<string, { domains: Set<string> }>> { |
| 676 | // Single query for all agent→domain pairs instead of O(N) per-agent queries |
| 677 | const agentDomains = await this.federatedIndex.getAllAgentDomainPairs(); |
| 678 | const snapshot = new Map<string, { domains: Set<string> }>(); |
| 679 | for (const [agentUrl, domains] of agentDomains) { |
| 680 | snapshot.set(agentUrl, { domains }); |
| 681 | } |
| 682 | return snapshot; |
| 683 | } |
| 684 | |
| 685 | private async produceEventsFromDiff( |
| 686 | preCrawlAgents: Map<string, { domains: Set<string> }>, |
no test coverage detected