/** * MAMA Embedding HTTP Server * * HTTP API for embedding generation, integrated with MCP server. * Provides fast embedding access for Claude Code hooks. * * Features: * - Model stays loaded in memory (singleton) * - HTTP API at localhost:${MAMA_EMBEDDING_PORT || MAMA_HTTP_PORT || 3849} * - Health check endpoint * - Shared model with MCP server * * @module embedding-http-server */ import type { IncomingMessage, ServerResponse, Server as HTTPServer } from 'http'; export declare const SHUTDOWN_TOKEN: string; export declare const DEFAULT_PORT: number; export declare const HOST = "127.0.0.1"; export declare const PORT_FILE: string; /** * Request handler type */ type RequestHandler = (req: IncomingMessage, res: ServerResponse) => Promise; /** * MessageRouter interface */ interface MessageRouter { process(message: unknown): Promise; } /** * SessionStore interface */ interface SessionStore { getHistory?(sessionId: string): unknown[]; getHistoryByChannel?(source: string, channelId: string): unknown[]; } /** * Server options */ export interface ServerOptions { messageRouter?: MessageRouter; sessionStore?: SessionStore; graphHandler?: RequestHandler; } /** * Clean up port file on exit */ export declare function cleanupPortFile(): void; /** * Start the HTTP embedding server * * @param port - Port to listen on (default: DEFAULT_PORT) * @returns HTTP server instance */ export declare function startEmbeddingServer(port?: number, options?: ServerOptions): Promise; /** * Pre-warm the embedding model */ export declare function warmModel(): Promise<{ success: boolean; latency?: number; error?: string; }>; export {}; //# sourceMappingURL=index.d.ts.map