import { ProviderError } from '@pellux/goodvibes-sdk/platform/types/errors';
import type { ToolCall, ToolDefinition } from '@pellux/goodvibes-sdk/platform/types/tools';
import type { ChatRequest, ChatResponse, ContentPart, ProviderMessage } from './interface.js';
export type ResponsesInputItem = {
    role: 'user';
    content: Array<{
        type: 'input_text';
        text: string;
    } | {
        type: 'input_image';
        image_url: string;
        detail: 'auto';
    }>;
} | {
    type: 'message';
    role: 'assistant';
    content: Array<{
        type: 'output_text';
        text: string;
        annotations: [];
    }>;
    status: 'completed';
    id: string;
} | {
    type: 'function_call';
    id: string;
    call_id: string;
    name: string;
    arguments: string;
} | {
    type: 'function_call_output';
    call_id: string;
    output: string;
};
export type NativeChatOutputItem = {
    type: 'message';
    content?: string;
} | {
    type: 'reasoning';
    content?: string;
} | {
    type: 'tool_call';
    tool?: string;
    arguments?: Record<string, unknown>;
} | {
    type: 'invalid_tool_call';
    reason?: string;
};
export type NativeChatResult = {
    output?: NativeChatOutputItem[];
    stats?: {
        input_tokens?: number;
        output_tokens?: number;
        total_output_tokens?: number;
    };
    response_id?: string;
};
export type NativeChatContext = {
    input: string | Array<Record<string, unknown>>;
    previousResponseId?: string;
};
export type LMStudioResponsesStream = AsyncIterable<unknown> & {
    finalResponse?: () => Promise<Record<string, unknown>>;
};
export type LMStudioResponsesClient = {
    create(params: Record<string, unknown>, options?: {
        signal?: AbortSignal;
    }): Promise<LMStudioResponsesStream>;
};
export type NativeFetch = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
export declare function createResponsesClient(baseURL: string, apiKey: string, defaultHeaders: Record<string, string> | undefined): LMStudioResponsesClient;
export declare function deriveNativeChatUrl(baseURL: string): string;
export declare function toNativeChatInput(content: string | ContentPart[]): string | Array<Record<string, unknown>>;
export declare function buildResponsesTools(tools?: ToolDefinition[]): Array<Record<string, unknown>> | undefined;
export declare function buildResponsesInput(messages: ProviderMessage[]): ResponsesInputItem[];
export declare function buildResponsesReasoning(reasoningEffort: ChatRequest['reasoningEffort']): Record<string, unknown> | undefined;
export declare function mapNativeReasoningEffort(reasoningEffort: ChatRequest['reasoningEffort']): 'off' | 'low' | 'medium' | 'high' | undefined;
export declare function mapResponsesStopReason(status: string | undefined, toolCalls: ToolCall[]): ChatResponse['stopReason'];
export declare function extractNativeMessageText(output: NativeChatOutputItem[] | undefined): string;
export declare function consumeSSE(body: ReadableStream<Uint8Array>, onEvent: (eventType: string, payload: Record<string, unknown>) => void): Promise<void>;
export declare function buildHttpError(prefix: string, response: Response, provider: string, operation: string, phase: string): Promise<ProviderError>;
export declare function makeTranscriptKey(model: string, systemPrompt: string | undefined, messages: ProviderMessage[]): string;
export declare function parseJsonObject(raw: string): Record<string, unknown>;
export declare function toRecord(value: unknown): Record<string, unknown>;
export declare function shouldFallbackFromNative(err: unknown): boolean;
export declare function shouldFallbackFromResponses(err: unknown): boolean;
export declare function normalizeProviderError(err: unknown, provider: string, operation: string, phase?: string): ProviderError;
//# sourceMappingURL=lm-studio-helpers.d.ts.map