import type { MemoryEdge, MemoryEdgeId, MemoryId } from "@oscharko-dev/keiko-contracts/memory";
import type { MemoryUpdate } from "@oscharko-dev/keiko-contracts/memory";
export type ConsolidationJobState = "queued" | "running" | "completed" | "failed" | "canceled" | "skipped";
export interface ConsolidationJob {
    readonly id: string;
    readonly state: ConsolidationJobState;
    readonly startedAt?: number;
    readonly completedAt?: number;
    readonly result?: ConsolidationResult;
    readonly error?: string;
}
export type StaleReason = "expired" | "low-confidence" | "aged-out";
export interface StaleFlag {
    readonly memoryId: MemoryId;
    readonly reason: StaleReason;
    readonly detectedAt: number;
}
export type ReviewReason = "multi-way-duplicate" | "potential-conflict";
export type ProposedAction = {
    readonly kind: "merge";
    readonly winner: MemoryId;
    readonly losers: readonly MemoryId[];
} | {
    readonly kind: "supersede";
    readonly newer: MemoryId;
    readonly older: MemoryId;
};
export interface ReviewItem {
    readonly id: string;
    readonly reason: ReviewReason;
    readonly relatedMemoryIds: readonly MemoryId[];
    readonly proposedAction?: ProposedAction;
    readonly detectedAt: number;
}
export interface ConsolidationOptions {
    readonly nowMs: number;
    readonly newEdgeId: () => MemoryEdgeId;
    readonly newReviewItemId: () => string;
    readonly jaccardThreshold?: number;
    readonly staleConfidenceThreshold?: number;
    readonly maxAgeMs?: number;
    readonly maxClustersPerRun?: number;
    readonly cancellationSignal?: () => boolean;
    readonly summaryGenerator?: (text: string) => Promise<string>;
}
export interface ConsolidationResult {
    readonly state: "completed" | "canceled" | "skipped" | "failed";
    readonly edgesProposed: readonly MemoryEdge[];
    readonly updatesProposed: readonly MemoryUpdate[];
    readonly staleFlags: readonly StaleFlag[];
    readonly reviewItems: readonly ReviewItem[];
    readonly clustersInspected: number;
    readonly elapsedMs: number;
}
//# sourceMappingURL=types.d.ts.map