/** * @license * Copyright 2025 OSAgent OC * SPDX-License-Identifier: Apache-2.0 */ import type { Content, GenerateContentConfig, GenerateContentResponse, PartListUnion } from '@google/genai'; import { type Config } from '../config/config.js'; import { OSAChat } from './geminiChat.js'; import { Turn, type ChatCompressionInfo, type ServerOSAStreamEvent } from './turn.js'; import { type ChatRecordingService } from '../services/chatRecordingService.js'; import { LoopDetectionService } from '../services/loopDetectionService.js'; export declare function isThinkingSupported(model: string): boolean; export declare function isThinkingDefault(model: string): boolean; export declare class OSAClient { private readonly config; private chat?; private readonly generateContentConfig; private sessionTurnCount; private readonly loopDetector; private lastPromptId; private lastSentIdeContext; private forceFullIdeContext; /** * At any point in this conversation, was compression triggered without * being forced and did it fail? */ private hasFailedCompressionAttempt; constructor(config: Config); initialize(): Promise; private getContentGeneratorOrFail; addHistory(content: Content): Promise; getChat(): OSAChat; isInitialized(): boolean; getHistory(): Content[]; stripThoughtsFromHistory(): void; setHistory(history: Content[]): void; setTools(): Promise; resetChat(): Promise; /** * Recreate the chat with a new system instruction while preserving history and tools. * Used when the system prompt changes mid-session. */ resetChatWithSystemInstruction(sysInstr: string): Promise; getChatRecordingService(): ChatRecordingService | undefined; getLoopDetectionService(): LoopDetectionService; addDirectoryContext(): Promise; startChat(extraHistory?: Content[]): Promise; private getIdeContextParts; sendMessageStream(request: PartListUnion, signal: AbortSignal, prompt_id: string, turns?: number): AsyncGenerator; generateContent(contents: Content[], generationConfig: GenerateContentConfig, abortSignal: AbortSignal, model: string): Promise; tryCompressChat(prompt_id: string, force?: boolean): Promise; } export declare const TEST_ONLY: { COMPRESSION_PRESERVE_THRESHOLD: number; COMPRESSION_TOKEN_THRESHOLD: number; };