import { IncomingMessage, Server, ServerResponse } from "node:http"; //#region src/node.d.ts /** * The minimal shape `chumbo/node` serves: any app exposing a web-standard * fetch handler, such as the result of `createSupabaseMcp`. */ interface NodeFetchApp { fetch(request: Request): Response | Promise; } type NodeRequestHandler = (request: IncomingMessage, response: ServerResponse) => void; interface ServeOptions { /** TCP port to listen on. Defaults to 8080, Cloud Run's conventional port. */ port?: number; /** Bind address. Defaults to 0.0.0.0 so containers accept external traffic. */ hostname?: string; } interface RunningNodeApp { /** A URL that reaches the server from the local machine. */ url: string; server: Server; /** Stop listening and end every open connection, including SSE streams. */ close(): Promise; } /** * Adapt a fetch-handler app to a Node `http` request listener, for embedding * a Chumbo MCP app in an existing Node server. * * The request URL is reconstructed from `x-forwarded-proto` and * `x-forwarded-host` when a reverse proxy provides them, so advertised * OAuth discovery paths stay correct behind load balancers. */ declare function toNodeHandler(app: NodeFetchApp): NodeRequestHandler; /** * Serve a fetch-handler app over Node's built-in HTTP server. Suitable for * Cloud Run, Fly, Railway, or any container platform: * * ```ts * import { serve } from "chumbo/node"; * const running = await serve(app, { port: Number(process.env.PORT ?? 8080) }); * ``` */ declare function serve(app: NodeFetchApp, options?: ServeOptions): Promise; //#endregion export { NodeFetchApp, NodeRequestHandler, RunningNodeApp, ServeOptions, serve, toNodeHandler }; //# sourceMappingURL=node.d.ts.map