import type { IncomingMessage, ServerResponse } from "node:http"; import { type Backend } from "../providers/backend.js"; import { RoutingBackend } from "../routing/router.js"; /** * M3 coverage: the OpenAI Responses adapter (Codex) against a mock OpenAI * chat backend. Verifies request translation (instructions, input items, * function-call outputs, tools), the non-streaming `response` object, and the * streamed Responses event sequence. */ type Mock = { url: string; lastChatBody: () => Record | undefined; lastModelCallId: () => string | undefined; close: () => Promise; }; declare function sendJson(res: ServerResponse, status: number, value: unknown): void; declare function readAll(req: IncomingMessage): Promise; declare function startMock(): Promise; declare function chatOnlyOpenAiBackend(baseUrl: string, defaultModel: string): Backend; declare const PATCH = "*** Begin Patch\n*** Update File: a.md\n@@\n-old\n+new\n*** End Patch\n"; declare function sseStream(...chunks: string[]): ReadableStream; declare function chatChunk(delta: Record, finish?: string | null): string; declare const TOOL_SEARCH_DECL: { type: string; execution: string; description: string; parameters: { type: string; properties: { query: { type: string; }; limit: { type: string; }; }; required: string[]; }; }; declare const WEB_SEARCH_DECL: { type: string; external_web_access: boolean; }; declare function codexAliasBackend(sourceCalls: string[]): Promise; export type { Mock }; export { chatChunk, chatOnlyOpenAiBackend, codexAliasBackend, PATCH, readAll, sendJson, sseStream, startMock, TOOL_SEARCH_DECL, WEB_SEARCH_DECL };