# MEI bridge (protocol lives in mei-studio) agent-mei opens **MEI** (Machine Educated Intelligence) artifacts authored in MeiStudio. The shared wire is implemented in mei-studio (Rust **1.94.1** — do **not** bump this editor’s toolchain to chase it): - Protocol crate: `mei-studio/crates/agent-mei-bridge` - Docs: `mei-studio/docs/agent-mei.md` - **Exact Mac patch steps:** `mei-studio/docs/agent-mei-mac-patch.md` ## Landed in this tree (source) 1. `crates/agent_mei_panel/src/agent_mei_panel.rs` — `control_dispatch`: `"mei_open"`; `"open"` routes `.mei.json` / `.mei` to it. 2. `crates/agent_mei_panel/src/mei_panel.rs` — GPUI `MeiReceiptPanel` over `mei.panel/v1` (tier, joules, measured_vs_modelled, merkle, jcr1_rows + grant toast). 3. `crates/zed/src/zed.rs` — dock loads `MeiReceiptPanel`. 4. `crates/joule_core/src/control.rs` — MCP tool `agent_mei_mei_open`. 5. `crates/joule_core/src/cascade_gate.rs` — MEI grant alignment note (no auto-export / no auto-ACP). Shells PATH binary **`mei-open`** (prefer binary over path-dep — toolchain split). No network / no phone-home. ## Headless today (works without GPUI) ```bash mei-open path/to/graph.mei.json # validate + handle JSON mei-open path/to/graph.mei.json --panel # mei.panel/v1 for the dock mei-open path/to/graph.mei.json --grant-env # → JOULE_CODE_GRANT=l0,l1,l2,l3[,l4] ``` Naked L4 is refused unless the artifact’s `grant_capabilities` contains `l4_frontier` (aligned with omitting `l4` from `JOULE_CODE_GRANT` / JCR-1 cascade gate). ## Smoke (Mac, after `mei-open` on PATH) ```bash export JOULE_CODE_CONTROL_SOCK=/tmp/jc-mei.sock export JOULE_CODE_GRANT=l0,l1,l2,l3 # no l4 agent-mei /path/to/project & agent-mei --jc-control mei_open --jc-params '{"path":"/path/to/examples/demo.mei.json"}' agent-mei --jc-control state ```