/**
 * compaction-sections.ts
 *
 * Section builder functions for prompt compaction.
 *
 * Rule-based builders return CompactionSection | null directly.
 * LLM-assisted builders return a string prompt to be sent to the LLM by the
 * orchestrator; the caller assembles the section from the LLM response.
 *
 * Empty sections return null — the orchestrator omits them entirely (no header).
 */
import type { ProviderMessage } from '../providers/interface.js';
import type { AgentRecord } from '../tools/agent/index.js';
import type { WrfcChain } from '../agents/wrfc-types.js';
import type { ExecutionPlan } from './execution-plan.js';
import type { CompactionSection, SessionMemory } from './compaction-types.js';
/**
 * buildHandoffHeader — always returns the mandatory handoff header.
 * This is the first line of every compacted output.
 */
export declare function buildHandoffHeader(): CompactionSection;
/**
 * buildSessionMemories — format pinned memories.
 * Returns null if there are no memories.
 */
export declare function buildSessionMemories(memories: SessionMemory[]): CompactionSection | null;
/**
 * buildCurrentTask — one line stating what the user is currently doing.
 * Uses plan title if a plan exists, otherwise falls back to the last user message.
 */
export declare function buildCurrentTask(planTitle: string | null, lastUserMessage: string | null): CompactionSection | null;
/**
 * buildRunningAgents — list agents in running or pending status.
 * Includes WRFC chain ID, agent ID, and task (truncated to 80 chars).
 * Returns null if no agents are running.
 */
export declare function buildRunningAgents(agents: AgentRecord[], chains: WrfcChain[]): CompactionSection | null;
/**
 * gatherRecentConversation — collect user/assistant messages backward from most
 * recent, stopping when adding the next message would exceed maxTokens.
 * Returns full messages only (no partial messages).
 *
 * The returned messages are raw — they will be further filtered by the LLM
 * substance filter in the orchestrator.
 */
export declare function gatherRecentConversation(messages: ProviderMessage[], maxTokens?: number): ProviderMessage[];
/**
 * buildToolResultsPrompt — build the prompt for LLM-assisted tool relevance extraction.
 *
 * The caller sends this to the LLM and uses the response as the section content.
 */
export declare function buildToolResultsPrompt(toolMessages: ProviderMessage[]): string;
/**
 * buildConversationFilterPrompt — build the LLM prompt for filtering gathered
 * recent messages for substance.
 *
 * The caller sends this to the LLM; the response replaces the raw gathered messages.
 * Multi-turn coherence rule: keep user-assistant PAIRS.
 */
export declare function buildConversationFilterPrompt(gatheredMessages: ProviderMessage[]): string;
/**
 * buildAgentActivityTable — rule-based table from WRFC chain data.
 * One row per chain, most recent first. Skips intermediate reviews/fix cycles.
 * Stops when adding the next row would exceed the token budget.
 *
 * Returns:
 *   - section: the table section (or null if no chains)
 *   - remainingChains: chains that did not fit in the table (for older summary)
 */
export declare function buildAgentActivityTable(chains: WrfcChain[], tokenBudget: number): {
    section: CompactionSection | null;
    remainingChains: WrfcChain[];
};
/**
 * buildOlderAgentSummaryPrompt — build the prompt for LLM-assisted summary of
 * agents that did not fit in the activity table.
 *
 * Returns empty string if no older chains.
 */
export declare function buildOlderAgentSummaryPrompt(olderChains: WrfcChain[]): string;
/**
 * buildResolvedProblemsPrompt — build the prompt for LLM-assisted extraction
 * of problem → resolution pairs from the conversation.
 *
 * Returns empty string if no messages.
 */
export declare function buildResolvedProblemsPrompt(messages: ProviderMessage[]): string;
/**
 * buildPlanProgress — rule-based from plan state.
 * Returns null if no active plan.
 */
export declare function buildPlanProgress(plan: ExecutionPlan | null): CompactionSection | null;
/**
 * buildSessionLineage — format the append-only micro-log.
 * Each compaction adds one entry; prior entries are never modified.
 */
export declare function buildSessionLineage(originalTask: string | undefined, lineageEntries: string[], compactionCount: number): CompactionSection | null;
//# sourceMappingURL=compaction-sections.d.ts.map