Commit Graph

16 Commits

Author SHA1 Message Date
Zhicheng Han ffd825afe2 fix: keep self-update on the active install path (#123) 2026-04-22 10:33:38 +08:00
ekko 477af66232 fix: auth bypass, SPA serving, and provider improvements (#97)
* feat(chat): polish syntax highlighting and tool payload rendering (#94)

* [verified] feat(chat): polish syntax highlighting and tool payload rendering

* [verified] fix(chat): tighten large tool payload rendering

* docs: update data volume path in Docker docs

Align documentation with docker-compose.yml change:
hermes-web-ui-data -> hermes-web-ui, /app/dist/data -> /root/.hermes-web-ui

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor: bundle server build and restructure service modules

- Add build-server.mjs script for standalone server compilation
- Add logger service with structured output
- Restructure auth, gateway-manager, hermes-cli, hermes services
- Update docker-compose volume mount path
- Update tsconfig and entry point for bundled server

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* refactor: separate controllers from routes and centralize route registration

- Extract business logic from route handlers into controllers/
- Add centralized route registry in routes/index.ts with public/auth/protected layers
- Replace global auth whitelist with sequential middleware registration
- Extract shared helpers to services/config-helpers.ts
- Allow custom provider name to be user-editable in ProviderFormModal
- Deduplicate custom providers by poolKey instead of base_url in getAvailable

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: auth bypass via path case, SPA serving, and provider improvements

- Fix auth bypass: path case-insensitive check for /api, /v1, /upload
- Fix SPA returning 401: skip auth for non-API paths (static files)
- Fix profile switch: use local loading state instead of shared store ref
- Auto-append /v1 to base_url when fetching models (frontend + backend)
- Guard .env writing to built-in providers only
- Add builtin field to provider presets, enable base_url input in form
- Print auth token to console on startup (pino only writes to file)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Zhicheng Han <43314240+hanzckernel@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-21 12:35:48 +08:00
ekko 562261d13f feat: multi-gateway profile support, provider management overhaul, and model settings tab
- Profile-aware proxy: inject API key from profile-specific .env, route requests via X-Hermes-Profile header
- Remove auth.json dependency: built-in providers use .env, custom providers use config.yaml
- Add allProviders field to available-models response with all hardcoded provider catalogs
- Add Models tab in Settings for editing provider API keys (built-in → .env, custom → config.yaml)
- Add PUT /api/config/providers/:poolKey for updating provider credentials
- ProviderFormModal uses backend allProviders for preset dropdown
- Gateway log format support: parse both agent and gateway log formats
- Add webui server.log to log viewer with log rotation at 3MB
- Fix provider delete loading state and OAuth provider cleanup
- Setup script: require Node.js 23+, auto-upgrade if version too low

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-19 20:59:25 +08:00
ekko 26423984d1 fix: profile import file upload, startup health check, sidebar scroll, node-pty fallback
- Change profile import from server path input to browser file upload (multipart)
- Fix startup script to wait for health check before opening browser
- Add overflow scroll with hidden scrollbar to sidebar nav
- Graceful degradation when node-pty fails to load (WSL compatibility)
- Remove rename button from profile cards
- Restrict profile name input to English letters, numbers, hyphens
- Use raw.githubusercontent.com URLs in README setup script

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-16 15:19:05 +08:00
ekko 71c7f25f4b feat: add web terminal, improve README, fix node-pty and i18n issues
- Add web terminal view with xterm.js and node-pty WebSocket backend
- Rewrite README with badges, feature table, mobile demo video
- Add package keywords and improved description for npm/GitHub SEO
- Fix node-pty spawn-helper missing execute permission after npm install -g
- Auto-fix node-pty permissions on CLI startup
- Fix duplicate 'error' key in en.ts and zh.ts i18n files
- Remove nested NSpin in PlatformSettings (causes invisible loading spinner)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-15 16:36:04 +08:00
ekko 66cc9a6f1e fix: generate token on start, include token in URL, reset api_server config
- Pre-generate auth token before server start and pass via AUTH_TOKEN env var
- Append token to startup URL for auto-login
- Reset api_server config values to defaults on startup

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-15 08:28:36 +08:00
ekko 1f45254dd0 feat: add token auth, login page, skill toggle, and route restructure
- Add token-based authentication with auto-generated token stored in server/data/.token
- Add login page with URL token auto-fill support
- Add route guards requiring auth for all pages except login
- Restructure routes: / for login, /chat for conversations
- Add skill enable/disable toggle via config.yaml skills.disabled
- Unify logo to /logo.png across sidebar, login, messages, and empty state
- Hide sidebar on login page, prevent flash with router.isReady()
- Fix session export JSON parse error when CLI returns non-JSON output
- Display token in CLI on server start

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 21:48:53 +08:00
ekko 2487e147ab fix: prevent Windows terminal popups with windowsHide option
Add windowsHide: true to all spawn/execFile calls in bin and server code
to prevent new console windows from appearing on Windows.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 17:17:15 +08:00
ekko 9dd5fca9f9 feat: add usage statistics page, CLI improvements, and UI enhancements
- Add Usage Stats page with token breakdown, model distribution, and 30-day trend
- Pass through cache/cost token fields in BFF (cache_read/write_tokens, reasoning_tokens, actual_cost_usd)
- Add CLI commands: -v/--version, -h/--help, update/upgrade with auto-restart
- Auto-open browser on startup, auto-kill port conflicts (cross-platform)
- Validate all api_server config fields on startup (enabled, host, port, key, cors_origins)
- Add streaming thinking video animation with tool calls panel
- Add context token usage display (used / total) in chat header
- Sidebar: white logo area with shadow, dance video beside logo (canvas seamless loop)
- Fix sidebar nav scroll (app-main overflow-y: auto)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 14:48:58 +08:00
ekko 8f8cf629bb feat: WSL support, js-yaml migration, and stability improvements
- PID/log files moved to ~/.hermes-web-ui/ for WSL compatibility
- Replace all regex YAML parsing with js-yaml in filesystem.ts
- Auto-detect WSL and use hermes gateway run for background startup
- Stop command: SIGTERM with SIGKILL fallback, clean stale PIDs
- Setup script: auto-install Node.js and hermes-web-ui

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 10:22:29 +08:00
ekko ee9f56dfbd feat: add Koa2 BFF server, CLI management, sessions CLI integration, and logs page
- Add Koa2 BFF layer for API proxy, file upload, session management
- Auto-check and enable api_server in ~/.hermes/config.yaml on startup
- Integrate sessions with Hermes CLI (list, get, delete)
- Add Logs page with level filtering, log file selection, and search
- Add CLI commands: start/stop/restart/status for daemon management
- Unify package.json for frontend and server dependencies
- Default port changed to 8648

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 21:33:04 +08:00
ekko a2f8f6aec5 feat: add attachment upload UI and local file upload endpoint
- Add attachment button, file picker, and preview area to ChatInput
- Render image/file attachments in user message bubbles (MessageItem)
- Add Attachment type and attachments field to Message interface
- Add POST /__upload endpoint to both Vite dev server and production server
  for saving files to temp directory and returning local file paths
- Translate README to English

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 18:54:46 +08:00
ekko fe8a06591b fix: read request body before forwarding in API proxy
Node.js fetch requires duplex option when streaming request body.
Read body chunks first, then forward as Buffer.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 16:19:52 +08:00
ekko 7ea54efb01 refactor: replace Vite runtime with lightweight Node.js server
Use native http module to serve built static files and proxy API
requests. No Vite dependency at runtime — only needed for building.
This fixes SFC compilation errors on global install.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 16:13:36 +08:00
ekko c4df531cef fix: use Vite API directly for global CLI
Spawn-based approach fails on global install because node_modules
is hoisted. Use programmatic Vite API instead. Move vite, plugin-vue,
and sass to dependencies so they're available at runtime.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 16:08:58 +08:00
ekko cd58797f4c init: hermes-web-ui v0.1.0
Hermes Agent Web 管理面板,支持对话交互和定时任务管理。

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 15:59:14 +08:00