import type Anthropic from "@anthropic-ai/sdk"; import type { GenerationSettings, SystemBlock } from "@use-crux/core"; import type { CallArgs } from "@use-crux/core/adapter"; import type { NativeChatRequestArgs } from "@use-crux/core/adapter"; import type { AnthropicExtra, AnthropicRequest } from "./types"; /** Default `max_tokens` when a call site does not provide one. */ export declare const DEFAULT_MAX_TOKENS = 4096; /** * Cast a request body into Anthropic's non-streaming message params. * * The SDK types are intentionally closed over many provider fields, while the * adapter assembles them from canonical settings plus provider-native extras. * This helper keeps that boundary cast in one place. */ export declare function asAnthropicNonStreamingParams(params: Record): Anthropic.MessageCreateParamsNonStreaming; /** * Cast a request body into Anthropic's streaming message params. * * Keep this paired with {@link asAnthropicNonStreamingParams} so request * assembly stays consistent between `call()` and `stream()`. */ export declare function asAnthropicStreamingParams(params: Record): Anthropic.MessageCreateParamsStreaming; /** Build the Anthropic request body from canonical Crux call arguments. */ export declare function anthropicRequest(args: NativeChatRequestArgs): AnthropicRequest; /** * Build the Anthropic `system` request field from Crux system blocks. * * Anthropic supports explicit cache-control breakpoints. Crux marks the * stable-prefix boundary during prompt resolution, so the adapter emits one * native breakpoint on that block instead of marking every cached block. */ export declare function anthropicSystemParam(system: string | undefined, systemBlocks: readonly SystemBlock[] | undefined): string | Anthropic.TextBlockParam[] | undefined; /** * Build Anthropic tool declaration params from either provider-native extras or * canonical Crux tool definitions. */ export declare function anthropicToolParams(tools: CallArgs["tools"], extra: { readonly tools?: readonly Anthropic.ToolUnion[]; readonly tool_choice?: Anthropic.ToolChoice; } | undefined): Record; /** Read Anthropic's required `max_tokens` value from mapped settings. */ export declare function anthropicMaxTokens(settings: Record): number; /** Map canonical generation settings to Anthropic-native request fields. */ export declare function mapAnthropicSettings(settings: GenerationSettings): Record; /** * The JSON Schema behavior Anthropic's structured-output format accepts. * * Anthropic rejects several JSON Schema validation keywords; core drops those * during lowering rather than the adapter sanitizing them. Exact per-keyword and * envelope conformance is finalized in the Anthropic provider slice. */ export declare const anthropicStructuredCapabilities: { id: string; supportsJsonSchema: true; requiresAllProperties: false; supportsOptionalProperties: true; supportsNullable: true; supportsBooleanSchemas: false; supportsReferences: true; supportsUnions: true; supportsRecursiveSchemas: true; additionalProperties: "supported"; unsupportedKeywords: string[]; }; /** * Strip `description` fields from a JSON schema. * * Anthropic rejects tool parameter schemas containing nested descriptions; this * recursively preserves every other field. */ export declare function stripDescriptions(schema: Record): Record;