diff --git a/CLAUDE.md b/CLAUDE.md index 10f833a..7b84b4a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -333,6 +333,8 @@ Unmatched `/api/hermes/*` and `/v1/*` requests are forwarded to the upstream Her The proxy is implemented as both a route (`proxyRoutes.all('/api/hermes/{*any}', proxy)`) and a middleware (`proxyMiddleware`) registered on the main app to catch any requests that slip through route matching. +**Important:** Custom API endpoints handled locally (not proxied) must be registered **before** `hermesRoutes.routes()` in `bootstrap()`. The proxy route `proxyRoutes.all('/api/hermes/{*any}')` matches all `/api/hermes/*` paths, so any middleware registered after it will never be reached. See the `update` middleware in `index.ts` for an example. + ### Hermes CLI Wrapper (`packages/server/src/services/hermes-cli.ts`) All Hermes interactions go through `child_process.execFile('hermes', [...args])`. Each function wraps a CLI subcommand: diff --git a/package.json b/package.json index 754f38a..9e3a00c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hermes-web-ui", - "version": "0.2.7", + "version": "0.2.6", "description": "Web dashboard for Hermes Agent — multi-platform AI chat, session management, scheduled jobs, usage analytics & channel configuration (Telegram, Discord, Slack, WhatsApp)", "repository": { "type": "git", diff --git a/packages/client/src/api/hermes/skills.ts b/packages/client/src/api/hermes/skills.ts index 490874d..b31fd10 100644 --- a/packages/client/src/api/hermes/skills.ts +++ b/packages/client/src/api/hermes/skills.ts @@ -25,8 +25,10 @@ export interface SkillFileEntry { export interface MemoryData { memory: string user: string + soul: string memory_mtime: number | null user_mtime: number | null + soul_mtime: number | null } export async function fetchSkills(): Promise { @@ -48,7 +50,7 @@ export async function fetchMemory(): Promise { return request('/api/hermes/memory') } -export async function saveMemory(section: 'memory' | 'user', content: string): Promise { +export async function saveMemory(section: 'memory' | 'user' | 'soul', content: string): Promise { await request('/api/hermes/memory', { method: 'POST', body: JSON.stringify({ section, content }), diff --git a/packages/client/src/api/hermes/system.ts b/packages/client/src/api/hermes/system.ts index 3aaa9f5..1eeddab 100644 --- a/packages/client/src/api/hermes/system.ts +++ b/packages/client/src/api/hermes/system.ts @@ -3,6 +3,9 @@ import { request } from '../client' export interface HealthResponse { status: string version?: string + webui_version?: string + webui_latest?: string + webui_update_available?: boolean } // Config-based model types @@ -45,6 +48,10 @@ export async function checkHealth(): Promise { return request('/health') } +export async function triggerUpdate(): Promise<{ success: boolean; message: string }> { + return request<{ success: boolean; message: string }>('/api/hermes/update', { method: 'POST' }) +} + export async function fetchConfigModels(): Promise { return request('/api/hermes/config/models') } diff --git a/packages/client/src/components/hermes/profiles/ProfileCard.vue b/packages/client/src/components/hermes/profiles/ProfileCard.vue index ce9ef52..5bb0b57 100644 --- a/packages/client/src/components/hermes/profiles/ProfileCard.vue +++ b/packages/client/src/components/hermes/profiles/ProfileCard.vue @@ -41,12 +41,13 @@ function handleSwitch() { positiveText: t('common.confirm'), negativeText: t('common.cancel'), onPositiveClick: async () => { - const ok = await profilesStore.switchProfile(props.profile.name) - if (ok) { - message.success(t('profiles.switchSuccess', { name: props.profile.name })) - } else { - message.error(t('profiles.switchFailed')) - } + profilesStore.switchProfile(props.profile.name).then(ok => { + if (ok) { + window.location.reload() + } else { + message.error(t('profiles.switchFailed')) + } + }) }, }) } @@ -101,10 +102,6 @@ async function handleExport() { {{ t('profiles.gateway') }} {{ profile.gateway }} -
- {{ t('profiles.alias') }} - {{ profile.alias }} -
@@ -164,7 +161,7 @@ async function handleExport() { size="tiny" quaternary type="error" - :disabled="isDefault" + :disabled="isDefault || profile.active" @click="handleDelete" > {{ t('common.delete') }} diff --git a/packages/client/src/components/hermes/settings/PlatformSettings.vue b/packages/client/src/components/hermes/settings/PlatformSettings.vue index 8273a6b..7bc4996 100644 --- a/packages/client/src/components/hermes/settings/PlatformSettings.vue +++ b/packages/client/src/components/hermes/settings/PlatformSettings.vue @@ -1,5 +1,5 @@