import type { HookRegistry } from "../../contracts/hooks.js";
import type { MemoryProvider } from "../ports/memory-provider.js";
import type { MemoryWriter } from "../ports/memory-writer.js";
import type { MemoryRecallSource } from "../ports/memory-recall-source.js";
export declare const MEMORY_PREFETCH_CONFIG: {
    readonly MAX_SESSION_BYTES: number;
    readonly LIMIT_PER_RECALL: 10;
    readonly MAX_SURFACED_ENTRIES: 100;
};
export interface MemoryHooksDeps {
    /** QMemory adapter (MemoryProvider with search/health). */
    memoryProvider?: MemoryProvider;
    /** Local memory provider for direct writes (auto-extract). */
    localMemoryProvider?: MemoryWriter;
    /** User ID for memory lookups. */
    userId: string;
    /** Logger. */
    log: {
        debug(msg: string): void;
        warn(msg: string): void;
    };
    /** Access to recent messages (for auto-extract). Set externally per turn. */
    getLastUserMessage?: () => string | undefined;
    /** Access to last assistant response (for implicit extraction). Set externally per turn. */
    getLastAssistantMessage?: () => string | undefined;
    /** Background LLM for implicit extraction. If provided, enables Layer 2. */
    llmExtract?: (prompt: string) => Promise<string | null>;
}
/** Session-scoped state for dedup and byte budget (CC parity). */
export interface MemoryPrefetchState {
    /** Paths already surfaced this session (CC readFileState LRU parity). */
    surfacedPaths: Set<string>;
    /** Total bytes injected this session. */
    sessionBytes: number;
}
/**
 * Create a fresh memory prefetch state (once per session).
 */
export declare function createMemoryPrefetchState(): MemoryPrefetchState;
/**
 * Register memory lifecycle hooks on the HookRegistry.
 *
 * Hook points wired:
 *   - memory.before_recall: prefetch context from qmemory (query-based)
 *   - memory.after_recall: log recall results
 *
 * CC parity additions:
 *   - LRU dedup via surfacedPaths (filterDuplicateMemoryAttachments)
 *   - Session byte limit (MAX_SESSION_BYTES = 60KB)
 *   - Async prefetch (non-blocking promise, abort-aware)
 *
 * Returns a cleanup function to unregister.
 */
export declare function registerMemoryHooks(hooks: HookRegistry, deps: MemoryHooksDeps, 
/** Shared statepass the same object across hook re-registrations in a session. */
prefetchState?: MemoryPrefetchState): () => void;
export interface MemdirRecallHookDeps {
    /** Project memory recall source (lazy: may be null at registration time). */
    getMemorySource: () => MemoryRecallSource | null;
    /** Logger. */
    log: {
        debug(msg: string): void;
        warn(msg: string): void;
    };
}
/**
 * Register the MEMDIR cross-file recall hook on `memory.before_recall`.
 *
 * - Priority 40 (before QMemory at 50)
 * - Scans topic files, selects top-5 relevant
 * - Injects content into recalledMemories (merged with QMemory results)
 * - Respects session byte budget from shared MemoryPrefetchState
 * - Dedup via surfacedPaths (shared with QMemory hook)
 */
export declare function registerMemdirRecallHook(hooks: HookRegistry, deps: MemdirRecallHookDeps, prefetchState?: MemoryPrefetchState): () => void;
