Expand description
On-disk plugin discovery (PL8.B).
A plugin lives in its own directory under ~/.config/lattice/plugins/,
holding a plugin.toml manifest and a .wasm component. Discovery scans that
tree, parses each manifest, and reads the component bytes — every failure is a
logged skip, never fatal: one malformed plugin dir must not stop the others
or fail boot (the four-artefact graceful-degradation clause).
Structs§
- Discovered
Plugin - A plugin found on disk, ready to load: its parsed manifest, the component bytes, and the directory it came from (for diagnostics).
Functions§
- default_
core_ plugins_ dir - The core-plugins root — prebuilt plugins that ship WITH lattice
(plugin-manager.md §7 / PM.1). Distinct from
default_plugins_dir(the user’srequire+build cache): core plugins are the batteries-included set, discovered at boot at theBundledtier. Resolved via a SEARCH PATH — the first existing candidate wins, except an explicit$LATTICE_RUNTIMEoverride always wins (whether or not it exists yet): - default_
init_ dir - The user’s
init.rsconfig plugin directory:~/.config/lattice/init/on Linux AND macOS (honoring$XDG_CONFIG_HOME),%APPDATA%\lattice\initon Windows. Holds the user’sinit.rs-compiled component + itsplugin.toml(id = "init",provides = [...]for the seams it uses). Loaded at boot with a boot-capability (Bundled) tier — it’s the user’s own trusted config, not an external install.Noneif the platform has no config dir. - default_
plugins_ dir - The default plugins directory:
~/.config/lattice/plugins/on Linux AND macOS (honoring$XDG_CONFIG_HOME),%APPDATA%\lattice\pluginson Windows.Noneif the platform has no config dir (the editor then loads no on-disk plugins). - default_
source_ cache_ dir - PM.6/PM.7b: the git source cache —
~/.config/lattice/cache/sources/. - discover
- Scan
dirfor plugin subdirectories, returning every one that parses. A missingdiryields an empty list (no plugins installed — normal). Each subdirectory needs aplugin.toml+ exactly one.wasm; anything else is logged atwarn/debugand skipped. - discover_
one - Parse a single explicitly-named plugin directory — the
:plugin-load <path>entry point (PL8.C). Unlikediscover(which scans a tree and silently skips non-plugin subdirs), this is a direct request for one dir, so a missing manifest is an error the user sees, not a silent skip.