import type { StreamEvent } from '@langchain/core/tracers/log_stream';
import type { YagrContextCompactionEvent } from '../types.js';
import type { CompactionService } from '../compaction/compaction-service.js';
export interface CompactionMiddlewareOptions {
    sessionId: string;
    compactionService: CompactionService;
    onCompaction?: (event: YagrContextCompactionEvent) => void | Promise<void>;
}
export declare function createCompactionEventHandler(options: CompactionMiddlewareOptions): (event: StreamEvent) => Promise<void>;
export declare function processCompactionFromStream(event: StreamEvent, sessionId: string, compactionService: CompactionService, onCompaction?: (event: YagrContextCompactionEvent) => void | Promise<void>): Promise<void>;
//# sourceMappingURL=compaction-middleware.d.ts.map