/** * OpenAI Responses HTTP wire-format ↔ omp Context bridge for the auth-gateway. * * Inbound: parses `POST /v1/responses` request bodies into a {@link ParsedRequest}. * Outbound: encodes omp's {@link AssistantMessage} (and event stream) back into * the documented `response.*` SSE taxonomy or the non-streaming JSON shape. * * Spec: https://platform.openai.com/docs/api-reference/responses * Inverse direction (source-of-truth for item shapes): ../../providers/openai-responses.ts */ import type { AuthGatewayStreamControl, AuthGatewayParsedRequest as ParsedRequest } from "../auth-gateway/types"; import type { AssistantMessage, AssistantMessageEventStream } from "../types"; export type { ParsedRequest }; export declare function parseRequest(body: unknown, headers?: Headers): ParsedRequest; export declare function formatError(status: number, type: string, message: string): Response; export declare function encodeResponse(message: AssistantMessage, requestedModelId: string): Record; export declare function encodeStream(events: AssistantMessageEventStream, requestedModelId: string, _options?: ParsedRequest["options"], control?: AuthGatewayStreamControl): ReadableStream;