Skip to main content

Module dsl

Module dsl 

Source
Expand description

Lua internal DSL for Blueprint authoring (flow_dsl + bp_dsl).

Raw AST (JSON) authoring cost is high at real BP scale — see the flow-dsl design issue for the phase-b/c flow numbers that 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.

Functions§

build_bp_from_script
Run a .bp.lua DSL script (source text, not a file path) in a fresh mlua::Lua VM and return its result as serde_json::Value.
preload
Register flow_dsl and bp_dsl in lua’s package.preload table so require("flow_dsl") / require("bp_dsl") resolve to the baked-in Lua source. Idempotent to call more than once on the same Lua (each call simply re-sets the same two preload entries).