/** * Federation registry — central service discovery for cross-service Manifest runtimes. * * The registry tracks ServiceDescriptors, resolves service endpoints, and * optionally performs periodic health checks to keep the federation view fresh. * * The registry is deterministic: same descriptors in → same lookups out. * Health checks are the only non-deterministic path and are opt-in. * * @module federation/registry */ import type { ServiceDescriptor, ServiceHealth, FederationRegistryOptions, ExposedCommand } from './types'; /** * FederationRegistry: discovers and tracks remote Manifest services. * * Usage: * const registry = new FederationRegistry({ healthCheckIntervalMs: 30000 }); * registry.register(ordersDescriptor); * registry.register(inventoryDescriptor); * const svc = registry.get('orders'); * const cmds = registry.findCommandsByEntity('orders', 'Order'); */ export declare class FederationRegistry { private services; private options; private healthTimer; constructor(options?: FederationRegistryOptions); /** * Register a service descriptor. Replaces any existing descriptor * with the same serviceId. */ register(descriptor: ServiceDescriptor): void; /** * Register multiple service descriptors in a single call. */ registerAll(descriptors: ServiceDescriptor[]): void; /** * Remove a service from the registry. */ unregister(serviceId: string): boolean; /** * Get a service descriptor by ID. Returns undefined if not registered. */ get(serviceId: string): ServiceDescriptor | undefined; /** * List all registered service descriptors. */ list(): ServiceDescriptor[]; /** * Find all commands exposed for a given entity across all services. * Returns an array of { serviceId, command } pairs. */ findCommandsByEntity(entityName: string): Array<{ serviceId: string; command: ExposedCommandRef; }>; /** * Find the service and command descriptor for a specific (entity, command) pair. * Returns undefined if not found. */ findCommand(entityName: string, commandName: string): { service: ServiceDescriptor; command: ExposedCommand; } | undefined; /** * Get the list of all reachable services. */ getReachable(): ServiceDescriptor[]; /** * Manually trigger a health check on a single service. * Returns the updated health status. */ checkHealth(serviceId: string): Promise; /** * Stop the health check timer. Call this on shutdown to prevent leaks. */ stop(): void; private startHealthChecks; private probeHealth; } /** * Reference to an exposed command including the full descriptor. */ export interface ExposedCommandRef { name: string; descriptor: ExposedCommand; } //# sourceMappingURL=registry.d.ts.map