feat: profile-aware routes, provider sync, channel settings improvements

- Add hermes-profile.ts for dynamic profile path resolution (all backend
  routes now read from active profile directory instead of hardcoded ~/.hermes/)
- Add profile switcher dropdown in sidebar, reload page on switch
- Sync PROVIDER_PRESETS with Hermes CLI (fix keys: kimi-coding→kimi-for-coding,
  kilocode→kilo, ai-gateway→vercel, opencode-zen→opencode; remove moonshot)
- Sync PROVIDER_ENV_MAP with Hermes models.dev + overlays (correct env var names)
- Add gateway restart after adding model provider
- Don't write GLM_BASE_URL/KIMI_BASE_URL for zai/kimi (let Hermes auto-detect)
- Write API keys to .env and credential_pool for all providers
- Built-in providers skip custom_providers in config.yaml
- Add debounce + per-field loading state for channel settings inputs
- Run hermes setup --reset for profiles without config.yaml
- Create empty .env for new profiles (not copied from default)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
ekko
2026-04-16 13:51:42 +08:00
parent 014168864f
commit 99a47cf1ad
23 changed files with 712 additions and 185 deletions
+8 -14
View File
@@ -43,7 +43,7 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [
{
label: 'DeepSeek',
value: 'deepseek',
base_url: 'https://api.deepseek.com/v1',
base_url: 'https://api.deepseek.com',
models: ['deepseek-chat', 'deepseek-reasoner'],
},
{
@@ -53,8 +53,8 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [
models: ['glm-5', 'glm-5-turbo', 'glm-4.7', 'glm-4.5', 'glm-4.5-flash'],
},
{
label: 'Kimi Coding Plan',
value: 'kimi-coding',
label: 'Kimi for Coding',
value: 'kimi-for-coding',
base_url: 'https://api.kimi.com/coding/v1',
models: [
'kimi-for-coding',
@@ -65,12 +65,6 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [
'kimi-k2-0905-preview',
],
},
{
label: 'Moonshot (Pay-as-you-go)',
value: 'moonshot',
base_url: 'https://api.moonshot.ai/v1',
models: ['kimi-k2.5', 'kimi-k2-thinking', 'kimi-k2-turbo-preview', 'kimi-k2-0905-preview'],
},
{
label: 'xAI',
value: 'xai',
@@ -91,7 +85,7 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [
{
label: 'MiniMax',
value: 'minimax',
base_url: 'https://api.minimax.io/anthropic',
base_url: 'https://api.minimax.io/anthropic/v1',
models: ['MiniMax-M2.7', 'MiniMax-M2.5', 'MiniMax-M2.1', 'MiniMax-M2'],
},
{
@@ -137,7 +131,7 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [
},
{
label: 'Kilo Code',
value: 'kilocode',
value: 'kilo',
base_url: 'https://api.kilo.ai/api/gateway',
models: [
'anthropic/claude-opus-4.6',
@@ -148,8 +142,8 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [
],
},
{
label: 'AI Gateway',
value: 'ai-gateway',
label: 'Vercel AI Gateway',
value: 'vercel',
base_url: 'https://ai-gateway.vercel.sh/v1',
models: [
'anthropic/claude-opus-4.6',
@@ -168,7 +162,7 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [
},
{
label: 'OpenCode Zen',
value: 'opencode-zen',
value: 'opencode',
base_url: 'https://opencode.ai/zen/v1',
models: [
'gpt-5.4-pro',