Skip to content

Module map

The main sections follow the workspace crate boundaries, beginning with the shared contract and ending with the adapters and portable models. Cargo.toml:2-14

The shared wire contract defines execution, file-transfer, health, lifecycle-hook, identity, and tunnel types used by the daemon and client stack. crates/protocol/src/lib.rs:30-35 Its module declarations are the starting point for a wire-format change; transport implementations live in their consumers. crates/protocol/src/lib.rs:16-21

The guest daemon owns command execution, file transfer, lifecycle hooks, guest identity setup, TCP relay handlers, and the optional guest power-off after an exec’s process group ends. crates/agentd/src/lib.rs:37-57 Its router assembles the endpoint descriptions into the served application, while the schema module describes request and response shapes. crates/agentd/src/routes.rs:29-58 crates/agentd/src/schema.rs:2-12

The domain layer owns the values and rules shared by client surfaces: sizing, cost, service constraints, regions, names, errors, hook timeouts, and identity material. crates/microvms-domain/src/lib.rs:32-50 Rules receive ambient inputs as arguments, leaving production I/O to higher layers. crates/microvms-domain/src/lib.rs:2-21

The application layer owns the control-plane client, sandbox lifecycle, in-VM sessions, image preparation, and coding-agent recipes. crates/microvms-app/src/lib.rs:2-5 It declares the ports used for transport, local storage, time, entropy, provisioning, and other external effects; production implementations come from the edges layer. crates/microvms-app/src/lib.rs:6-12 crates/microvms-app/src/lib.rs:29-34

The edges layer implements the application ports with production I/O: signed control-plane requests, daemon HTTP calls, socket relays, local storage, release retrieval, clock, and entropy. crates/microvms-edges/src/lib.rs:2-22 The files below lead to the connection-serving loops and provisioning paths; the crate root also identifies the smaller port implementations. crates/microvms-edges/src/session/serve.rs:2-6 crates/microvms-edges/src/provision.rs:2-3 crates/microvms-edges/src/lib.rs:28-41

The composition root presents the Rust client API used by the CLI and language bindings, re-exporting the domain, application, edges, and protocol layers. crates/microvms-core/src/lib.rs:55-95 Its prelude supplies extension traits that construct application types with production ports. crates/microvms-core/src/prelude.rs:2-17

The microvm binary parses the command tree, dispatches handlers through its library seam, and renders command results. crates/microvms-cli/src/main.rs:81-108 crates/microvms-cli/src/main.rs:182-240 Command modules group lifecycle work, operations on existing VMs, local operations, and coding-agent workflows; project configuration supplies another source of run options. crates/microvms-cli/src/commands/mod.rs:25-39 crates/microvms-cli/src/config.rs:2-6

The Python binding maps the core client into PyO3 classes for values, lifecycle operations, sessions, execution, and coding-agent workflows. bindings/microvms-py/src/lib.rs:44-57 Blocking methods and awaitable _async twins use a shared Tokio runtime; the runtime module owns that bridge and its cancellation policies. bindings/microvms-py/src/runtime.rs:4-42

The Node binding exposes the core client through napi-rs classes, result objects, and options. bindings/microvms-js/src/lib.rs:17-35 Async exports return promises, and execution also has a process-style interface with separate output streams, waiting, and termination. bindings/microvms-js/src/lib.rs:62-78 bindings/microvms-js/src/process.rs:2-8

The portable model crate expresses daemon and client behavior as state machines checked with Stateright. crates/model/src/lib.rs:2-6 Its modules cover bootstrap and execution, client lifecycle, image preparation, output, launch posture, preflight, provisioning, completion, tunnels, and Dockerfile wrapping. crates/model/src/lib.rs:36-47 These specifications remain separate from the implementation exercised by the model-conformance crate. crates/model-conformance/src/lib.rs:2-10

These pages cite many of the same source files as this one.