refactor(registry): B2 migrate to LiteLLM-style schema — unified models[] with kind field

- 71 registry files: flat `media.*Config.models` → `models[]` with `kind` field
- `media` wrapper removed → serviceKinds, *Config fields promoted top-level
- `type` field renamed to `kind` (llm/image/tts/stt/embedding/embedding/video/music)
- providers/index.js: PROVIDER_MEDIA now built from flat top-level media fields
- shared/constants/providers.js: buildProviderEntry reads flat top-level media fields
- route /v1/models: modelKind() uses kind||type; removed subConfig merge block
- models/info route: removed sub-config fallback lookup (all models in PROVIDER_MODELS)
- ttsProviders/index.js: synthesizeViaConfig reads tts models from PROVIDER_MODELS
- test-models route, helpers.js, validate route: kind||type compat
- Baselines: PROVIDERS 62/62 ✅, Alias 90/90 ✅

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
decolua
2026-06-14 14:32:59 +07:00
parent e53ce79abb
commit dd1e0f9bcc
82 changed files with 2518 additions and 3651 deletions

View File

@@ -3,29 +3,49 @@ import { CLAUDE_API_HEADERS, KIMI_CODING_BASE_URL } from "../shared.js";
export default {
id: "kimi-coding",
alias: "kmc",
display: { name: "Kimi Coding", icon: "psychology", color: "#1E40AF", textIcon: "KC", website: "https://kimi.moonshot.cn", notice: { signupUrl: "https://kimi.moonshot.cn" } },
display: {
name: "Kimi Coding",
icon: "psychology",
color: "#1E40AF",
textIcon: "KC",
website: "https://kimi.moonshot.cn",
notice: {
signupUrl: "https://kimi.moonshot.cn",
},
},
category: "oauth",
transport: {
baseUrl: KIMI_CODING_BASE_URL,
baseUrl: "https://api.kimi.com/coding/v1/messages",
format: "claude",
urlSuffix: "?beta=true",
headers: { ...CLAUDE_API_HEADERS },
headers: {
"Anthropic-Version": "2023-06-01",
"Anthropic-Beta": "claude-code-20250219,interleaved-thinking-2025-05-14",
},
clientId: "17e5f671-d194-4dfb-9706-5516cb48c098",
tokenUrl: "https://auth.kimi.com/api/oauth/token",
refreshUrl: "https://auth.kimi.com/api/oauth/token",
auth: {"combined":true,"header":"x-api-key","scheme":"raw","hooks":["kimiHeaders"]},
},
oauth: {
deviceCodeUrl: "https://auth.kimi.com/api/oauth/device_authorization",
tokenUrl: "https://auth.kimi.com/api/oauth/token"
,
refreshLeadMs: 300000
auth: {
combined: true,
header: "x-api-key",
scheme: "raw",
hooks: [
"kimiHeaders",
],
},
},
models: [
{ id: "kimi-k2.6", name: "Kimi K2.6" },
{ id: "kimi-k2.5", name: "Kimi K2.5" },
{ id: "kimi-k2.5-thinking", name: "Kimi K2.5 Thinking" },
{ id: "kimi-latest", name: "Kimi Latest" }
{ id: "kimi-latest", name: "Kimi Latest" },
],
features: {"usage":true},
oauth: {
deviceCodeUrl: "https://auth.kimi.com/api/oauth/device_authorization",
tokenUrl: "https://auth.kimi.com/api/oauth/token",
refreshLeadMs: 300000,
},
features: {
usage: true,
},
};