mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-25 13:45:03 +08:00
faeca6b6ce
- Add MiniMax provider for Claude with extended timeout configuration - Update KAT-Coder URLs and model names to versioned variants (Pro V1/Air V1) - Unify PackyCode domain from codex.packycode.com to www.packyapi.com - Remove redundant comment in Zhipu GLM configuration
229 lines
6.9 KiB
TypeScript
229 lines
6.9 KiB
TypeScript
/**
|
|
* 预设供应商配置模板
|
|
*/
|
|
import { ProviderCategory } from "../types";
|
|
|
|
export interface TemplateValueConfig {
|
|
label: string;
|
|
placeholder: string;
|
|
defaultValue?: string;
|
|
editorValue: string;
|
|
}
|
|
|
|
/**
|
|
* 预设供应商的视觉主题配置
|
|
*/
|
|
export interface PresetTheme {
|
|
/** 图标类型:'claude' | 'codex' | 'generic' */
|
|
icon?: "claude" | "codex" | "generic";
|
|
/** 背景色(选中状态),支持 Tailwind 类名或 hex 颜色 */
|
|
backgroundColor?: string;
|
|
/** 文字色(选中状态),支持 Tailwind 类名或 hex 颜色 */
|
|
textColor?: string;
|
|
}
|
|
|
|
export interface ProviderPreset {
|
|
name: string;
|
|
websiteUrl: string;
|
|
// 新增:第三方/聚合等可单独配置获取 API Key 的链接
|
|
apiKeyUrl?: string;
|
|
settingsConfig: object;
|
|
isOfficial?: boolean; // 标识是否为官方预设
|
|
category?: ProviderCategory; // 新增:分类
|
|
// 新增:模板变量定义,用于动态替换配置中的值
|
|
templateValues?: Record<string, TemplateValueConfig>; // editorValue 存储编辑器中的实时输入值
|
|
// 新增:请求地址候选列表(用于地址管理/测速)
|
|
endpointCandidates?: string[];
|
|
// 新增:视觉主题配置
|
|
theme?: PresetTheme;
|
|
}
|
|
|
|
export const providerPresets: ProviderPreset[] = [
|
|
{
|
|
name: "Claude Official",
|
|
websiteUrl: "https://www.anthropic.com/claude-code",
|
|
settingsConfig: {
|
|
env: {},
|
|
},
|
|
isOfficial: true, // 明确标识为官方预设
|
|
category: "official",
|
|
theme: {
|
|
icon: "claude",
|
|
backgroundColor: "#D97757",
|
|
textColor: "#FFFFFF",
|
|
},
|
|
},
|
|
{
|
|
name: "DeepSeek",
|
|
websiteUrl: "https://platform.deepseek.com",
|
|
settingsConfig: {
|
|
env: {
|
|
ANTHROPIC_BASE_URL: "https://api.deepseek.com/anthropic",
|
|
ANTHROPIC_AUTH_TOKEN: "",
|
|
ANTHROPIC_MODEL: "DeepSeek-V3.2-Exp",
|
|
ANTHROPIC_DEFAULT_HAIKU_MODEL: "DeepSeek-V3.2-Exp",
|
|
ANTHROPIC_DEFAULT_SONNET_MODEL: "DeepSeek-V3.2-Exp",
|
|
ANTHROPIC_DEFAULT_OPUS_MODEL: "DeepSeek-V3.2-Exp",
|
|
},
|
|
},
|
|
category: "cn_official",
|
|
},
|
|
{
|
|
name: "Zhipu GLM",
|
|
websiteUrl: "https://open.bigmodel.cn",
|
|
settingsConfig: {
|
|
env: {
|
|
ANTHROPIC_BASE_URL: "https://open.bigmodel.cn/api/anthropic",
|
|
ANTHROPIC_AUTH_TOKEN: "",
|
|
ANTHROPIC_MODEL: "GLM-4.6",
|
|
ANTHROPIC_DEFAULT_HAIKU_MODEL: "glm-4.5-air",
|
|
ANTHROPIC_DEFAULT_SONNET_MODEL: "glm-4.6",
|
|
ANTHROPIC_DEFAULT_OPUS_MODEL: "glm-4.6",
|
|
},
|
|
},
|
|
category: "cn_official",
|
|
},
|
|
{
|
|
name: "Qwen Coder",
|
|
websiteUrl: "https://bailian.console.aliyun.com",
|
|
settingsConfig: {
|
|
env: {
|
|
ANTHROPIC_BASE_URL:
|
|
"https://dashscope.aliyuncs.com/api/v2/apps/claude-code-proxy",
|
|
ANTHROPIC_AUTH_TOKEN: "",
|
|
ANTHROPIC_MODEL: "qwen3-max",
|
|
ANTHROPIC_DEFAULT_HAIKU_MODEL: "qwen3-max",
|
|
ANTHROPIC_DEFAULT_SONNET_MODEL: "qwen3-max",
|
|
ANTHROPIC_DEFAULT_OPUS_MODEL: "qwen3-max",
|
|
},
|
|
},
|
|
category: "cn_official",
|
|
},
|
|
{
|
|
name: "Kimi k2",
|
|
websiteUrl: "https://platform.moonshot.cn/console",
|
|
settingsConfig: {
|
|
env: {
|
|
ANTHROPIC_BASE_URL: "https://api.moonshot.cn/anthropic",
|
|
ANTHROPIC_AUTH_TOKEN: "",
|
|
ANTHROPIC_MODEL: "kimi-k2-0905-preview",
|
|
ANTHROPIC_DEFAULT_HAIKU_MODEL: "kimi-k2-0905-preview",
|
|
ANTHROPIC_DEFAULT_SONNET_MODEL: "kimi-k2-0905-preview",
|
|
ANTHROPIC_DEFAULT_OPUS_MODEL: "kimi-k2-0905-preview",
|
|
},
|
|
},
|
|
category: "cn_official",
|
|
},
|
|
{
|
|
name: "ModelScope",
|
|
websiteUrl: "https://modelscope.cn",
|
|
settingsConfig: {
|
|
env: {
|
|
ANTHROPIC_BASE_URL: "https://api-inference.modelscope.cn",
|
|
ANTHROPIC_AUTH_TOKEN: "",
|
|
ANTHROPIC_MODEL: "ZhipuAI/GLM-4.6",
|
|
ANTHROPIC_DEFAULT_HAIKU_MODEL: "ZhipuAI/GLM-4.6",
|
|
ANTHROPIC_DEFAULT_SONNET_MODEL: "ZhipuAI/GLM-4.6",
|
|
ANTHROPIC_DEFAULT_OPUS_MODEL: "ZhipuAI/GLM-4.6",
|
|
},
|
|
},
|
|
category: "aggregator",
|
|
},
|
|
{
|
|
name: "KAT-Coder",
|
|
websiteUrl: "https://console.streamlake.ai",
|
|
apiKeyUrl: "https://console.streamlake.ai/console/api-key",
|
|
settingsConfig: {
|
|
env: {
|
|
ANTHROPIC_BASE_URL:
|
|
"https://vanchin.streamlake.ai/api/gateway/v1/endpoints/${ENDPOINT_ID}/claude-code-proxy",
|
|
ANTHROPIC_AUTH_TOKEN: "",
|
|
ANTHROPIC_MODEL: "KAT-Coder-Pro V1",
|
|
ANTHROPIC_DEFAULT_HAIKU_MODEL: "KAT-Coder-Air V1",
|
|
ANTHROPIC_DEFAULT_SONNET_MODEL: "KAT-Coder-Pro V1",
|
|
ANTHROPIC_DEFAULT_OPUS_MODEL: "KAT-Coder-Pro V1",
|
|
},
|
|
},
|
|
category: "cn_official",
|
|
templateValues: {
|
|
ENDPOINT_ID: {
|
|
label: "Vanchin Endpoint ID",
|
|
placeholder: "ep-xxx-xxx",
|
|
defaultValue: "",
|
|
editorValue: "",
|
|
},
|
|
},
|
|
},
|
|
{
|
|
name: "Longcat",
|
|
websiteUrl: "https://longcat.chat/platform",
|
|
apiKeyUrl: "https://longcat.chat/platform/api_keys",
|
|
settingsConfig: {
|
|
env: {
|
|
ANTHROPIC_BASE_URL: "https://api.longcat.chat/anthropic",
|
|
ANTHROPIC_AUTH_TOKEN: "",
|
|
ANTHROPIC_MODEL: "LongCat-Flash-Chat",
|
|
ANTHROPIC_DEFAULT_HAIKU_MODEL: "LongCat-Flash-Chat",
|
|
ANTHROPIC_DEFAULT_SONNET_MODEL: "LongCat-Flash-Chat",
|
|
ANTHROPIC_DEFAULT_OPUS_MODEL: "LongCat-Flash-Chat",
|
|
CLAUDE_CODE_MAX_OUTPUT_TOKENS: "6000",
|
|
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC: 1,
|
|
},
|
|
},
|
|
category: "cn_official",
|
|
},
|
|
{
|
|
name: "MiniMax",
|
|
websiteUrl: "https://platform.minimaxi.com",
|
|
apiKeyUrl: "https://platform.minimaxi.com/user-center/basic-information",
|
|
settingsConfig: {
|
|
"env": {
|
|
"ANTHROPIC_BASE_URL": "https://api.minimaxi.com/anthropic",
|
|
"ANTHROPIC_AUTH_TOKEN": "",
|
|
"API_TIMEOUT_MS": "3000000",
|
|
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": 1,
|
|
"ANTHROPIC_MODEL": "MiniMax-M2",
|
|
"ANTHROPIC_DEFAULT_SONNET_MODEL": "MiniMax-M2",
|
|
"ANTHROPIC_DEFAULT_OPUS_MODEL": "MiniMax-M2",
|
|
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "MiniMax-M2"
|
|
},
|
|
},
|
|
category: "cn_official",
|
|
},
|
|
{
|
|
name: "PackyCode",
|
|
websiteUrl: "https://www.packyapi.com",
|
|
apiKeyUrl: "https://www.packyapi.com",
|
|
settingsConfig: {
|
|
env: {
|
|
ANTHROPIC_BASE_URL: "https://www.packyapi.com",
|
|
ANTHROPIC_AUTH_TOKEN: "",
|
|
},
|
|
},
|
|
// 请求地址候选(用于地址管理/测速)
|
|
endpointCandidates: [
|
|
"https://www.packyapi.com",
|
|
"https://api-slb.packyapi.com",
|
|
],
|
|
category: "third_party",
|
|
},
|
|
{
|
|
name: "AnyRouter",
|
|
websiteUrl: "https://anyrouter.top",
|
|
apiKeyUrl: "https://anyrouter.top/register?aff=PCel",
|
|
settingsConfig: {
|
|
env: {
|
|
ANTHROPIC_BASE_URL: "https://anyrouter.top",
|
|
ANTHROPIC_AUTH_TOKEN: "",
|
|
},
|
|
},
|
|
// 请求地址候选(用于地址管理/测速)
|
|
endpointCandidates: [
|
|
"https://q.quuvv.cn",
|
|
"https://pmpjfbhq.cn-nb1.rainapp.top",
|
|
"https://anyrouter.top",
|
|
],
|
|
category: "third_party",
|
|
},
|
|
];
|