diff --git a/.gitignore b/.gitignore index 2c145f5..36b6b77 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,7 @@ hci.config.yaml .auth-state.json test-results/ playwright-report/ + +# QA run artifacts (regenerated by test:qa) +qa/screenshots/ +qa/qa-report.json diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..bc720ea --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,66 @@ +# Hermes Control Interface — Agent Onboarding + +> Self-hosted web dashboard for the Hermes AI agent stack. Manages terminals, files, sessions, cron jobs, token analytics, multi-agent gateways, and team access behind a password gate. + +## Project Purpose + +Single-pane operations console for Hermes profiles. 10 pages: Home · Agents · Usage · Skills · Chat · Logs · Monitor · Maintenance · Files · Office. RBAC v2 (28 permissions × 12 groups). Multi-agent gateway start/stop/configure with real-time logs over WebSocket. + +## Stack + +- **Frontend**: Vanilla JS + Vite (no framework), xterm.js, Chart.js +- **Backend**: Node ≥20, Express, WebSocket (`ws`), node-pty, better-sqlite3 +- **Auth**: bcrypt password gate, helmet, express-rate-limit +- **Test**: `node --test` (unit), Playwright (E2E in `qa/`) + +## Layout + +``` +server.js ⚠ ~150KB single-file backend (`stat -f %z server.js` for exact) — surgical edits only +auth.js password + session middleware +src/ + index.html SPA shell + js/ page modules + css/ styles + assets/ +docs/ API · CONFIG · DEPLOY · DESIGN · INSTALL · PASSWORD · SECURITY · TROUBLESHOOTING +qa/ Playwright suites +scripts/ setup-gateway-service.sh (only file present; `reset-password.js` referenced in package.json is missing — use HTTP endpoint instead) +test/ node --test specs +``` + +## Commands + +| Task | Command | +|------|---------| +| Dev (Vite) | `npm run dev` | +| Run server | `npm start` | +| Build | `npm run build` | +| Test | `npm test` | +| E2E | `npx playwright test` | +| Reset password (HTTP) | `POST /api/users/:username/reset-password` (admin role; see server.js:1639). NOTE: `package.json` `reset-password` script points to `scripts/reset-password.js` which is **missing** — use the HTTP endpoint instead | +| Install (fresh) | `npm install` only — there is no `install.sh`. Setup gateway via `bash scripts/setup-gateway-service.sh` | + +## Operational Invariants + +- **Password gate** is the only auth boundary. Never expose endpoints outside `requireAuth` middleware unless explicitly public (health checks). +- **RBAC v2**: 28 permissions across 12 groups. New endpoints must declare a permission. +- **WebSocket** streams log/terminal output. Always tear down on client disconnect (memory leak risk with node-pty). +- **launchd integration** (macOS): per-profile gateway services named `ai.hermes.gateway[-].plist` (verified via `ls ~/Library/LaunchAgents/ai.hermes.gateway*`). Watchdog companion: `ai.hermes.gateway-watchdog.plist`. (Project README mentions systemd but Mac Studio runs launchd via `launchctl`.) +- **Session ID parsing** must handle both new (`session_id:`) and legacy (`Session:`) formats. +- **Token analytics** uses `@pydantic/genai-prices` for cost. Refresh package when adding new models. + +## Pre-conditions Before Editing + +1. `server.js` is huge — locate target route via grep before editing. Avoid bulk reformat. +2. New permissions: register in the 28-permission catalog AND assign to default groups. +3. Gateway lifecycle changes: test with `launchctl bootout/bootstrap gui/$UID ~/Library/LaunchAgents/ai.hermes.gateway[-].plist` (Mac Studio uses launchd, not systemd). +4. Frontend changes: rebuild via `npm run build` and verify in dark mode (default theme). + +## Refs + +- `README.md` (605 lines) — full feature tour with screenshots +- `docs/API.md` — backend endpoint reference +- `docs/SECURITY.md` — auth + RBAC details +- `docs/CONFIG.md` — config schema (13 categories, 80+ settings) +- `docs/DEPLOY.md` — production deployment diff --git a/CLAUDE.md b/CLAUDE.md new file mode 120000 index 0000000..47dc3e3 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file diff --git a/README.md b/README.md index 92c1f11..659ac28 100644 --- a/README.md +++ b/README.md @@ -1,412 +1,243 @@ # Hermes Control Interface -A self-hosted web dashboard for the [Hermes AI agent](https://github.com/NousResearch/hermes-agent) stack. Manage agents, chat, terminals, files, cron, token analytics, MCP servers, and swarm pipelines — behind a password gate. +A self‑hosted web dashboard for the [Hermes AI agent](https://github.com/NousResearch/hermes-agent) stack. Manage terminals, files, sessions, cron jobs, token analytics, multi‑agent gateways, and team access — all behind a password gate. -**Stack:** Vanilla JS + Vite · Node.js · Express · WebSocket · xterm.js · Chart.js · better-sqlite3 -**Version:** 3.6.1 · **License:** MIT +**Stack:** Vanilla JS + Vite · Node.js · Express · WebSocket · xterm.js +**Version:** 3.5.1 ---- +--- -## Quick Start +## Introduction -```bash -git clone https://github.com/xaspx/hermes-control-interface.git -cd hermes-control-interface -cp .env.example .env # set HERMES_CONTROL_PASSWORD + HERMES_CONTROL_SECRET -npm install && npm run build -node server.js # → http://localhost:10274 -``` - -See [docs/INSTALL.md](docs/INSTALL.md) for production setup, nginx, and systemd. +Hermes Control Interface (HCI) is the web UI that lets you operate a Hermes AI agent deployment from a browser. It provides: ---- +* Real‑time chat via the Gateway API with tool‑call cards and session resume +* Full RBAC (28 permissions, 3 built‑in roles) and multi‑user management +* Multi‑agent gateway control, log streaming and systemd service integration +* Token‑usage analytics, health monitoring and diagnostics +* Secure, password‑protected access with bcrypt hashing, CSRF protection and rate limiting +* File explorer, in‑browser terminal, skill marketplace and maintenance tools -## Overview +The UI is built with vanilla JavaScript, Vite for bundling, and an Express‑powered backend that also hosts the WebSocket and PTY services required for the terminal. -| Page | What | -|------|------| -| **Home** | System health, agent overview, gateway status, token usage | -| **Chat** | Real-time streaming, tool call cards, multi-profile | -| **Workspace** | Browse, edit files and chat with Hermes scoped to a project directory | -| **Agents** | Profile CRUD, gateway lifecycle, per-agent dashboard/sessions/cron | -| **Office** | 3-panel swarm monitor — agent health, kanban pipeline, live feed | -| **Monitor** | Gateway logs, CPU/RAM metrics, live process view | -| **Usage** | Token analytics, daily trends, cost projections, budget alerts | -| **Logs** | Agent, error, and gateway logs with level filter | -| **Skills** | Browse, install, and remove Hermes skills | -| **Files** | Browse and edit files on the server | -| **MCP** | MCP server control plane — start, stop, restart, log tail, config editor | -| **Maintenance** | Backup, restore, HCI update, system doctor | +--- ---- +## Features -## Screenshots +### 🔐 Authentication & Security +* Single‑password login (configurable via `HERMES_CONTROL_PASSWORD`) +* BCrypt password hashing (cost 10) and optional multi‑user support +* CSRF tokens on all mutating endpoints +* Secure cookies (HTTPS‑only when applicable) +* Rate limiting (5 failed logins/15 min per IP, 30 terminal commands/min) +* Comprehensive XSS, injection and CORS hardening (see `docs/SECURITY_AUDIT.md`) -### Core Pages · Dark Mode +### 🏠 Home Dashboard +* System health overview (CPU, RAM, disk, uptime) +* Agent and gateway status badges +* 7‑day token‑usage summary with cost estimation -| | | | -|-|-|-| -| Home | Chat | Office | -| ![Home](docs/screenshots/dark/01-home.png) | ![Chat](docs/screenshots/dark/chat.png) | ![Office](docs/screenshots/dark/office.png) | -| Agents | MCP Manager | Usage | -| ![Agents](docs/screenshots/dark/02-agents.png) | ![MCP](docs/screenshots/dark/mcp.png) | ![Usage](docs/screenshots/dark/03-usage.png) | +### 🤖 Agents – Multi‑Agent Management +* List, create, clone, delete and set default Hermes profiles +* Start/stop/restart gateways per profile with live log viewer -### Agent Detail Pages +### 💬 Chat – Revamped Interface +* Real‑time streaming via Gateway API +* Collapsible tool‑call cards with JSON viewer +* Session sidebar for resume, rename, delete and export +* Multi‑profile support and auto‑fallback to CLI -| | | | -|-|-|-| -| Dashboard | Sessions | Gateway | -| ![Dashboard](docs/screenshots/dark/07-agent-dashboard.png) | ![Sessions](docs/screenshots/dark/08-agent-sessions.png) | ![Gateway](docs/screenshots/dark/09-agent-gateway.png) | -| Config | Memory | Skills | -| ![Config](docs/screenshots/dark/10-agent-config.png) | ![Memory](docs/screenshots/dark/11-agent-memory.png) | ![Skills](docs/screenshots/dark/12-agent-skills.png) | +### 📊 Usage & Analytics +* Token & cost breakdown by model, platform and time range +* Interactive charts and tables for sessions, messages and tools ---- +### 🛠️ Agent Detail (Dashboard, Sessions, Gateway, Config, Memory, Cron) -## Features +### 📦 Skills Marketplace +* Browse, install, update and uninstall skills from the official registry -### Office v3 — ZOO Swarm Monitor +### 🧑‍🔧 Maintenance & Administration +* Doctor diagnostics, system dump, update, backup/restore, HCI restart +* User management (create/edit/delete, role assignment, permission editing) -Three-panel dashboard with zero-subprocess agent states (~100ms vs 3000ms): +### 📁 File Explorer +* Scoped, secure, two‑pane editor with syntax highlighting -- **Agents Panel** — health grid via config.yaml + kanban.db -- **Kanban Panel** — 8 status lanes (triage→done), dependency arrows, board switcher -- **Live Feed** — 50 events from gateway logs, agent filter dropdown, keyword search -- **Task Popup** — expandable run history, workspace file browser, event enrichment, timeline, load-more +### 💻 Terminal +* Browser‑based PTY via `node‑pty` + `xterm.js` -### Chat +### 🔔 Notifications +* Real‑time alerts with persistent storage -- Real-time streaming via WebSocket gateway API -- Multi-profile support with profile switcher -- Tool call cards with collapsible JSON viewer -- Stop button, session resume, fork from message +### 🎨 Theme +* Dark (default) and Light modes, persisted in `localStorage` -### MCP Manager +--- -Full operational control plane — list, start, stop, restart MCP servers. Live log tail and config editor from the browser. 11 REST API routes. +## Installation -### Security +### Prerequisites -- CSP without `unsafe-eval`, CSRF on all mutating endpoints -- Rate limiting (global + chat), WebSocket RBAC -- Path traversal prevention, XSS protection -- 20 permissions across 3 roles (admin, viewer, custom) -- **Profile-based access isolation** — restrict users to specific agent profiles - -### Profile-Based Access Control - -Multi-agent teams can restrict which profiles (agents) each user can see and manage: - -```javascript -// User creation with profile restriction -createUser('cx-team', 'password', 'custom', ['jorah']); // only sees Jorah -createUser('influencer-team', 'password', 'custom', ['varys']); // only sees Varys -createUser('admin', 'password', 'admin', ['*']); // sees all agents -``` +| Requirement | Minimum | Recommended | +|---|---|---| +| Node.js | v20+ | v22 LTS | +| RAM | 512 MiB | 1 GiB+ | +| Disk | 200 MiB | 500 MiB+ | +| OS | Linux / macOS / WSL2 | Ubuntu 22.04 LTS | +| Hermes Agent | v0.3.x | latest | +| Build tools | `python3`, `make`, `g++` | required for `node‑pty` native module | -- `allowed_profiles` field on each user (`["*"]` = full access, `["jorah", "varys"]` = specific agents) -- Filters `/api/profiles`, `/api/office/agent-states`, and all `:profile` endpoints -- `requireProfileAccess` middleware on gateway, config, and keys routes -- Profile selection UI in the Create User form (checkboxes for available agents) -- Nav tabs hidden based on user permissions (Files, Maintenance = admin only) +### Manual Installation (Recommended) -### PWA +```bash +# 1. Clone the repository +git clone https://github.com/xaspx/hermes-control-interface.git +cd hermes-control-interface -Installable to homescreen. Service worker with offline caching. Auto-update on new version. +# 2. Install Node dependencies +npm install ---- +# 3. Prepare environment variables +cp .env.example .env +# Edit .env: +# HERMES_CONTROL_PASSWORD=your‑secure‑password +# HERMES_CONTROL_SECRET=$(openssl rand -hex 32) -## Architecture +# 4. Build the frontend assets +npm run build +# 5. Start the server +npm start ``` -Browser (11 pages, SPA) - │ - HTTPS :10274 - │ - Express Server (server.js — monolithic, ~6K+ lines) - ├── Auth (bcrypt, sessions, CSRF) - ├── RBAC (20 permissions, 3 roles) - ├── REST API (30+ routes) - ├── WebSocket (real-time) - │ - ├── Hermes CLI (agent states, gateway control) - ├── SQLite (kanban.db — task pipeline) - ├── Filesystem (config.yaml, logs, skills) - └── External (MCP servers, token pricing) -``` - -Full architecture: [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) - ---- - -## API - -| Endpoint | Auth | Description | -|----------|------|-------------| -| `GET /api/office/kanban?board=` | Login | Kanban board with tasks + links | -| `GET /api/office/kanban/:id?board=` | Login | Task detail with runs, events, comments | -| `GET /api/office/kanban/:id/workspace-file?board=&path=` | Login | Read workspace files (code, logs) | -| `POST /api/office/kanban/:id/action?board=` | Login+CSRF | Quick actions (done, start, reopen, etc.) | -| `GET /api/office/agent-states` | Login | Agent health grid | -| `GET /api/office/events` | Admin | Live feed from gateway logs | -| `GET /api/office/summary?board=` | Login | Board stats + recommendations | -Full API: [docs/API.md](docs/API.md) +The dashboard will be reachable at `http://localhost:10272` (default `PORT`). ---- - -## Configuration - -| Variable | Default | Description | -|----------|---------|-------------| -| `HERMES_CONTROL_PASSWORD` | — | Login password (bcrypt hashed) | -| `HERMES_CONTROL_SECRET` | — | Session secret (random string) | -| `PORT` | `10274` | Server port | -| `HERMES_CONTROL_HOME` | `~/.hermes` | Hermes state directory | -| `HERMES_PROJECTS_ROOT` | parent of repo | Projects directory | - -Full config: [docs/CONFIG.md](docs/CONFIG.md) - ---- - -## Requirements - -- Node.js 20+ -- Hermes Agent installed on the same machine -- `hermes` CLI available on PATH - ---- - -## Updating +### Production with systemd ```bash -git pull upstream main -npm install -npm run build -# Restart your HCI service (adjust service name): -systemctl restart hci-staging +# Use the helper script (creates a systemd unit) +bash scripts/setup-gateway-service.sh ``` -See [docs/DEPLOY.md](docs/DEPLOY.md) for zero-downtime deploys. - ---- - -## Documentation - -| Doc | Content | -|-----|---------| -| [INSTALL.md](docs/INSTALL.md) | Full setup — nginx, systemd, Cloudflare | -| [CONFIG.md](docs/CONFIG.md) | All environment variables | -| [API.md](docs/API.md) | REST API reference | -| [ARCHITECTURE.md](docs/ARCHITECTURE.md) | Design decisions, data flow | -| [SECURITY.md](docs/SECURITY.md) | CSP, CSRF, auth, hardening | -| [DEPLOY.md](docs/DEPLOY.md) | Production deployment patterns | -| [TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md) | Common issues and fixes | - ---- - -Built for the [Hermes Agent](https://github.com/NousResearch/hermes-agent) ecosystem. -[GitHub](https://github.com/xaspx/hermes-control-interface) - ---- - -## ❓ Frequently Asked Questions - -### General - -**Q: What is Hermes Control Interface (HCI)?** +Or create a unit manually: -HCI is a **self-hosted web dashboard** for the Hermes AI agent stack. Manage agents, chat, terminals, files, cron, token analytics, MCP servers, and swarm pipelines — all behind a password gate. +```ini +# /etc/systemd/system/hermes-control.service +[Unit] +Description=Hermes Control Interface +After=network.target -**Q: What can I manage with HCI?** +[Service] +Type=simple +User=hermes # non‑root preferred +WorkingDirectory=/path/to/hermes-control-interface +ExecStart=/usr/bin/node server.js +Restart=always +Environment=NODE_ENV=production -| Page | Capabilities | -|---|---|---| -| **Home** | System health, agent overview, gateway status, token usage | -| **Chat** | Real-time streaming, tool call cards, multi-profile | -| **Workspace** | Browse, edit files and chat with Hermes scoped to a project directory | -| **Agents** | Profile CRUD, gateway lifecycle, dashboard/sessions/cron | -| **Office** | 3-panel swarm monitor — agent health, kanban, live feed | -| **Monitor** | Gateway logs, CPU/RAM metrics, live process view | -| **Usage** | Token analytics, daily trends, cost projections, alerts | -| **Logs** | Agent/error/gateway logs with level filter | -| **Skills** | Browse, install, remove Hermes skills | -| **Files** | Browse and edit server files | -| **MCP** | Start, stop, restart MCP servers, log tail, config editor | -| **Maintenance** | Backup, restore, HCI update, system doctor | - -### Features - -**Q: What is Office v3 — ZOO Swarm Monitor?** - -Three-panel dashboard with **zero-subprocess agent states** (~100ms vs 3000ms): - -- **Agents Panel** — health grid via config.yaml + kanban.db -- **Kanban Panel** — 8 status lanes (triage→done), dependency arrows -- **Live Feed** — 50 events from gateway logs, agent filter, keyword search -- **Task Popup** — run history, workspace file browser, event enrichment - -**Q: What chat features are available?** - -| Feature | Description | -|---|---| -| **Real-time streaming** | WebSocket gateway API | -| **Multi-profile** | Profile switcher for different agents | -| **Tool call cards** | Collapsible JSON viewer | -| **Stop button** | Pause streaming mid-conversation | -| **Session resume** | Continue previous conversation | -| **Fork from message** | Branch conversation from any point | - -**Q: What is MCP Manager?** - -Full operational control plane for MCP servers: -- List, start, stop, restart servers -- Live log tail from browser -- Config editor (JSON/YAML) -- 11 REST API routes - -### Installation - -**Q: How do I install HCI?** - -```bash -git clone https://github.com/xaspx/hermes-control-interface.git -cd hermes-control-interface -cp .env.example .env # set HERMES_CONTROL_PASSWORD + HERMES_CONTROL_SECRET -npm install && npm run build -node server.js # → http://localhost:10274 +[Install] +WantedBy=multi-user.target ``` -See [docs/INSTALL.md](docs/INSTALL.md) for full setup. - -**Q: What are the requirements?** - -- Node.js 20+ -- Hermes Agent installed on same machine -- `hermes` CLI available on PATH - -**Q: How do I update HCI?** - ```bash -git pull upstream main -npm install -npm run build -# Restart your HCI service (adjust service name): -systemctl restart hci-staging +sudo systemctl enable hermes-control +sudo systemctl start hermes-control ``` -### Tech Stack - -**Q: What technologies does HCI use?** - -| Layer | Technology | -|---|---| -| **Frontend** | Vanilla JS + Vite | -| **Backend** | Node.js + Express + WebSocket | -| **Terminal** | xterm.js | -| **Charts** | Chart.js | -| **Database** | better-sqlite3 | -| **Version** | 3.6.1 | - -### Security - -**Q: What security features are included?** +--- -| Feature | Implementation | -|---|---| -| **CSP** | No `unsafe-eval` | -| **CSRF** | All mutating endpoints | -| **Rate limiting** | Global + chat | -| **WebSocket RBAC** | Role-based access | -| **Path traversal** | Prevention | -| **XSS** | Protection | -| **Permissions** | 20 across 3 roles (admin, viewer, custom) | +## Usage -### PWA +1. Open the UI in a browser (`http://HOST:PORT`). +2. Log in with the password defined in `.env`. +3. Navigate through the top‑level pages: **Home**, **Agents**, **Chat**, **Usage**, **Skills**, **Logs**, **Monitor**, **Files**, **Maintenance**, **Office**. +4. Use the **Users** tab (Administration → Users) to add additional accounts and assign roles. +5. For each Hermes profile you can start/stop the gateway, edit its configuration, view logs and manage scheduled cron jobs. +6. The **Chat** page streams responses instantly; use the stop button to abort a running stream. +7. The **Usage** page offers token analytics; select a time range and/or specific agent to filter. +8. The **File Explorer** lets you edit files under `~/.hermes` (or any roots defined via `HERMES_CONTROL_ROOTS`). -**Q: Can I install HCI as a PWA?** - -Yes! -- Installable to homescreen -- Service worker with offline caching -- Auto-update on new version - -### Configuration - -**Q: What environment variables are required?** - -| Variable | Default | Description | -|---|---|---| -| `HERMES_CONTROL_PASSWORD` | — | Login password (bcrypt) | -| `HERMES_CONTROL_SECRET` | — | Session secret | -| `PORT` | `10274` | Server port | -| `HERMES_CONTROL_HOME` | `~/.hermes` | Hermes state directory | -| `HERMES_PROJECTS_ROOT` | parent of repo | Projects directory | +All actions are logged in the **Audit** view for traceability. -See [docs/CONFIG.md](docs/CONFIG.md) for full list. +--- -### API +## Testing -**Q: What REST API endpoints are available?** - -| Endpoint | Auth | Description | -|---|---|---| -| `GET /api/office/kanban?board=` | Login | Kanban board | -| `GET /api/office/kanban/:id?board=` | Login | Task detail | -| `GET /api/office/kanban/:id/workspace-file` | Login | Read workspace files | -| `POST /api/office/kanban/:id/action` | Login+CSRF | Quick actions | -| `GET /api/office/agent-states` | Login | Agent health grid | -| `GET /api/office/events` | Admin | Live feed | -| `GET /api/office/summary?board=` | Login | Board stats | - -See [docs/API.md](docs/API.md) for full reference. +```bash +npm test # Unit tests (node --test, test/*.test.js) +npm run test:e2e # Playwright E2E (test/office-visualization.spec.js) — needs a first-run server on :8790 (credentials in test/global-setup.js) +npm run test:qa # Playwright route QA (qa/) — set QA_BASE_URL to a running instance +``` -### Architecture +--- -**Q: What is the HCI architecture?** +## Project Structure ``` -Browser (11 pages, SPA) - │ - HTTPS :10274 - │ - Express Server (server.js — monolithic, ~6K+ lines) - ├── Auth (bcrypt, sessions, CSRF) - ├── RBAC (20 permissions, 3 roles) - ├── REST API (30+ routes) - ├── WebSocket (real-time) - │ - ├── Hermes CLI (agent states, gateway control) - ├── SQLite (kanban.db — task pipeline) - ├── Filesystem (config.yaml, logs, skills) - └── External (MCP servers, token pricing) +. +├── AGENTS.md +├── auth.js # Multi‑user auth & RBAC logic +├── CLAUDE.md +├── CODE_OF_CONDUCT.md +├── CONTRIBUTING.md +├── dist/ # Production assets built by Vite +│ ├── assets/ # Hashed bundles (index-*.js/css, favicon, images) +│ ├── i18n/ +│ │ ├── en.json +│ │ └── ja.json +│ └── index.html +├── docs/ +│ ├── API.md +│ ├── CONFIG.md +│ ├── DEPLOY.md +│ ├── DESIGN.md +│ ├── INSTALL.md +│ ├── PASSWORD.md +│ ├── SECURITY.md +│ ├── TROUBLESHOOTING.md +│ ├── TUI_CHAT_REVAMP_PLAN.md +│ ├── SECURITY_AUDIT.md +│ └── plans/ +│ ├── 2026-04-19-gateway-health-check.md +│ ├── 2026-04-19-granular-update-system.md +│ └── 2026-05-06-ux-fixes.md +│ └── screenshots/ +│ ├── dark/ (01‑13 PNG files) +│ └── light/ (01‑03 PNG files) +├── hci.config.yaml.example +├── lib/ # Shared utility libraries +├── LICENSE +├── node_modules/ +├── package-lock.json +├── package.json +├── playwright.config.js +├── playwright.config.mts +├── qa/ # QA helpers & test data +├── README.md # <<‑‑ This file +├── scripts/ # Helper scripts (setup, lint, etc.) +├── SECURITY_AUDIT.md +├── server.js # Express + WebSocket + PTY server +├── src/ # Vite source code (frontend) +│ ├── assets/ +│ ├── css/ +│ ├── js/ +│ └── index.html +├── test/ +├── test-results/ +├── vite.config.js +└── (additional directories) ``` -See [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) for details. - -### Documentation +*Key directories* -**Q: Where can I find more documentation?** - -| Doc | Content | -|---|---| -| [INSTALL.md](docs/INSTALL.md) | nginx, systemd, Cloudflare | -| [CONFIG.md](docs/CONFIG.md) | All environment variables | -| [API.md](docs/API.md) | REST API reference | -| [ARCHITECTURE.md](docs/ARCHITECTURE.md) | Design decisions, data flow | -| [SECURITY.md](docs/SECURITY.md) | CSP, CSRF, auth, hardening | -| [DEPLOY.md](docs/DEPLOY.md) | Zero-downtime deploys | -| [TROUBLESHOOTING.md](docs/TROUBLESHOOTING.md) | Common issues and fixes | - -### Community & Support - -|| Resource | Link | -|---|---|---| -|| **GitHub Issues** | [github.com/xaspx/hermes-control-interface/issues](https://github.com/xaspx/hermes-control-interface/issues) | -|| **GitHub** | [xaspx/hermes-control-interface](https://github.com/xaspx/hermes-control-interface) | -|| **Hermes Agent** | [NousResearch/hermes-agent](https://github.com/NousResearch/hermes-agent) | +* `src/` – Front‑end source (ES modules, CSS, assets). +* `dist/` – Bundled static files served by Express in production. +* `server.js` – Backend API, WebSocket handling, PTY terminal, authentication. +* `auth.js` – RBAC implementation and password handling. +* `docs/` – Comprehensive documentation (API, configuration, deployment, security). -### License +--- -**Q: Is Hermes Control Interface free and open source?** +## License -Yes! **MIT License** - see [LICENSE](LICENSE). Self-host for free, manage your Hermes agent stack with a beautiful web UI. +This project is licensed under the MIT License – see the `LICENSE` file for details. \ No newline at end of file diff --git a/auth.js b/auth.js index d469667..5aa0c22 100644 --- a/auth.js +++ b/auth.js @@ -6,7 +6,7 @@ const fs = require('fs'); const path = require('path'); const os = require('os'); -const HERMES_HOME = path.join(os.homedir(), '.hermes'); +const HERMES_HOME = process.env.HERMES_HOME || path.join(os.homedir(), '.hermes'); const USERS_FILE = path.join(HERMES_HOME, 'hci-users.json'); const AUDIT_FILE = path.join(HERMES_HOME, 'hci-audit.log'); const SALT_ROUNDS = 10; diff --git a/dist/index.html b/dist/index.html index f9df7dc..f196b0f 100644 --- a/dist/index.html +++ b/dist/index.html @@ -13,7 +13,7 @@ - + @@ -54,9 +54,9 @@ Logs Skills Workspace - Files + Files MCP - Maintenance + Maintenance