/**
 * Visualization API Server
 *
 * Provides REST endpoints and WebSocket for the Brain Dashboard.
 * Runs alongside or instead of the MCP server.
 */
import { Request, Response } from 'express';
import { WebSocketServer } from 'ws';
import type { DefenceSource } from '../defence/types.js';
/**
 * Normalise an incoming `source` object from a REST request body into a
 * trusted `DefenceSource`.
 *
 * - Unknown `type` values fall back to `'api'` (no rejection — defence in depth)
 * - `identifier` longer than {@link MAX_SOURCE_IDENTIFIER_LENGTH} is truncated
 *   with an ellipsis ("…") so the truncation is visible in audit logs
 * - Non-string identifiers fall back to `'rest-api'`
 *
 * Exported for unit tests.
 */
export declare function normaliseDefenceSource(raw: unknown): DefenceSource;
export declare const __test__: {
    ALLOWED_DEFENCE_SOURCE_TYPES: readonly ("user" | "cli" | "hook" | "email" | "web" | "agent" | "file" | "api" | "tool_response")[];
    MAX_SOURCE_IDENTIFIER_LENGTH: number;
};
export declare const WS_MAX_PAYLOAD: number;
export declare const WS_MAX_CONNECTIONS = 50;
export declare const WS_HEARTBEAT_MS = 30000;
/**
 * Standard `ws` ping/pong heartbeat. Marks every socket alive on `pong`, and on
 * each tick terminates any socket that didn't answer the previous ping. The
 * returned interval is `unref()`'d so it never keeps the process alive on its
 * own, and is cleared automatically when the server closes. Exported for unit
 * testing (booting the full HTTP server in jest is impractical).
 */
export declare function setupWebSocketHeartbeat(wss: Pick<WebSocketServer, 'clients' | 'on'>, intervalMs?: number): NodeJS.Timeout;
/**
 * Handler for `POST /api/v1/scan`.
 *
 * Scans content through the defence pipeline. The `config` field on the
 * request body is intentionally ignored — runtime always uses the persisted
 * defence mode. Any attempt to override config is logged as a BLOCK with
 * RESTRICTED sensitivity so incident-triage queries surface it (Fix #13).
 *
 * Exported for unit tests.
 */
export declare function handleV1Scan(req: Request, res: Response): void;
/**
 * Handler for `POST /api/v1/scan/batch`.
 *
 * Scans up to 100 items in one request. Like {@link handleV1Scan}, the
 * `config` field is intentionally ignored; source is normalised through
 * {@link normaliseDefenceSource} (Fix #13).
 *
 * Exported for unit tests.
 */
export declare function handleV1ScanBatch(req: Request, res: Response): void;
/**
 * Start the visualization API server
 */
export declare function startVisualizationServer(dbPath?: string): void;
