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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# HF Space Hermes Web UI Replacement Implementation Plan
|
| 2 |
+
|
| 3 |
+
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
| 4 |
+
|
| 5 |
+
**Goal:** Replace the built-in Hermes dashboard startup path in the Hugging Face Docker Space image with `hermes-web-ui`, without changing Hermes core application code.
|
| 6 |
+
|
| 7 |
+
**Architecture:** Keep the existing Hermes container and runtime bootstrap. Install the external UI during image build, enable the Hermes API server through the gateway, then run the new UI as the foreground Space process on port `7860`.
|
| 8 |
+
|
| 9 |
+
**Tech Stack:** Docker, bash entrypoint, npm global package install, Hermes gateway/API server
|
| 10 |
+
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
### Task 1: Document the Docker-only integration boundary
|
| 14 |
+
|
| 15 |
+
**Files:**
|
| 16 |
+
- Create: `E:\Codeing\hermes-agent-2026.4.13\docs\superpowers\specs\2026-04-17-hf-space-hermes-web-ui-design.md`
|
| 17 |
+
- Create: `E:\Codeing\hermes-agent-2026.4.13\docs\superpowers\plans\2026-04-17-hf-space-hermes-web-ui.md`
|
| 18 |
+
|
| 19 |
+
- [ ] **Step 1: Confirm the integration boundary**
|
| 20 |
+
|
| 21 |
+
State that only Docker/runtime files will change:
|
| 22 |
+
|
| 23 |
+
```text
|
| 24 |
+
Dockerfile
|
| 25 |
+
docker/entrypoint.sh
|
| 26 |
+
```
|
| 27 |
+
|
| 28 |
+
- [ ] **Step 2: Record the runtime contract**
|
| 29 |
+
|
| 30 |
+
Document that the new UI will consume:
|
| 31 |
+
|
| 32 |
+
```text
|
| 33 |
+
UPSTREAM=http://127.0.0.1:8642
|
| 34 |
+
PORT=7860
|
| 35 |
+
HERMES_HOME=/opt/data or runtime override
|
| 36 |
+
HERMES_BIN=/opt/hermes/.venv/bin/hermes
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
- [ ] **Step 3: Record the Hermes side requirement**
|
| 40 |
+
|
| 41 |
+
Document that the Space startup must export:
|
| 42 |
+
|
| 43 |
+
```text
|
| 44 |
+
API_SERVER_ENABLED=true
|
| 45 |
+
API_SERVER_HOST=127.0.0.1
|
| 46 |
+
API_SERVER_PORT=8642
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
### Task 2: Install hermes-web-ui during image build
|
| 50 |
+
|
| 51 |
+
**Files:**
|
| 52 |
+
- Modify: `E:\Codeing\hermes-agent-2026.4.13\Dockerfile`
|
| 53 |
+
|
| 54 |
+
- [ ] **Step 1: Add the package install in the Docker image**
|
| 55 |
+
|
| 56 |
+
Insert a pinned global install in the existing Node/npm layer:
|
| 57 |
+
|
| 58 |
+
```dockerfile
|
| 59 |
+
RUN npm install --prefer-offline --no-audit && \
|
| 60 |
+
npm install -g --no-audit hermes-web-ui@0.3.2 && \
|
| 61 |
+
npx playwright install --with-deps chromium --only-shell && \
|
| 62 |
+
cd /opt/hermes/scripts/whatsapp-bridge && \
|
| 63 |
+
npm install --prefer-offline --no-audit && \
|
| 64 |
+
npm cache clean --force
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
- [ ] **Step 2: Keep all existing Hermes build behavior intact**
|
| 68 |
+
|
| 69 |
+
Do not remove:
|
| 70 |
+
|
| 71 |
+
```dockerfile
|
| 72 |
+
npx playwright install --with-deps chromium --only-shell
|
| 73 |
+
uv venv
|
| 74 |
+
uv pip install --no-cache-dir -e ".[all]"
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
- [ ] **Step 3: Verify the Dockerfile still has a single image entrypoint**
|
| 78 |
+
|
| 79 |
+
Ensure this remains unchanged:
|
| 80 |
+
|
| 81 |
+
```dockerfile
|
| 82 |
+
ENTRYPOINT [ "/opt/hermes/docker/entrypoint.sh" ]
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
### Task 3: Replace official dashboard startup in Space mode
|
| 86 |
+
|
| 87 |
+
**Files:**
|
| 88 |
+
- Modify: `E:\Codeing\hermes-agent-2026.4.13\docker\entrypoint.sh`
|
| 89 |
+
|
| 90 |
+
- [ ] **Step 1: Write the Space-mode environment exports**
|
| 91 |
+
|
| 92 |
+
Add these inside the existing `SPACE_ID` / `SPACE_HOST` block before launching processes:
|
| 93 |
+
|
| 94 |
+
```bash
|
| 95 |
+
export API_SERVER_ENABLED="${API_SERVER_ENABLED:-true}"
|
| 96 |
+
export API_SERVER_HOST="${API_SERVER_HOST:-127.0.0.1}"
|
| 97 |
+
export API_SERVER_PORT="${API_SERVER_PORT:-8642}"
|
| 98 |
+
```
|
| 99 |
+
|
| 100 |
+
- [ ] **Step 2: Replace the dashboard command wiring**
|
| 101 |
+
|
| 102 |
+
Change the command variables to:
|
| 103 |
+
|
| 104 |
+
```bash
|
| 105 |
+
HERMES_BIN="$INSTALL_DIR/.venv/bin/hermes"
|
| 106 |
+
GATEWAY_CMD="$HERMES_BIN gateway run"
|
| 107 |
+
WEB_UI_CMD="hermes-web-ui start --host 0.0.0.0 --port 7860"
|
| 108 |
+
|
| 109 |
+
export PORT="${PORT:-7860}"
|
| 110 |
+
export UPSTREAM="${UPSTREAM:-http://127.0.0.1:${API_SERVER_PORT}}"
|
| 111 |
+
export HERMES_BIN
|
| 112 |
+
```
|
| 113 |
+
|
| 114 |
+
- [ ] **Step 3: Preserve background gateway + foreground UI process behavior**
|
| 115 |
+
|
| 116 |
+
Run:
|
| 117 |
+
|
| 118 |
+
```bash
|
| 119 |
+
$SHELL_EXEC -lc "$GATEWAY_CMD" &
|
| 120 |
+
exec $SHELL_EXEC -lc "$WEB_UI_CMD"
|
| 121 |
+
```
|
| 122 |
+
|
| 123 |
+
- [ ] **Step 4: Remove the official dashboard launch only**
|
| 124 |
+
|
| 125 |
+
Delete the old dashboard command assignment:
|
| 126 |
+
|
| 127 |
+
```bash
|
| 128 |
+
DASHBOARD_CMD="$HERMES_BIN dashboard --host 0.0.0.0 --port 7860 --no-open"
|
| 129 |
+
```
|
| 130 |
+
|
| 131 |
+
and its exec call, while leaving the rest of the bootstrap logic untouched.
|
| 132 |
+
|
| 133 |
+
### Task 4: Verify the integration wiring
|
| 134 |
+
|
| 135 |
+
**Files:**
|
| 136 |
+
- Verify: `E:\Codeing\hermes-agent-2026.4.13\Dockerfile`
|
| 137 |
+
- Verify: `E:\Codeing\hermes-agent-2026.4.13\docker\entrypoint.sh`
|
| 138 |
+
|
| 139 |
+
- [ ] **Step 1: Run shell syntax validation**
|
| 140 |
+
|
| 141 |
+
Run:
|
| 142 |
+
|
| 143 |
+
```bash
|
| 144 |
+
bash -n docker/entrypoint.sh
|
| 145 |
+
```
|
| 146 |
+
|
| 147 |
+
Expected: exit code `0` and no output
|
| 148 |
+
|
| 149 |
+
- [ ] **Step 2: Inspect the startup wiring**
|
| 150 |
+
|
| 151 |
+
Run:
|
| 152 |
+
|
| 153 |
+
```bash
|
| 154 |
+
Select-String -Path Dockerfile,docker/entrypoint.sh -Pattern "hermes-web-ui|API_SERVER_ENABLED|UPSTREAM|dashboard --host|gateway run"
|
| 155 |
+
```
|
| 156 |
+
|
| 157 |
+
Expected:
|
| 158 |
+
- `hermes-web-ui` appears in both build/runtime wiring
|
| 159 |
+
- `API_SERVER_ENABLED` appears in `docker/entrypoint.sh`
|
| 160 |
+
- the old `dashboard --host` launch no longer appears in the active Space startup path
|
| 161 |
+
|
| 162 |
+
- [ ] **Step 3: Report deployment follow-up**
|
| 163 |
+
|
| 164 |
+
State clearly that after local file changes, the Hugging Face Space still needs:
|
| 165 |
+
|
| 166 |
+
```text
|
| 167 |
+
1. upload or commit the modified files
|
| 168 |
+
2. rebuild the Docker Space
|
| 169 |
+
3. inspect startup logs to confirm gateway + hermes-web-ui both start
|
| 170 |
+
```
|