/**
 * HTTP sync server extracted from WarpRuntime.serve().
 *
 * Handles request routing, JSON parsing, validation, and error responses
 * for the sync protocol. All HTTP I/O flows through an HttpServerPort
 * so the domain never touches node:http directly.
 *
 * @module domain/services/sync/HttpSyncServer
 */
import { type HttpSyncServerOptions, type ListenResult } from './HttpSyncServerHelpers.ts';
export default class HttpSyncServer {
    private readonly _httpPort;
    private readonly _graph;
    private readonly _logger;
    readonly _path: string;
    readonly _host: string;
    readonly _maxRequestBytes: number;
    private readonly _auth;
    private readonly _authMode;
    constructor(options: HttpSyncServerOptions);
    /**
     * Runs auth verification and writer whitelist checks. Returns an error
     * response when enforcement blocks the request, or null to proceed.
     *
     * In log-only mode both checks record metrics/logs but always return
     * null so the request proceeds.
     */
    private _authorize;
    /**
     * Verifies the request signature via SyncAuthService.
     */
    private _verifySignature;
    /**
     * Checks writer IDs from the request frontier against the whitelist.
     */
    private _checkWriterWhitelist;
    /**
     * Handles an incoming HTTP request through the sync pipeline.
     */
    private _handleRequest;
    /**
     * Runs content-type, route, and body-size validation.
     */
    private _preflight;
    /**
     * Forwards the parsed sync request to the graph and wraps errors.
     */
    private _executeSyncRequest;
    /**
     * Starts the HTTP sync server.
     *
     * @param port - Port to listen on (0 for ephemeral)
     * @returns Server handle with `url` and `close()` method
     * @throws SyncError If port is not a number
     */
    listen(port: number): Promise<ListenResult>;
}
