import type { IncomingMessage, ServerResponse } from 'node:http'; import type { HostConnectionService } from '@deepseek-ai/dsh-client-connection'; /** Public WebServer route surface used by the plugin. */ export interface WebRouteHost { register(route: { kind: 'exact' | 'prefix'; path: string; handler: (req: IncomingMessage, res: ServerResponse) => void | Promise; }): () => void; } export type BrowserRequestGate = Pick; export declare class RequestBodyError extends Error { readonly status: 400 | 413; constructor(message: string, status: 400 | 413); } /** Bound memory while draining oversized requests so the route can return 413. */ export declare function readJsonRequest(req: IncomingMessage, maxBytes?: number): Promise>; /** Raw WebServer routes do not inherit Connection's authentication fence. */ export declare function authenticatedWebRoutes(server: WebRouteHost, connection: () => BrowserRequestGate | undefined): WebRouteHost;