/** * Shared HTTP helpers used by every route file. Kept tiny on purpose — * if it doesn't fit in this file, it belongs in a route module. */ import type { IncomingMessage, ServerResponse } from "node:http"; /** Write a JSON response with the right content-type. */ export declare function sendJson(res: ServerResponse, status: number, body: unknown): void; /** Read the request body as JSON. Returns `{}` for empty bodies; throws on malformed JSON. */ export declare function readJsonBody(req: IncomingMessage): Promise; /** * Set CORS headers. We accept localhost (dashboard dev), chrome-extension * origins (the Cortex browser extension), and fall back to `*` for * anything else — the localhost bind is the real security boundary, not * the origin check. */ export declare function setCors(res: ServerResponse, origin: string | undefined): void; //# sourceMappingURL=http.d.ts.map