/** One scripted assistant turn: the final text answer codex should emit. */ export interface CodexTurn { /** Final text answer for this turn. */ readonly text: string; } /** * One `/v1/responses` request the mock received, parsed for assertions: the * user's prompt (last `input` item with `role:"user"`), the requested model, * and the declared function-tool names. */ export interface CodexRequest { readonly prompt: string; readonly model: string; readonly toolNames: readonly string[]; } export interface CodexMockHandle { readonly url: string; readonly port: number; /** Every `/v1/responses` request the mock received, in order. */ readonly requests: readonly CodexRequest[]; close(): Promise; } /** * Render the PROVEN OpenAI-Responses SSE event sequence for a single assistant * text message — `response.created` through `response.completed`. This exact * sequence is confirmed to make real `codex` complete a turn. Pure and exported * so the renderer is testable without the HTTP server. */ export declare function renderResponsesSSE(text: string, opts?: { model?: string; }): string; /** * Parse a Responses request body — the user's prompt (the LAST `input` item * with `role:"user"`, joining its `content[].text`), the requested `model`, and * the declared function-tool names. Tolerates malformed JSON (returns an empty * prompt). Pure and exported so request capture is testable without the server. */ export declare function parseResponsesRequest(body: string): { prompt: string; model: string; toolNames: string[]; }; /** * Start the scripted Codex Responses mock on a free port. Each * `POST /v1/responses` consumes the next scripted turn; one past the end of the * script is a 400, never a copy of the last turn (#340); HEAD and any other path * get `{}`. Resolves to a handle * with the base `url`, the `port`, the recorded `requests`, and `close()`. */ export declare function startCodexMock(script: readonly CodexTurn[], opts?: { onRequest?: (req: CodexRequest) => void; }): Promise; //# sourceMappingURL=mock-model.d.ts.map