MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / snapshotAgentState

Method snapshotAgentState

server/src/crawler.ts:675–683  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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> }>,

Callers 2

crawlAllAgentsMethod · 0.95
produceEventsFromDiffMethod · 0.95

Calls 2

setMethod · 0.45

Tested by

no test coverage detected