MAGI
Internals
Crate path, key types, adjacent protocols for MAGI.
MAGI (Multi-Agentic Glass-box Interpretation) lives in protocols/magi-lib. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols.
Source
| Path | Contains |
|---|---|
protocols/magi-lib/src/lib.rs | ProtocolModule impl, operation dispatch |
protocols/magi-lib/src/protocol.rs | core protocol logic |
protocols/magi-lib/src/types.rs | request/response types (derive schemars::JsonSchema) |
protocols/magi-lib/tests/ | unit + integration tests |
schemas/magi/v1/ | published JSON Schemas |
ProtocolModule contract
impl ProtocolModule for MagiProtocol {
fn protocol_name(&self) -> &'static str { "MAGI" }
fn version(&self) -> &'static str { "v1.0.0" }
fn operations(&self) -> Vec<&'static str> {
vec![
"trace",
"attribute",
"circuit",
]
}
async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext)
-> Result<Response, ProtocolError>
{
match op {
"trace" => self.trace(payload, ctx).await,
"attribute" => self.attribute(payload, ctx).await,
"circuit" => self.circuit(payload, ctx).await,
_ => Err(ProtocolError::UnknownOperation(op.into())),
}
}
}Adjacent
| Relation | Members |
|---|---|
| Consults | — |
| Records to | MAX · MOTET · MOMENT |
| Subject to | MAXIM · MOAT (cross-org) · MOOT (disputes) |
| Settled with | MEAL · MANA · MADE |
Status
Partial · core methods implemented; some features pending.
Tests
cargo test -p magi-lib --all-featuresSee also
ProtocolModuletrait — the contract- Engine pipeline — the 8 stages
- Plugins — author your own