import type { AgentRuntime } from "@elizaos/core"; /** * Minimal subset of ServerState needed for coordinator bridge wiring. * Avoids importing the full ServerState interface (which is private to server.ts). */ export interface WirableState { runtime: AgentRuntime | null; broadcastWs?: ((data: Record) => void) | null; } export interface WireCoordinatorOpts { /** Wire the chat bridge. Returns true on success. */ wireChatBridge: (state: S) => boolean; /** Wire the WebSocket bridge. Returns true on success. */ wireWsBridge: (state: S) => boolean; /** Wire the event-routing bridge. Returns true on success. */ wireEventRouting: (state: S) => boolean; /** Wire the swarm-complete synthesis callback. Returns true on success. */ wireSwarmSynthesis?: (state: S) => boolean; /** Label for log messages (e.g. "boot", "restart"). */ context: string; /** Logger with warn/debug methods. */ logger: { warn: (msg: string) => void; debug?: (msg: string) => void; }; } export interface WireResult { chat: boolean; ws: boolean; eventRouting: boolean; swarmSynthesis: boolean; } /** * Wire coordinator bridges using polling-based service discovery. * * 1. Attempts immediate wiring (coordinator may already be available). * 2. If any bridge fails, polls for the SWARM_COORDINATOR service via * `runtime.getService()` (the orchestrator plugin registers it via * direct map insertion, so `getServiceLoadPromise` never resolves). * 3. Once the service appears, retries failed bridges up to MAX_RETRIES. * 4. On timeout or exhaustion, broadcasts a system-warning WS event. * * Safe for fire-and-forget (`void wireCoordinatorBridgesWhenReady(...)`). */ export declare function wireCoordinatorBridgesWhenReady(state: S, opts: WireCoordinatorOpts): Promise; //# sourceMappingURL=coordinator-wiring.d.ts.map