/**
 * @plan PLAN-20251023-STATELESS-HARDENING.P08
 * @requirement REQ-SP2-001
 * @project-plans/debuglogging/requirements.md
 */
import { type IModel } from '../IModel.js';
import type { ToolFormat } from '../../tools/IToolFormatter.js';
import { type IProviderConfig } from '../types/IProviderConfig.js';
import { BaseProvider, type NormalizedGenerateChatOptions } from '../BaseProvider.js';
import { type OAuthManager } from '../../auth/precedence.js';
import { type IContent } from '../../services/history/IContent.js';
/**
 * Rate limit information from Anthropic API response headers
 */
export interface AnthropicRateLimitInfo {
    requestsLimit?: number;
    requestsRemaining?: number;
    requestsReset?: Date;
    tokensLimit?: number;
    tokensRemaining?: number;
    tokensReset?: Date;
    inputTokensLimit?: number;
    inputTokensRemaining?: number;
}
export declare class AnthropicProvider extends BaseProvider {
    private static modelTokenPatterns;
    private lastRateLimitInfo?;
    constructor(apiKey?: string, baseURL?: string, config?: IProviderConfig, oauthManager?: OAuthManager);
    /**
     * Implementation of BaseProvider abstract method
     * Determines if this provider supports OAuth authentication
     */
    protected supportsOAuth(): boolean;
    private getLogger;
    private getStreamingLogger;
    private getToolsLogger;
    private getAuthLogger;
    private getErrorsLogger;
    private getCacheLogger;
    private getRateLimitLogger;
    private instantiateClient;
    /**
     * @plan PLAN-20251023-STATELESS-HARDENING.P08
     * @requirement REQ-SP4-002
     * @project-plans/20251023stateless4/analysis/pseudocode/provider-cache-elimination.md line 11
     * Build provider client per call with fresh SDK instance
     */
    private buildProviderClient;
    /**
     * @plan PLAN-20251023-STATELESS-HARDENING.P08
     * @requirement REQ-SP4-002
     * @project-plans/20251023stateless4/analysis/pseudocode/provider-cache-elimination.md line 15
     * No operation - stateless provider has no cache to clear
     */
    clearClientCache(_runtimeKey?: string): void;
    clearAuthCache(): void;
    getModels(): Promise<IModel[]>;
    getCurrentModel(): string;
    getDefaultModel(): string;
    /**
     * Returns default model list when no authentication is available
     */
    private getDefaultModels;
    /**
     * Helper method to get the latest Claude 4 model ID for a given tier.
     * This can be used when you want to ensure you're using the latest model.
     * @param tier - The model tier: 'opus', 'sonnet', or 'haiku'
     * @returns The latest model ID for that tier
     */
    getLatestClaude4Model(tier?: 'opus' | 'sonnet' | 'haiku'): string;
    private getMaxTokensForModel;
    private getContextWindowForModel;
    /**
     * Anthropic always requires payment (API key or OAuth)
     */
    isPaidMode(): boolean;
    /**
     * Get the list of server tools supported by this provider
     */
    getServerTools(): string[];
    /**
     * Invoke a server tool (native provider tool)
     */
    invokeServerTool(_toolName: string, _params: unknown, _config?: unknown, _signal?: AbortSignal): Promise<unknown>;
    /**
     * Get current model parameters from SettingsService per call
     * @returns Current parameters or undefined if not set
     * @plan PLAN-20251023-STATELESS-HARDENING.P08
     * @requirement REQ-SP4-003
     * Gets model parameters from SettingsService per call (stateless)
     */
    getModelParams(): Record<string, unknown> | undefined;
    /**
     * Check if the provider is authenticated using any available method
     * Uses the base provider's isAuthenticated implementation
     */
    isAuthenticated(): Promise<boolean>;
    /**
     * Detect the appropriate tool format for the current model/configuration
     * @returns The detected tool format
     */
    detectToolFormat(): ToolFormat;
    getToolFormat(): ToolFormat;
    /**
     * Normalize tool IDs from various formats to Anthropic format
     * Handles IDs from OpenAI (call_xxx), Anthropic (toolu_xxx), and history (hist_tool_xxx)
     */
    private normalizeToAnthropicToolId;
    /**
     * Normalize tool IDs from Anthropic format to history format
     */
    private normalizeToHistoryToolId;
    /**
     * Sort object keys alphabetically for stable JSON serialization
     * This prevents cache invalidation due to key order changes
     */
    private sortObjectKeys;
    /**
     * Merge beta headers, ensuring no duplicates
     */
    private mergeBetaHeaders;
    /**
     * @plan PLAN-20251023-STATELESS-HARDENING.P08
     * @requirement REQ-SP4-002, REQ-SP4-003
     * @project-plans/20251023stateless4/analysis/pseudocode/provider-cache-elimination.md line 11
     */
    protected generateChatCompletionWithOptions(options: NormalizedGenerateChatOptions): AsyncIterableIterator<IContent>;
    private getRetryConfig;
    private shouldRetryAnthropicResponse;
    /**
     * Extract rate limit information from response headers
     */
    private extractRateLimitHeaders;
    /**
     * Check rate limits and log warnings if approaching limits
     */
    private checkRateLimits;
    /**
     * Get current rate limit information
     * Returns the last known rate limit state from the most recent API call
     */
    getRateLimitInfo(): AnthropicRateLimitInfo | undefined;
    /**
     * Wait for rate limit reset if needed based on current rate limit state
     * This proactively throttles requests before they're made to prevent hitting rate limits
     * @private
     */
    private waitForRateLimitIfNeeded;
    /**
     * Sleep for the specified number of milliseconds
     * @private
     */
    private sleep;
}
