02 · Configure & compile
The core is a set of pure MUFL libraries with no standalone build — your config.mufl merges its exports with the MUFL stdlib, and your application file loads the libraries by name. This page produces your first compiled packet (.muflo).
Prereqs:
- 01 · Vendor the core completed (
mufl_code/corepopulated). $ADAPT_TOOLKITexported (see Start here).
Steps:
Create
mufl_code/config.mufl. The core ships its own compile configuration whose$exportsblock lists the seven libraries; your top-level config pulls it in withconfig_load #"core"and merges it with the stdlib:muflconfig script { stdlib_config = (config_load #$MUFL_STDLIB_PATH). core_config = (config_load #"core"). ( $imports -> ( $libraries -> (stdlib_config $exports $libraries) '(core_config $exports $libraries) '($protocol_container -> #"protocol_container.mm"), ), $exports -> ( $libraries -> (,), $applications -> (,) ) ). }Create
mufl_code/protocol_container.mm. This is a boot requirement: the SDK runs::protocol_container::init_my_ipdon every packet during broker registration, so every application packet must ship this library (the config above maps it in). 03 · Wire the host explains the boot sequence; the stub is:mufl// Minimal protocol_container library — provides ::protocol_container::init_my_ipd, // which the ADAPT wrapper runs on every packet during broker registration // (possession-proof / identity-proof-document setup). Mirrors the toolkit's // per-unit protocol_container stub; deps resolve from the stdlib. library protocol_container loads libraries identity_proof_document, identity_proof_document_types, native_attestation_document, browser_attestation_document, current_transaction_info uses transactions { trn init_my_ipd _ { current_transaction_info::validate_origin (::transaction::envelope::origin::user,). identity_proof_document_types::set_my_ipd(identity_proof_document::create()). return ::transaction::success []. } }Create a minimal application,
mufl_code/my_agent.mu. The file name is yours; the application name must beactor(the wire-visible inbound transaction names are::actor::*— 03 · Wire the host covers why):mufl// Minimal first packet: proves the config merge + compile work. application actor loads libraries protocol_container, version uses transactions { trn readonly get_version _ { return ($core -> (version::get_core_version NIL)). } }Compile from inside
mufl_code/:shcd mufl_code MUFL_STDLIB_PATH="$ADAPT_TOOLKIT/mufl_stdlib" \ "$ADAPT_TOOLKIT/build.linux.release/mufl-compile" \ -mp "$ADAPT_TOOLKIT/meta" -mp "$ADAPT_TOOLKIT/transactions" my_agent.muUnused symbolwarnings from stdlib libraries are expected noise.
Verify:
ls *.mufloSuccess markers:
- The compiler's last line is
SAVED TO FILE: <…muflo>. ls *.mufloshows exactly one content-hash-named unit, e.g.2272124BF5B3D5E124487F68AFCC075581688F01A055EBC54F8C6EC6CC3047A5.muflo.
Next: 03 · Wire the host.