/**
 * provider-router — Anthropic → Groq cascade for agent loops.
 *
 * Contract:
 *   1. Prefer Anthropic if configured; on rate-limit (429) or timeout, fall
 *      back to Groq. On both failing, invoke `queueRetryFn` (BullMQ owns
 *      retry scheduling) then throw.
 *   2. Normalize tool-call shape across providers to `{name, args:object}`.
 *      Anthropic returns `tool_use` blocks with parsed `input`; Groq returns
 *      OpenAI-style `tool_calls[].function.arguments` as a JSON string.
 *   3. `usage.inputTokens` / `usage.outputTokens` are always finite numbers.
 */
export interface ProviderRouterRequest {
    messages: Array<{
        role: string;
        content: string;
        toolName?: string;
    }>;
    tools?: unknown[];
    maxTokens?: number;
}
export interface ProviderRouterResponse {
    content: string;
    toolCalls: Array<{
        name: string;
        args: unknown;
    }>;
    usage: {
        inputTokens: number;
        outputTokens: number;
    };
    provider: string;
    latencyMs: number;
}
export interface ProviderRouter {
    complete(request: ProviderRouterRequest): Promise<ProviderRouterResponse>;
}
export interface ProviderRouterOptions {
    preferAnthropic?: boolean;
    anthropicApiKey?: string;
    groqApiKey?: string;
    queueRetryFn?: (req: unknown) => Promise<void>;
    model?: {
        anthropic?: string;
        groq?: string;
    };
    /** Injected for tests — Anthropic SDK client. */
    anthropicClient?: AnthropicLike;
    /** Injected for tests — fetch used to call Groq. */
    fetchImpl?: typeof fetch;
}
export interface AnthropicLike {
    messages: {
        create(params: Record<string, unknown>): Promise<unknown>;
    };
}
export declare class ProviderRouterError extends Error {
    readonly cause?: unknown | undefined;
    constructor(message: string, cause?: unknown | undefined);
}
export declare function createProviderRouter(opts?: ProviderRouterOptions): ProviderRouter;
//# sourceMappingURL=provider-router.d.ts.map