Skip to main content
Rezi pins a small set of ABI constants that must match the Zireael engine. These values are exported from @rezi-ui/core so wrappers and tooling can validate compatibility.

Version Pins

ConstantValueNotes
ZR_ENGINE_ABI_MAJOR1Engine ABI major version
ZR_ENGINE_ABI_MINOR2Engine ABI minor version
ZR_ENGINE_ABI_PATCH0Engine ABI patch version
ZR_DRAWLIST_VERSION_V11ZRDL v1 drawlist format
ZR_DRAWLIST_VERSION_V22ZRDL v2 drawlist format
ZR_DRAWLIST_VERSION_V33ZRDL v3 drawlist format
ZR_DRAWLIST_VERSION_V44ZRDL v4 drawlist format
ZR_DRAWLIST_VERSION_V55ZRDL v5 drawlist format
ZR_EVENT_BATCH_VERSION_V11ZREV v1 event batch format
ZR_UNICODE_VERSION_MAJOR15Unicode version (major)
ZR_UNICODE_VERSION_MINOR1Unicode version (minor)
ZR_UNICODE_VERSION_PATCH0Unicode version (patch)

Magic Numbers

ConstantValueMeaning
ZRDL_MAGIC0x4C44525A”ZRDL” as little-endian u32
ZREV_MAGIC0x5645525A”ZREV” as little-endian u32

Cursor Shapes

ConstantValueMeaning
ZR_CURSOR_SHAPE_BLOCK0Block cursor
ZR_CURSOR_SHAPE_UNDERLINE1Underline cursor
ZR_CURSOR_SHAPE_BAR2Bar cursor

Result Codes

ZrResult values are returned by engine FFI calls.
NameValueMeaning
OK0Success
ERR_INVALID_ARGUMENT-1Invalid argument or impossible value
ERR_OOM-2Allocation failed
ERR_LIMIT-3Buffer too small or cap exceeded
ERR_UNSUPPORTED-4Unknown version/opcode/feature
ERR_FORMAT-5Malformed binary data
ERR_PLATFORM-6OS/terminal error

Key Codes & Modifiers

Key code and modifier constants are ABI-pinned and exported from @rezi-ui/core.

Special Keys

KeyCode
ZR_KEY_UNKNOWN0
ZR_KEY_ESCAPE1
ZR_KEY_ENTER2
ZR_KEY_TAB3
ZR_KEY_BACKSPACE4
KeyCode
ZR_KEY_INSERT10
ZR_KEY_DELETE11
ZR_KEY_HOME12
ZR_KEY_END13
ZR_KEY_PAGE_UP14
ZR_KEY_PAGE_DOWN15

Arrow Keys

KeyCode
ZR_KEY_UP20
ZR_KEY_DOWN21
ZR_KEY_LEFT22
ZR_KEY_RIGHT23

Function Keys

KeyCode
ZR_KEY_F1100
ZR_KEY_F2101
ZR_KEY_F3102
ZR_KEY_F4103
ZR_KEY_F5104
ZR_KEY_F6105
ZR_KEY_F7106
ZR_KEY_F8107
ZR_KEY_F9108
ZR_KEY_F10109
ZR_KEY_F11110
ZR_KEY_F12111

ASCII Keys

Printable ASCII keys use their codepoints:
  • ZR_KEY_SPACE is 32
  • Letters A-Z use 65-90
  • Digits 0-9 use 48-57
  • Common punctuation/symbols use 32-126

Modifiers (bitmask)

ModifierBit
ZR_MOD_SHIFT1 << 0
ZR_MOD_CTRL1 << 1
ZR_MOD_ALT1 << 2
ZR_MOD_META1 << 3
When a ZREV key event is parsed, mods is the bitmask of these flags.

ZREV Record Kinds

ZREV events use a numeric record kind in the binary format:
KindValueMeaning
key1Key press/release/repeat
text2Unicode codepoint input
paste3Bracketed paste bytes
mouse4Mouse move/click/drag/scroll
resize5Terminal size change
tick6Frame timing delta
user7App-defined payload

Mouse Kinds

Mouse kindValue
move1
drag2
down3
up4
wheel5
These numeric values intentionally mirror the Zireael C header to keep mouse event routing stable across the TypeScript and native boundaries.

Build docs developers (and LLMs) love