import { BaseMessage } from '@langchain/core/messages'; import type { TokenCounter } from '@/types/run'; export type SummarizeTier = 'full' | 'simple' | 'emergency'; export type SummarizeConfig = { /** Max tokens for the summary output */ maxOutputTokens?: number; /** Token counter for validation */ tokenCounter?: TokenCounter; /** Max tokens the summary should fit within */ summaryBudget?: number; /** Whether this is a multi-agent conversation */ isMultiAgent?: boolean; /** Current agent workflow state for multi-agent context */ agentWorkflowState?: { currentAgentId: string; agentChain: string[]; pendingAgents: string[]; }; }; export type SummarizeResult = { summary: string; tier: SummarizeTier; tokenCount?: number; messagesCompacted: number; }; export declare const FULL_SUMMARY_TEMPLATE = "Analyze this conversation and produce a structured summary covering each section below. Be precise and preserve actionable details.\n\n## 1. Task Overview & User Intent\nWhat the user originally asked for and their high-level goal.\n\n## 2. Technical Context\nLanguages, frameworks, libraries, APIs, and architectural patterns involved.\n\n## 3. Files & Code State\nAll file paths mentioned, their current state, and any pending modifications.\n\n## 4. Problem Resolution History\nProblems encountered, debugging steps taken, and their outcomes.\n\n## 5. Agent Workflow State\n{agent_workflow}\n\n## 6. Tool Results Summary\nTools called, their inputs, and key outputs (omit verbose raw data).\n\n## 7. Progress Tracking\nWhat has been completed, what remains, and any blockers.\n\n## 8. Active Working State\nVariables, configurations, and runtime state that must be preserved.\n\n## 9. Continuation Plan\nImmediate next steps and the order in which they should be executed.\n\n## 10. Critical Context\nAny constraints, warnings, edge cases, or decisions that must not be lost.\n\nConversation:\n{conversation}\n\nStructured Summary:"; export declare const SIMPLE_SUMMARY_TEMPLATE = "Summarize this conversation preserving: user's original request, key decisions, current task state, and any file paths mentioned.\n\nConversation:\n{conversation}\n\nSummary:"; export declare function formatMessagesForSummary(messages: BaseMessage[]): string; export declare function buildFullSummaryPrompt(conversation: string, config?: SummarizeConfig): string; export declare function buildSimpleSummaryPrompt(conversation: string): string; export declare function createEmergencySummary(messages: BaseMessage[]): string; export declare function validateSummarySize(summary: string, budget: number, tokenCounter: TokenCounter): boolean; export declare function summarize(messages: BaseMessage[], callback: (prompt: string, maxTokens: number) => Promise, config?: SummarizeConfig): Promise;