/**
 * MemoryPrefetchCoordinator — owns the per-session memory prefetch cadence and
 * the post-turn sync hand-off to external memory providers.
 *
 * Previously these lived as two methods + a private `Map<sessionKey, turn>` on
 * `AgentManager`. Moving them out makes the memory layer a stand-alone concern
 * with a single owner that handles both "what to prefix on the user turn" and
 * "what to sync after the turn ends".
 */
import type { AgentMessage } from '@earendil-works/pi-agent-core';
import type { Config } from '../../config/schema.js';
import type { MemoryManager } from './manager.js';
export interface MemoryPrefetchCoordinatorOptions {
    /** Effective config snapshot accessor; tested against `isMemorySubsystemEnabled`. */
    getConfig: () => Config | undefined;
    /** Resolve the per-session memory manager (workspace runtime lookup lives in AgentManager). */
    getMemoryManagerForSession: (sessionKey: string) => MemoryManager;
    /** Return the last assistant text for a session — fed into external `syncAll`. */
    getLastAssistantContent: (sessionKey: string) => string | null;
}
export declare class MemoryPrefetchCoordinator {
    private readonly opts;
    /** Per-session user-message index, incremented before each `applyPrefetch` call. */
    private readonly prefetchUserTurn;
    constructor(opts: MemoryPrefetchCoordinatorOptions);
    /** Forget a session entirely (called when AgentManager removes the agent). */
    forgetSession(sessionKey: string): void;
    /** Tear down all per-session state (process stop / hot reload). */
    clear(): void;
    /**
     * Prepend the prefetched memory fence to the user turn when the cadence
     * config says we should. Returns the original message untouched otherwise.
     */
    applyToUserMessage(userMessage: AgentMessage, sessionKey: string): Promise<AgentMessage>;
    /** Post-turn: push the latest exchange to external providers + warm next prefetch. */
    afterTurn(sessionKey: string, userPlainText: string): void;
}
