package miaou-driver-web

  1. Overview
  2. Docs
Miaou web driver (xterm.js over WebSocket)

Install

dune-project
 Dependency

Authors

Maintainers

Sources

v0.5.2.tar.gz
md5=60a3b9f181f24572a06a9492532bfdda
sha512=fcc35a275066be2900e6201782faf47503076fa4640f08cf78067835a6f447b74613009e55b2ac799adb7ca46f1bffa261fc5971753f2cc3c6bef327511c7ef6

doc/miaou-driver-web.driver/Miaou_driver_web/Web_viewer/index.html

Module Miaou_driver_web.Web_viewerSource

Standalone viewer-only HTTP+WebSocket server.

Runs alongside the headless driver so a human can open a browser and observe a TUI session driven by an AI agent in real time.

Sourcetype t

A running web viewer server.

Sourceval start : sw:Eio.Switch.t -> net:[> [> ] Eio.Net.ty ] Eio.Resource.t -> port:int -> unit -> t

start ~sw ~net ~port () starts the HTTP+WebSocket server on port. The server runs as a fiber in sw and serves:

  • / and /viewer — the xterm.js viewer page
  • /client.js — the JavaScript client
  • /ws/viewer — WebSocket endpoint for viewer connections
Sourceval broadcast : t -> rows:int -> cols:int -> string -> unit

broadcast t ~rows ~cols data sends the raw ANSI frame data to all connected viewers. The terminal dimensions rows x cols are tracked so that newly connecting viewers can resize their xterm.js terminal to match the headless driver. If the dimensions change, a JSON "dimensions" message is sent before the ANSI frame.

Sourceval url : t -> string

url t returns the viewer URL, e.g. "http://127.0.0.1:8765/viewer".