Overview

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.

Lifecycle
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
Local API
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"
EndpointPurpose
GET /v1/healthLiveness, version, protocol, sessions (no token)
GET /v1/metaProtocol version + runtime capabilities
POST /v1/runsCreate a run (detached)
GET /v1/runs/:idStatus, result, pending help ids
GET /v1/runs/:id/events?since=N&stream=1Event page or SSE stream
POST /v1/runs/:id/cancelCancel the run
POST /v1/runs/:id/help/:helpIdResolve a human help request
POST /v1/runs/:id/approvals/:idResolve an approval