import { type Dispatch, type MutableRefObject, type SetStateAction } from "react";
import type { Message, Provider } from "@kenkaiiii/gg-ai";
import { type ContextWindowOptions } from "../../core/model-registry.js";
import type { AuthStorage } from "../../core/auth-storage.js";
import type { SettingsManager } from "../../core/settings-manager.js";
import type { CompletedItem } from "../app-items.js";
interface UseContextCompactionOptions {
    currentModel: string;
    currentProvider: Provider;
    maxTokens: number;
    authStorage?: AuthStorage;
    contextWindowOptions: ContextWindowOptions;
    activeApiKey: string | undefined;
    activeAccountId: string | undefined;
    activeProjectId: string | undefined;
    activeBaseUrl: string | undefined;
    setLiveItems: Dispatch<SetStateAction<CompletedItem[]>>;
    getId: () => string;
    approvedPlanPathRef: MutableRefObject<string | undefined>;
    settingsRef: MutableRefObject<SettingsManager | null>;
    messagesRef: MutableRefObject<Message[]>;
    lastActualTokensRef: MutableRefObject<number>;
    lastActualTokensTimestampRef: MutableRefObject<number>;
    persistCompactedSession: (compactedMessages: readonly Message[]) => Promise<void>;
}
export interface ContextCompaction {
    compactionAbortRef: MutableRefObject<AbortController | null>;
    compactConversation: (messages: Message[], signal?: AbortSignal) => Promise<Message[]>;
    transformContext: (messages: Message[], options?: {
        force?: boolean;
    }) => Promise<Message[]>;
}
/**
 * Owns context compaction: the manual `compactConversation` flow (spinner +
 * credential resolution + abort handling) and the `transformContext` callback
 * the agent loop calls before each turn / on overflow. Extracted verbatim from
 * `App.tsx`.
 */
export declare function useContextCompaction({ currentModel, currentProvider, maxTokens, authStorage, contextWindowOptions, activeApiKey, activeAccountId, activeProjectId, activeBaseUrl, setLiveItems, getId, approvedPlanPathRef, settingsRef, messagesRef, lastActualTokensRef, lastActualTokensTimestampRef, persistCompactedSession, }: UseContextCompactionOptions): ContextCompaction;
export {};
//# sourceMappingURL=useContextCompaction.d.ts.map