/** * Anthropic Messages adapter. Claude Code speaks the Anthropic Messages API to * whatever `ANTHROPIC_BASE_URL` points at, so to back it with a local model we * translate `/v1/messages` (and `/v1/messages/count_tokens`, and the * `/v1/models` discovery probe) to and from the gateway's OpenAI Chat * Completions core. * * Layers: * - `anthropic-wire.ts` — request types * - `anthropic-codec.ts` — JSON request/response translation * - `anthropic-stream.ts` — SSE translation * - `anthropic-models.ts` — Claude picker and `/v1/models` * - this module — HTTP handlers that wire the codec to a `Backend` */ import type { Backend, BackendRequest, BackendRequestOptions } from "../providers/backend.js"; import type { AnthropicRequest } from "./anthropic-wire.js"; export type { AnthropicTranslationOptions } from "./anthropic-codec.js"; export { anthropicToChat, chatToAnthropicMessage, countTokensEstimate, mapStopReason } from "./anthropic-codec.js"; export type { ClaudeModelSelection, ClaudePickerModelRoute } from "./anthropic-models.js"; export { anthropicModelsResponse, CLAUDE_ALIAS_PREFIX, CLAUDE_PICKER_PREFIX, claudePickerClientModel, resolveClaudeModelAlias, resolveClaudeModelSelection, withClaudeReasoningSelection } from "./anthropic-models.js"; export { openAiSseToAnthropic } from "./anthropic-stream.js"; export type { AnthropicRequest } from "./anthropic-wire.js"; export declare function handleAnthropicMessages(backend: Backend, body: AnthropicRequest, modelCallId?: string, signal?: AbortSignal, backendOptions?: BackendRequestOptions): BackendRequest; export declare function handleCountTokens(body: AnthropicRequest): Response;