import { type ConversationEnvironment, simpleTokenEstimator } from './environment'; import type { Conversation, Message, TokenEstimator } from './types'; export { simpleTokenEstimator }; /** * Estimates total tokens in a conversation using the provided estimator function. * If no estimator is provided, the environment's default estimator is used. */ export declare function estimateConversationTokens(conversation: Conversation, estimateTokens?: TokenEstimator, environment?: Partial): number; /** * Options for truncateToTokenLimit. */ export interface TruncateOptions { estimateTokens?: TokenEstimator; preserveSystemMessages?: boolean; preserveLastN?: number; preserveToolPairs?: boolean; } /** * Truncates conversation to fit within an estimated token limit. * Removes oldest messages first while preserving system messages and optionally the last N messages. * If no estimator is provided, the environment's default estimator is used. * Tool interactions are preserved as atomic blocks by default. */ export declare function truncateToTokenLimit(conversation: Conversation, maxTokens: number, optionsOrEstimator?: TruncateOptions | TokenEstimator, environment?: Partial): Conversation; /** * Returns the last N messages from the conversation. * By default excludes system messages and hidden messages. * Tool interactions are preserved as atomic blocks by default. */ export declare function getRecentMessages(conversation: Conversation, count: number, options?: { includeHidden?: boolean; includeSystem?: boolean; preserveToolPairs?: boolean; }): ReadonlyArray; /** * Truncates conversation to keep only messages from the specified position onwards. * Optionally preserves system messages regardless of position. * Tool interactions are preserved as atomic blocks by default. */ export declare function truncateFromPosition(conversation: Conversation, position: number, options?: { preserveSystemMessages?: boolean; preserveToolPairs?: boolean; }, environment?: Partial): Conversation; //# sourceMappingURL=context.d.ts.map