Skip to main content

Module bridge

Module bridge 

Source
Expand description

Lua bridge — parses Lua-authored BluePrints (a Lua-table representation of mlua_flow_ir::Node) into a Rust Node, plus the initial ctx when the Lua source also builds one.

This module is parse-only. Execution goes through crate::service::TaskLaunchService (compile, service::linker::link, Engine::dispatch_attempt_with), not through this bridge — the one-shot glue that used to live here (build a throwaway mlua::Lua, parse, then drive the result straight through an EngineDispatcher) was retired once TaskLaunchService became the sole production entry point.

mlua-flow-ir also ships a sync path (flow.eval) that lets a dispatcher be written on the Lua side, but engine-async ↔ sync impedance forces a block_on there. That would violate our discipline, so we do not use it.

Functions§

parse_lua_blueprint
Load a Lua source, evaluate it, and pull out a BluePrint Node (mlua_flow_ir::Node). The Lua source must ultimately return a table — one that follows the flow.ir schema.
parse_lua_blueprint_with_ctx
Load a Lua source, and also build the initial ctx (a Lua table) on the Lua side and convert it to a JSON Value. Returns (BluePrint, initial ctx). The Lua source is expected to return a table of the form return { bp = ..., ctx = ... }.