pmpx-engine
Runs what a plugin answers, and reports it as values
pmpx-engine owns the execution half of pmpx: a plugin answers what to run, and this crate decides how — resolving the real path, choosing the interpreter, inheriting stdio, waiting, translating the exit status. The pipeline is open → select → load → run: Session::open, select, load_backend/load_plugin, then flow::run_verb and run. It is the only crate in the workspace that builds a std::process::Command, and it never prints: a run is reported as Events.
API
Plan— this crate's own "what to run":program,args,cwdSession— one run's state, read once inSession::open;Optionscarries what argv saidEvent— the whole report of a run, includingPhase { name, micros, detail }ChildOutput— where a started program's output goes:Inherit, orOnStderrfor--jsonrun— resolve, spawn, wait, pass the exit code through; needs no pluginresolve/ProgramKind— the real path, and whether it isNative,CmdShimorPowerShellShimstorefeature (off by default) —install,uninstall,update,search,viewand the installed plugin set; turning it on is what pulls incrate-plugin-kit
Notes
- Without
store, thedetect,session,flowandstoremodules are not compiled; what is left is the execution core, with nocrate-plugin-kitlinked. - A backend's exit code is passed through verbatim —
Ok(code), neverErr; a code that does not fit in 8 bits becomes its low 8 bits, plus aWarning. - It measures its own phases and reports each as
Event::Phase, so a trace can attribute the time that is not the backend's runtime. - The decision lives in
pmpx-detectand the ABI inpmpx-loader; this crate is not depended on by them.
Tests: unit tests beside the code, plus cargo test -p pmpx-engine --features store for the store.
License: same as the workspace (see the repository root).