feat(ai): refactor provider definitions (#11368)

This builds the model catalog from per-provider definitions and
models.dev v2 data.

It eplacer `generate-models.ts` with one `defineProvider()` file per
built-in provider, shared model-family rules (Claude, GPT, DeepSeek,
Kimi, Google), and source adapters. models.dev is read through its v2
API. Outputs and CLI flags are unchanged.
This commit is contained in:
Armin Ronacher 2026-10-28 11:06:10 +01:00 • committed by GitHub
parent 068e972c7b
commit 2e0f175bd5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
120 changed files with 3952 additions and 3899 deletions

View file

@ -63,7 +63,11 @@ const currentThinkingOutput = join(temporaryRoot, "after-thinking");
let worktreeAdded = false;
function generateCatalog(cwd, outputDir, pretty = false) {
const args = ["packages/ai/scripts/generate-models.ts", "--strict", "--json-only", "--json-output", outputDir];
// Baselines from before the catalog moved still have the old generator.
const generator = existsSync(join(cwd, "packages/ai/catalog/generate.ts"))
? "packages/ai/catalog/generate.ts"
: "packages/ai/scripts/generate-models.ts";
const args = [generator, "--strict", "--json-only", "--json-output", outputDir];
if (pretty) args.push("--pretty");
run(process.execPath, args, { cwd, capture: true });
}