Expand description
PM.7: the host side of the require seam.
Design: plugin-manager.md
§3, §6. A guest (in practice the user’s init.rs) calls
plugin-manager.require(spec) from its register-plugins export; the
Host impl records the spec into this Store’s [RequireContributions],
and PluginHost::spawn_plugin_manager_plugin drains them after the
export returns.
The record-then-drain split is the register-mode / register-grammar
precedent, and here it is load-bearing rather than merely consistent: a
require that resolved inline would put a git clone and a cargo build
inside a guest call on the boot path. The host drains and runs the pipeline
off-thread instead, so the editor draws its first frame without waiting on
a network it may not even have.
This module does not resolve, build or load anything. It converts a WIT
spec into a host RequiredPlugin and hands it back; the pipeline that
consumes it lives in lattice-plugin-loader, which is where resolve and
build_plugin already live and where the loader’s registries are reachable.
Keeping the boundary this thin is what lets the pipeline be tested without
standing up a wasm guest at all.
Structs§
- Required
Plugin - One plugin a guest declared via
require.
Enums§
- Required
Source - Where a required plugin comes from. The host-side mirror of the WIT
plugin-sourcevariant.
Functions§
- is_
safe_ plugin_ name - Is
namea single safe path component?