import { type Dispatch, type MutableRefObject, type SetStateAction } from "react"; import type { Message, Provider, Usage } from "@kenkaiiii/gg-ai"; import type { TransformContextOptions } from "@kenkaiiii/gg-agent"; 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; authStorage?: AuthStorage; contextWindowOptions: ContextWindowOptions; activeApiKey: string | undefined; activeAccountId: string | undefined; activeProjectId: string | undefined; activeBaseUrl: string | undefined; setLiveItems: Dispatch>; getId: () => string; approvedPlanPathRef: MutableRefObject; settingsRef: MutableRefObject; messagesRef: MutableRefObject; persistCompactedSession: (compactedMessages: readonly Message[]) => Promise; } export interface ContextCompaction { compactionAbortRef: MutableRefObject; compactConversation: (messages: Message[], signal?: AbortSignal) => Promise; transformContext: (messages: Message[], options: TransformContextOptions) => Promise; recordProviderUsage: (usage: Usage, messages: Message[]) => void; } /** * 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, authStorage, contextWindowOptions, activeApiKey, activeAccountId, activeProjectId, activeBaseUrl, setLiveItems, getId, approvedPlanPathRef, settingsRef, messagesRef, persistCompactedSession, }: UseContextCompactionOptions): ContextCompaction; export {}; //# sourceMappingURL=useContextCompaction.d.ts.map