99a47cf1ad
- 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>
51 lines
1.2 KiB
TypeScript
51 lines
1.2 KiB
TypeScript
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import type { ProxyOptions } from 'vite'
|
|
import { resolve } from 'path'
|
|
import pkg from './package.json'
|
|
|
|
const BACKEND = 'http://127.0.0.1:8648'
|
|
|
|
function createProxyConfig(): ProxyOptions {
|
|
return {
|
|
target: BACKEND,
|
|
changeOrigin: true,
|
|
configure: (proxy) => {
|
|
proxy.on('proxyReq', (proxyReq) => {
|
|
proxyReq.removeHeader('origin')
|
|
proxyReq.removeHeader('referer')
|
|
})
|
|
proxy.on('proxyRes', (proxyRes) => {
|
|
proxyRes.headers['cache-control'] = 'no-cache'
|
|
proxyRes.headers['x-accel-buffering'] = 'no'
|
|
})
|
|
},
|
|
}
|
|
}
|
|
|
|
export default defineConfig({
|
|
root: 'packages/client',
|
|
plugins: [vue()],
|
|
define: {
|
|
__APP_VERSION__: JSON.stringify(pkg.version),
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': resolve(__dirname, 'packages/client/src'),
|
|
},
|
|
},
|
|
build: {
|
|
outDir: '../../dist/client',
|
|
emptyOutDir: true,
|
|
},
|
|
server: {
|
|
proxy: {
|
|
'/api': createProxyConfig(),
|
|
'/v1': createProxyConfig(),
|
|
'/health': createProxyConfig(),
|
|
'/upload': createProxyConfig(),
|
|
'/webhook': createProxyConfig(),
|
|
},
|
|
},
|
|
})
|