import type { LanguageModel, ModelMessage, UserModelMessage, SystemModelMessage, LanguageModelUsage } from "ai";
import type { LLMObsTracer } from "../../llmobs/tracer.js";
import type { ContextOptionsV2, CachingConfig } from "./config.js";
import type { ContextRecordV2, CompactionCallbacks, CompactionPhase, ModeState, AttachmentsRecord, CompactionSummary } from "./types.js";
/** Strip base64 media from screenshot tool results, replacing with a text placeholder. */
export declare function stripScreenshotMediaFromToolMessage(msg: ModelMessage): ModelMessage;
export interface Context {
    setSystemPrompt(prompt: SystemModelMessage): void;
    addUserMessage(message: UserModelMessage): Promise<void>;
    addResponse(response: ModelMessage, usage: LanguageModelUsage): Promise<void>;
    getMessages(): Promise<ModelMessage[]>;
}
export type { CompactionCallbacks, CompactionPhase, ModeState };
export interface ContextV2Options {
    rootDir: string;
    summarizationModel: LanguageModel;
    config?: Partial<ContextOptionsV2>;
    caching?: Partial<CachingConfig>;
    onPersist?: (record: ContextRecordV2) => Promise<void>;
    compactionCallbacks?: CompactionCallbacks;
    tracer?: LLMObsTracer;
    getModeState?: () => ModeState | undefined;
}
export declare class ContextV2 implements Context {
    private systemPrompt?;
    private messages;
    private attachments?;
    private config;
    private caching;
    private summarizationModel;
    private queue;
    private onPersist?;
    private compactionCallbacks?;
    private tracer?;
    private rootDir;
    private pendingInputSummaries;
    private pendingOutputSummaries;
    private pendingProtection;
    private skillsNeedReload;
    private getModeState?;
    private isDisposed;
    constructor(options: ContextV2Options);
    setCompactionCallbacks(callbacks: CompactionCallbacks | undefined): void;
    updateConfig(config: Partial<ContextOptionsV2>): void;
    dispose(): void;
    storeSummary(toolCallId: string, summary: CompactionSummary): void;
    markSkillsNeedReload(): void;
    checkAndClearSkillsNeedReload(): boolean;
    setAttachments(attachments: AttachmentsRecord): void;
    getAttachments(): AttachmentsRecord | undefined;
    truncateAfterTimestamp(timestamp: number): void;
    static fromRecord(record: ContextRecordV2, options: ContextV2Options): ContextV2;
    toRecord(): ContextRecordV2;
    setSystemPrompt(prompt: SystemModelMessage): void;
    private collectPendingInputSummaries;
    private collectPendingOutputSummaries;
    /**
     * Collect protection flags for tool results in this message.
     * Returns a record mapping toolCallId to protection status, or undefined if none are protected.
     * Clears the pending protection flags as they are consumed.
     */
    private collectPendingProtection;
    addUserMessage(message: UserModelMessage): Promise<void>;
    addResponse(response: ModelMessage, usage: LanguageModelUsage, options?: {
        skipCompaction?: boolean;
    }): Promise<void>;
    getMessages(): Promise<ModelMessage[]>;
    /**
     * Returns the last known input token count from the most recent assistant message.
     * This represents the cumulative context size at the time of that turn.
     */
    private getLastKnownInputTokens;
    private persist;
    private compactIfNeeded;
}
//# sourceMappingURL=context.d.ts.map