import type { MessageParam, MessageStreamEvent } from '@anthropic-ai/sdk/resources/messages';
import type { LlmUsageStats } from '@longrun-ai/kernel/types/context-health';
import type { Team } from '../../team';
import type { FuncTool } from '../../tool';
import type { ChatMessage, ProviderConfig } from '../client';
import type { LlmBatchResult, LlmFailureDisposition, LlmGenerator, LlmRequestContext, LlmStreamReceiver, LlmStreamResult } from '../gen';
export type AnthropicStreamConsumeOptions = {
    abortSignal?: AbortSignal;
    forcedJsonToolName?: string;
    genseq?: number;
};
export type AnthropicStreamConsumeResult = {
    usage: LlmUsageStats;
    llmGenModel?: string;
};
export declare function buildAnthropicRequestMessagesWrapper(context: ChatMessage[], requestContextOrProviderConfig?: LlmRequestContext | ProviderConfig, providerConfigMaybe?: ProviderConfig): Promise<MessageParam[]>;
export declare function consumeAnthropicStream(stream: AsyncIterable<MessageStreamEvent>, receiver: LlmStreamReceiver, options?: AnthropicStreamConsumeOptions): Promise<AnthropicStreamConsumeResult>;
/**
 * Reconstruct Anthropic context from persisted messages with genseq tracking.
 * This function groups messages by generation sequence and converts them to
 * Anthropic SDK MessageParam[] format for context restoration.
 *
 * @param persistedMessages - Array of ChatMessage objects with genseq tracking
 * @returns Array of MessageParam objects in Anthropic SDK format
 */
export declare function reconstructAnthropicContextWrapper(persistedMessages: ChatMessage[]): MessageParam[];
export declare function reconstructAnthropicContextWrapperAsync(persistedMessages: ChatMessage[]): Promise<MessageParam[]>;
/**
 * AnthropicGen
 *
 * Implements `LlmGenerator` for Anthropic, mapping tool calls and text deltas
 * and providing both streaming and non-streaming generation.
 */
export declare class AnthropicGen implements LlmGenerator {
    private readonly generatorApiType;
    constructor(generatorApiType?: 'anthropic' | 'anthropic-compatible');
    get apiType(): "anthropic" | "anthropic-compatible";
    classifyFailure(error: unknown): LlmFailureDisposition | undefined;
    genToReceiver(providerConfig: ProviderConfig, agent: Team.Member, systemPrompt: string, funcTools: FuncTool[], requestContext: LlmRequestContext, context: ChatMessage[], receiver: LlmStreamReceiver, genseq: number, abortSignal?: AbortSignal): Promise<LlmStreamResult>;
    genMoreMessages(providerConfig: ProviderConfig, agent: Team.Member, systemPrompt: string, funcTools: FuncTool[], requestContext: LlmRequestContext, context: ChatMessage[], genseq: number, abortSignal?: AbortSignal): Promise<LlmBatchResult>;
}
