import { type AssistantMessage } from "./anthropic.js"; /** * Fallback id for a message whose source response carried none. * * NOT a constant: `msg_repair` was emitted for every repaired turn, so two different * responses in one session were indistinguishable to anything keying off the id — and * because it was emitted even when the backend HAD supplied a real id, the client's view * of the conversation silently disagreed with the provider's. The prefix marks it as * relay-synthesized so nobody mistakes it for something the provider can be asked about. * * Exported because the buffered (non-streamed) repair path needs the SAME fallback: it had * its own hardcoded `msg_repair`, so the two paths disagreed about what an unknown id looks * like. One definition, one prefix. */ export declare function syntheticMessageId(): string; /** * Serialize an AssistantMessage into an Anthropic SSE byte string — the inverse * of reconstructFromSse. Used by repair mode to re-emit a reshaped (or original) * response as a fresh stream when the client asked for streaming. Emits the * event choreography the Claude harness expects: * message_start → (content_block_start → delta → stop)* → message_delta → message_stop * * The backend's own `id`, `model` and `usage` are re-emitted whenever the message * carries them, so a repair does not rewrite the response's identity. Whatever it did * not carry is synthesized (id) or omitted (model, usage) — never zero-filled. */ export declare function emitSse(msg: AssistantMessage): string; /** * Serialize ONLY the trailing content blocks (from `startIndex` onward) plus the * message terminators — no `message_start`, no earlier blocks. Used by streaming * repair: the proxy has already forwarded `message_start` and any leading text * blocks byte-for-byte, then withheld from the first tool_use block. When a repair * lands, this re-emits just the (corrected) tool_use blocks at their original * indices so the client sees one coherent, contiguous stream. */ export declare function emitSseTail(msg: AssistantMessage, startIndex: number): string;