import { EventEmitter } from 'events';
import { SessionInfo, AgentPhase, Intent, AnalysisPlan } from '../types';
export interface SessionStoreConfig {
    sessionDir?: string;
    retentionMs?: number;
    maxActiveSessions?: number;
}
export interface SessionData extends SessionInfo {
    intent?: Intent;
    plan?: AnalysisPlan;
    startTime: number;
    endTime?: number;
    metadata: Record<string, any>;
}
/**
 * 会话存储实现
 */
export declare class SessionStore extends EventEmitter {
    private config;
    private sessionDir;
    private activeSessions;
    constructor(config?: SessionStoreConfig);
    /**
     * 创建新会话
     */
    createSession(traceId: string, query: string): Promise<SessionData>;
    /**
     * 生成会话 ID
     */
    private generateSessionId;
    /**
     * 更新会话状态
     */
    updatePhase(sessionId: string, phase: AgentPhase): Promise<void>;
    /**
     * 更新会话意图
     */
    updateIntent(sessionId: string, intent: Intent): Promise<void>;
    /**
     * 更新会话计划
     */
    updatePlan(sessionId: string, plan: AnalysisPlan): Promise<void>;
    /**
     * 设置会话错误
     */
    setError(sessionId: string, error: string): Promise<void>;
    /**
     * 设置检查点 ID
     */
    setCheckpoint(sessionId: string, checkpointId: string): Promise<void>;
    /**
     * 更新会话元数据
     */
    updateMetadata(sessionId: string, metadata: Record<string, any>): Promise<void>;
    /**
     * 获取会话
     */
    getSession(sessionId: string): Promise<SessionData | null>;
    /**
     * 获取会话信息（简化版）
     */
    getSessionInfo(sessionId: string): Promise<SessionInfo | null>;
    /**
     * 列出所有会话
     */
    listSessions(): Promise<SessionInfo[]>;
    /**
     * 列出可恢复的会话
     */
    listRecoverableSessions(): Promise<SessionInfo[]>;
    /**
     * 按 trace ID 查找会话
     */
    findByTraceId(traceId: string): Promise<SessionInfo[]>;
    /**
     * 按状态查找会话
     */
    findByPhase(phase: AgentPhase): Promise<SessionInfo[]>;
    /**
     * 删除会话
     */
    deleteSession(sessionId: string): Promise<void>;
    /**
     * 清理过期会话
     */
    cleanupExpired(): Promise<number>;
    /**
     * 清理超过限制的活动会话
     */
    private cleanupExcessSessions;
    /**
     * 保存会话到磁盘
     */
    private saveSession;
    /**
     * 从磁盘加载会话
     */
    private loadSession;
    /**
     * 获取会话文件路径
     */
    private getSessionPath;
    /**
     * 确保目录存在
     */
    private ensureDirectory;
    /**
     * 判断阶段是否可恢复
     */
    private isResumablePhase;
    /**
     * 获取统计信息
     */
    getStats(): Promise<{
        totalSessions: number;
        activeSessions: number;
        byPhase: Record<AgentPhase, number>;
        resumable: number;
    }>;
    /**
     * 关闭存储（持久化所有活动会话）
     */
    close(): Promise<void>;
}
export default SessionStore;
//# sourceMappingURL=sessionStore.d.ts.map