mlua_swarm_compile/lib.rs
1//! Blueprint compile pipeline for mlua-swarm.
2//!
3//! # Position in the crate graph
4//!
5//! - `mlua-swarm-schema` — pure Blueprint / AgentDef types (no runtime dep).
6//! - `mlua-swarm-dsl` — Lua authoring frontend (`.bp.lua` → `serde_json::Value`).
7//! - **`mlua-swarm-compile`** (this crate) — takes a wire body
8//! (`serde_json::Value`, whether hand-written or DSL-produced) and turns
9//! it into a `BPReady` state: refs resolved via the linker's include
10//! cascade, agent.md frontmatter parsed into `AgentDef`, and shape checks
11//! applied. Consumed by both the CLI (`mse bp lint` / `mse bp build`) and
12//! the server register path.
13//! - `mlua-swarm` — engine runtime (dispatch / middleware / spawner
14//! adapters), depends on this crate for the register-time transformation.
15//! - `mlua-swarm-cli` / `mlua-swarm-server` — call into this crate at the
16//! HTTP request → typed BP boundary, so authoring and registration go
17//! through the same code (single-linker discipline, GH issue 4c4e3eb8).
18
19pub mod agent_md;
20pub mod linker;
21
22pub use linker::{
23 env_blueprint_includes, expand_file_refs, expand_file_refs_with_config,
24 load_blueprint_from_path, pre_read_default_agent_kind, pre_read_in_bp_includes, LoadError,
25 ResolveConfig,
26};