import type { KeyHandle } from "../runtime/infra/key-pool.js";
import type { ModelPurpose } from "../runtime/infra/model-registry.js";
import type { TurnConfig } from "../agent/types.js";
import { type LLMTransport, type ProviderRegistry } from "./provider-core-facade.js";
export interface ResolvedModelClient {
    transport: LLMTransport;
    apiKey: string;
    model: string;
}
export interface ResolvedTextGenerationConfig {
    provider: string;
    model: string;
    apiKey: string;
    baseUrl?: string;
    configKey: string;
}
export type KeyHandleProvider = () => KeyHandle | null | undefined;
type ModelClientResolverDeps = {
    purpose: ModelPurpose;
    providerRegistry: ProviderRegistry;
    currentProvider: string;
    currentTransport: LLMTransport | null;
};
export declare function wrapTransportWithKeyHandleProvider(transport: LLMTransport, acquireKeyHandle: KeyHandleProvider): LLMTransport;
export declare function wrapTransportWithKeyHandle(transport: LLMTransport, keyHandle?: KeyHandle): LLMTransport;
export declare function takeTextGenerationKeyHandleProvider(config: ResolvedTextGenerationConfig): KeyHandleProvider;
export declare function releaseUnusedTextGenerationKeyHandle(config: ResolvedTextGenerationConfig): void;
export declare function resolveTextGenerationConfig(config: TurnConfig, log?: (message: string) => void): ResolvedTextGenerationConfig | null;
export declare function resolveModelClientForPurpose(deps: ModelClientResolverDeps): ResolvedModelClient | null;
export declare function withResolvedModelClient<T>(deps: ModelClientResolverDeps, fn: (client: ResolvedModelClient) => T | Promise<T>): Promise<T | null>;
export {};
