/**
 * Engine Session Manager
 *
 * In-memory session store for the headless API engine.
 * Each session gets a preset-scoped toolMap and tracks call history.
 */
import type { McpTool } from "../types.js";
import type { SessionContext } from "./contextBridge.js";
export interface ToolCallRecord {
    id: string;
    toolName: string;
    args: Record<string, unknown>;
    result: unknown;
    status: "success" | "error";
    durationMs: number;
    timestamp: number;
}
export interface DisclosureEvent {
    kind: string;
    toolName?: string;
    stepIndex?: number;
    status: "running" | "complete" | "error";
    data?: unknown;
    timestamp: number;
}
export interface EngineSession {
    id: string;
    createdAt: number;
    lastActivity: number;
    preset: string;
    toolMap: Map<string, McpTool>;
    callHistory: ToolCallRecord[];
    disclosureEvents: DisclosureEvent[];
    status: "active" | "completed" | "error";
    contextSnapshot?: SessionContext;
}
/**
 * Build a scoped toolMap for a preset.
 * Falls back to full toolMap if preset is unknown.
 */
export declare function createSession(preset: string, presets: Record<string, string[]>, toolsetMap: Record<string, McpTool[]>, fallbackToolMap: Map<string, McpTool>): EngineSession;
export declare function getSession(id: string): EngineSession | undefined;
export declare function endSession(id: string): boolean;
export declare function listSessions(): Array<{
    id: string;
    preset: string;
    status: string;
    toolCount: number;
    callCount: number;
    createdAt: number;
    lastActivity: number;
}>;
export declare function executeToolInSession(session: EngineSession, toolName: string, args: Record<string, unknown>): Promise<ToolCallRecord>;
export declare function cleanExpired(): number;
export declare function getSessionCount(): number;
