import type { MessageCreateParamsStreaming } from "@anthropic-ai/sdk/resources/messages.js";
import type { Context, Model, SimpleStreamOptions, StreamFunction, StreamOptions } from "../types.js";
import { BaseStreamHandler } from "../kit/base-stream-handler.js";
import { type ProviderLifecycleHooks } from "./simple-options.js";
export interface AnthropicOptions extends StreamOptions {
    thinkingEnabled?: boolean;
    thinkingBudgetTokens?: number;
    interleavedThinking?: boolean;
    toolChoice?: "auto" | "any" | "none" | {
        type: "tool";
        name: string;
    };
}
export interface AnthropicExecutionOptions {
    hooks?: ProviderLifecycleHooks<MessageCreateParamsStreaming, unknown>;
    retryPolicy?: {
        maxAttempts?: number;
        baseDelayMs?: number;
    };
}
/**
 * Assembles the streaming request payload for the Anthropic Messages API.
 *
 * Acts as the single place that turns a generic model/context/options triple
 * into a concrete `MessageCreateParamsStreaming` object.
 */
export declare class AnthropicRequestBuilder {
    private readonly model;
    private readonly context;
    private readonly isOAuthToken;
    private readonly options?;
    constructor(model: Model<"anthropic-messages">, context: Context, isOAuthToken: boolean, options?: AnthropicOptions | undefined);
    /**
     * Produce the parameters passed to the Anthropic streaming endpoint.
     *
     * @returns The fully populated SDK streaming request.
     */
    build(): MessageCreateParamsStreaming;
}
/**
 * Stream handler tailored to Anthropic.
 *
 * Drives the Anthropic SDK stream and forwards normalized assistant events.
 */
export declare class AnthropicStreamHandler extends BaseStreamHandler {
    private readonly executeFn?;
    constructor(executeFn?: (() => Promise<void>) | undefined);
    /**
     * Run the supplied executor, if any, to consume the Anthropic stream.
     */
    protected processStream(): Promise<void>;
    /**
     * Walk the raw SDK stream, handing each event to the supplied callback.
     *
     * @param anthropicStream - Raw async iterable produced by the Anthropic SDK.
     * @param onEvent - Invoked once per streamed event.
     */
    process(anthropicStream: AsyncIterable<unknown>, onEvent: (event: any) => void): Promise<void>;
}
/**
 * Reads a `Retry-After` header off an Anthropic APIError and converts it to a
 * delay in milliseconds. The header is the integer-seconds form per the
 * Anthropic API; a missing/non-numeric value yields `null` so callers fall
 * back to exponential backoff.
 */
export declare function parseAnthropicRetryAfterMs(error: unknown): number | null;
/**
 * Classifies an Anthropic failure as worth retrying. Mirrors
 * `kit/provider-errors.ts:isRetryableError`: transient HTTP statuses (408/409/
 * 429/529/5xx) and an `overloaded_error` body are retryable; auth/validation
 * (401/403/4xx) are not. Generic errors fall back to a message sniff covering
 * network/timeout/overload conditions. The `_attempt` is accepted to satisfy
 * the RetryPolicy.shouldRetry contract but unused here (the loop already caps
 * attempts).
 */
export declare function shouldRetryAnthropic(error: unknown, _attempt: number): boolean;
export declare const streamAnthropic: StreamFunction<"anthropic-messages", AnthropicOptions>;
export declare const streamSimpleAnthropic: StreamFunction<"anthropic-messages", SimpleStreamOptions>;
