Skip to main content

ActionPlugin

Trait ActionPlugin 

Source
pub trait ActionPlugin: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn execute(
        &self,
        action: &Action,
        ctx: &ExecCtx<'_>,
    ) -> Result<ExecStep, ExecError>;
}
Expand description

Uniform registration surface for every Tier-1 action.

Implementations MUST be Send + Sync so the registry can be threaded across executor threads without interior locking. execute takes the parsed Action (not a serde_json::Value): the parse step in grex-core::pack has already validated shape + invariants, and the executors that will consume this trait in M4-B already own a typed &Action. Taking the typed form keeps the trait zero-cost at the boundary and defers the “raw Value for external plugins” form to the dylib / WASM work in M5+.

Required Methods§

Source

fn name(&self) -> &str

Short kebab-case name matching the YAML key and Action::name. Used as the key inside Registry.

Source

fn execute( &self, action: &Action, ctx: &ExecCtx<'_>, ) -> Result<ExecStep, ExecError>

Execute one Action against ctx.

§Errors

Returns ExecError on variable-expansion failure, invalid paths, require failure under on_fail: error, exec shape invariants, or filesystem I/O error (wet-run plugins only).

Implementors§