import { FederationNode } from '../entities/federation-node.js'; import type { WgManifestSection } from '../value-objects/wg-config.js'; export type DiscoveryMechanism = 'static' | 'dns-sd' | 'ipfs-registry' | 'a2a-card'; export interface FederationManifest { readonly nodeId: string; readonly publicKey: string; readonly endpoint: string; readonly capabilities: { readonly agentTypes: readonly string[]; readonly maxConcurrentSessions: number; readonly supportedProtocols: readonly string[]; readonly complianceModes: readonly string[]; }; readonly version: string; readonly signature: string; readonly timestamp: string; /** * ADR-111 — optional WG mesh identity. Present only when the publishing * node has opted into the in-tree WG layer (`config.wgMesh: true`). * The Ed25519 manifest signature covers this block too — peers verifying * the manifest also verify the WG-key binding. */ readonly wg?: WgManifestSection; } export interface DiscoveryServiceDeps { signManifest: (manifest: Omit) => Promise; verifyManifest: (manifest: FederationManifest) => Promise; onPeerDiscovered?: (node: FederationNode) => void; } export interface DiscoveryConfig { readonly staticPeers: readonly string[]; readonly enableDnsSd: boolean; readonly enableIpfsRegistry: boolean; readonly ipfsRegistryCid?: string; readonly discoveryIntervalMs: number; readonly staleThresholdMs: number; } export declare class DiscoveryService { private readonly deps; private readonly config; private readonly knownPeers; private localManifest; private discoveryTimer; constructor(deps: DiscoveryServiceDeps, config?: Partial); publishManifest(manifest: Omit): Promise; getLocalManifest(): FederationManifest | null; discoverPeers(): Promise; addStaticPeer(endpoint: string, manifest?: FederationManifest): Promise; /** * Register an externally-discovered peer (e.g. mapped from an A2A Agent * Card via `fromAgentCard`). Unlike `addStaticPeer` this takes a fully * constructed node — the caller owns validation of the external format — * and the node keeps whatever trust level it was constructed with * (A2A-card peers arrive UNTRUSTED). Existing peers are refreshed, not * replaced, so accumulated trust state survives re-discovery. */ registerExternalPeer(node: FederationNode): FederationNode; removePeer(nodeId: string): boolean; getPeer(nodeId: string): FederationNode | undefined; listPeers(): FederationNode[]; listActivePeers(): FederationNode[]; pruneStale(): string[]; startPeriodicDiscovery(): void; stopPeriodicDiscovery(): void; private findByEndpoint; private hashEndpoint; } //# sourceMappingURL=discovery-service.d.ts.map