Skip to main content

Module hook_executor

Module hook_executor 

Source

Structs§

BashExecOutput
BashHookExecutor
Bash backend. Runs the configured command inside virtual_bash against the session VFS. JSON payload is delivered to the script via $EVERRUNS_HOOK_PAYLOAD_JSON (and the same JSON written to $EVERRUNS_HOOK_PAYLOAD_PATH on the session VFS); the script writes a JSON decision to stdout. Falls back to exit-code semantics when stdout is empty (Git-hook compatibility).
ExecutorOpts
Per-invocation knobs honored by every executor. The adapter clamps these against the global UserHookSpec validation; backends should treat them as already-validated.
HookPayload
Envelope handed to every executor. For bash hooks this is serialized into $EVERRUNS_HOOK_PAYLOAD_JSON / $EVERRUNS_HOOK_PAYLOAD_PATH; other backends (webhook, wasm, blueprint) consume it in their own format. data is event-specific; see specs/user-hooks.md for the per-event shape.

Constants§

HOOK_PAYLOAD_DIR
Storage-relative directory used by SessionFileSystem impls that strip the workspace prefix. The bashkit VirtualBashHookDispatcher writes to this path and exposes the workspace-prefixed equivalent to scripts.
HOOK_PAYLOAD_WORKSPACE_DIR
Workspace-relative directory the hook script reads the payload file from. Concrete dispatchers may map this onto a different storage path (e.g. the bashkit virtual_bash adapter strips the /workspace prefix before hitting the session VFS).

Traits§

BashHookDispatcher
Indirection used to route bash hook invocations through the session’s existing virtual_bash sandbox without everruns-core’s executor module having to depend on bashkit directly. The concrete VirtualBashHookDispatcher (see crate::hook_dispatch) is the production implementation.
HookExecutor
Backend that runs a single hook invocation against a single payload.

Functions§

parse_bash_output
Parse the bash backend’s output per the spec contract.
payload_filename
Filename (without directory) for a payload file. Combines a sanitized hook id with a fresh UUIDv7 so concurrent invocations don’t collide.
standard_hook_env
Build the standard env vars every bash hook receives — the canonical EVERRUNS_HOOK_PAYLOAD_JSON plus the convenience scalars documented in specs/user-hooks.md. Returns the env in declaration order so dispatcher logs render deterministically.