import { LicenseManager } from "@enterprise-skills/core"; /** * The MCP server core (learning-loop S1, LEARNING_LOOP_DESIGN ยง3.1). * * WHY A CLI SUBCOMMAND AND NOT THE PACKAGE THE DESIGN FIRST NAMED: the local * queues and their flush functions live in this package, and the dependency * graph points cli -> everything, so a sibling `@enterprise-skills/mcp` could * reach them only by duplicating them. Shipping as `enterprise-skills mcp * serve` reuses the exact queue/flush/license code paths customers already * run, adds no publish loop, and IDE configs point at the binary users * already install. The design doc carries this amendment. * * The transport is MCP's stdio framing: newline-delimited UTF-8 JSON-RPC 2.0. * Only the three methods an S1 client needs are implemented โ€” initialize, * tools/list, tools/call (plus the notifications/initialized no-op) โ€” and the * protocol version is pinned below so a future spec bump is a deliberate * change here, never silent drift. The handler is PURE (message in, response * or null out, effects behind an injected deps object) so every frame is * testable without a process. * * THE PUMP: connection initialize and every tools/call flush both local * queues best-effort. This is the fix for the measured S1 gap โ€” IDE-only * users filled queues that only CLI invocations ever drained. */ export declare const MCP_PROTOCOL_VERSION = "2025-06-18"; interface JsonRpcResponse { jsonrpc: "2.0"; id: number | string | null; result?: unknown; error?: { code: number; message: string; }; } export interface McpDeps { /** Best-effort queue pump; never throws into the protocol loop. */ flushQueues: () => Promise; manager: LicenseManager; submitReport: (input: { type: "feedback" | "bug"; message: string; severity?: "minor" | "moderate" | "significant"; skill?: string; }) => Promise<{ submitted: boolean; }>; cliVersion: string; } export declare function defaultDeps(): McpDeps; /** * One JSON-RPC message in, one response (or null for notifications) out. * Never throws: protocol errors become JSON-RPC error responses. */ export declare function handleMessage(raw: string, deps: McpDeps): Promise; /** The stdio loop: newline-delimited JSON-RPC over stdin/stdout. */ export declare function serveStdio(deps?: McpDeps): Promise; export {}; //# sourceMappingURL=server.d.ts.map