Dispose of all resources. Idempotent.
Get terminal capabilities.
Resolves with the terminal's capability snapshot. Should be called after start() to get accurate values.
Terminal capabilities
Poll for the next event batch.
This is poll-based rather than callback-based to avoid callbacks from native. Resolves with the next batch when available.
Post a user event without blocking.
This is thread-safe and can wake a blocking engine poll.
User-defined tag for the event
Arbitrary payload bytes
Submit a frame to be rendered.
Frame submission is async and must not block the main thread. Drawlist bytes are ZRDL v1 and MUST be treated as immutable by the backend.
ZRDL v1 drawlist bytes
Start the backend (initialize engine, enter raw mode, etc.). Resolves when the backend is ready to process frames.
Stop the backend (exit raw mode, cleanup). Resolves when stopped.
Backend interface for the app runtime.
The app runtime is backend-agnostic but requires a backend with explicit buffer ownership. The Node backend's worker protocol is one implementation of this contract.
See
docs/backend/worker-model.md for the Node implementation details.