/**
 * The server fleet — a name-keyed collection of {@link ServerEndpoint}s driven
 * through one lifecycle.
 *
 * {@link ServerFleet} (the interface) is declared in `./contract`; this module is
 * its one concrete implementation. The fleet's defining responsibility is
 * *failure isolation*: when many external MCP servers are connected at once, one
 * server that refuses to spawn, hangs, or speaks a broken handshake must not sink
 * the others. Every connection is therefore attempted in parallel and settled
 * independently — a faulted endpoint is simply left in its `faulted` phase, its
 * fault recorded in the aggregate {@link FleetStatus}, while its healthy peers go
 * on serving.
 *
 * The fleet owns no transport of its own; it constructs one
 * {@link ServerEndpointImpl} per {@link ServerConfig} and delegates. It exposes
 * immutable snapshots — `endpoints()` and `status()` return fresh, frozen
 * projections — so a caller can never mutate the fleet's internal bookkeeping
 * through a returned handle.
 */
import type { BridgeConfig, FleetStatus, ServerEndpoint, ServerFleet } from "./contract";
/**
 * A {@link ServerFleet} over the SDK-backed {@link ServerEndpointImpl}.
 *
 * Construct empty, then {@link start} it with a {@link BridgeConfig} to mint and
 * connect one endpoint per configured server. The fleet keys endpoints by
 * {@link ServerConfig.id} in configuration order and preserves that order in
 * every projection it returns.
 */
export declare class ServerFleetImpl implements ServerFleet {
    /**
     * Endpoints keyed by server id, in insertion (configuration) order. A `Map`
     * gives O(1) lookup by id while preserving the declaration order that every
     * snapshot reproduces.
     */
    private readonly byId;
    /** The configuration the fleet was last {@link start}ed with, if any. */
    private config?;
    /**
     * Connect every server in `config` in parallel, isolating per-server failures.
     *
     * One endpoint is minted per {@link ServerConfig} and registered immediately
     * (so even an endpoint that fails to connect appears in `endpoints()` and
     * `status()` carrying its fault). Connections are then awaited together via
     * `Promise.allSettled`: a rejection from any single `open()` is absorbed — the
     * endpoint records its own {@link import("./contract").ProtocolFault} and moves
     * to `faulted` — and never propagates out of `start`, so a single bad server
     * cannot prevent the rest of the fleet from coming up.
     *
     * A later id in `config` silently supersedes an earlier duplicate, matching the
     * registry's last-registration-wins convention.
     */
    start(config: BridgeConfig): Promise<void>;
    /**
     * {@link ServerFleet} vocabulary for {@link start}. The fleet was constructed
     * empty, so `spinUp` reconnects against the configuration the fleet already
     * holds; it throws if the fleet has never been {@link start}ed.
     */
    spinUp(): Promise<void>;
    /**
     * Gracefully close every endpoint, in parallel. Each `close()` is idempotent
     * and any-phase safe, and `allSettled` ensures one endpoint's close error does
     * not prevent its peers from closing.
     */
    close(): Promise<void>;
    /** {@link ServerFleet} vocabulary for {@link close}. */
    tearDown(): Promise<void>;
    /** Look up a single endpoint by its server id, or `undefined` if absent. */
    endpoint(server: string): ServerEndpoint | undefined;
    /**
     * Every endpoint currently held, in configuration order, as a fresh frozen
     * array. The snapshot is immutable: callers cannot reorder or grow the fleet's
     * internal collection through the returned handle.
     */
    endpoints(): readonly ServerEndpoint[];
    /**
     * The aggregate health of every endpoint: one {@link EndpointStatus} per
     * server, keyed by id, as a fresh frozen record. Each status is the endpoint's
     * own point-in-time projection, so the snapshot reflects phases and faults at
     * the moment of the call.
     */
    status(): FleetStatus;
    /** Mint one endpoint for a server config. Isolated for overriding in tests. */
    private mint;
}
/**
 * Construct and start a {@link ServerFleet} for a {@link BridgeConfig}.
 *
 * The returned fleet has already attempted every connection (in parallel, with
 * per-server failure isolation); inspect {@link ServerFleet.status} to learn
 * which servers came up `ready` and which `faulted`.
 */
export declare function startServerFleet(config: BridgeConfig): Promise<ServerFleetImpl>;
