import type { AssistantMessage, AssistantMessageEventStream } from "../types"; /** * Anthropic Messages API (https://docs.anthropic.com/en/api/messages) ↔ pi-ai * gateway translation. Inbound: foreign HTTP body → omp Context. Outbound: * omp AssistantMessage[Stream] → Anthropic-shaped JSON / SSE. */ import type { AuthGatewayStreamControl, AuthGatewayParsedRequest as ParsedRequest } from "../auth-gateway/types"; export type { ParsedRequest }; export declare function parseRequest(body: unknown, headers?: Headers): ParsedRequest; export declare function encodeResponse(message: AssistantMessage, requestedModelId: string): Record; export declare function encodeStream(events: AssistantMessageEventStream, requestedModelId: string, _options?: ParsedRequest["options"], control?: AuthGatewayStreamControl): ReadableStream; /** * Anthropic error envelope: `{ type: "error", error: { type, message } }`. * See https://docs.anthropic.com/en/api/errors. Returned as a `Response` so * the gateway can hand it straight back to the client without extra wrapping. */ export declare function formatError(status: number, type: string, message: string): Response;