hosts library

Stable backend and host entrypoint for interactive terminal apps.

Prefer this library when you want the supported embedding and transport surface without importing the broader package:artisanal/tui.dart barrel.

This entrypoint includes:

  • ProgramHost for stdio, embedded, bridge, websocket, and socket runs
  • backend terminals such as EmbeddedTerminalBackend and SocketTerminalBackend
  • TerminalBridge and the JSON bridge protocol types
  • reusable browser and raw TCP host servers

Classes

BackendTerminal
Terminal implementation that layers ANSI/OSC semantics over a TerminalBackend.
BrowserTerminalHostServer
Reusable browser host server for remote TUI sessions.
EmbeddedTerminalBackend
Generic embedded backend backed by callbacks and externally supplied streams.
JsonTerminalBackend
Message-oriented backend that speaks the terminal bridge JSON protocol.
ProgramHost
Reusable launch target for a Program.
ProgramHostBinding
Resolved runtime configuration produced by a ProgramHost.
ProgramOptions
Options for configuring the TUI program.
SocketTerminalBackend
Socket-backed backend for remote/shell-mode terminal hosts.
SocketTerminalHostServer
Reusable raw socket host server for remote TUI sessions.
StdioTerminalBackend
Native stdio backend for BackendTerminal.
TerminalBackend
Low-level I/O backend for a terminal host.
TerminalBridge
Bridge controller for embedded terminal hosts such as xterm.js, sockets, or custom UI surfaces.
TerminalBridgeJsonChannel
JSON message channel layered over a TerminalBridge.
TerminalBridgeMessage
JSON-serializable bridge message for remote/browser terminal hosts.
WebSocketTerminalBackend
WebSocket-backed backend that speaks the terminal bridge JSON protocol.

Enums

TerminalBridgeMessageType
Message kinds used by TerminalBridgeMessage.

Typedefs

BrowserTerminalSessionHandler = Future<void> Function(WebSocket socket)
Session handler invoked for each accepted browser websocket connection.
ProgramHostResolver = ProgramHostBinding Function(ProgramOptions options)
Resolves a reusable launch target for a Program.
SocketTerminalSessionHandler = Future<void> Function(Socket socket)
Session handler invoked for each accepted raw socket terminal connection.
TerminalDimensions = ({int height, int width})
Terminal dimensions expressed in cells.