import { ContextEngineRegistry, type CompressibleMessage, type CompressionResult, type CompressionStrategy, type AsyncCompressionStrategy, type SummarizeFn } from "../context/context-compression-strategies.js";
import type { HookRegistry } from "./hook-registry.js";
import type { RuntimeLogger } from "./hook-registry.js";
import type { LLMTransport } from "../ports/index.js";
/** Rough token estimate: ~4 chars per token for mixed CJK/English. */
export declare function estimateTokens(msg: CompressibleMessage): number;
/** Estimate total tokens for a message array. */
export declare function estimateTotalTokens(messages: CompressibleMessage[]): number;
export declare function getCompressionMetrics(): import("../context/context-compression-strategies.js").CompressionMetricsSnapshot;
export declare function getContextEngineRegistry(): ContextEngineRegistry;
/**
 * Create a summarization callback using an injected LLM transport.
 * For CLI mode: uses the same transport that powers the agent loop.
 * Falls back to non-LLM summary when transport/apiKey not available.
 */
export declare function createSummarizeFn(log: RuntimeLogger, opts?: {
    transport?: LLMTransport;
    apiKey?: string;
    model?: string;
}): SummarizeFn;
/** Phase 1: sync-only pipeline (ToolResultTrim + MicroCompact + SlidingWindow) */
export declare function createSyncPipeline(): CompressionStrategy;
/** Phase 2+3: async pipeline with LLM summarization + cache awareness */
export declare function createAsyncPipeline(summarize: SummarizeFn, opts?: {
    onCacheInvalidated?: (info: {
        droppedCount: number;
        strategy: string;
    }) => void;
}): AsyncCompressionStrategy;
/** Phase 2.3: incremental compaction pipeline (for partial compact) */
export declare function createIncrementalPipeline(summarize: SummarizeFn, opts?: {
    preserveRecentCount?: number;
    onCacheInvalidated?: (info: {
        droppedCount: number;
        strategy: string;
    }) => void;
}): AsyncCompressionStrategy;
export interface CompressOptions {
    budget?: number;
    model?: string;
    pipeline?: CompressionStrategy;
    allowLlm?: boolean;
    summarize?: SummarizeFn;
    sessionId?: string;
}
/** Synchronous compression (Phase 1 only). */
export declare function compressMessages(messages: CompressibleMessage[], opts?: CompressOptions): CompressionResult;
/** Async compression (Phase 2+) — supports LLM summarization. */
export declare function compressMessagesAsync(messages: CompressibleMessage[], opts: CompressOptions & {
    summarize: SummarizeFn;
}): Promise<CompressionResult>;
export declare function registerDefaultContextEngine(log: RuntimeLogger, opts?: {
    transport?: LLMTransport;
    apiKey?: string;
    model?: string;
}): void;
export declare function registerContextCompressionHook(hooks: HookRegistry, log: RuntimeLogger, opts?: {
    transport?: LLMTransport;
    apiKey?: string;
    model?: string;
}): void;
