/**
 * Generic event structure
 */
export interface Event {
    eventId: string;
    eventType: string;
    timestamp: string;
    agentType?: string;
    instanceId?: string;
    payload: Record<string, unknown>;
    metadata?: Record<string, unknown>;
}
/**
 * Event query filter
 */
export interface EventQuery {
    eventTypes?: string[];
    agentTypes?: string[];
    instanceIds?: string[];
    startTime?: string;
    endTime?: string;
    limit?: number;
    offset?: number;
}
/**
 * Event statistics
 */
export interface EventStats {
    totalEvents: number;
    eventsByType: Record<string, number>;
    oldestEvent?: string;
    newestEvent?: string;
    storeSizeBytes: number;
}
/**
 * EventStore
 *
 * Minimal append-only event log:
 * - Persists to .mycontext/event-store.jsonl (JSON Lines format)
 * - Simple querying (type, time range, agent)
 * - Event replay capability
 * - No complex projections yet
 */
export declare class EventStore {
    private storePath;
    private writeStream?;
    private eventCount;
    constructor(baseDir?: string);
    /**
     * Initialize event store
     */
    init(): Promise<void>;
    /**
     * Append event to store
     */
    append(eventType: string, payload: Record<string, unknown>, options?: {
        agentType?: string;
        instanceId?: string;
        metadata?: Record<string, unknown>;
    }): Promise<Event>;
    /**
     * Append batch of events
     */
    appendBatch(events: Omit<Event, "eventId" | "timestamp">[]): Promise<Event[]>;
    /**
     * Query events
     */
    query(filter?: EventQuery): Promise<Event[]>;
    /**
     * Get recent events
     */
    getRecent(limit?: number): Promise<Event[]>;
    /**
     * Get events by type
     */
    getByType(eventType: string, limit?: number): Promise<Event[]>;
    /**
     * Get events by agent
     */
    getByAgent(agentType: string, limit?: number): Promise<Event[]>;
    /**
     * Get events by instance
     */
    getByInstance(instanceId: string): Promise<Event[]>;
    /**
     * Get events in time range
     */
    getByTimeRange(startTime: string, endTime: string, limit?: number): Promise<Event[]>;
    /**
     * Replay events (useful for debugging and reconstruction)
     */
    replay(callback: (event: Event) => void | Promise<void>, filter?: EventQuery): Promise<number>;
    /**
     * Get statistics
     */
    getStats(): Promise<EventStats>;
    /**
     * Clear all events (use with caution!)
     */
    clear(): Promise<void>;
    /**
     * Compact store (remove old events, keep recent N)
     */
    compact(keepRecent?: number): Promise<number>;
    /**
     * Export events to JSON array
     */
    export(outputPath: string, filter?: EventQuery): Promise<number>;
    /**
     * Import events from JSON array
     */
    import(inputPath: string): Promise<number>;
    /**
     * Close event store
     */
    close(): Promise<void>;
    /**
     * Read events from file (streaming)
     */
    private readEvents;
    /**
     * Count total events in store
     */
    private countEvents;
}
//# sourceMappingURL=EventStore.d.ts.map