mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-29 09:37:37 +08:00
feat(settings): add Hermes config dir override with data-driven dispatch
Adds a dedicated Hermes row to the directory-override settings so users can point CC Switch at alternate Hermes config locations (e.g. a second profile directory for work/personal split). `get_config_dir` on the Rust side already supports hermes; this just wires up the frontend row. Wiring it through `useDirectorySettings` revealed a scaling problem: every supported app required five parallel ternary chains across `computeDefaultConfigDir`, `updateDirectory`, `browseDirectory`, `resetDirectory`, and `updateDirectoryState`. Replaces those with two lookup tables (`APP_DIRECTORY_META`, `DIRECTORY_KEY_TO_SETTINGS_FIELD`) so adding the next app is two entries, not fifteen edit sites. Drive-by cleanup from the same touch: * `resetAllDirectories` takes a `ResolvedAppDirectoryOverrides` object instead of five positional optional strings. * `setResolvedDirs` returns the same reference when the sanitized value is unchanged, so no-op edits don't cascade renders. Also lands all i18n updates for this series (`hermesConfigDir` and placeholder, Memory section's enable/disable/toggleFailed copy, and the reworded `schemaMigratedV12` warning) in zh/en/ja together.
This commit is contained in:
@@ -579,11 +579,14 @@
|
||||
"opencodeConfigDirDescription": "Override OpenCode configuration directory (opencode.json).",
|
||||
"openclawConfigDir": "OpenClaw Configuration Directory",
|
||||
"openclawConfigDirDescription": "Override OpenClaw configuration directory (openclaw.json).",
|
||||
"hermesConfigDir": "Hermes Configuration Directory",
|
||||
"hermesConfigDirDescription": "Override Hermes configuration directory (config.yaml).",
|
||||
"browsePlaceholderClaude": "e.g., /home/<your-username>/.claude",
|
||||
"browsePlaceholderCodex": "e.g., /home/<your-username>/.codex",
|
||||
"browsePlaceholderGemini": "e.g., /home/<your-username>/.gemini",
|
||||
"browsePlaceholderOpencode": "e.g., /home/<your-username>/.config/opencode",
|
||||
"browsePlaceholderOpenclaw": "e.g., /home/<your-username>/.openclaw",
|
||||
"browsePlaceholderHermes": "e.g., /home/<your-username>/.hermes",
|
||||
"browseDirectory": "Browse Directory",
|
||||
"resetDefault": "Reset to default directory (takes effect after saving)",
|
||||
"checkForUpdates": "Check for Updates",
|
||||
@@ -1674,7 +1677,14 @@
|
||||
"title": "Hermes config warnings detected",
|
||||
"parseFailed": "config.yaml could not be parsed as valid YAML. Fix the file before editing it here.",
|
||||
"configNotFound": "Hermes config.yaml not found. Create it at ~/.hermes/config.yaml or configure the path in settings.",
|
||||
"envParseFailed": "The .env file could not be parsed."
|
||||
"envParseFailed": "The .env file could not be parsed.",
|
||||
"modelNoDefault": "No default model or provider is configured in the 'model' section.",
|
||||
"customProvidersNotList": "custom_providers should be a YAML list (items prefixed with '-'), not a mapping.",
|
||||
"modelProviderUnknown": "model.provider references a provider that is not configured.",
|
||||
"modelDefaultNotInProvider": "model.default is not in the selected provider's models list.",
|
||||
"duplicateProviderName": "custom_providers contains duplicate provider names — only one entry will be used.",
|
||||
"duplicateProviderBaseUrl": "custom_providers contains duplicate base_urls — possible accidental copy.",
|
||||
"schemaMigratedV12": "Hermes moved some providers into the 'providers:' dict. CC Switch only manages 'custom_providers:' — edit or remove those entries via Hermes Web UI."
|
||||
},
|
||||
"memory": {
|
||||
"title": "Memory",
|
||||
@@ -1682,7 +1692,10 @@
|
||||
"userTab": "User Profile (USER.md)",
|
||||
"usage": "{{current}} / {{limit}} characters",
|
||||
"overLimit": "Over budget — Hermes will truncate on next load",
|
||||
"disabled": "Memory is disabled in config.yaml. Enable it in Hermes config for edits to take effect.",
|
||||
"enableOn": "Enabled",
|
||||
"enableOff": "Disabled",
|
||||
"disabledHint": "Hermes will skip this memory until re-enabled",
|
||||
"toggleFailed": "Failed to toggle memory",
|
||||
"saveSuccess": "Memory saved",
|
||||
"saveFailed": "Failed to save memory",
|
||||
"loadFailed": "Failed to read memory file",
|
||||
|
||||
@@ -579,11 +579,14 @@
|
||||
"opencodeConfigDirDescription": "OpenCode の設定ディレクトリ(opencode.json)を上書きします。",
|
||||
"openclawConfigDir": "OpenClaw 設定ディレクトリ",
|
||||
"openclawConfigDirDescription": "OpenClaw の設定ディレクトリ(openclaw.json)を上書きします。",
|
||||
"hermesConfigDir": "Hermes 設定ディレクトリ",
|
||||
"hermesConfigDirDescription": "Hermes の設定ディレクトリ(config.yaml)を上書きします。",
|
||||
"browsePlaceholderClaude": "例: /home/<your-username>/.claude",
|
||||
"browsePlaceholderCodex": "例: /home/<your-username>/.codex",
|
||||
"browsePlaceholderGemini": "例: /home/<your-username>/.gemini",
|
||||
"browsePlaceholderOpencode": "例: /home/<your-username>/.config/opencode",
|
||||
"browsePlaceholderOpenclaw": "例: /home/<your-username>/.openclaw",
|
||||
"browsePlaceholderHermes": "例: /home/<your-username>/.hermes",
|
||||
"browseDirectory": "ディレクトリを選択",
|
||||
"resetDefault": "デフォルトに戻す(保存後に反映)",
|
||||
"checkForUpdates": "アップデートを確認",
|
||||
@@ -1674,7 +1677,14 @@
|
||||
"title": "Hermes 設定の警告を検出",
|
||||
"parseFailed": "config.yaml を有効な YAML として解析できません。ここで編集する前にファイルを修正してください。",
|
||||
"configNotFound": "Hermes config.yaml が見つかりません。~/.hermes/config.yaml に作成するか、設定でパスを構成してください。",
|
||||
"envParseFailed": ".env ファイルを解析できません。"
|
||||
"envParseFailed": ".env ファイルを解析できません。",
|
||||
"modelNoDefault": "'model' セクションに既定モデルまたはプロバイダーが設定されていません。",
|
||||
"customProvidersNotList": "custom_providers はマッピングではなく、YAML リスト('-' で始まる項目)である必要があります。",
|
||||
"modelProviderUnknown": "model.provider が指すプロバイダーは設定に存在しません。",
|
||||
"modelDefaultNotInProvider": "model.default は選択中のプロバイダーのモデル一覧に含まれていません。",
|
||||
"duplicateProviderName": "custom_providers にプロバイダー名の重複があります。1 件のみ有効になります。",
|
||||
"duplicateProviderBaseUrl": "custom_providers に重複した base_url があります。誤ってコピーされた可能性があります。",
|
||||
"schemaMigratedV12": "Hermes は一部のプロバイダーを 'providers:' dict に移しました。CC Switch は 'custom_providers:' のみを管理します。該当する項目は Hermes Web UI で編集・削除してください。"
|
||||
},
|
||||
"memory": {
|
||||
"title": "メモリ",
|
||||
@@ -1682,7 +1692,10 @@
|
||||
"userTab": "ユーザープロファイル (USER.md)",
|
||||
"usage": "{{current}} / {{limit}} 文字",
|
||||
"overLimit": "上限を超えました。Hermes は次回読み込み時に切り詰めます",
|
||||
"disabled": "Memory が config.yaml で無効化されています。Hermes 設定で有効化すると編集内容が反映されます。",
|
||||
"enableOn": "有効",
|
||||
"enableOff": "無効",
|
||||
"disabledHint": "再度有効化するまで Hermes はこの記憶をスキップします",
|
||||
"toggleFailed": "メモリの切り替えに失敗しました",
|
||||
"saveSuccess": "記憶を保存しました",
|
||||
"saveFailed": "記憶の保存に失敗しました",
|
||||
"loadFailed": "記憶ファイルの読み込みに失敗しました",
|
||||
|
||||
@@ -579,11 +579,14 @@
|
||||
"opencodeConfigDirDescription": "覆盖 OpenCode 配置目录 (opencode.json)。",
|
||||
"openclawConfigDir": "OpenClaw 配置目录",
|
||||
"openclawConfigDirDescription": "覆盖 OpenClaw 配置目录 (openclaw.json)。",
|
||||
"hermesConfigDir": "Hermes 配置目录",
|
||||
"hermesConfigDirDescription": "覆盖 Hermes 配置目录 (config.yaml)。",
|
||||
"browsePlaceholderClaude": "例如:/home/<你的用户名>/.claude",
|
||||
"browsePlaceholderCodex": "例如:/home/<你的用户名>/.codex",
|
||||
"browsePlaceholderGemini": "例如:/home/<你的用户名>/.gemini",
|
||||
"browsePlaceholderOpencode": "例如:/home/<你的用户名>/.config/opencode",
|
||||
"browsePlaceholderOpenclaw": "例如:/home/<你的用户名>/.openclaw",
|
||||
"browsePlaceholderHermes": "例如:/home/<你的用户名>/.hermes",
|
||||
"browseDirectory": "浏览目录",
|
||||
"resetDefault": "恢复默认目录(需保存后生效)",
|
||||
"checkForUpdates": "检查更新",
|
||||
@@ -1674,7 +1677,14 @@
|
||||
"title": "检测到 Hermes 配置警告",
|
||||
"parseFailed": "config.yaml 无法解析为有效 YAML。请先修复文件再在此编辑。",
|
||||
"configNotFound": "未找到 Hermes config.yaml。请在 ~/.hermes/config.yaml 创建或在设置中配置路径。",
|
||||
"envParseFailed": ".env 文件无法解析。"
|
||||
"envParseFailed": ".env 文件无法解析。",
|
||||
"modelNoDefault": "model 段未设置默认模型或供应商。",
|
||||
"customProvidersNotList": "custom_providers 应为 YAML 列表(以 `-` 开头),而不是映射。",
|
||||
"modelProviderUnknown": "model.provider 指向的供应商未在配置中找到。",
|
||||
"modelDefaultNotInProvider": "model.default 指向的模型不在所选供应商的模型列表中。",
|
||||
"duplicateProviderName": "custom_providers 中存在重复的供应商名,只会有一条生效。",
|
||||
"duplicateProviderBaseUrl": "custom_providers 中存在重复的 base_url,可能是意外复制。",
|
||||
"schemaMigratedV12": "Hermes 把部分供应商移到了 'providers:' dict。CC Switch 只管理 'custom_providers:',请在 Hermes Web UI 编辑或删除这些条目。"
|
||||
},
|
||||
"memory": {
|
||||
"title": "记忆管理",
|
||||
@@ -1682,7 +1692,10 @@
|
||||
"userTab": "用户画像 (USER.md)",
|
||||
"usage": "已用 {{current}} / {{limit}} 字符",
|
||||
"overLimit": "已超过上限,Hermes 下次加载时会截断",
|
||||
"disabled": "Memory 在 config.yaml 中已禁用,编辑后需在 Hermes 配置启用才会生效。",
|
||||
"enableOn": "已启用",
|
||||
"enableOff": "已禁用",
|
||||
"disabledHint": "在重新启用前 Hermes 会跳过此记忆",
|
||||
"toggleFailed": "切换记忆状态失败",
|
||||
"saveSuccess": "记忆已保存",
|
||||
"saveFailed": "保存记忆失败",
|
||||
"loadFailed": "读取记忆文件失败",
|
||||
|
||||
Reference in New Issue
Block a user