digraph {
  rankdir = "BT"
  audio_server [label = "internal/audio_server.sock", shape = "rectangle"]
  browser [label = "Browser"]
  confirmationui_sign [label = "internal/confui_sign.sock", shape = "rectangle"]
  gnss_grpc_proxy
  gnss_grpc_server [label = "GNSS gRPC server", shape = "rectangle"]
  host_bluetooth [label = "Host bluetooth (netsim / rootcanal)"]
  host_confirmationui_in [label = "internal/confui_fifo_vm.in", shape = "rectangle"]
  host_confirmationui_out [label = "internal/confui_fifo_vm.out", shape = "rectangle"]
  keyboard_server [label = "internal/keyboard.sock", shape = "rectangle"]
  touch_server [label = "internal/touch_N.sock", shape = "rectangle"]
  run_cvd
  operator_proxy
  secure_env
  socket_vsock_proxy
  wayland_socket [label = "internal/frames.sock", shape = "rectangle"]
  webrtc [label = < <B>webrtc</B> >, penwidth = 2]
  vmm [label = "crosvm"]

  subgraph cluster_host {
    label = "cuttlefish-user Debian package"

    operator [label = "Host Orchestrator"]
    operator_socket [label = "/run/cuttlefish/operator", shape = "rectangle"]
  }

  subgraph cluster_android {
    label = "Cuttlefish VM"
    subgraph devices {
      rank = same;
      confirmationui_console [label = "/dev/hvc8", shape = "rectangle"]
      keyboard_input [label = "/dev/input/event3 | keyboard", shape = "rectangle"]
      touch_input [label = "/dev/input/event2 | touch", shape = "rectangle"]
    }
    adb_daemon [label = "ADB Daemon"]
    confirmationui [label = "ConfirmationUI HAL"]
  }

  operator -> browser [label = < <I>HTTPS</I> (1443) >, dir = both]
  webrtc -> browser [label = < <I>WebRTC</I> >, dir = both]
  operator_proxy -> browser [label = < <I>HTTPS</I> (8443) >, dir = both]
  operator -> operator_proxy [label = < <I>HTTP</I> (1080) >, dir = both]
  operator_socket -> operator [label = < <I>JSON</I> >, dir = both]
  webrtc -> operator_socket [label = < <I>JSON</I> >, dir = both]
  webrtc -> run_cvd [dir = back]
  webrtc -> host_bluetooth

  webrtc -> confirmationui_sign -> secure_env [dir = both]
  webrtc -> gnss_grpc_server -> gnss_grpc_proxy [dir = both, label = "TCP"]

  adb_daemon -> socket_vsock_proxy -> webrtc [dir = both]

  audio_server -> webrtc [dir = both]
  vmm -> audio_server [dir = both]

  vmm -> wayland_socket -> webrtc [label = < <I>Wayland</I> >, dir = both]

  vmm -> keyboard_server -> webrtc [dir = back]

  vmm -> touch_server -> webrtc [dir = back]

  vmm -> host_confirmationui_out -> webrtc
  vmm -> host_confirmationui_in -> webrtc [dir = back]

  confirmationui -> confirmationui_console -> vmm [dir = both]

  keyboard_input -> vmm
  touch_input -> vmm
}
