import type { ChatMessage } from '@genesislcap/foundation-ai';
/**
 * Prepares history for the LLM only: masks tool call args and results from other
 * agents so the active specialist is not confused by tools it does not have.
 * Canonical history in `ChatDriver` stays unmasked for UI and logging.
 */
export declare function transformHistoryForAgent(history: ChatMessage[], agentName: string): ChatMessage[];
/**
 * Applies a history cap for sub-agent context: the last `cap` messages are passed
 * verbatim; older messages have their tool payloads masked.
 */
export declare function applyHistoryCap(history: readonly ChatMessage[], cap: number): ChatMessage[];
/** Recent messages kept verbatim when compacting; everything earlier is summarized. */
export declare const COMPACT_KEEP_RECENT_MESSAGES = 4;
/** Don't bother compacting unless at least this many messages would be summarized. */
export declare const COMPACT_MIN_MESSAGES_TO_COMPACT = 4;
/**
 * Index at which the verbatim tail begins — everything before it gets summarized.
 * The tail starts on a clean turn boundary (a `user` message): a user message
 * never appears between a `tool_use` and its `tool_result`, so cutting there
 * guarantees the summarized region is tool-pair-balanced (compaction only runs
 * when idle, so history is turn-complete). Returns `null` when there is nothing
 * worth compacting (too short, or no earlier user boundary) — e.g. a freshly
 * restored session whose only user turn is the current one.
 */
export declare function findCompactionCut(history: readonly ChatMessage[]): number | null;
/**
 * Build the one-shot summarizer prompt for a run of older messages (used with
 * `AIProvider.prompt`). Mirrors the `<conversation_history>` block convention
 * that suggestions use. Any existing `compacted-summary` at the head is folded
 * in (rendered as prior-summary context), so rolling re-compaction produces one
 * combined summary.
 */
export declare function buildCompactionSummaryPrompt(toCompact: readonly ChatMessage[]): {
    systemPrompt: string;
    userMessage: string;
};
/**
 * Normalize history for a provider request (GENC-1351 §5.7): translate each
 * `compacted-summary` message into a `user` message that wraps its summary in a
 * `<conversation_summary>` block, so the raw display-only role never reaches a
 * transport. Other roles pass through untouched. Pure — returns a new array.
 *
 * Applied at the request-build chokepoint *before* per-agent masking, so the
 * guarantee holds for every provider/transport regardless of any optional
 * per-agent history transform.
 */
export declare function normalizeForProvider(history: readonly ChatMessage[]): ChatMessage[];
/** Human-facing divider label for a `compacted-summary` message. */
export declare function compactionDividerLabel(m: ChatMessage): string;
//# sourceMappingURL=history-transform.d.ts.map