/**
 * Client for talking to a remote streaming endpoint that fronts the model. It
 * opens an SSE connection, decodes the line-delimited proxy events, and rebuilds
 * the assistant message incrementally so the result matches a direct stream.
 */
import { EventStream, type AssistantMessage, type AssistantMessageEvent, type Context, type Model, type SimpleStreamOptions, type StopReason } from "../ml/index.js";
declare class ProxyMessageEventStream extends EventStream<AssistantMessageEvent, AssistantMessage> {
    constructor();
}
export type ProxyAssistantMessageEvent = {
    type: "start";
} | {
    type: "text_start";
    contentIndex: number;
} | {
    type: "text_delta";
    contentIndex: number;
    delta: string;
} | {
    type: "text_end";
    contentIndex: number;
    contentSignature?: string;
} | {
    type: "thinking_start";
    contentIndex: number;
} | {
    type: "thinking_delta";
    contentIndex: number;
    delta: string;
} | {
    type: "thinking_end";
    contentIndex: number;
    contentSignature?: string;
} | {
    type: "toolcall_start";
    contentIndex: number;
    id: string;
    toolName: string;
} | {
    type: "toolcall_delta";
    contentIndex: number;
    delta: string;
} | {
    type: "toolcall_end";
    contentIndex: number;
} | {
    type: "done";
    reason: Extract<StopReason, "stop" | "length" | "toolUse">;
    usage: AssistantMessage["usage"];
} | {
    type: "error";
    reason: Extract<StopReason, "aborted" | "error">;
    errorMessage?: string;
    usage: AssistantMessage["usage"];
};
export interface RetryConfig {
    maxAttempts?: number;
    baseDelayMs?: number;
    maxDelayMs?: number;
}
export interface ProxyStreamOptions extends SimpleStreamOptions {
    authToken: string;
    getAuthToken?: () => Promise<string>;
    proxyUrl: string;
    timeoutMs?: number;
    retry?: RetryConfig;
    logger?: (message: string, meta?: Record<string, unknown>) => void;
}
export declare function streamProxy(model: Model<any>, context: Context, options: ProxyStreamOptions): ProxyMessageEventStream;
export {};
