import type { LanguageModelV3 } from "@ai-sdk/provider";
import type { ModelMessage, LanguageModel } from "ai";
import type { Tool } from "../agent/tools2/types.js";
import type { AppShell } from "../app-interface/shell.js";
import type { ChatSessionStore } from "../chat/chat-session-store.js";
import type { PromptCostUsageEntry } from "../chat/chat-session-store.js";
import { LLMObsTracer } from "../llmobs/tracer.js";
import type { EditorClient } from "../types.js";
import type { ContextOptionsV2 } from "./context-v2/config.js";
import type { ContextManagerV2 } from "./context-v2/index.js";
import type { ContextId } from "./context-v2/types.js";
import type { StreamTextResult, StreamTextProvider } from "./interaction/provider.js";
import type { StreamTextOptions } from "./interaction/provider.js";
import { type ProviderType, type CoreModelType, type FallbackStrategy, type LogRef, type RetryConfigOptions, type StreamObserver } from "./stream/index.js";
export interface LLMClientStreamTextOptions<TOOLS extends Record<string, Tool>> extends Omit<StreamTextOptions<TOOLS>, "messages"> {
    context?: {
        contextId?: ContextId;
        messages?: ModelMessage[];
        contextOptionsV2?: Partial<ContextOptionsV2>;
    };
    logging?: {
        conversationId?: string;
        logRef?: LogRef;
        metadata?: Record<string, unknown>;
    } | false;
    retry?: RetryConfigOptions;
    providerConfig: {
        provider: ProviderType;
        model: CoreModelType;
    };
    /**
     * Thinking knobs for the model. When set, the orchestrator will rebuild
     * provider-specific thinking options per attempt based on the current
     * model (required because `claude-opus-4-7` uses adaptive+effort while
     * other models use `thinking.type: "enabled"` with a budget).
     */
    thinking?: {
        enabled: boolean;
        budgetTokens: number;
        interleaved: boolean;
    };
    enableFallback?: boolean;
    fallbackStrategy?: FallbackStrategy;
    peer?: EditorClient;
    chatSessionStore?: ChatSessionStore;
    observers?: StreamObserver[];
    /** Model to use for summarization during context compaction. Should be a fast model like Haiku. */
    summarizationModel?: LanguageModel;
    /** Safety features configuration for this request */
    safety?: {
        /** Unified scope for all safety features */
        scope?: "all" | "last";
        /** Safety classification config */
        classification?: {
            enabled: boolean;
            model?: LanguageModelV3;
            timeout?: number;
            failOpen?: boolean;
        };
        /** Secret redaction config */
        secretRedaction?: {
            level?: "full" | "initial-prompt" | "off";
        };
    };
}
export interface LLMClientParameters {
    contextManagerV2: ContextManagerV2;
    appShell: AppShell;
    baseProvider?: StreamTextProvider;
    retryOptions?: RetryConfigOptions;
    unifiedProviderEnabled?: boolean;
    organizationId?: string;
    applicationId?: string;
    getJwt?: () => string | undefined;
    onUsageRecorded?: (usage: {
        toolCalls: number;
        stepCount: number;
        linesAdded: number;
        linesEdited: number;
        linesRemoved: number;
        promptCostUsageEntries: PromptCostUsageEntry[];
    }) => void;
}
/**
 * Extracts text content from a user message.
 *
 * @param user - The user message to extract text from
 * @param scope - Which text parts to extract: "all" (default) or "last" (user prompt only)
 * @returns Extracted text content
 */
export declare function extractTextFromMessage(message: ModelMessage, scope?: "all" | "last"): string;
export declare class LLMClient {
    private readonly contextManagerV2;
    private readonly appShell;
    private readonly baseProvider;
    private readonly retryOptions?;
    private readonly unifiedProviderEnabled;
    private readonly organizationId?;
    private readonly applicationId?;
    private readonly getJwt?;
    private readonly onUsageRecorded?;
    private readonly logger;
    constructor(params: LLMClientParameters);
    /**
     * Applies safety classification to a user message.
     *
     * @param user - The user message to classify
     * @param userText - The extracted text to classify
     * @param config - Safety classification configuration
     * @returns Object containing the processed message and classification result
     */
    private applySafetyClassification;
    streamText<TOOLS extends Record<string, Tool>>(options: LLMClientStreamTextOptions<TOOLS>, logger?: import("../../util/logger.js").Logger, tracer?: LLMObsTracer): Promise<StreamTextResult<TOOLS>>;
    private createContext;
}
//# sourceMappingURL=client.d.ts.map