/**
 * MCP lifecycle handlers — `initialize` and `notifications/initialized`.
 *
 * Spec: https://modelcontextprotocol.io/specification/2025-06-18/basic/lifecycle
 * v1 supports protocol version `2025-06-18` (preferred) and `2025-03-26`
 * (backcompat). Anything else returns 400 to the client; per the spec, the
 * server SHOULD respond with its preferred supported version so the client
 * can decide whether to connect on the older version or disconnect.
 */
import { type McpSessionRecord } from './session.ts';
export declare const PROTOCOL_VERSION_PREFERRED = "2025-06-18";
export declare const PROTOCOL_VERSION_BACKCOMPAT = "2025-03-26";
export declare const SUPPORTED_PROTOCOL_VERSIONS: readonly ["2025-06-18", "2025-03-26"];
export declare const SERVER_INFO: {
    readonly name: "harper-mcp";
    readonly version: string;
};
/** Server capabilities advertised on `initialize` for v1. */
export declare const SERVER_CAPABILITIES: {
    readonly tools: {
        readonly listChanged: true;
    };
    readonly resources: {
        readonly listChanged: true;
    };
    readonly logging: {};
};
export interface InitializeParams {
    protocolVersion?: unknown;
    capabilities?: unknown;
    clientInfo?: unknown;
}
export interface InitializeResult {
    protocolVersion: string;
    serverInfo: typeof SERVER_INFO;
    capabilities: typeof SERVER_CAPABILITIES;
    instructions?: string;
}
export interface InitializeOutcome {
    ok: true;
    session: McpSessionRecord;
    result: InitializeResult;
}
export interface InitializeFailure {
    ok: false;
    reason: string;
    supportedVersions: readonly string[];
}
/**
 * Negotiate protocol version, create a session, and return the JSON-RPC
 * result body. The caller (transport core) maps `ok: false` to HTTP 400.
 *
 * Per the MCP spec: if the client requests a version the server does not
 * support, the server MUST respond with a version it does support (so the
 * client can decide whether to downgrade or disconnect) — NOT fail. We
 * pick `PROTOCOL_VERSION_PREFERRED` for any unknown version. The only
 * `ok: false` cases are a missing or non-string `protocolVersion` field,
 * which is a protocol-level violation rather than version negotiation.
 *
 * `instructions` is optional per spec; we omit it in v1 (it can be wired
 * later when tools land in #617 and we know which profile is active).
 */
export declare function handleInitialize(params: InitializeParams | undefined, user: string): Promise<InitializeOutcome | InitializeFailure>;
/**
 * Flip the session to `initialized: true`. Called when the client posts the
 * `notifications/initialized` JSON-RPC notification (per MCP §lifecycle).
 * The transport returns HTTP 202 with no body regardless of outcome here.
 */
export declare function handleInitialized(session: McpSessionRecord): Promise<McpSessionRecord>;
