/** * Embedded HTTP server for the Twining dashboard. * * CRITICAL: Never use console.log or process.stdout in this module. * The MCP StdioServerTransport owns stdout exclusively — any writes * corrupt the JSON-RPC byte stream. */ import http from "node:http"; import { type DashboardDeps } from "./api-routes.js"; /** * Create a request handler that routes between API and static files. * API routes are checked first, then health check, then static files. */ export declare function handleRequest(publicDir: string, projectRoot: string, deps?: DashboardDeps): (req: http.IncomingMessage, res: http.ServerResponse) => void; /** * Start the dashboard HTTP server. * Returns the server and actual port, or null if the dashboard is disabled. * * @param projectRoot - The project root directory (used for API data access) * @param deps - Shared store/engine instances from the MCP server; omitted in * standalone mode, in which the API handler constructs its own. */ export declare function startDashboard(projectRoot: string, deps?: DashboardDeps): Promise<{ server: http.Server; port: number; } | null>; /** * Register signal handlers for graceful dashboard shutdown. * Closes the HTTP server on SIGTERM/SIGINT with a 3-second force-exit timeout. */ export declare function setupDashboardShutdown(httpServer: http.Server): void; //# sourceMappingURL=http-server.d.ts.map