/**
 * HTTP transport for the wire protocol.
 *
 * Hono + @hono/node-server. Every endpoint:
 *   1. Validates the request against its Zod schema.
 *   2. Calls the matching handler in `handlers.ts`.
 *   3. Renders 4xx for `WireError` with structured body, 500 for unexpected.
 *
 * The server holds optional `IngestionStores` (passed to `createApp`)
 * to receive production traces and user feedback. With no stores wired,
 * the ingestion endpoints return 503 — read endpoints (`/v1/judge`,
 * `/v1/rubrics`, `/v1/version`) remain fully functional.
 *
 * Run via `agent-eval serve --port 5005`.
 */
import { type ServerType } from '@hono/node-server';
import { Hono } from 'hono';
import { type IngestionStores } from './handlers';
export interface CreateAppOptions {
    /** Stores wired to the ingestion endpoints. */
    stores?: IngestionStores;
    /**
     * Bearer-token auth. When provided, every endpoint EXCEPT `/healthz`
     * and `/v1/version` requires `Authorization: Bearer <token>`. The
     * token may be a static string OR a function for time-bounded /
     * rotating tokens.
     *
     * Recommended for any server that accepts ingestion writes from the
     * public internet. Read-only deployments may omit it.
     */
    auth?: {
        bearer: string | ((token: string) => boolean | Promise<boolean>);
    };
}
export declare function createApp(opts?: CreateAppOptions): Hono<import("hono/types").BlankEnv, import("hono/types").BlankSchema, "/">;
export interface ServeOptions extends CreateAppOptions {
    /** Default 5005. */
    port?: number;
    /** Default '127.0.0.1'. Set to '0.0.0.0' to listen on all interfaces. */
    host?: string;
}
export declare function startServer(opts?: ServeOptions): ServerType;
export interface StartedServer {
    server: ServerType;
    /** The OS-assigned port. When opts.port was 0, this is the actual port the
     *  kernel bound — callers that need to dial back (smoke tests, sidecars
     *  registering with a parent) read this rather than guessing a free port. */
    port: number;
    /** Resolved host the server bound to (defaults to 127.0.0.1). */
    host: string;
    /** Close the server. Resolves once active connections have drained. */
    close(): Promise<void>;
}
/**
 * Promise-returning variant of `startServer` that resolves once the server is
 * listening and surfaces the resolved bound port. Use this from smoke tests
 * (`startServerAsync({ port: 0 })`) and any caller that needs to dial back.
 */
export declare function startServerAsync(opts?: ServeOptions): Promise<StartedServer>;
//# sourceMappingURL=server.d.ts.map