Expand description
Lua internal DSL for Blueprint authoring (flow_dsl + bp_dsl).
Raw AST (JSON) authoring cost is high at real Blueprint scale (hundreds
of lines and deep nesting for a multi-stage flow) — that cost motivated
this module. flow_dsl.lua (flow.ir vocabulary) and bp_dsl.lua
(Blueprint vocabulary, depends on flow_dsl) are baked into this
binary via include_str! and preloaded into a fresh mlua::Lua VM so
require("flow_dsl") / require("bp_dsl") resolve without touching
the filesystem. The flow-ir / mlua-swarm-schema crates are not
touched by this module — canonical JSON stays the wire format; the DSL
is purely an authoring-time convenience that emits it.
§Crate positioning
This crate is the DSL frontend only (.bp.lua → serde_json::Value).
The compile pipeline (linker → shape lint → BPReady) lives in the
sibling mlua-swarm-compile crate, which consumes the JSON this crate
produces. mlua-swarm-schema (types) stays free of the mlua runtime
dep so that consumers who only need type surfaces (e.g. the server’s
wire codec) do not transitively pull the Lua interpreter.
Functions§
- build_
bp_ from_ script - Run a
.bp.luaDSL script (source text, not a file path) in a freshmlua::LuaVM and return its result asserde_json::Value. - build_
bp_ from_ script_ with_ warnings - Like
build_bp_from_script, but also drains the authoring-time warningsbp_dsl.luaaccumulated during the run (currently the B.pipeline dead-halt lint: pipeline-levelhalt_onwith zero gate-emitting stages). Best-effort: a script that neverrequiresbp_dslyields an empty list. - preload
- Register
flow_dslandbp_dslinlua’spackage.preloadtable sorequire("flow_dsl")/require("bp_dsl")resolve to the baked-in Lua source. Idempotent to call more than once on the sameLua(each call simply re-sets the same twopreloadentries).