Kaynağa Gözat

feat(core): add 6 CodingPlan providers with deploymentName (total 42)

fanghanjun 6 ay önce
ebeveyn
işleme
3cc2094df2

+ 26 - 2
packages/core/src/__tests__/providers-schema.test.ts

@@ -100,7 +100,31 @@ describe("providers structural integrity", () => {
     expect(getProvider("higress")?.baseUrl).toBe("");
   });
 
-  it("B4:总 provider 数 = 36", () => {
-    expect(getAllProviders().length).toBe(36);
+  it("B4:总 provider 数 = 36(不含 CodingPlan)", () => {
+    const nonCoding = getAllProviders().filter((p) => !p.id.endsWith("CodingPlan"));
+    expect(nonCoding.length).toBe(36);
+  });
+
+  it("B6:CodingPlan 6 个 provider 全部收录", () => {
+    const ids = getAllProviders().map((p) => p.id);
+    for (const id of [
+      "kimiCodingPlan", "minimaxCodingPlan", "bailianCodingPlan",
+      "glmCodingPlan", "volcengineCodingPlan", "opencodeCodingPlan",
+    ]) {
+      expect(ids).toContain(id);
+    }
+  });
+
+  it("B6:总 provider 数 = 42 (36 base + 6 CodingPlan)", () => {
+    expect(getAllProviders().length).toBe(42);
+  });
+
+  it("B6:CodingPlan provider 都走 anthropic-messages", () => {
+    for (const id of [
+      "kimiCodingPlan", "minimaxCodingPlan", "bailianCodingPlan",
+      "glmCodingPlan", "volcengineCodingPlan", "opencodeCodingPlan",
+    ]) {
+      expect(getProvider(id)?.api).toBe("anthropic-messages");
+    }
   });
 });

+ 23 - 0
packages/core/src/llm/providers/bailianCodingPlan.ts

@@ -0,0 +1,23 @@
+import type { InkosProvider } from "./types.js";
+
+export const BAILIAN_CODING_PLAN: InkosProvider = {
+  id: "bailianCodingPlan",
+  label: "百炼 Coding Plan",
+  api: "anthropic-messages",
+  baseUrl: "https://dashscope.aliyuncs.com/apps/anthropic",
+  piProvider: "anthropic",
+  checkModel: "qwen-max",
+  temperatureRange: [0, 2],
+  defaultTemperature: 0.7,
+  writingTemperature: 1,
+  models: [
+    { id: "qwen3.5-plus", displayName: "Qwen3.5 Plus", maxOutput: 65536, contextWindowTokens: 1000000, abilities: { reasoning: true, vision: true, functionCall: true }, enabled: true, releasedAt: "2026-02-15" },
+    { id: "qwen3-coder-plus", displayName: "Qwen3 Coder Plus", maxOutput: 65536, contextWindowTokens: 1000000, abilities: { functionCall: true }, releasedAt: "2025-09-23" },
+    { id: "qwen3-max-2026-01-23", displayName: "Qwen3 Max", maxOutput: 65536, contextWindowTokens: 262144, abilities: { reasoning: true, functionCall: true }, enabled: true, releasedAt: "2026-01-23" },
+    { id: "qwen3-coder-next", displayName: "Qwen3 Coder Next", maxOutput: 65536, contextWindowTokens: 262144, abilities: { functionCall: true }, releasedAt: "2026-02-15" },
+    { id: "glm-5", displayName: "GLM-5", maxOutput: 131072, contextWindowTokens: 200000, abilities: { reasoning: true, functionCall: true }, enabled: true, releasedAt: "2026-02-12" },
+    { id: "glm-4.7", displayName: "GLM-4.7", maxOutput: 131072, contextWindowTokens: 200000, abilities: { reasoning: true, functionCall: true }, enabled: true, releasedAt: "2025-12-01" },
+    { id: "kimi-k2.5", displayName: "Kimi K2.5", maxOutput: 32768, contextWindowTokens: 262144, abilities: { reasoning: true, vision: true, functionCall: true }, enabled: true, releasedAt: "2026-01-27" },
+    { id: "MiniMax-M2.5", displayName: "MiniMax-M2.5", maxOutput: 131072, contextWindowTokens: 204800, abilities: { reasoning: true, functionCall: true }, enabled: true, releasedAt: "2026-02-12" },
+  ],
+};

+ 22 - 0
packages/core/src/llm/providers/glmCodingPlan.ts

@@ -0,0 +1,22 @@
+import type { InkosProvider } from "./types.js";
+
+export const GLM_CODING_PLAN: InkosProvider = {
+  id: "glmCodingPlan",
+  label: "GLM Coding Plan",
+  api: "anthropic-messages",
+  baseUrl: "https://api.z.ai/api/anthropic",
+  piProvider: "anthropic",
+  checkModel: "glm-5.1",
+  temperatureRange: [0, 1],
+  defaultTemperature: 0.95,
+  writingTemperature: 0.95,
+  models: [
+    { id: "GLM-5.1", displayName: "GLM-5.1", maxOutput: 131072, contextWindowTokens: 204800, abilities: { reasoning: true, functionCall: true }, enabled: true, releasedAt: "2026-03-27" },
+    { id: "GLM-5", displayName: "GLM-5", maxOutput: 131072, contextWindowTokens: 200000, abilities: { reasoning: true, functionCall: true }, enabled: true, releasedAt: "2026-02-12" },
+    { id: "GLM-5-Turbo", displayName: "GLM-5-Turbo", maxOutput: 131072, contextWindowTokens: 200000, abilities: { reasoning: true, functionCall: true }, enabled: true, releasedAt: "2026-02-12" },
+    { id: "GLM-4.7", displayName: "GLM-4.7", maxOutput: 131072, contextWindowTokens: 200000, abilities: { reasoning: true, functionCall: true }, enabled: true, releasedAt: "2025-12-01" },
+    { id: "GLM-4.6", displayName: "GLM-4.6", maxOutput: 65536, contextWindowTokens: 202752, abilities: { functionCall: true }, releasedAt: "2025-12-01" },
+    { id: "GLM-4.5", displayName: "GLM-4.5", maxOutput: 65536, contextWindowTokens: 202752, abilities: { functionCall: true }, releasedAt: "2025-12-01" },
+    { id: "GLM-4.5-Air", displayName: "GLM-4.5-Air", maxOutput: 65536, contextWindowTokens: 202752, abilities: { functionCall: true }, releasedAt: "2025-12-01" },
+  ],
+};

+ 9 - 0
packages/core/src/llm/providers/index.ts

@@ -39,6 +39,13 @@ import { MISTRAL } from "./mistral.js";
 import { XAI } from "./xai.js";
 import { NEWAPI } from "./newapi.js";
 import { GITHUB_COPILOT } from "./githubCopilot.js";
+// B6 CodingPlan
+import { KIMI_CODING_PLAN } from "./kimiCodingPlan.js";
+import { MINIMAX_CODING_PLAN } from "./minimaxCodingPlan.js";
+import { BAILIAN_CODING_PLAN } from "./bailianCodingPlan.js";
+import { GLM_CODING_PLAN } from "./glmCodingPlan.js";
+import { VOLCENGINE_CODING_PLAN } from "./volcengineCodingPlan.js";
+import { OPENCODE_CODING_PLAN } from "./opencodeCodingPlan.js";
 
 export type { InkosProvider, InkosModel, ApiProtocol } from "./types.js";
 
@@ -52,6 +59,8 @@ const ALL_PROVIDERS: readonly InkosProvider[] = [
   SPARK, SENSENOVA, TENCENTCLOUD, XIAOMI_MIMO, LONGCAT, INTERNLM,
   MODELSCOPE, GITEEAI, QINIU, HIGRESS, INFINIAI, ZEROONE, AI360,
   OLLAMA, OPENROUTER, CUSTOM, MISTRAL, XAI, NEWAPI, GITHUB_COPILOT,
+  // B6 CodingPlan(6 个)
+  KIMI_CODING_PLAN, MINIMAX_CODING_PLAN, BAILIAN_CODING_PLAN, GLM_CODING_PLAN, VOLCENGINE_CODING_PLAN, OPENCODE_CODING_PLAN,
 ];
 
 const PROVIDERS_BY_ID: Map<string, InkosProvider> = new Map(

+ 18 - 0
packages/core/src/llm/providers/kimiCodingPlan.ts

@@ -0,0 +1,18 @@
+import type { InkosProvider } from "./types.js";
+
+export const KIMI_CODING_PLAN: InkosProvider = {
+  id: "kimiCodingPlan",
+  label: "Kimi Coding Plan",
+  api: "anthropic-messages",
+  baseUrl: "https://api.moonshot.cn/anthropic",
+  piProvider: "anthropic",
+  checkModel: "kimi-k2.5",
+  temperatureRange: [0, 1],
+  defaultTemperature: 1,
+  writingTemperature: 1,
+  temperatureHint: "kimi-k2.5 推荐 temperature=1.0",
+  models: [
+    { id: "kimi-k2.5", displayName: "Kimi K2.5", maxOutput: 32768, contextWindowTokens: 262144, abilities: { reasoning: true, vision: true, functionCall: true }, enabled: true, releasedAt: "2026-01-27", deploymentName: "k2p5" },
+    { id: "kimi-k2-thinking", displayName: "Kimi K2 Thinking", maxOutput: 65536, contextWindowTokens: 262144, abilities: { reasoning: true, functionCall: true }, releasedAt: "2025-11-06" },
+  ],
+};

+ 21 - 0
packages/core/src/llm/providers/minimaxCodingPlan.ts

@@ -0,0 +1,21 @@
+import type { InkosProvider } from "./types.js";
+
+export const MINIMAX_CODING_PLAN: InkosProvider = {
+  id: "minimaxCodingPlan",
+  label: "MiniMax Coding Plan",
+  api: "anthropic-messages",
+  baseUrl: "https://api.minimaxi.com/anthropic",
+  piProvider: "anthropic",
+  checkModel: "MiniMax-M2.7",
+  temperatureRange: [0, 2],
+  defaultTemperature: 0.9,
+  writingTemperature: 0.9,
+  models: [
+    { id: "MiniMax-M2.7", displayName: "MiniMax M2.7", maxOutput: 131072, contextWindowTokens: 204800, abilities: { functionCall: true }, enabled: true, releasedAt: "2026-03-18" },
+    { id: "MiniMax-M2.7-highspeed", displayName: "MiniMax M2.7 Highspeed", maxOutput: 131072, contextWindowTokens: 204800, abilities: { functionCall: true }, releasedAt: "2026-03-18" },
+    { id: "MiniMax-M2.5", displayName: "MiniMax M2.5", maxOutput: 131072, contextWindowTokens: 204800, abilities: { functionCall: true }, enabled: true, releasedAt: "2026-02-12" },
+    { id: "MiniMax-M2.5-highspeed", displayName: "MiniMax M2.5 Highspeed", maxOutput: 131072, contextWindowTokens: 204800, abilities: { functionCall: true }, releasedAt: "2026-02-12" },
+    { id: "MiniMax-M2.1", displayName: "MiniMax M2.1", maxOutput: 131072, contextWindowTokens: 204800, abilities: { functionCall: true }, releasedAt: "2025-12-23" },
+    { id: "MiniMax-M2", displayName: "MiniMax M2", maxOutput: 131072, contextWindowTokens: 204800, abilities: { functionCall: true }, releasedAt: "2025-12-23" },
+  ],
+};

+ 24 - 0
packages/core/src/llm/providers/opencodeCodingPlan.ts

@@ -0,0 +1,24 @@
+import type { InkosProvider } from "./types.js";
+
+export const OPENCODE_CODING_PLAN: InkosProvider = {
+  id: "opencodeCodingPlan",
+  label: "OpenCode Coding Plan",
+  api: "anthropic-messages",
+  baseUrl: "https://opencode.ai/api/anthropic",
+  piProvider: "anthropic",
+  checkModel: "glm-5.1",
+  temperatureRange: [0, 1],
+  defaultTemperature: 0.7,
+  writingTemperature: 1,
+  models: [
+    { id: "glm-5.1", displayName: "GLM-5.1", maxOutput: 32000, contextWindowTokens: 204800, abilities: { reasoning: true, functionCall: true }, enabled: true, releasedAt: "2026-04-07" },
+    { id: "glm-5", displayName: "GLM-5", maxOutput: 32000, contextWindowTokens: 204800, abilities: { reasoning: true, functionCall: true }, enabled: false, releasedAt: "2026-02-11" },
+    { id: "kimi-k2.5", displayName: "Kimi K2.5", maxOutput: 32000, contextWindowTokens: 262144, abilities: { reasoning: true, vision: true, functionCall: true }, enabled: false, releasedAt: "2026-01-27" },
+    { id: "mimo-v2-omni", displayName: "MiMo-V2 Omni", maxOutput: 32000, contextWindowTokens: 262144, abilities: { reasoning: true, vision: true, functionCall: true }, enabled: false, releasedAt: "2026-03-18" },
+    { id: "qwen3.6-plus", displayName: "Qwen3.6 Plus", maxOutput: 32000, contextWindowTokens: 262144, abilities: { reasoning: true, vision: true, functionCall: true }, enabled: true, releasedAt: "2026-04-02" },
+    { id: "minimax-m2.5", displayName: "MiniMax M2.5", maxOutput: 32000, contextWindowTokens: 204800, abilities: { reasoning: true, functionCall: true }, enabled: false, releasedAt: "2026-02-12" },
+    { id: "minimax-m2.7", displayName: "MiniMax M2.7", maxOutput: 32000, contextWindowTokens: 204800, abilities: { reasoning: true, functionCall: true }, enabled: true, releasedAt: "2026-03-18" },
+    { id: "mimo-v2-pro", displayName: "MiMo-V2 Pro", maxOutput: 32000, contextWindowTokens: 1048576, abilities: { reasoning: true, functionCall: true }, enabled: false, releasedAt: "2026-03-18" },
+    { id: "qwen3.5-plus", displayName: "Qwen3.5 Plus", maxOutput: 32000, contextWindowTokens: 262144, abilities: { reasoning: true, vision: true, functionCall: true }, enabled: false, releasedAt: "2026-02-16" },
+  ],
+};

+ 23 - 0
packages/core/src/llm/providers/volcengineCodingPlan.ts

@@ -0,0 +1,23 @@
+import type { InkosProvider } from "./types.js";
+
+export const VOLCENGINE_CODING_PLAN: InkosProvider = {
+  id: "volcengineCodingPlan",
+  label: "火山 Coding Plan",
+  api: "anthropic-messages",
+  baseUrl: "https://ark.cn-beijing.volces.com/api/v3/anthropic",
+  piProvider: "anthropic",
+  checkModel: "doubao-seed-code",
+  temperatureRange: [0, 1],
+  defaultTemperature: 0.7,
+  writingTemperature: 1,
+  models: [
+    { id: "doubao-seed-code", displayName: "Doubao Seed Code", maxOutput: 32000, contextWindowTokens: 256000, abilities: { reasoning: true, vision: true, functionCall: true }, enabled: true, releasedAt: "2025-11-01", deploymentName: "doubao-seed-code-preview-251028" },
+    { id: "doubao-seed-2.0-code", displayName: "Doubao Seed 2.0 Code", maxOutput: 128000, contextWindowTokens: 256000, abilities: { reasoning: true, vision: true, functionCall: true }, enabled: true, releasedAt: "2026-02-15", deploymentName: "doubao-seed-2-0-code-preview-260215" },
+    { id: "doubao-seed-2.0-pro", displayName: "Doubao Seed 2.0 Pro", maxOutput: 128000, contextWindowTokens: 256000, abilities: { reasoning: true, vision: true, functionCall: true }, enabled: true, releasedAt: "2026-02-15", deploymentName: "doubao-seed-2-0-pro-260215" },
+    { id: "doubao-seed-2.0-lite", displayName: "Doubao Seed 2.0 Lite", maxOutput: 128000, contextWindowTokens: 256000, abilities: { reasoning: true, vision: true, functionCall: true }, enabled: true, releasedAt: "2026-02-15", deploymentName: "doubao-seed-2-0-lite-260215" },
+    { id: "MiniMax-M2.5", displayName: "MiniMax M2.5", maxOutput: 131072, contextWindowTokens: 204800, abilities: { reasoning: true, functionCall: true }, enabled: true, releasedAt: "2026-02-12" },
+    { id: "glm-4.7", displayName: "GLM-4.7", maxOutput: 131072, contextWindowTokens: 200000, abilities: { reasoning: true, functionCall: true }, enabled: true, releasedAt: "2025-12-01" },
+    { id: "deepseek-v3.2", displayName: "DeepSeek-V3.2", maxOutput: 65536, contextWindowTokens: 262144, abilities: { reasoning: true, functionCall: true }, enabled: true, releasedAt: "2025-12-01" },
+    { id: "kimi-k2.5", displayName: "Kimi K2.5", maxOutput: 32768, contextWindowTokens: 262144, abilities: { reasoning: true, vision: true, functionCall: true }, enabled: true, releasedAt: "2026-01-27" },
+  ],
+};