/**
 * PersistenceHandler — writes AgentController events to SessionManager.
 *
 * Owns timing state (turn start, tool start times). Computes duration deltas
 * and writes entries to SessionManager. Tracks the last assistant message for
 * downstream retry/compaction checks.
 *
 * Does NOT own turnIndex — that's a shared pipeline counter passed in by the
 * orchestrator so both this handler and the extension emitter see the same value.
 *
 * Part of the AgentSession event pipeline (step 4). Does not reference
 * AgentSession or any other pipeline handler.
 */
import type { AssistantMessage } from '../../ai/types.js';
import type { AgentLoopEvent } from '../../core/index.js';
import type { PersistenceSessionStore } from './session-store-types.js';
/** Tool info snapshot written to SessionManager on agent_start. */
export interface ToolSnapshot {
    name: string;
    description: string;
    parameters: unknown;
}
export declare class PersistenceHandler {
    private _turnStartTime;
    private _toolStartTimes;
    private _lastAssistantMessage;
    /** Last assistant message seen. Read by the pipeline on agent_end. */
    get lastAssistantMessage(): AssistantMessage | undefined;
    /** Clear lastAssistantMessage after the pipeline has consumed it. */
    clearLastAssistant(): void;
    /**
     * Reset state and snapshot system prompt + tools at the start of an agent invocation.
     * Called directly by the pipeline on agent_start (not through handle()).
     */
    startAgent(sessionManager: PersistenceSessionStore, systemPrompt: string, tools: ToolSnapshot[]): void;
    /**
     * Handle a non-agent_start event: write timing + message data to SessionManager.
     *
     * agent_start is handled by startAgent() — the pipeline calls that directly
     * because it needs to pass the system prompt and tool snapshot.
     */
    handle(event: AgentLoopEvent, sessionManager: PersistenceSessionStore, turnIndex: number): void;
    private _onMessageEnd;
}
//# sourceMappingURL=persistence-handler.d.ts.map