import { HookDispatcher } from '../hooks/dispatcher.js';
import { UserAuthManager } from '@pellux/goodvibes-sdk/platform/security/user-auth';
import { ConfigManager } from '../config/manager.js';
interface HttpListenerConfig {
    port?: number;
    host?: string;
    allowedOrigins?: string[];
    hookDispatcher?: HookDispatcher;
    configManager: ConfigManager;
    serveFactory?: typeof Bun.serve;
    /** Max requests per 60-second window per IP. Default: 60. */
    rateLimit?: number;
    /** Pre-configured UserAuthManager owned by the runtime service graph. */
    userAuth: UserAuthManager;
}
interface HttpDangerConfig {
    httpListener: boolean;
}
/**
 * HttpListener — webhook listener, disabled by default.
 *
 * Enable via: danger.httpListener = true in config.
 * All routes require Bearer token auth (set via enable()).
 * POST /webhook — parse hook event, fire through HookDispatcher.
 * GET  /health  — liveness check.
 * Rate limited to 60 requests/minute per IP by default.
 */
export declare class HttpListener {
    private config;
    private enabled;
    private server;
    private port;
    private host;
    private allowedOrigins;
    private hookDispatcher;
    private authToken;
    private userAuth;
    private rateLimiter;
    private readonly configManager;
    private readonly serveFactory;
    private tlsState;
    constructor(config: HttpListenerConfig);
    /**
     * Enable the listener. Requires danger.httpListener = true in config.
     * The provided token is used to authenticate all incoming requests.
     * Returns true if enabled, false if the config forbids it.
     */
    enable(dangerConfig: HttpDangerConfig, token?: string): boolean;
    /**
     * Start listening. Refuses to start if not enabled.
     */
    start(): Promise<void>;
    /**
     * Stop the listener.
     */
    stop(): Promise<void>;
    /**
     * Returns true if the listener is currently running.
     */
    get isRunning(): boolean;
    private checkAuth;
    private parseJsonBody;
    private handleRequest;
    private handleLogin;
    private handleWebhook;
}
export {};
//# sourceMappingURL=http-listener.d.ts.map