import { MetaMemoryConfig, MetamemoryState, MessageMetadata } from './types/index.js';
import type { ResponseInput, Agent } from '@just-every/ensemble';
export interface MetaMemoryOptions {
    config?: Partial<MetaMemoryConfig>;
    agent: Agent;
}
export declare class Metamemory {
    private taggedMessages;
    private topicTags;
    private topicCompaction;
    private config;
    private isProcessing;
    private messageQueue;
    private lastProcessedIndex;
    private agent;
    constructor(options: MetaMemoryOptions);
    /**
     * Process new messages and update message metadata
     */
    processMessages(messages: ResponseInput): Promise<{
        newTopicCount?: number;
        updatedTopicCount?: number;
        newMessageCount?: number;
        updatedMessageCount?: number;
    }>;
    /**
     * Get messages by topic
     */
    getMessagesByTopic(topic: string): MessageMetadata[];
    /**
     * Get all topics
     */
    getAllTopics(): string[];
    /**
     * Get the current state of metamemory
     */
    getState(): MetamemoryState;
    /**
     * Restore metamemory from a saved state
     */
    restoreState(state: MetamemoryState): void;
    /**
     * Get memory statistics
     */
    getMemoryStats(): {
        totalMessages: number;
        totalTopics: number;
        lastProcessedIndex: number;
    };
    /**
     * Check and perform compaction on topics as needed
     */
    checkCompact(messages: ResponseInput): Promise<void>;
    /**
     * Generate a compaction for a topic
     */
    private generateCompaction;
    /**
     * Create a compaction summary using the agent
     */
    private createCompactionSummary;
    /**
     * Compact messages by replacing with summaries
     */
    compact(messages: ResponseInput): ResponseInput;
    /**
     * Get all message IDs up to and including the specified last ID
     */
    private getCompactedMessageIds;
    /**
     * Calculate total tokens for a topic
     */
    private calculateTopicTokens;
    /**
     * Handle merged topics by updating compaction data
     */
    private handleMergedTopics;
}
export type { MetamemoryState } from './types/index.js';
//# sourceMappingURL=index.d.ts.map