import { Server } from "@modelcontextprotocol/sdk/server/index.js"; import { type Observation } from "../observability/observe.js"; import type { DatabaseInstance } from "../storage/db.js"; import type { LanguageAdapter, LanguageCode } from "../types.js"; export interface ServerRuntimeContext { db: DatabaseInstance; adapters: ReadonlyMap; /** * Mirrors `config.git.recentCommits`. Used as both the cap on * commits surfaced in `get_symbol_context`'s git block and the * hotness threshold (ADR-11). One knob, one meaning. */ gitRecentCommits: number; /** * Mirrors `config.mcp.symbolContextBM25` (ADR-16, v0.3 Theme 1.2 * Fix 3). When true, `get_symbol_context` BM25-ranks the intent * block IF the caller passes a `query` parameter. Falls back to * v0.2 deterministic ordering otherwise. Defaults to false. */ symbolContextBM25?: boolean; } export interface CreateServerOptions { name?: string; version: string; /** * When provided, tools that need storage + adapters are wired to the * real implementations. When omitted, those tools return "server not * initialized" errors — useful for unit tests that only verify the * MCP plumbing (tools/list, protocol correctness). */ context?: ServerRuntimeContext; /** * Cohort observability writer per v0.6 Step 6.2 / Q6.0.4 hybrid + * ADR-20 cohort observability contract. When provided, every * tool-call dispatch records one observation (sanitized request + * response shape + latency). Server-level interception captures * all three tools without per-handler instrumentation drift. * Omitted → no observation recorded (default cohort behavior). */ observabilityWriter?: (observation: Omit) => void; /** * Filesystem cwd used by the observability sanitize step to strip * absolute paths to relative form. Required when * `observabilityWriter` is provided; ignored otherwise. */ observabilityCwd?: string; } export declare function createServer(options: CreateServerOptions): Server; //# sourceMappingURL=server.d.ts.map