/**
 * Dynamic Context Discovery Engine
 *
 * Inspired by Cursor's lazy context loading approach.
 * Instead of shipping all MCP tool descriptions to every request,
 * this engine provides minimal summaries and expands on demand.
 *
 * Reduces context tokens by ~40-50% for tool descriptions alone.
 */
export interface ToolSummary {
    name: string;
    /** 1-line summary (10-15 words max) */
    summary: string;
    /** Full description (loaded on demand) */
    fullDescription: string;
    /** Keywords for task matching */
    keywords: string[];
}
export interface ResolvedContext {
    /** Tools with full descriptions (task-relevant) */
    expanded: string[];
    /** Tools with summary only (not immediately relevant) */
    summarized: string[];
    /** Estimated tokens saved */
    tokensSaved: number;
    /** Original token count if all tools had full descriptions */
    originalTokens: number;
}
export interface ToolDefinition {
    name: string;
    description: string;
    inputSchema: Record<string, unknown>;
}
export declare class DynamicContextDiscovery {
    private toolSummaries;
    private contextTokensBefore;
    private contextTokensAfter;
    /**
     * Register tools and generate 1-line summaries for lazy loading.
     */
    registerTools(tools: ToolDefinition[]): void;
    /**
     * Resolve which tools should get full descriptions based on the current task.
     * Returns tools split into expanded (full desc) and summarized (1-line).
     */
    resolveContext(task: string, tools: ToolDefinition[]): ResolvedContext;
    /**
     * Apply dynamic context to a tool list: expand relevant tools, summarize others.
     */
    applyToTools(task: string, tools: ToolDefinition[]): ToolDefinition[];
    /**
     * Get full description for a specific tool (pull-on-demand).
     */
    getFullDescription(toolName: string): string | null;
    /**
     * Get context savings metrics.
     */
    getContextMetrics(): {
        tokensBefore: number;
        tokensAfter: number;
        savings: number;
        pct: number;
    };
    private generateSummary;
    private extractKeywords;
}
export declare function getSharedContextDiscovery(): DynamicContextDiscovery;
