/**
 * ConversationContext — tiered memory for multi-turn agent sessions.
 *
 * Two tiers:
 *  - Working memory: last `workingMemorySize` turns kept verbatim
 *  - Episodic memory: older turns replaced by LLM-generated summaries
 *
 * Strategy-aware output via toMessages(strategy):
 *  - "minimal" / "ooda": appends history as system suffix (backward-compat with renderHistorySuffix)
 *  - "react" / "plan": returns LLMMessage[] array with summaries as system prefix
 *  - "one-shot": returns []
 *
 * @public @since 2.3.0
 */
import type { Turn, CompactionSummary, CompactionReport, ConversationContextSnapshot, ConversationContextOpts, LLMMessage } from "./types.js";
import type { AgentStrategyName } from "../strategies/index.js";
/** Completion function accepted by compact(). */
export type CompactionLLMFn = (prompt: string) => Promise<string>;
/** Options for compact(). */
export interface CompactOpts {
    /** How many recent turns to keep verbatim. Defaults to workingMemorySize. */
    readonly keepLast?: number;
}
export declare class ConversationContext {
    private readonly _workingMemorySize;
    private _turns;
    private _summaries;
    constructor(opts?: ConversationContextOpts);
    get turns(): readonly Turn[];
    get summaries(): readonly CompactionSummary[];
    get turnCount(): number;
    get workingMemorySize(): number;
    /**
     * Append a turn to the conversation.
     */
    addTurn(role: "user" | "assistant", content: string, meta?: Turn["meta"]): void;
    /**
     * Return conversation history formatted for the given strategy.
     *
     * - "minimal" | "ooda": string suffix to append after system prompt
     * - "react" | "plan": LLMMessage[] array (system prefix + user/assistant)
     * - "one-shot": empty array
     *
     * @param strategy — agent strategy name
     * @param systemPrompt — base system prompt (used for "minimal"/"ooda" suffix mode)
     */
    toMessages(strategy: AgentStrategyName, systemPrompt?: string): string | LLMMessage[];
    /**
     * Estimate token count across all turns + summaries.
     * Uses length/4 heuristic (characters → tokens).
     */
    estimatedTokens(): number;
    /**
     * Compact the conversation: keep last `keepLast` turns verbatim,
     * summarize older turns via `llmFn`, return a CompactionReport.
     */
    compact(llmFn: CompactionLLMFn, opts?: CompactOpts): Promise<CompactionReport>;
    /**
     * Compact if estimated fill ratio exceeds `threshold`.
     * Returns true if compaction was triggered.
     *
     * @param model — model identifier used to look up context window size
     * @param llmFn — LLM function for generating the summary
     * @param threshold — fill ratio threshold (default: 0.70)
     */
    maybeCompact(model: string, llmFn: CompactionLLMFn, threshold?: number): Promise<boolean>;
    /**
     * Serialize to a snapshot suitable for JSON.stringify / file persistence.
     */
    toJSON(): ConversationContextSnapshot;
    /**
     * Reconstruct a ConversationContext from a snapshot.
     * Validates version field; throws on incompatible format.
     */
    static fromJSON(snapshot: ConversationContextSnapshot): ConversationContext;
}
//# sourceMappingURL=context.d.ts.map