/**
 * Agent State Module
 *
 * Manages the state of the agent including mode, cost tracking,
 * session management, and configuration.
 * Extracted from CodeBuddyAgent for better modularity and testability.
 */
import { EventEmitter } from "events";
import { CostTracker } from "../utils/cost-tracker.js";
import { AgentModeManager, AgentMode } from "./agent-mode.js";
import { SandboxManager } from "../security/sandbox.js";
import { ContextManagerV2 } from "../context/context-manager-v2.js";
import { SessionStore } from "../persistence/session-store.js";
import type { ChatEntry } from "./types.js";
/**
 * Agent configuration options
 */
export interface AgentConfig {
    maxToolRounds: number;
    sessionCostLimit: number;
    yoloMode: boolean;
    parallelToolExecution: boolean;
    ragToolSelection: boolean;
    selfHealing: boolean;
}
/**
 * Default agent configuration
 */
export declare const DEFAULT_AGENT_CONFIG: AgentConfig;
/**
 * YOLO mode configuration
 */
export declare const YOLO_CONFIG: Partial<AgentConfig>;
/**
 * AgentState manages all state-related concerns for the agent.
 */
export declare class AgentState extends EventEmitter {
    private config;
    private sessionCost;
    private costTracker;
    private modeManager;
    private sandboxManager;
    private contextManager;
    private sessionStore;
    private lastToolSelection;
    private abortController;
    constructor(options?: Partial<AgentConfig>);
    /**
     * Get current configuration
     */
    getConfig(): Readonly<AgentConfig>;
    /**
     * Update configuration
     */
    updateConfig(updates: Partial<AgentConfig>): void;
    /**
     * Get max tool rounds
     */
    getMaxToolRounds(): number;
    /**
     * Set max tool rounds
     */
    setMaxToolRounds(rounds: number): void;
    /**
     * Enable or disable YOLO mode
     */
    setYoloMode(enabled: boolean): void;
    /**
     * Check if YOLO mode is enabled
     */
    isYoloModeEnabled(): boolean;
    /**
     * Get current session cost
     */
    getSessionCost(): number;
    /**
     * Get session cost limit
     */
    getSessionCostLimit(): number;
    /**
     * Set session cost limit
     */
    setSessionCostLimit(limit: number): void;
    /**
     * Check if session cost limit has been reached
     */
    isSessionCostLimitReached(): boolean;
    /**
     * Record cost for current request
     */
    recordSessionCost(inputTokens: number, outputTokens: number, model: string): void;
    /**
     * Format cost status for display
     */
    formatCostStatus(): string;
    /**
     * Get the cost tracker
     */
    getCostTracker(): CostTracker;
    /**
     * Get current mode
     */
    getMode(): AgentMode;
    /**
     * Set mode
     */
    setMode(mode: AgentMode): void;
    /**
     * Get mode status
     */
    getModeStatus(): string;
    /**
     * Check if tool is allowed in current mode
     */
    isToolAllowedInCurrentMode(toolName: string): boolean;
    /**
     * Get the mode manager
     */
    getModeManager(): AgentModeManager;
    /**
     * Get sandbox status
     */
    getSandboxStatus(): string;
    /**
     * Validate a command in sandbox
     */
    validateCommand(command: string): {
        valid: boolean;
        reason?: string;
    };
    /**
     * Get the sandbox manager
     */
    getSandboxManager(): SandboxManager;
    /**
     * Get context statistics
     */
    getContextStats(messages: unknown[]): import("../context/context-manager-v2.js").ContextStats;
    /**
     * Format context stats as a readable string
     */
    formatContextStats(messages: unknown[]): string;
    /**
     * Update context manager configuration
     */
    updateContextConfig(config: {
        maxContextTokens?: number;
        responseReserveTokens?: number;
        recentMessagesCount?: number;
        enableSummarization?: boolean;
        compressionRatio?: number;
        model?: string;
    }): void;
    /**
     * Get the context manager
     */
    getContextManager(): ContextManagerV2;
    /**
     * Save current session
     */
    saveCurrentSession(chatHistory: ChatEntry[]): Promise<void>;
    /**
     * Get session list
     */
    getSessionList(): Promise<string>;
    /**
     * Export current session
     */
    exportCurrentSession(outputPath?: string): Promise<string | null>;
    /**
     * Get the session store
     */
    getSessionStore(): SessionStore;
    /**
     * Enable or disable parallel tool execution
     */
    setParallelToolExecution(enabled: boolean): void;
    /**
     * Check if parallel tool execution is enabled
     */
    isParallelToolExecutionEnabled(): boolean;
    /**
     * Enable or disable RAG tool selection
     */
    setRAGToolSelection(enabled: boolean): void;
    /**
     * Check if RAG tool selection is enabled
     */
    isRAGToolSelectionEnabled(): boolean;
    /**
     * Set the last tool selection result
     */
    setLastToolSelection(selection: unknown): void;
    /**
     * Get the last tool selection result
     */
    getLastToolSelection(): unknown | null;
    /**
     * Create a new abort controller
     */
    createAbortController(): AbortController;
    /**
     * Get the current abort controller
     */
    getAbortController(): AbortController | null;
    /**
     * Abort the current operation
     */
    abortCurrentOperation(): void;
    /**
     * Clear the abort controller
     */
    clearAbortController(): void;
    /**
     * Check if operation was aborted
     */
    isAborted(): boolean;
    /**
     * Dispose all resources
     */
    dispose(): void;
}
