/** * Hook Executor * * Executes user-configured shell commands after workflow operations. * Commands run as child processes with timeout protection. * * ## Hook payload (Phase 4.5 — audit cli-headless F10) * * Workflows pass a compact JSON summary of the completed operation. Hooks * receive it two ways (use whichever fits the script): * * - `$PLUGINATOR_PAYLOAD` env var — convenient for one-liners * (`curl -d "$PLUGINATOR_PAYLOAD" https://discord...`). Omitted when the * payload exceeds {@link MAX_PAYLOAD_ENV_BYTES} (env-size safety); stdin * always carries it. * - stdin — the full payload, newline-terminated (`jq .` works directly). * * The payload shape is event-specific (see each workflow's call site); every * payload has an `event` field matching `$PLUGINATOR_EVENT`. The Phase 3 env * allowlist is unchanged — PLUGINATOR_PAYLOAD is injected by Pluginator like * PLUGINATOR_EVENT, not passed through from the parent environment. * * @since v2.9.1 */ import type { HookConfig, HookEvent, HookResult } from './hook-types.js'; /** * Payloads above this size are delivered via stdin ONLY — oversized env vars * risk E2BIG at exec time on some platforms. Typical payloads (counts + * plugin name/version lists) are well under 4KB. */ export declare const MAX_PAYLOAD_ENV_BYTES: number; /** * Build a minimal env object for hook subprocesses by intersecting the parent * env with HOOK_ENV_ALLOWLIST. Always sets PLUGINATOR_EVENT; sets * PLUGINATOR_PAYLOAD when a payload is provided (and small enough — see * MAX_PAYLOAD_ENV_BYTES). Both PLUGINATOR_* vars are INJECTED by Pluginator, * not passed through from the parent env — the Phase 3 allowlist semantics * are unchanged. * * Exported for testability. */ export declare function buildHookEnv(parentEnv: NodeJS.ProcessEnv, event: HookEvent, payload?: string): NodeJS.ProcessEnv; /** * Execute a single hook command. Returns null if the hook is disabled. * * @param payload Optional JSON summary of the completed operation — delivered * via `$PLUGINATOR_PAYLOAD` AND stdin (newline-terminated). See module doc. */ export declare function executeHook(hook: HookConfig, payload?: string): Promise; /** * Execute all enabled hooks for a specific event, sequentially. * * @param payload Optional JSON summary forwarded to every matching hook * (env var + stdin — see module doc). */ export declare function executeHooksForEvent(hooks: HookConfig[], event: HookEvent, payload?: string): Promise; //# sourceMappingURL=hook-executor.d.ts.map