/**
 * Builtin Providers
 *
 * 内置提供商定义
 */

import { anthropicProvider, anthropicFactory } from './anthropic.js';
import { openaiProvider, openaiFactory } from './openai.js';
import { deepseekProvider, deepseekFactory } from './deepseek.js';
import type { ProviderInfo, ProviderFactory } from '../types.js';

export interface BuiltinProvider {
  info: ProviderInfo;
  factory: ProviderFactory;
}

/** 所有内置提供商 */
export const builtinProviders: Record<string, BuiltinProvider> = {
  anthropic: {
    info: anthropicProvider,
    factory: anthropicFactory,
  },
  openai: {
    info: openaiProvider,
    factory: openaiFactory,
  },
  deepseek: {
    info: deepseekProvider,
    factory: deepseekFactory,
  },
};

/** 获取所有内置提供商列表 */
export function getBuiltinProviders(): BuiltinProvider[] {
  return Object.values(builtinProviders);
}

/** 获取内置提供商 */
export function getBuiltinProvider(id: string): BuiltinProvider | undefined {
  return builtinProviders[id];
}

/** 检查是否为内置提供商 */
export function isBuiltinProvider(id: string): boolean {
  return id in builtinProviders;
}

export { anthropicProvider, anthropicFactory } from './anthropic.js';
export { openaiProvider, openaiFactory } from './openai.js';
export { deepseekProvider, deepseekFactory } from './deepseek.js';
