/**
 * Self-Summarization Engine
 *
 * LLM-based context compression inspired by Cursor's self-summarization approach.
 * At configurable token thresholds, generates ~1000 token semantic summaries
 * preserving task state, key decisions, and file context.
 *
 * Summaries are stored in Nexus memory and reused on subsequent sessions
 * to dramatically reduce token consumption on repeat project visits.
 */
export interface SelfSummary {
    /** Semantic summary (~1000 tokens) */
    summary: string;
    /** Current task/plan state */
    taskState: string;
    /** Key decisions preserved for continuity */
    keyDecisions: string[];
    /** File fingerprints: path → sha256 hash (for change detection) */
    fileFingerprints: Record<string, string>;
    /** Number of times this session has been summarized */
    priorSummaryCount: number;
    /** When the summary was generated */
    timestamp: number;
    /** Project scope identifier */
    projectId: string;
    /** Token count of the summary itself */
    summaryTokens: number;
    /** Original context tokens that were compressed */
    originalTokens: number;
}
export interface SummarizationContext {
    /** Recent conversation/action history */
    conversationHistory: string[];
    /** Currently active file paths */
    activeFiles: string[];
    /** Current task description or plan state */
    taskState: string;
    /** How many prior summarizations have occurred */
    priorSummaryCount: number;
    /** Estimated current token count */
    currentTokenCount: number;
}
export interface SelfSummarizerOptions {
    /** Token count threshold to trigger summarization (default: 40000) */
    tokenThreshold?: number;
    /** Max tokens for the summary output (default: 1000) */
    summaryBudget?: number;
    /** Project identifier for scoped storage */
    projectId?: string;
}
export declare class SelfSummarizer {
    private tokenThreshold;
    private summaryBudget;
    private projectId;
    private summaryCount;
    constructor(options?: SelfSummarizerOptions);
    /**
     * Check if summarization should trigger based on current token count.
     */
    shouldSummarize(currentTokenCount: number): boolean;
    /**
     * Generate a self-summary from current session context.
     * Uses a local heuristic-based approach (no LLM call required) that
     * extracts key information from the conversation history.
     *
     * For LLM-based summarization, the caller should pass the prompt from
     * buildSummarizationPrompt() to their preferred LLM endpoint.
     */
    summarize(context: SummarizationContext): SelfSummary;
    /**
     * Get the LLM prompt for external summarization.
     * The caller should send this to Anthropic API and store the result.
     */
    getSummarizationPrompt(context: SummarizationContext): string;
    /**
     * Attempt to bootstrap from a previously stored summary for this project.
     * Returns null if no summary exists or it's too old.
     */
    bootstrapFromSummary(projectId?: string): SelfSummary | null;
    private persistSummary;
    private ensureSummariesDir;
}
export declare function getSharedSummarizer(options?: SelfSummarizerOptions): SelfSummarizer;
