Hermes Web UI is a TypeScript monorepo that ships a browser dashboard, a Koa backend, and an Electron desktop distribution around Hermes Agent.
| Area | Path | Responsibility |
|---|---|---|
| Client | packages/client/src |
Vue UI, routing, Pinia stores, API wrappers, i18n, browser-visible state. |
| Server | packages/server/src |
HTTP API, auth, Socket.IO, SQLite stores, file access, Hermes runtime integration. |
| Desktop | packages/desktop |
Electron shell, local Web UI server bootstrap, updater, bundled Python/Hermes runtime. |
| Tests | tests |
Vitest unit/integration tests and Playwright browser tests. |
| CI | .github/workflows |
Build, e2e, lockfile, Docker, and desktop release automation. |
packages/client/src/api.packages/server/src/routes wire HTTP paths to controllers.Keep each layer narrow. Routes should not grow business logic, and client code should not duplicate server persistence rules.
~/.yaoyao-webui through config.appHome.YAOYAO_WEBUI_HOME and YAOYAO_WEBUI_STATE_DIR override Web UI state location; the Hermes variables are legacy aliases only.config.uploadDir, which is derived from the Web UI home unless UPLOAD_DIR is set.dist assets.routes/ registers HTTP and WebSocket entry points.controllers/ handles request-level behavior.services/ owns reusable IO, domain behavior, external process calls, and integration logic.db/ owns SQLite schemas and stores.middleware/ owns request middleware such as user auth.shared/ contains cross-server constants and helpers.Architecture rules:
packages/server/src/services/auth.ts.execFile or spawn with argument arrays over shell command strings.views/ contains route-level screens.components/ contains reusable UI.stores/ contains Pinia state.api/ contains HTTP clients and should use packages/client/src/api/client.ts.i18n/ contains locale messages for user-facing strings.styles/ contains global styling and theme primitives.Frontend rules:
<script setup lang="ts">.Desktop packaging is intentionally split:
.github/workflows/build.yml..github/workflows/desktop-release.yml..github/workflows/desktop-manual-build.yml builds one desktop target for targeted repairs or re-runs.Do not make a Windows job require macOS .dmg files or a Linux job require
Windows installers. Keep fail_on_unmatched_files: true where platform-specific
artifact lists make the expectation explicit.
The minimum mechanical harness is:
npm run harness:check for repository docs, workflow, and package-script invariants.npm run test or focused Vitest tests for local logic.npm run test:e2e for browser-visible routing/auth/chat regressions.npm run build for type checking and production bundles.See docs/harness/validation.md for change-specific commands.