Skip to main content

Module bridge

Module bridge 

Source
Expand description

Layer 0: Runtime Primitives

Registers Rust-backed functions into the alc.* Lua namespace. These provide capabilities that cannot be expressed in Pure Lua: I/O (state), serialization (json), host communication (llm), and text processing (chunk).

All functions registered here are available in every Lua session without explicit require().

Structs§

BridgeConfig
All handles needed by Layer 0 runtime primitives.

Constants§

PRELUDE
Layer 1 prelude (also used by fork to setup child VMs).

Functions§

install_for_pkg_test
Install the production alc.* primitive surface plus the mock layer on lua for use by the alc_pkg_test sandbox.
register
Register all Layer 0 runtime primitives onto the given table.
register_env
Register alc.env on the given alc table and store the snapshot as side-band app-data on lua so fork children can inherit it via lua.app_data_ref::<Arc<HashMap<String,String>>>().