/**
 * Shared interface for conversation context implementations.
 *
 * This interface defines the minimal set of methods required by:
 * - LLMClient (setSystemPrompt, startTurn, getMessages, initializeWith, storeSummary)
 * - ContextObserver (startStep, endStep, endTurn)
 * - AttachmentsStore (setAttachments, getAttachments)
 */
import type { ModelMessage, UserModelMessage, SystemModelMessage, LanguageModelUsage } from "ai";
import type { AttachmentsRecord } from "../../attachments/store.js";
import type { CompactionSummary } from "./types.js";
/**
 * Core conversation context interface.
 *
 * Implementation:
 * - ContextV2Adapter: Wrapper around ContextV2 with phase-based compaction
 */
export interface ConversationContext {
    /**
     * Sets the system prompt for the conversation.
     */
    setSystemPrompt(prompt: SystemModelMessage): void;
    /**
     * Starts a new conversation turn with a user message.
     * May be async in v2 implementation.
     */
    startTurn(user: UserModelMessage): void | Promise<void>;
    /**
     * Starts a new step within the active turn.
     * Called before each LLM inference cycle.
     */
    startStep(): void;
    /**
     * Ends the current step, recording response messages.
     * @param responses - Accumulated assistant/tool messages for the step
     * @param usage - Optional token usage for compaction decisions
     */
    endStep(responses: ModelMessage[], usage?: LanguageModelUsage): void | Promise<void>;
    /**
     * Ends the active turn.
     * @param usage - Optional final token usage
     */
    endTurn(usage?: LanguageModelUsage): void;
    /**
     * Returns all messages in the conversation (system + history).
     * May be async in v2 implementation.
     */
    getMessages(): ModelMessage[] | Promise<ModelMessage[]>;
    /**
     * Initializes the context with existing messages.
     * Used for ephemeral contexts that need pre-existing conversation history.
     * May be async in v2 implementation.
     */
    initializeWith(messages: ModelMessage[]): void | Promise<void>;
    /**
     * Stores a tool call summary for use during compaction.
     * Summaries are used to provide meaningful placeholders when
     * tool outputs are compressed. If the summary has `protected: true`,
     * the tool result will be marked as protected from compaction.
     */
    storeSummary(toolCallId: string, summary: CompactionSummary): void;
    /**
     * Mark that skills need to be re-read (called after phase 2 compaction).
     */
    markSkillsNeedReload(): void;
    /**
     * Check if skills need to be re-read and clear the flag.
     * Returns true if skills should be re-read.
     */
    checkAndClearSkillsNeedReload(): boolean;
    /**
     * Sets the attachments record for the context.
     * Used by AttachmentsStore to persist user-uploaded files.
     */
    setAttachments(attachments: AttachmentsRecord): void;
    /**
     * Gets the attachments record from the context.
     * Returns undefined if no attachments have been set.
     */
    getAttachments(): AttachmentsRecord | undefined;
    /**
     * Truncates all messages after a given timestamp.
     * Messages without timestamps are never truncated (treated as permanent).
     */
    truncateAfterTimestamp(timestamp: number): void;
}
/**
 * Handle for a context instance with release capability.
 * Used by ContextObserver to manage context lifecycle.
 */
export interface ContextHandle {
    context: ConversationContext;
    release(): void;
}
//# sourceMappingURL=conversation-context.d.ts.map