import { type Table } from '../../resources/databases.ts';
export interface McpSessionRecord {
    id: string;
    protocolVersion: string;
    initialized: boolean;
    user: string;
    createdAt: number;
    lastActivity: number;
}
/**
 * Initialize the session table. Called from `handleApplication(scope)` and
 * `registerMcpProfile()` when the MCP component boots. Idempotent.
 */
export declare function ensureSessionTable(): Table;
/** Test seam: allow tests to inject a fake table without touching Harper. */
export declare function _setSessionTableForTest(fake: Table | undefined): void;
export declare function createSession({ user, protocolVersion, }: {
    user: string;
    protocolVersion: string;
}): Promise<McpSessionRecord>;
/**
 * Look up a session by id. Returns the record if present and not expired,
 * else `null`. The transport core maps `null` to HTTP 404.
 */
export declare function loadSession(id: string): Promise<McpSessionRecord | null>;
/**
 * Persist updated session state. Used to bump `lastActivity` (sliding-window
 * idle reset) and to flip `initialized` after `notifications/initialized`.
 */
export declare function saveSession(record: McpSessionRecord): Promise<void>;
export declare function deleteSession(id: string): Promise<void>;
/**
 * Convenience: touch `lastActivity` and persist. Returns the updated
 * record so the caller doesn't re-fetch.
 */
export declare function touchSession(record: McpSessionRecord): Promise<McpSessionRecord>;
