/**
 * Memory Supersession Service (Memory Phase 1 — M4)
 *
 * Provides explicit supersession of agent memory entries: when a fact is
 * updated (e.g. "Pro pricing was $799 → now $800 + 1000 credits"), instead
 * of leaving both entries to confuse default recall, an agent or TL marks
 * the old entry as superseded by the new one. After supersession:
 *
 * - Old entry's `supersededBy` is set to the new entry's id.
 * - Old entry's `superseded` boolean is also set (legacy v2 field, kept for
 *   filter compatibility with existing scoring code).
 * - Old entry's `evidence` is extended with `supersession-reason:<reason>`
 *   so the audit trail survives.
 * - The old entry remains in the raw memory store (for audit) but is hidden
 *   by default recall (see `isHiddenFromDefaultRecall` in
 *   `./role-knowledge-eligibility.ts`).
 *
 * @module services/memory/memory-supersession.service
 */
import { AgentMemoryService } from './agent-memory.service.js';
/**
 * Result of a supersede operation.
 */
export interface SupersedeResult {
    /** Old entry id that was just marked as superseded */
    oldId: string;
    /** New entry id that supersedes the old one */
    newId: string;
    /** ISO timestamp when supersession was recorded */
    supersededAt: string;
    /** Reason provided by caller (echoed back for confirmation) */
    reason?: string;
}
/**
 * Parameters for {@link MemorySupersessionService.supersede}.
 */
export interface SupersedeParams {
    /** Agent whose memory store contains both entries */
    agentId: string;
    /** Id of the entry being superseded */
    oldId: string;
    /** Id of the new entry that replaces the old one */
    newId: string;
    /** Optional human-readable reason; appended to old entry's evidence */
    reason?: string;
}
/**
 * Public interface of {@link MemorySupersessionService}.
 */
export interface IMemorySupersessionService {
    supersede(params: SupersedeParams): Promise<SupersedeResult>;
}
/**
 * Coordinates explicit supersession of memory entries.
 *
 * Singleton; delegates to {@link AgentMemoryService} for the actual disk read
 * + write so we don't bypass cache invalidation or atomic-write semantics.
 *
 * @example
 * ```typescript
 * const supersession = MemorySupersessionService.getInstance();
 * const result = await supersession.supersede({
 *   agentId: 'crewly-product-max-c69ce8e6',
 *   oldId: 'rk-pricing-799',
 *   newId: 'rk-pricing-800-plus-credits',
 *   reason: 'Steve updated pricing 2026-05-01: $800 + 1000 credits + overage',
 * });
 * // result.supersededAt = '2026-05-03T18:00:00.000Z'
 * ```
 */
export declare class MemorySupersessionService implements IMemorySupersessionService {
    private static instance;
    private readonly agentMemory;
    private readonly logger;
    private constructor();
    /**
     * Get singleton instance. Pass `agentMemory` in tests to inject a custom
     * AgentMemoryService bound to a test directory.
     *
     * @param agentMemory - Optional custom AgentMemoryService for testing
     * @returns Singleton instance
     */
    static getInstance(agentMemory?: AgentMemoryService): MemorySupersessionService;
    /**
     * Clear singleton instance — for test isolation.
     */
    static clearInstance(): void;
    /**
     * Mark `oldId` as superseded by `newId` in the given agent's memory store.
     *
     * Validates:
     * - both ids resolve to existing entries
     * - they are not the same id (a memory cannot supersede itself)
     *
     * The write goes through `AgentMemoryService` so cache invalidation +
     * atomic file replacement are honored.
     *
     * @param params - Supersede parameters
     * @returns Result describing the supersession
     * @throws Error if the agent has no memory, either id is missing, or ids match
     */
    supersede(params: SupersedeParams): Promise<SupersedeResult>;
}
//# sourceMappingURL=memory-supersession.service.d.ts.map