Expand description
Plugin runtime: wasmtime Component Model.
Replaces the dlopen-era libloading implementation with a sandboxed
WebAssembly Component Model runtime. See
docs/superpowers/specs/2026-04-27-wasm-plugin-runtime-design.md for
the full design.
Pipeline:
PluginManager::new()builds a sharedwasmtime::Engine.- For each enabled
plugins.tomlentry,load_plugineither uses the.cwasmcache (if all 5 trust conditions hold) or precompiles in-memory. - Per-plugin
Store<HostContext>is created once and reused for everyexec/ hook dispatch. with_envis the single dispatch wrapper. AnEnvGuardRAII guard binds a raw*mut ShellEnvfor the duration of the callback and resets to null on every exit path (Ok/Err/panic). The pointer is the onlyunsafesite in the binding layer.exec_commandreturns a 3-valuedPluginExecso callers insrc/exec/cannot accidentally fall through to PATH lookup when a plugin handler exists but failed.
Modules§
- cache
- cwasm cache key + sidecar metadata + 5-condition trust validation.
- config
- pattern
- Glob-style argv allowlist patterns for the
commands:execcapability.
Structs§
- Plugin
Manager - Manages loaded plugins and dispatches commands/hooks.
Enums§
- Plugin
Exec - Result of attempting to dispatch a command to the plugin layer.