vigiles API reference
    Preparing search index...

    Interface ReactHook<N>

    interface ReactHook<N extends readonly NeedSpec[] = readonly ProviderName[]> {
        match?: { tools: readonly string[] };
        needs?: N;
        on: string;
        react: (e: ReactEvent<N>) => Reaction;
        role: "react";
    }

    Type Parameters

    Index

    Properties

    match?: { tools: readonly string[] }

    Which tools to react to. OMIT IT for an event that carries no tool at all (Stop, SubagentStop, SessionEnd), exactly as inject and the prompt/stop gates already do — hookRouting then emits no matcher.

    🔴 IT USED TO BE REQUIRED, WHICH MADE EVERY TOOL-LESS REACT DEAD. runReact gates on tool_name; a Stop event carries none, so the name defaulted to "", matched nothing, and the hook returned nothing() forever. MEASURED 2026-08-12 against the real runtime: a Stop react printed nothing and exited 0 — indistinguishable from a hook that decided to stay quiet, which is the whole reason advisory hooks die unnoticed. Three of the seven hooks this feature was built for are Stop nudges.

    needs?: N

    Declared context providers the trusted runtime gathers into e.ctx.

    on: string
    react: (e: ReactEvent<N>) => Reaction

    Reacts to a tool that already ran. Returns a Reaction — NO deny exists here.

    role: "react"