export type EventCategory = 'service' | 'promise' | 'task' | 'tool' | 'model' | 'route' | 'approval' | 'file' | 'schedule' | 'notification' | 'permission' | 'system';
export interface HarnessEvent {
    event_id: string;
    category: EventCategory;
    type: string;
    /** ISO timestamp. */
    timestamp: string;
    /**
     * Process-local monotonic sequence number. Assigned by appendEvent so
     * events emitted in the same millisecond keep a deterministic order even
     * when timestamps tie. Optional for backward compatibility with legacy
     * JSONL lines written before this field existed.
     */
    seq?: number;
    /** Optional correlation key (service_id, session_id, etc). */
    subject_id?: string;
    /** Structured payload. */
    data: Record<string, unknown>;
    /** Actor: user, agent, scheduler, system. */
    actor: string;
    /** Optional parent event for causal chains. */
    parent_event_id?: string;
}
export interface EventSnapshot {
    snapshot_id: string;
    subject_id: string;
    timestamp: string;
    state: Record<string, unknown>;
    last_event_id: string;
}
export interface EventQuery {
    category?: EventCategory;
    type?: string;
    subject_id?: string;
    after?: string;
    before?: string;
    limit?: number;
    actor?: string;
}
export interface EventStoreSummary {
    total_events: number;
    categories: Record<string, number>;
    first_event_at?: string;
    last_event_at?: string;
    snapshot_count: number;
}
export declare function subscribeEventStream(listener: (event: HarnessEvent) => void): () => void;
export declare function appendEvent(projectDir: string, event: Omit<HarnessEvent, 'event_id' | 'timestamp' | 'seq'>): Promise<HarnessEvent>;
/** Convenience: emit a typed event. */
export declare function emitEvent(projectDir: string, category: EventCategory, type: string, data: Record<string, unknown>, actor?: string, subjectId?: string, parentEventId?: string): Promise<HarnessEvent>;
export declare function queryEvents(projectDir: string, query?: EventQuery): Promise<HarnessEvent[]>;
export declare function getEvent(projectDir: string, eventId: string): Promise<HarnessEvent | null>;
export declare function createSnapshot(projectDir: string, subjectId: string, state: Record<string, unknown>, lastEventId: string): Promise<EventSnapshot>;
export declare function getSnapshot(projectDir: string, subjectId: string): Promise<EventSnapshot | null>;
export declare function listSnapshots(projectDir: string): Promise<string[]>;
/**
 * Replay events for a subject, stopping before a target event.
 * Returns all events that would remain after "undoing" the target event
 * and everything after it.
 */
export declare function getUndoEvents(projectDir: string, subjectId: string, undoBeforeEventId: string): Promise<HarnessEvent[]>;
export declare function summarizeEventStore(projectDir: string): Promise<EventStoreSummary>;
/** Generate a text summary of events around a failure. */
export declare function generatePostmortem(projectDir: string, subjectId: string, windowMinutes?: number): Promise<string>;
/** Keep only the most recent `maxEntries` events. */
export declare function pruneEventStore(projectDir: string, maxEntries?: number): Promise<number>;
/** Remove events older than `retentionDays`. */
export declare function pruneEventsByAge(projectDir: string, retentionDays?: number): Promise<number>;
//# sourceMappingURL=eventStore.d.ts.map