Daemon (background runs)
The daemon owns runs that outlive a single CLI command, plus the event stream and the Chrome extension bridge.
Overview#
The daemon owns runs that outlive a single CLI command, plus the event stream and the Chrome extension bridge. It binds to 127.0.0.1 only and uses a local token.
mlola browser daemon start --port 7717
mlola browser daemon status
mlola browser daemon stop
npx mlola-browserd --port 7717 # foreground, when the daemon package is installed
TOKEN=$(cat ~/.mlola/browser-runtime/daemon/token)
curl -s -H "Authorization: Bearer $TOKEN" localhost:7717/v1/health
curl -s -X POST -H "Authorization: Bearer $TOKEN" -H 'content-type: application/json' \
-d '{"goal":"Download my latest invoice","startUrl":"https://billing.example.com/invoices"}' \
localhost:7717/v1/runs
curl -s -H "Authorization: Bearer $TOKEN" "localhost:7717/v1/runs/<id>/events?since=0"
| Endpoint | Purpose |
|---|---|
| GET /v1/health | Liveness, version, protocol, sessions (no token) |
| GET /v1/meta | Protocol version + runtime capabilities |
| POST /v1/runs | Create a run (detached) |
| GET /v1/runs/:id | Status, result, pending help ids |
| GET /v1/runs/:id/events?since=N&stream=1 | Event page or SSE stream |
| POST /v1/runs/:id/cancel | Cancel the run |
| POST /v1/runs/:id/help/:helpId | Resolve a human help request |
| POST /v1/runs/:id/approvals/:id | Resolve an approval |