import { type WireRequest, type WireTurn } from './openai-wire.js'; type Row = Record; /** A message's content as text: a string, or its text blocks (and the text of its tool results) joined. */ export declare const messagesText: (content: unknown) => string; /** The last user message's text. */ export declare function messagesLastUserText(messages: Row[]): string; /** The tool results the last message carries, by the names of the tool_use blocks they answer. */ export declare function messagesToolResults(messages: Row[]): string[]; /** A Messages request as a scenario reads it (the OpenAI wire's `WireRequest`): its model, its system and messages' * text, its last user text, the tools it offers and the tool results it ends with. */ export declare function messagesWireRequest(body: Row): WireRequest; /** The labeled stub for a Messages request: with tools offered (`tool_choice` not `none`) and the last message not a * tool's result, it calls the tool the choice names, else the first, with input its schema admits; with a JSON schema * for the output, it answers a value the schema admits; otherwise it echoes the last user message. `label` names the * twin. */ export declare function messagesStubTurn(body: Row, label: string): WireTurn; export type MessageShape = { id: string; model: string; turn: WireTurn; body: Row; /** each tool_use block's id, and the thinking block's signature */ toolId: (i: number) => string; signature?: (thinking: string) => string; /** usage fields the vendor adds (service_tier, the prompt cache's counts) */ usage?: Row; }; /** A message (`type: message`): a thinking block when the request turns thinking on, then the * text, then the tool_use blocks; its stop reason, and its usage estimated from the request and the answer. A text * longer than `max_tokens` is cut there and stops `max_tokens`. */ export declare function message(s: MessageShape): Row; /** A message as the stream's events: message_start (its content empty), per block its start, deltas and stop (a ping * after the first start), message_delta with the stop reason and the output usage, message_stop. `extra` adds fields * a vendor puts on the two closing events (Merge's `routing`). */ export declare function messageSSE(m: Row, extra?: Row, options?: { ping?: boolean; completeToolInput?: boolean; }): string; /** An admitted Messages generation failure is an error SSE event, or the native JSON envelope. */ export declare function messageFailure(error: Row, stream: boolean, requestId?: string): Row | string; export {};