zshot/cliDownload

Navigator Sessions

Drive a navigator session interactively, one action per call, while the server holds the browser open between requests. All endpoints accept POST JSON bodies under the server’s authentication.

EndpointBodyResponse
/sessions/startRender request with navigate set to the goalFirst frame
/sessions/actsession, seq, replyNext frame
/sessions/finishsession, and optionally outcome, statement, discardFinal render

Frames

Each frame contains the navigator prompt: the goal, the page accessibility text with element refs such as @e7, and available actions.

{
  "session": "6dfd8976-d2fa-4c8a-8b8c-137e04354f41",
  "seq": 1,
  "frame": {
    "text": "…",
    "images": [{ "media_type": "image/png", "data": "<base64>" }]
  }
}

images includes a page screenshot when available, such as after a VISION action.

Set navigator_frames to compact in /sessions/start and each frame after the first holds only the sections that changed. A reply of FULL_FRAME returns every section again. A compact frame re-sent for a mismatched seq notes the mismatch on its first line.

Acting

reply carries one action such as CLICK @e4 or FILL @e7: Ada, and seq identifies the frame being answered. Requests with a mismatched seq are no-ops that return the current frame, making retries safe after lost responses. Only one call can act on a session at a time; concurrent calls return 409.

curl -X POST localhost:3000/sessions/act \
  -H 'Content-Type: application/json' \
  -d '{"session": "6dfd8976-d2fa-4c8a-8b8c-137e04354f41", "seq": 1, "reply": "CLICK @e4"}'

Finishing

/sessions/finish closes the session and returns the same response as POST /: the output in the session’s output_type, plus Link headers for any additional assets such as with_navigator_video.

FieldMeaning
outcomedone by default, or impossible, which returns 502
statementCaller-provided summary returned by goal output
discardSet true to close the session without rendering, returning 204

Send DONE and IMPOSSIBLE through /sessions/finish; /sessions/act rejects them with 400. If the navigator needs another turn, such as when a --navigator-goal condition is unmet, /sessions/finish returns 409 with the next frame and keeps the session open.

Limits

Idle sessions are closed after --server-session-idle-timeout. Requests to closed sessions return 404. navigator_max_steps defaults to 100.

Each open session counts as an active render toward --server-max-concurrency and /status.