/**
 * Agent Context Facade
 *
 * Encapsulates all context and memory management operations for agents.
 * This facade handles:
 * - Token counting and context window management
 * - Memory system (cross-session persistence)
 * - Context statistics and compression
 */
import type { TokenCounter } from '../../utils/token-counter.js';
import type { ContextManagerV2 } from '../../context/context-manager-v2.js';
import type { CodeBuddyMessage } from '../../codebuddy/client.js';
import { type MemoryEntry, type MemoryType } from '../../memory/index.js';
/**
 * Configuration for context management
 */
export interface ContextConfig {
    maxContextTokens?: number;
    responseReserveTokens?: number;
    recentMessagesCount?: number;
    enableSummarization?: boolean;
    compressionRatio?: number;
}
/**
 * Statistics about context usage
 */
export interface ContextStats {
    totalTokens: number;
    maxTokens: number;
    usagePercent: number;
    isCritical: boolean;
    isNearLimit: boolean;
    messageCount: number;
    summarizedSessions: number;
}
/**
 * Memory statistics
 */
export interface MemoryStats {
    totalMemories: number;
    byType: Record<string, number>;
    projects: number;
    summaries: number;
}
/**
 * Dependencies required by AgentContextFacade
 */
export interface AgentContextFacadeDeps {
    tokenCounter: TokenCounter;
    contextManager: ContextManagerV2;
    getSessionId: () => string | undefined;
}
/**
 * Facade for context and memory management in agents.
 *
 * Responsibilities:
 * - Token counting and context window monitoring
 * - Memory storage, retrieval, and summarization
 * - Context statistics and configuration
 */
export declare class AgentContextFacade {
    private readonly tokenCounter;
    private readonly contextManager;
    private readonly getSessionId;
    private _memory;
    private memoryEnabled;
    constructor(deps: AgentContextFacadeDeps);
    /**
     * Get or initialize the memory system
     */
    private get memory();
    /**
     * Get context statistics for the current messages
     */
    getStats(messages: CodeBuddyMessage[]): ContextStats;
    /**
     * Format context statistics as a human-readable string
     */
    formatStats(messages: CodeBuddyMessage[]): string;
    /**
     * Update context manager configuration
     */
    updateConfig(config: ContextConfig): void;
    /**
     * Get the context manager instance (for advanced operations)
     */
    getContextManager(): ContextManagerV2;
    /**
     * Get the token counter instance (for advanced operations)
     */
    getTokenCounter(): TokenCounter;
    /**
     * Store a memory entry
     */
    remember(type: MemoryType, content: string, options?: {
        summary?: string;
        importance?: number;
        tags?: string[];
        metadata?: Record<string, unknown>;
    }): Promise<MemoryEntry>;
    /**
     * Recall memories matching the query
     */
    recall(query?: string, options?: {
        types?: MemoryType[];
        tags?: string[];
        limit?: number;
        minImportance?: number;
    }): Promise<MemoryEntry[]>;
    /**
     * Build context string from relevant memories
     */
    getMemoryContext(query?: string): Promise<string>;
    /**
     * Store a conversation summary for long-term memory
     */
    storeConversationSummary(summary: string, topics: string[], decisions: string[] | undefined, messageCount: number): Promise<void>;
    /**
     * Enable or disable the memory system
     */
    setMemoryEnabled(enabled: boolean): void;
    /**
     * Check if memory is enabled
     */
    isMemoryEnabled(): boolean;
    /**
     * Get memory statistics
     */
    getMemoryStats(): MemoryStats | null;
    /**
     * Format memory status as a human-readable string
     */
    formatMemoryStatus(): string;
    /**
     * Dispose of all resources
     */
    dispose(): void;
}
