/**
 * Middleware Implementations
 *
 * Concrete middleware implementations for conversation control:
 * - TurnLimitMiddleware: Prevents conversations from exceeding turn limits
 * - PriceLimitMiddleware: Monitors and limits session costs
 * - AutoCompactMiddleware: Automatically compacts context when needed
 * - ContextWarningMiddleware: Warns when context is filling up
 */
import { ConversationMiddleware, ConversationContext, MiddlewareResult, TurnLimitConfig, PriceLimitConfig, AutoCompactConfig, ContextWarningConfig } from './types.js';
/**
 * Prevents conversations from exceeding a maximum turn count
 */
export declare class TurnLimitMiddleware implements ConversationMiddleware {
    readonly name = "turn-limit";
    readonly priority = 10;
    private config;
    private warningIssued;
    constructor(config: TurnLimitConfig);
    beforeTurn(context: ConversationContext): Promise<MiddlewareResult>;
    afterTurn(_context: ConversationContext): Promise<MiddlewareResult>;
    reset(): void;
}
/**
 * Monitors and limits session costs
 */
export declare class PriceLimitMiddleware implements ConversationMiddleware {
    readonly name = "price-limit";
    readonly priority = 20;
    private config;
    private warningIssued;
    constructor(config: PriceLimitConfig);
    beforeTurn(context: ConversationContext): Promise<MiddlewareResult>;
    afterTurn(context: ConversationContext): Promise<MiddlewareResult>;
    reset(): void;
}
/**
 * Automatically triggers context compaction when token usage is high
 */
export declare class AutoCompactMiddleware implements ConversationMiddleware {
    readonly name = "auto-compact";
    readonly priority = 30;
    private config;
    private lastCompactTokens;
    constructor(config: AutoCompactConfig);
    beforeTurn(context: ConversationContext): Promise<MiddlewareResult>;
    afterTurn(_context: ConversationContext): Promise<MiddlewareResult>;
    reset(): void;
}
/**
 * Issues a warning when context usage reaches a threshold
 */
export declare class ContextWarningMiddleware implements ConversationMiddleware {
    readonly name = "context-warning";
    readonly priority = 40;
    private config;
    private warningIssued;
    constructor(config: ContextWarningConfig);
    beforeTurn(context: ConversationContext): Promise<MiddlewareResult>;
    afterTurn(_context: ConversationContext): Promise<MiddlewareResult>;
    reset(): void;
}
/**
 * Prevents rapid-fire requests (optional rate limiting)
 */
export declare class RateLimitMiddleware implements ConversationMiddleware {
    readonly name = "rate-limit";
    readonly priority = 5;
    private lastRequestTime;
    private minIntervalMs;
    constructor(minIntervalMs?: number);
    beforeTurn(_context: ConversationContext): Promise<MiddlewareResult>;
    afterTurn(_context: ConversationContext): Promise<MiddlewareResult>;
    reset(): void;
}
/**
 * Limits the number of tool executions per turn
 */
export declare class ToolExecutionLimitMiddleware implements ConversationMiddleware {
    readonly name = "tool-execution-limit";
    readonly priority = 15;
    private maxToolCallsPerTurn;
    private currentTurnToolCalls;
    constructor(maxToolCallsPerTurn?: number);
    beforeTurn(_context: ConversationContext): Promise<MiddlewareResult>;
    afterTurn(_context: ConversationContext): Promise<MiddlewareResult>;
    /**
     * Called by tool executor before each tool call
     */
    checkToolCall(): boolean;
    reset(): void;
}
/**
 * Create default middleware stack
 */
export declare function createDefaultMiddlewares(options?: {
    maxTurns?: number;
    maxCost?: number;
    autoCompactThreshold?: number;
    contextWarningPercentage?: number;
}): ConversationMiddleware[];
/**
 * Create YOLO mode middleware stack (relaxed limits)
 */
export declare function createYoloMiddlewares(options?: {
    maxTurns?: number;
    maxCost?: number;
}): ConversationMiddleware[];
