import type { IncomingMessage, ServerResponse } from "node:http"; export declare const OBSERVER_STATIC_HOST = "127.0.0.1"; export interface ObserverStaticHandlerOptions { /** Directory served as the loopback root. Requests can never escape it. */ root: string; /** File served for directory requests. Defaults to `index.html`. */ indexPath?: string; /** * When set, an exact `/` request returns a 302 to `/` instead * of serving a file. Used to land visitors on `observer/index.html` so the * Observer's relative artifact links (`../run.json`, ...) resolve. */ redirectRootTo?: string; } export interface ObserverStaticServeOptions extends ObserverStaticHandlerOptions { /** TCP port to bind on 127.0.0.1. Defaults to an ephemeral port (0). */ port?: number; /** * Relative entry page (e.g. `observer/index.html`). Drives the returned * `url` and the `/` -> entry redirect so callers open the page directly. */ entryPath?: string; } export interface ObserverStaticServer { url: string; port: number; host: string; close(): Promise; } export declare function observerStaticContentType(filePath: string): string; /** * Resolve, guard, and serve a single static request from `root`. Never throws: * any unexpected failure is reported as a 500 so the connection always closes. * Exported directly so the security guards can be unit-tested without binding a * socket. */ export declare function respondToObserverStaticRequest(options: ObserverStaticHandlerOptions, request: Pick, response: ServerResponse): Promise; export declare function createObserverStaticHandler(options: ObserverStaticHandlerOptions): (request: IncomingMessage, response: ServerResponse) => void; export declare function serveObserverStatic(options: ObserverStaticServeOptions): Promise;