import { openaiAdapter } from './openai'; import { qwenLocalAdapter } from './qwen-local'; import type { ImageAdapter } from './types'; export * from './types'; /** * Every adapter Atelier can speak — the CODE side. * * An adapter knows a vendor's HTTP API. It is written once and rarely changes. What model to use, * whose key, and whether it is switched on are not its business: those are a `providers` row, made * and edited at runtime. Several providers can share one adapter, which is the entire point — OpenAI * with gpt-image-1 and OpenAI with dall-e-3 are two configurations of one piece of code. * * A list in one place, the way `hono.ts` keeps its mounts: adding an adapter is a new file plus a * line here. */ export const ADAPTERS: ImageAdapter[] = [openaiAdapter, qwenLocalAdapter]; export function adapterByName(name: string): ImageAdapter | undefined { return ADAPTERS.find((adapter) => adapter.name === name); }