Expand description
Blueprint loader (Phase B). Loads a Blueprint from a JSON / YAML file
and recursively expands the internal {"$file": "..."} refs.
§File-ref expansion
Anywhere inside the JSON value, this form is replaced by the referenced file’s contents as a raw string. Paths are resolved relative to the Blueprint file’s directory:
{ "$file": "prompts/system-writer.md" }Typical uses:
- Externalising a large prompt out of a flow
Step.in:{"op":"lit","value":{"$file":"prompts/x.md"}}. - Externalising any field inside
AgentDef.spec(system_prompt, args, etc.). - Externalising per-agent or global
hints.
§Agent-md ref expansion (structured ref)
Specialised ref that expands an agent.md (frontmatter + body) into
an AgentDef object:
{
"agents": [
{ "$agent_md": "agents/domain-researcher.md" }
]
}Where $file returns a raw string, $agent_md runs the file through
agent_md_loader::parse and returns a fully-populated AgentDef JSON
object with profile.system_prompt, meta, spec, and so on already
filled in. Path hygiene matches $file: absolute paths and .. are
rejected.
Enums§
- Load
Error - Everything that can go wrong while loading and
$file/$agent_mdexpanding a Blueprint from disk.
Functions§
- expand_
file_ refs default_kindis the fallback used when a$agent_mdhas no siblingkind— it should already be resolved by upper layers of the four-layer cascade. Callers resolve the BP top-leveldefault_agent_kindand any CLI override before calling this function and pass in the literal kind.- load_
blueprint_ from_ path - Load a Blueprint from a file path. Detects JSON vs. YAML by
extension, recursively expands
$filerefs, and parses the result into a typedBlueprint. - pre_
read_ default_ agent_ kind - Pull
default_agent_kindout of the raw BP JSON top level. Falls back to the schema’sDefaultimpl (Operator) if the key is missing or its type does not match. This is the first stage of resolving the default kind used insideexpand_file_refswhen a$agent_mdhas no siblingkindoverride.