/**
 * Provider adapter dispatcher. Selects the right adapter by provider key and
 * exposes a uniform `testConnection` / `listModels` surface to the catalog and
 * route layers.
 */
import * as anthropic from './anthropic.js';
import * as custom from './custom.js';
import * as openai from './openai.js';
import * as xai from './xai.js';
const ADAPTERS = {
    openai,
    anthropic,
    xai,
    custom,
};
export function getAdapter(provider) {
    return ADAPTERS[provider] ?? custom;
}
export function testConnection(provider, ctx) {
    return getAdapter(provider).testConnection(ctx);
}
export function listModels(provider, ctx) {
    return getAdapter(provider).listModels(ctx);
}
export function generateText(provider, ctx, opts) {
    return getAdapter(provider).generateText(ctx, opts);
}
//# sourceMappingURL=index.js.map