- Add persistent app settings with custom Claude Code and Codex config directories - Add config directory override UI in settings modal with manual input, browse, and reset options - Integrate tauri-plugin-dialog for native directory picker - Support WSL and other special environments where config paths need manual specification Changes: - settings.rs: Implement settings load/save and directory override logic - SettingsModal: Add config directory override UI components - API: Add get_config_dir and pick_directory commands
32 lines
958 B
TypeScript
32 lines
958 B
TypeScript
export type ProviderCategory =
|
||
| "official" // 官方
|
||
| "cn_official" // 国产官方
|
||
| "aggregator" // 聚合网站
|
||
| "third_party" // 第三方供应商
|
||
| "custom"; // 自定义
|
||
|
||
export interface Provider {
|
||
id: string;
|
||
name: string;
|
||
settingsConfig: Record<string, any>; // 应用配置对象:Claude 为 settings.json;Codex 为 { auth, config }
|
||
websiteUrl?: string;
|
||
// 新增:供应商分类(用于差异化提示/能力开关)
|
||
category?: ProviderCategory;
|
||
createdAt?: number; // 添加时间戳(毫秒)
|
||
}
|
||
|
||
export interface AppConfig {
|
||
providers: Record<string, Provider>;
|
||
current: string;
|
||
}
|
||
|
||
// 应用设置类型(用于 SettingsModal 与 Tauri API)
|
||
export interface Settings {
|
||
// 是否在系统托盘(macOS 菜单栏)显示图标
|
||
showInTray: boolean;
|
||
// 覆盖 Claude Code 配置目录(可选)
|
||
claudeConfigDir?: string;
|
||
// 覆盖 Codex 配置目录(可选)
|
||
codexConfigDir?: string;
|
||
}
|