export type ProviderCategory = | "official" // 官方 | "cn_official" // 国产官方 | "aggregator" // 聚合网站 | "third_party" // 第三方供应商 | "custom"; // 自定义 export interface Provider { id: string; name: string; settingsConfig: Record; // 应用配置对象:Claude 为 settings.json;Codex 为 { auth, config } websiteUrl?: string; // 新增:供应商分类(用于差异化提示/能力开关) category?: ProviderCategory; createdAt?: number; // 添加时间戳(毫秒) // 可选:供应商元数据(仅存于 ~/.cc-switch/config.json,不写入 live 配置) meta?: ProviderMeta; } export interface AppConfig { providers: Record; current: string; } // 自定义端点配置 export interface CustomEndpoint { url: string; addedAt: number; lastUsed?: number; } // 供应商元数据(字段名与后端一致,保持 snake_case) export interface ProviderMeta { // 自定义端点:以 URL 为键,值为端点信息 custom_endpoints?: Record; } // 应用设置类型(用于 SettingsModal 与 Tauri API) export interface Settings { // 是否在系统托盘(macOS 菜单栏)显示图标 showInTray: boolean; // 点击关闭按钮时是否最小化到托盘而不是关闭应用 minimizeToTrayOnClose: boolean; // 覆盖 Claude Code 配置目录(可选) claudeConfigDir?: string; // 覆盖 Codex 配置目录(可选) codexConfigDir?: string; // 首选语言(可选,默认中文) language?: "en" | "zh"; // Claude 自定义端点列表 customEndpointsClaude?: Record; // Codex 自定义端点列表 customEndpointsCodex?: Record; } // MCP 服务器定义(宽松:允许扩展字段) export interface McpServer { // 可选:社区常见 .mcp.json 中 stdio 配置可不写 type type?: "stdio" | "http"; // stdio 字段 command?: string; args?: string[]; env?: Record; cwd?: string; // http 字段 url?: string; headers?: Record; // 通用字段 enabled?: boolean; // 是否启用该 MCP 服务器,默认 true [key: string]: any; } // MCP 配置状态 export interface McpStatus { userConfigPath: string; userConfigExists: boolean; serverCount: number; } // 新:来自 config.json 的 MCP 列表响应 export interface McpConfigResponse { configPath: string; servers: Record; }