import { IncomingMessage, ServerResponse, Server } from 'node:http'; import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import Database from 'better-sqlite3'; import { V as VectorStore } from '../types-CRqwkJoZ.js'; import { EmbeddingProvider } from '../embeddings/types.js'; import { NeuromcpConfig } from '../config.js'; import { Logger } from '../observability/logger.js'; import { Metrics } from '../observability/metrics.js'; interface HttpTransportOptions { readonly port: number; readonly host: string; } interface HttpDeps { readonly db: Database.Database; readonly vecStore: VectorStore; readonly embedder: EmbeddingProvider; readonly config: NeuromcpConfig; readonly logger: Logger; readonly metrics: Metrics; } /** * Build the REST + SSE request handler. Exported so both the legacy * dual-mode HTTP transport (`startHttpTransport`) and the new MCP-HTTP * daemon (`startMcpHttpDaemon`) can mount the same endpoints — /health, * /api/search, /api/store, /api/store-batch, /events — without duplicating * the implementation. * * The returned handler responds with `404 not_found` for any path it does * not own, so callers can chain it after their own route matching. * * `deps` is optional because /health works without DB/embedder access. */ declare function createRestRequestHandler(logger: Logger, deps?: HttpDeps, extraAllowedHosts?: ReadonlySet): (req: IncomingMessage, res: ServerResponse) => Promise; /** * Start an HTTP server with Streamable HTTP transport + search API. * Runs alongside stdio — enables remote MCP clients and hook consumption. */ declare function startHttpTransport(_server: McpServer, options: HttpTransportOptions, logger: Logger, deps?: HttpDeps): Promise; export { type HttpDeps, type HttpTransportOptions, createRestRequestHandler, startHttpTransport };