| 163 | } |
| 164 | |
| 165 | function showHelp() { |
| 166 | console.log(` |
| 167 | Agent Canvas Static-frontend Development Stack |
| 168 | |
| 169 | Runs the automation stack, but serves a production build of the |
| 170 | frontend via scripts/static-server.mjs. Use this when a remote or flaky network |
| 171 | makes Vite's per-module requests painful (e.g. ngrok or plane wifi). |
| 172 | |
| 173 | USAGE: |
| 174 | npm run dev:static [-- options] |
| 175 | |
| 176 | OPTIONS: |
| 177 | -p, --port <port> Ingress port (default: 8000) |
| 178 | -H, --host <host> Bind address for ingress/static (default: 127.0.0.1) |
| 179 | --allow-lan-session-key Inject the session key on a non-loopback bind (opt-in) |
| 180 | --automation-ref <ref> Git ref for automation backend (default: main) |
| 181 | --automation-repo <url> Git repo URL for automation |
| 182 | --skip-build Reuse existing build/ directory (faster restart) |
| 183 | -v, --verbose Set backend log level to DEBUG (default: WARNING) |
| 184 | -h, --help Show this help |
| 185 | |
| 186 | ENVIRONMENT VARIABLES: |
| 187 | PORT Alternative to --port |
| 188 | OH_AUTOMATION_GIT_REF Alternative to --automation-ref |
| 189 | OH_AGENT_SERVER_GIT_REF Git ref for agent-server SDK |
| 190 | OH_SECRET_KEY Secret key for sessions |
| 191 | LOG_LEVEL Log level for both backends (default: WARNING) |
| 192 | Python names and aliases both work; aliases and |
| 193 | numbers are mapped onto Uvicorn's own set. |
| 194 | AUTOMATION_LOG_LEVEL Log level for the automation service only |
| 195 | (default: LOG_LEVEL) |
| 196 | |
| 197 | ACCESS POINTS: |
| 198 | Main UI: http://localhost:PORT/ |
| 199 | API Docs: http://localhost:PORT/api/automation/docs |
| 200 | |
| 201 | NOTES: |
| 202 | • The build is produced once at startup. Edit the source and rerun this |
| 203 | command (or rebuild with \`npm run build:app\`) to pick up changes. |
| 204 | • The static server sends ETag headers, so reloads return 304s instead of |
| 205 | refetching content — much friendlier on slow links. |
| 206 | `); |
| 207 | } |
| 208 | |
| 209 | // ═══════════════════════════════════════════════════════════════════════════ |
| 210 | // Prerequisites & Setup |